/* 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;
}

/* ─── Tempo (weather) ────────────────────────────────────────────────── */
.wx {
  border: 1px solid var(--theme-palette-border, #e2e8f0);
  border-radius: var(--theme-borders-radius-lg, 14px);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--theme-palette-surface-raised, #f8fafc), var(--theme-palette-surface, #fff));
}
.wx-now {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.wx-now__emoji { font-size: 2.4rem; line-height: 1; }
.wx-now__head { display: flex; flex-direction: column; }
.wx-now__temp { font-size: 2.1rem; font-weight: var(--font-weight-black, 800); line-height: 1; }
.wx-now__cond { font-size: 0.9rem; color: var(--theme-palette-text-secondary, #64748b); }
.wx-now__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 0 auto;
  padding: 0;
}
.wx-now__meta div { text-align: center; }
.wx-now__meta dt { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--theme-palette-text-secondary, #64748b); }
.wx-now__meta dd { margin: 0; font-size: 0.92rem; font-weight: var(--font-weight-semibold, 600); font-variant-numeric: tabular-nums; }

.wx-forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--theme-palette-divider, #edf2f7);
}
.wx-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.2rem;
  border-radius: var(--theme-borders-radius-sm, 6px);
}
.wx-day:first-child { background: var(--theme-palette-primary-subtle, #eef4fb); }
.wx-day__wd { font-size: 0.7rem; text-transform: capitalize; color: var(--theme-palette-text-secondary, #64748b); }
.wx-day__emoji { font-size: 1.3rem; line-height: 1; }
.wx-day__max { font-size: 0.85rem; font-weight: var(--font-weight-bold, 700); font-variant-numeric: tabular-nums; }
.wx-day__min { font-size: 0.78rem; color: var(--theme-palette-text-secondary, #64748b); font-variant-numeric: tabular-nums; }
.wx__credit { margin: 0.75rem 0 0; font-size: 0.75rem; color: var(--theme-palette-text-secondary, #64748b); }

/* Temperatura por cidade (linha de atalho) */
.wx-cities {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 480px) { .wx-cities { grid-template-columns: repeat(2, 1fr); } }
.wx-cities__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.3rem;
  border: 1px solid var(--theme-palette-border, #e2e8f0);
  border-radius: var(--theme-borders-radius, 10px);
  text-decoration: none;
  color: var(--theme-palette-text, #1a202c);
  background: var(--theme-palette-surface, #fff);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wx-cities__item:hover { background: var(--theme-palette-primary-subtle, #eef4fb); }
.wx-cities__item.is-current {
  border-color: var(--theme-palette-primary, #0ea5e9);
  box-shadow: 0 0 0 1px var(--theme-palette-primary, #0ea5e9);
}
.wx-cities__name { font-size: 0.72rem; color: var(--theme-palette-text-secondary, #64748b); }
.wx-cities__temp { font-size: 0.95rem; font-weight: var(--font-weight-bold, 700); font-variant-numeric: tabular-nums; }
.wx-cities__temp--na { color: var(--theme-palette-text-secondary, #94a3b8); }

/* ─── Trânsito: status por rodovia (ARTESP) ──────────────────────────── */
/* AIDEV-NOTE: a cor NUNCA vem do payload; só a `key` (whitelist em
   trafficSummary) escolhe a classe. Evita CSS injetado via JSON do snapshot. */
.living-dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  margin-right: 0.32em;
  vertical-align: baseline;
  background: #94a3b8;
}
.living-dot--normal { background: #16a34a; }
.living-dot--lento { background: #d97706; }
.living-dot--congestionado,
.living-dot--interditado { background: #dc2626; }

.traffic-status {
  border: 1px solid var(--theme-palette-border, #e2e8f0);
  border-radius: var(--theme-borders-radius-lg, 14px);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}
.traffic-status__lead {
  margin: 0 0 0.85rem;
  font-size: 1.02rem;
}
.traffic-status__worst--normal { color: #15803d; }
.traffic-status__worst--lento { color: #b45309; }
.traffic-status__worst--congestionado,
.traffic-status__worst--interditado { color: #b91c1c; }

.traffic-status__list { list-style: none; margin: 0; padding: 0; }
.traffic-status__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--theme-palette-divider, #edf2f7);
}
.traffic-status__item:first-child { border-top: 0; }
.traffic-status__road { font-weight: var(--font-weight-semibold, 600); }
.traffic-pill {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: var(--font-weight-semibold, 600);
  padding: 0.24rem 0.6rem;
  border-radius: var(--theme-borders-radius-full, 999px);
  background: #f1f5f9;
  color: #475569;
}
.traffic-pill--normal { background: #dcfce7; color: #14532d; }
.traffic-pill--lento { background: #fef3c7; color: #78350f; }
.traffic-pill--congestionado,
.traffic-pill--interditado { background: #fee2e2; color: #7f1d1d; }
.traffic-status__source { margin-top: 0.9rem; }

/* ─── Trânsito (mapa Waze) ───────────────────────────────────────────── */
.traffic-map {
  border-radius: var(--theme-borders-radius-lg, 14px);
  overflow: hidden;
  border: 1px solid var(--theme-palette-border, #e2e8f0);
  background: #0f172a;
}
.traffic-map__frame {
  display: block;
  width: 100%;
  height: 800px;
  border: 0;
}
/* Em tela baixa/celular, 800px passa da dobra inteira e o usuário perde o resto
   da página; aí o mapa acompanha a altura da janela. */
@media (max-height: 900px), (max-width: 767px) {
  .traffic-map__frame { height: 75vh; }
}
.traffic-links { margin-top: 1.25rem; }
.traffic-links h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
.traffic-links__list { padding-left: 1.1rem; line-height: 1.7; }

/* ─── Widget de serviços na sidebar (tábua + tempo) ──────────────────── */
.svc-widget__card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--theme-palette-border, #e2e8f0);
  border-radius: var(--theme-borders-radius, 10px);
  overflow: hidden;
  background: linear-gradient(135deg, var(--theme-palette-primary-subtle, #eef4fb), var(--theme-palette-surface, #fff));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.svc-widget__card:hover {
  border-color: var(--theme-palette-primary, #0ea5e9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.svc-widget__wx {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem 0.6rem;
}
.svc-widget__emoji { font-size: 2rem; line-height: 1; }
.svc-widget__temp {
  font-size: 1.7rem;
  font-weight: var(--font-weight-black, 800);
  line-height: 1;
}
.svc-widget__cond {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  font-weight: var(--font-weight-semibold, 600);
  color: var(--theme-palette-text, #1a202c);
}
.svc-widget__cond small {
  font-weight: var(--font-weight-normal, 400);
  color: var(--theme-palette-text-secondary, #64748b);
  font-size: 0.72rem;
}
.svc-widget__tide {
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  border-top: 1px solid var(--theme-palette-border, #e2e8f0);
  background: var(--theme-palette-surface, #fff);
}
.svc-widget__more {
  display: block;
  padding: 0.5rem 0.85rem;
  font-size: 0.76rem;
  font-weight: var(--font-weight-semibold, 600);
  color: var(--theme-palette-primary, #0369a1);
  background: var(--theme-palette-surface, #fff);
  border-top: 1px solid var(--theme-palette-divider, #edf2f7);
}

/* ─── 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-group { margin-top: 1rem; }
.cam-group:first-of-type { margin-top: 0.25rem; }
.cam-group__title {
  font-size: 0.9rem;
  font-weight: var(--font-weight-bold, 700);
  margin: 0 0 0.5rem;
  padding-left: 0.15rem;
  color: var(--theme-palette-text, #1a202c);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cam-group__title::before {
  content: "";
  width: 4px;
  height: 1em;
  border-radius: 2px;
  background: var(--theme-palette-primary, #0ea5e9);
}

.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; }
}
