/* Living pages (páginas vivas): header status bar + tide/ferry pages.
   Uses the portal theme variables so it inherits each portal's palette. */

/* ─── Header inline chips — bloco BRANCO encostado no canto direito ───── */
.living-inline {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;              /* empurra pro canto direito */
  background: #fff;
  border-radius: var(--theme-borders-radius-full, 999px);
  padding: 0.18rem 0.3rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-width: 0;
}
.living-inline::-webkit-scrollbar { display: none; }
.living-inline__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
  color: #1f2937;
  font-size: 0.76rem;
  font-weight: var(--font-weight-semibold, 600);
  line-height: 1;
  padding: 0.22rem 0.5rem;
  border-radius: var(--theme-borders-radius-full, 999px);
  transition: background 0.15s ease, color 0.15s ease;
}
.living-inline__chip:hover {
  background: var(--theme-palette-primary-subtle, #eef4fb);
  color: var(--theme-palette-primary, #0369a1);
}
.living-inline__icon {
  font-size: 0.9rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  /* Emoji colorido assenta um pouco baixo no line-box; sobe uma fração pra
     centrar oticamente com o texto ao lado. Relativo (em) → escala com a fonte. */
  transform: translateY(-0.06em);
}

/* Mobile: o top-bar some por padrão; aqui trazemos ele de volta só pra mostrar
   os chips (a data fica oculta) — o dado de maré/balsa é útil no celular. */
@media (max-width: 767px) {
  .site-header__top-bar { display: block !important; }
  .site-header__top-bar .container { padding-top: 5px; padding-bottom: 5px; }
  .site-header__date { display: none; }
  .living-inline { margin-left: auto; }
  .living-inline__chip { font-size: 0.74rem; }
}

/* ─── Living pages (shared) ──────────────────────────────────────────── */
.living-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
}
.living-header { margin: 0.75rem 0 1.25rem; }
.living-header__title {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: var(--font-weight-black, 800);
  margin: 0 0 0.3rem;
}
.living-header__subtitle {
  color: var(--theme-palette-text-secondary, #64748b);
  font-size: 0.98rem;
}
.living-empty {
  padding: 2rem;
  text-align: center;
  color: var(--theme-palette-text-secondary, #64748b);
  background: var(--theme-palette-surface-raised, #f8fafc);
  border-radius: var(--theme-borders-radius-lg, 12px);
}
.living-source {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--theme-palette-divider, #edf2f7);
  font-size: 0.82rem;
  color: var(--theme-palette-text-secondary, #64748b);
  line-height: 1.5;
}
.living-crosslink {
  margin-top: 1.25rem;
  font-size: 0.92rem;
}

/* ─── Tide "now" hero ────────────────────────────────────────────────── */
.tide-now {
  display: grid;
  gap: 0.25rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--theme-borders-radius-lg, 14px);
  color: #fff;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #0369a1, #0ea5e9);
}
.tide-now--low { background: linear-gradient(135deg, #0e7490, #22b8cf); }
.tide-now__trend {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-weight-bold, 700);
  opacity: 0.92;
}
.tide-now__main {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.tide-now__label { font-size: 1.15rem; font-weight: var(--font-weight-bold, 700); }
.tide-now__time { font-size: 2.1rem; font-weight: var(--font-weight-black, 800); line-height: 1; }
.tide-now__height { font-size: 1.1rem; opacity: 0.95; }
.tide-now__hint { font-size: 0.85rem; opacity: 0.9; margin: 0.15rem 0 0; }

/* ─── Tide days grid ─────────────────────────────────────────────────── */
.tide-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}
.tide-day {
  border: 1px solid var(--theme-palette-border, #e2e8f0);
  border-radius: var(--theme-borders-radius, 10px);
  padding: 0.85rem 1rem;
  background: var(--theme-palette-surface, #fff);
}
.tide-day--today {
  border-color: var(--theme-palette-primary, #0ea5e9);
  box-shadow: 0 0 0 1px var(--theme-palette-primary, #0ea5e9);
}
.tide-day__title {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.95rem;
  text-transform: capitalize;
  margin: 0 0 0.6rem;
  font-weight: var(--font-weight-bold, 700);
}
.tide-day__date { color: var(--theme-palette-text-secondary, #64748b); font-weight: var(--font-weight-normal, 400); }
.tide-day__badge {
  margin-left: auto;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--theme-palette-primary, #0ea5e9);
  color: #fff;
  padding: 0.1rem 0.4rem;
  border-radius: var(--theme-borders-radius-full, 999px);
}
.tide-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.tide-event {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--theme-borders-radius-sm, 6px);
  background: var(--theme-palette-surface-raised, #f8fafc);
  font-variant-numeric: tabular-nums;
}
.tide-event__type {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: var(--font-weight-bold, 700);
}
.tide-event--high .tide-event__type { color: #0369a1; }
.tide-event--low .tide-event__type { color: #b45309; }
.tide-event__time { font-weight: var(--font-weight-semibold, 600); }
.tide-event__height { color: var(--theme-palette-text-secondary, #64748b); font-size: 0.88rem; }

/* ─── Ferry page ─────────────────────────────────────────────────────── */
.ferry-status {
  border: 1px solid var(--theme-palette-border, #e2e8f0);
  border-radius: var(--theme-borders-radius-lg, 14px);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--theme-palette-surface, #fff);
}
.ferry-status__badge {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-weight-bold, 700);
  padding: 0.2rem 0.55rem;
  border-radius: var(--theme-borders-radius-full, 999px);
}
.ferry-status__badge--ok { background: var(--theme-palette-success, #16a34a); color: #fff; }
.ferry-status__cadence { font-size: 1.2rem; margin: 0.6rem 0 0.2rem; }
.ferry-status__note { color: var(--theme-palette-text-secondary, #64748b); font-size: 0.9rem; margin: 0 0 0.75rem; }
.ferry-status__cta {
  display: inline-block;
  font-weight: var(--font-weight-semibold, 600);
  color: var(--theme-palette-primary, #0369a1);
  text-decoration: none;
}
.ferry-status__cta:hover { text-decoration: underline; }
.ferry-info h2 { font-size: 1.15rem; margin: 1.25rem 0 0.5rem; }
.ferry-info__list { padding-left: 1.1rem; line-height: 1.6; }
.ferry-info__list li { margin-bottom: 0.35rem; }

/* ─── Câmeras ao vivo (carrossel) ────────────────────────────────────── */
.ferry-cams { margin-bottom: 1.75rem; }
.ferry-cams__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
}
.ferry-cams__head h2 { font-size: 1.15rem; margin: 0; }
.ferry-cams__live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: var(--font-weight-bold, 700);
  letter-spacing: 0.06em;
  color: var(--theme-palette-error, #dc2626);
}
.ferry-cams__live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--theme-palette-error, #dc2626);
  animation: camLivePulse 1.6s ease-in-out infinite;
}
@keyframes camLivePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.cam-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cam-carousel__track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
  border-radius: var(--theme-borders-radius-lg, 12px);
  flex: 1 1 auto;
  min-width: 0;
}
.cam-carousel__track::-webkit-scrollbar { display: none; }
.cam-carousel__track:focus-visible { outline: 2px solid var(--theme-palette-primary, #0ea5e9); outline-offset: 3px; }

.cam-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  margin: 0;
}
.cam-slide__frame {
  position: relative;
  border-radius: var(--theme-borders-radius, 10px);
  overflow: hidden;
  background: #0f172a;
  aspect-ratio: 16 / 10;
}
.cam-slide__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cam-slide__badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--theme-borders-radius-full, 999px);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.7rem;
  font-weight: var(--font-weight-semibold, 600);
  backdrop-filter: blur(2px);
}
.cam-slide__offline {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}
.cam-slide--offline .cam-slide__img { display: none; }
.cam-slide--offline .cam-slide__offline { display: flex; }
.cam-slide__label {
  margin-top: 0.4rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold, 600);
  color: var(--theme-palette-text-secondary, #64748b);
}

.cam-carousel__nav {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--theme-palette-border, #e2e8f0);
  border-radius: 50%;
  background: var(--theme-palette-surface, #fff);
  color: var(--theme-palette-text, #1a202c);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease, transform 0.1s ease;
}
.cam-carousel__nav:hover { background: var(--theme-palette-primary-subtle, #eef4fb); }
.cam-carousel__nav:active { transform: scale(0.94); }

.cam-carousel__dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.cam-carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--theme-palette-border, #cbd5e1);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cam-carousel__dot.is-active {
  background: var(--theme-palette-primary, #0ea5e9);
  transform: scale(1.25);
}

.ferry-cams__credit {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--theme-palette-text-secondary, #64748b);
  text-align: center;
}

/* Telas estreitas: some as setas (o swipe/scroll já resolve), só dots. */
@media (max-width: 560px) {
  .cam-carousel__nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cam-carousel__track { scroll-behavior: auto; }
  .ferry-cams__live-dot { animation: none; }
}
