/* ==========================================================================
   TOKENS — base fria (pedra/sal), nao creme. Acentos = materiais da viagem.
   ========================================================================== */
:root {
  --stone:        #EAEBE3;
  --stone-deep:   #DBDECE;
  --paper:        #FFFFFF;
  --ink:          #1B2126;
  --ink-soft:     #57616A;
  --ink-faint:    #8B939B;
  --line:         #D2D5C6;

  --gold:         #9C7328;
  --gold-soft:    #F1E4C2;
  --terracotta:   #A2472B;
  --terracotta-soft: #F3DBCE;
  --teal:         #12645C;
  --teal-soft:    #D0E6E1;
  --plum:         #63416B;
  --plum-soft:    #E6DAE8;
  --navy:         #212C38;
  --navy-soft:    #DCE1E6;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(27,33,38,0.05), 0 10px 26px -14px rgba(27,33,38,0.22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 72px;
}

:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a { color: inherit; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.trip-header {
  background: var(--navy);
  padding: 16px 16px 0;
  position: sticky;
  top: 0;
  z-index: 20;
}

.trip-header__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 4px 12px;
}

.trip-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--paper);
}
.trip-title__year {
  font-weight: 400;
  font-style: italic;
  color: #D9A15C;
  margin-left: 6px;
  font-size: 0.85em;
}

.trip-dates {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #9AA5AE;
  letter-spacing: 0.03em;
}

.day-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 4px 14px;
  max-width: 1000px;
  margin: 0 auto;
  scrollbar-width: none;
}
.day-strip::-webkit-scrollbar { display: none; }

.day-chip {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.10);
  color: #EDF0F2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.day-chip.active {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--navy);
  font-weight: 600;
}

/* ==========================================================================
   DAY VIEW
   ========================================================================== */
main#dayView {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 40px;
}

.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Boarding-pass style day header — the signature element */
.day-head {
  display: flex;
  background: var(--paper);
  margin: 0 0 16px;
  box-shadow: var(--shadow);
  position: relative;
}
.day-head__stamp {
  flex: 0 0 64px;
  background: var(--region-color, var(--navy));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  padding: 12px 4px;
}
.day-head__stamp-num {
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}
.day-head__stamp-of {
  font-size: 9px;
  opacity: 0.75;
  margin-top: 2px;
}
.day-head__perforation {
  flex: 0 0 0;
  width: 0;
  border-left: 2px dashed rgba(27,33,38,0.18);
  position: relative;
}
.day-head__body {
  flex: 1;
  padding: 14px 18px;
  min-width: 0;
}
.day-head__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--region-color, var(--ink-soft));
  font-weight: 600;
  margin-bottom: 3px;
}
.day-head h2 {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  margin: 0;
  line-height: 1.15;
  color: var(--ink);
}

/* padding wrapper for everything below the boarding-pass head */
.day-body-pad { padding: 0 16px; }

/* Reservations callout */
.reservas-box {
  background: var(--gold-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.reservas-box__title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6E4F16;
  font-weight: 600;
  margin-bottom: 8px;
}
.reserva-item {
  font-size: 13.5px;
  padding: 6px 0;
  border-top: 1px dashed rgba(110,79,22,0.25);
  display: flex;
  gap: 8px;
}
.reserva-item:first-of-type { border-top: none; }
.reserva-status {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  height: fit-content;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255,255,255,0.6);
}
.reserva-status--sim { color: var(--teal); }
.reserva-status--solicitada { color: #6E4F16; }
.reserva-status--recomendado { color: var(--terracotta); }
.reserva-item__text b { display: block; color: var(--ink); }
.reserva-item__text span { color: #6E4F16; }

/* Numbered route strip — replaces the trip-wide elevation nav */
.route-strip {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  gap: 0;
  padding: 4px 2px 14px;
  margin-bottom: 4px;
  scrollbar-width: thin;
}
.route-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: 58px;
  cursor: pointer;
}
.route-stop__dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--region-color, var(--navy));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.route-stop__label {
  font-size: 9.5px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 4px;
  line-height: 1.2;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.route-connector {
  flex: 0 0 auto;
  width: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 13px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--ink-faint);
  line-height: 1.3;
  text-align: center;
}
.route-connector__line {
  width: 100%;
  height: 1px;
  background: var(--line);
  margin-bottom: 3px;
}

/* Map */
.day-map {
  height: 260px;
  overflow: hidden;
  margin-bottom: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1;
  isolation: isolate;
}
.numbered-pin {
  background: var(--terracotta);
  color: #fff;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

/* Timeline of stops */
.timeline { position: relative; }

.stop {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stop__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  user-select: none;
}

.stop__num {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--region-color, var(--gold));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.stop__time {
  flex: 0 0 46px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--region-color, var(--gold));
  font-weight: 600;
  padding-top: 3px;
}

.stop__main { flex: 1; min-width: 0; }
.stop__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.3;
  margin: 0;
}
.stop__nota {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 3px;
  line-height: 1.4;
}

.stop__chevron {
  flex: 0 0 auto;
  color: var(--ink-faint);
  transition: transform 0.2s ease;
  margin-top: 4px;
}
.stop.open .stop__chevron { transform: rotate(180deg); }

.stop__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.stop.open .stop__body { max-height: 900px; }

.stop__body-inner {
  padding: 0 14px 16px 82px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: -1px;
}

.stop__desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-line;
}
.stop__desc p { margin: 0 0 10px; }

.stop__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.stop__link {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s, background 0.15s;
}
.stop__link:hover { border-color: var(--region-color, var(--gold)); background: var(--stone); }
.stop__link--maps { border-color: var(--teal); color: var(--teal); }

.stop__fontes {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--stone);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
}
.stop__fontes-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.stop__fontes ul { margin: 0; padding-left: 18px; }
.stop__fontes li { font-size: 11.5px; margin-bottom: 4px; word-break: break-all; }
.stop__fontes a { color: var(--teal); }

/* Deslocamento connector row */
.deslocamento {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 24px;
  margin: -2px 0 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
}
.deslocamento__line {
  flex: 0 0 auto;
  width: 1px;
  align-self: stretch;
  background: var(--line);
  margin-left: 3px;
}
.deslocamento__icon { flex: 0 0 auto; color: var(--ink-faint); }
.deslocamento__text { flex: 1; }
.deslocamento__text a { color: var(--teal); text-decoration: none; }
.deslocamento__badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--terracotta-soft);
  color: var(--terracotta);
  margin-left: 4px;
}

.status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 6px;
  font-weight: 600;
}
.status-pill--planoB, .status-pill--planoA { background: var(--plum-soft); color: var(--plum); }
.status-pill--adecidir { background: var(--terracotta-soft); color: var(--terracotta); }
.status-pill--aguardando, .status-pill--telefone { background: var(--gold-soft); color: #6E4F16; }

/* ==========================================================================
   BOTTOM NAV
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 58px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #E7EAEC;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  max-width: 38%;
}
.bottom-nav__btn:disabled { opacity: 0.28; cursor: default; }
.bottom-nav__btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav__counter {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #9AA5AE;
  letter-spacing: 0.03em;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (min-width: 720px) {
  main#dayView { padding-top: 8px; }
  .day-head h2 { font-size: 30px; }
  .stop__name { font-size: 18px; }
}

@media (max-width: 400px) {
  .trip-title { font-size: 18px; }
  .stop__body-inner { padding-left: 70px; }
  .day-head__stamp { flex-basis: 54px; }
}
