:root {
  --paper: #f7f4ee;
  --paper-strong: #fffdfa;
  --ink: #101f3f;
  --ink-soft: #34466c;
  --muted: #66704f;
  --line: rgba(16, 31, 63, 0.14);
  --blue: #123f73;
  --blue-soft: #dbe7ee;
  --olive: #5c7044;
  --terracotta: #b8633d;
  --sand: #dfcaa2;
  --gold: #cc984e;
  --shadow: 0 18px 55px rgba(16, 31, 63, 0.14);
  --radius: 8px;
  --content: min(1180px, calc(100vw - 44px));
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.82), rgba(247, 244, 238, 0.96) 32rem),
    var(--paper);
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  height: 74px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(16, 31, 63, 0.1);
  background: rgba(255, 253, 250, 0.86);
  backdrop-filter: blur(16px);
}

.brand,
.main-nav,
.header-actions,
.mobile-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: max-content;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(18, 63, 115, 0.42);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(18, 63, 115, 0.1), rgba(255, 255, 255, 0.7)),
    var(--paper-strong);
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.main-nav {
  gap: 6px;
}

.main-nav a,
.mobile-nav a {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.main-nav a:hover,
.mobile-nav a:hover {
  background: rgba(18, 63, 115, 0.08);
  color: var(--blue);
}

.header-actions {
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(16, 31, 63, 0.14);
  border-radius: 7px;
  background: rgba(255, 253, 250, 0.72);
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(18, 63, 115, 0.42);
  background: var(--paper-strong);
}

.icon-button svg,
.button svg,
.overview-item svg,
.booking-meta svg,
.route-meta svg,
.day-detail svg,
.pass-link svg,
.stop-card svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.menu-toggle {
  display: none;
}

.mobile-nav {
  position: fixed;
  inset: 74px 18px auto;
  z-index: 19;
  display: none;
  flex-direction: column;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

main {
  overflow: hidden;
}

section[id] {
  scroll-margin-top: 96px;
}

.hero {
  position: relative;
  display: grid;
  min-height: 590px;
  padding: 116px max(24px, calc((100vw - 1180px) / 2)) 72px;
  align-items: end;
  background:
    linear-gradient(90deg, rgba(255, 253, 250, 0.98) 0%, rgba(255, 253, 250, 0.87) 28%, rgba(255, 253, 250, 0.18) 56%, rgba(255, 253, 250, 0.04) 100%),
    linear-gradient(180deg, rgba(16, 31, 63, 0.05), rgba(16, 31, 63, 0.1)),
    url("./assets/hero-lisbon-azulejo.jpg") center / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 130px;
  background: linear-gradient(180deg, rgba(247, 244, 238, 0), var(--paper));
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 590px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  max-width: 690px;
  font-size: clamp(3.9rem, 7vw, 6.25rem);
  line-height: 0.92;
}

.hero-dates {
  margin: 18px 0 0;
  color: var(--olive);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
}

.hero-summary {
  max-width: 520px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1;
}

.button.primary {
  background: var(--blue);
  color: #fffdfa;
  box-shadow: 0 12px 28px rgba(18, 63, 115, 0.2);
}

.button.secondary {
  border-color: rgba(16, 31, 63, 0.18);
  background: rgba(255, 253, 250, 0.76);
  color: var(--ink);
}

.button.compact {
  min-height: 42px;
  padding-inline: 14px;
  white-space: nowrap;
}

.button:hover {
  transform: translateY(-1px);
}

.overview-band {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  width: var(--content);
  margin: -22px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: 0 14px 40px rgba(16, 31, 63, 0.08);
}

.overview-item {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 20px;
  background: rgba(255, 253, 250, 0.88);
}

.overview-item:first-child {
  border-radius: 7px 0 0 7px;
}

.overview-item:last-child {
  border-radius: 0 7px 7px 0;
}

.overview-item svg {
  flex: 0 0 auto;
  color: var(--terracotta);
}

.overview-item strong,
.overview-item span {
  display: block;
}

.overview-item strong {
  margin-bottom: 3px;
  font-size: 0.92rem;
}

.overview-item span {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.35;
}

.section-shell {
  width: var(--content);
  margin: 88px auto 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading h2,
.notes-copy h2 {
  font-size: clamp(2.4rem, 4.6vw, 4.6rem);
  line-height: 0.92;
}

.section-heading p,
.notes-copy p {
  max-width: 660px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
}

.view-controls {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 250, 0.8);
}

.segment {
  min-width: 76px;
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 780;
  cursor: pointer;
}

.segment.active {
  background: var(--ink);
  color: #fffdfa;
}

.timeline {
  display: grid;
  gap: 16px;
}

.day-card {
  display: grid;
  grid-template-columns: 108px minmax(220px, 320px) minmax(260px, 1fr) minmax(250px, 320px);
  overflow: hidden;
  min-height: 256px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.88);
  box-shadow: 0 14px 36px rgba(16, 31, 63, 0.06);
}

.date-rail {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18, 63, 115, 0.06), transparent),
    rgba(255, 253, 250, 0.78);
}

.weekday {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 840;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.day-number {
  color: var(--olive);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.8rem;
  line-height: 0.92;
}

.month {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.day-image {
  min-height: 100%;
  background: var(--blue-soft);
}

.day-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 256px;
  object-fit: cover;
}

.day-main {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 18px;
  padding: 24px 26px;
}

.day-location {
  color: var(--terracotta);
  font-size: 0.8rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.day-main h3 {
  margin-top: 5px;
  font-size: clamp(2rem, 3vw, 3.1rem);
  line-height: 0.95;
}

.day-summary {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

.day-details {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.day-detail {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.35;
}

.day-detail svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--olive);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-passes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}

.pass-label {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 840;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pass-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(18, 63, 115, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.76);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 820;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(16, 31, 63, 0.12);
  border-radius: 999px;
  background: rgba(18, 63, 115, 0.06);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 760;
  line-height: 1;
}

.tag.booked {
  border-color: rgba(92, 112, 68, 0.26);
  background: rgba(92, 112, 68, 0.12);
  color: var(--olive);
}

.tag.travel {
  border-color: rgba(184, 99, 61, 0.26);
  background: rgba(184, 99, 61, 0.1);
  color: var(--terracotta);
}

.map-panel {
  display: grid;
  grid-template-rows: minmax(174px, 1fr) auto;
  min-height: 100%;
  border-left: 1px solid var(--line);
  background: #eef2ef;
}

.route-map-wrap {
  min-height: 174px;
  margin: 18px 18px 8px;
  overflow: hidden;
  border: 1px solid rgba(18, 63, 115, 0.12);
  border-radius: 7px;
  background: var(--blue-soft);
}

.route-map-link,
.trip-map-link {
  display: block;
  width: 100%;
  height: 100%;
}

.route-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 174px;
  border: 0;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.92) contrast(0.98);
}

.map-fallback {
  display: grid;
  min-height: 174px;
  place-items: center;
  padding: 20px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 760;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(18, 63, 115, 0.12), rgba(184, 99, 61, 0.12)),
    var(--paper-strong);
  overflow: hidden;
}

.route-line {
  position: absolute;
  inset: 50% 14% auto 14%;
  height: 3px;
  border-radius: 999px;
  background: var(--olive);
  transform: rotate(var(--angle, -12deg));
  transform-origin: center;
}

.route-line::before,
.route-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid var(--blue);
  border-radius: 50%;
  background: var(--paper-strong);
  transform: translateY(-50%);
}

.route-line::before {
  left: -6px;
}

.route-line::after {
  right: -6px;
  border-color: var(--terracotta);
}

.map-label {
  position: absolute;
  max-width: 110px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
}

.map-label.start {
  left: 14px;
  bottom: 18px;
}

.map-label.end {
  right: 14px;
  top: 18px;
  text-align: right;
}

.map-meta {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.route-meta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.35;
}

.route-meta svg {
  flex: 0 0 auto;
  color: var(--blue);
}

.route-meta strong {
  display: block;
  color: var(--ink);
}

.map-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 800;
}

.trip-map {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.88);
  box-shadow: 0 16px 42px rgba(16, 31, 63, 0.08);
}

.trip-map-frame {
  min-height: 560px;
  background: var(--blue-soft);
}

.trip-map-frame img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.92) contrast(0.98);
}

.trip-stops {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 22px;
  border-left: 1px solid var(--line);
}

.trip-stops h3 {
  font-size: 1.9rem;
  line-height: 1.05;
}

.trip-stops p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.stop-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stop-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(16, 31, 63, 0.1);
}

.stop-card svg {
  color: var(--terracotta);
}

.stop-date {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stop-card strong {
  display: block;
  font-size: 0.95rem;
}

.stop-card span:last-child {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.35;
}

.booking-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.booking-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 368px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: 0 12px 30px rgba(16, 31, 63, 0.06);
}

.booking-card img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.booking-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.booking-status {
  color: var(--olive);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.booking-body h3 {
  font-size: 1.6rem;
  line-height: 1.08;
}

.booking-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.booking-meta {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.booking-meta span {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.35;
}

.booking-meta svg {
  flex: 0 0 auto;
  color: var(--terracotta);
}

.booking-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 18px 18px;
}

.text-link,
.pass-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 820;
  cursor: pointer;
}

.pass-toggle {
  color: var(--ink-soft);
}

.pass-toggle.saved {
  color: var(--olive);
}

.notes-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 36px;
  width: var(--content);
  margin: 96px auto 0;
  padding: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(130deg, rgba(18, 63, 115, 0.08), rgba(184, 99, 61, 0.08)),
    var(--paper-strong);
}

.packing-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 20px;
  border: 1px solid rgba(16, 31, 63, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.76);
}

.packing-panel h3 {
  margin-bottom: 4px;
  font-size: 1.55rem;
}

.packing-panel label {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.packing-panel input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--olive);
}

.packing-panel span {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: var(--ink);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: var(--content);
  margin: 56px auto 0;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--blue);
  font-weight: 800;
}

@media (max-width: 1080px) {
  .day-card {
    grid-template-columns: 92px minmax(210px, 280px) minmax(260px, 1fr);
  }

  .map-panel {
    grid-column: 2 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .map-panel {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .booking-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  :root {
    --content: min(100vw - 28px, 680px);
  }

  .site-header {
    height: 68px;
    padding-inline: 14px;
  }

  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .mobile-nav.open {
    display: flex;
  }

  .hero {
    min-height: 72vh;
    padding: 112px 18px 42px;
    align-items: center;
    background:
      linear-gradient(180deg, rgba(255, 253, 250, 0.98) 0%, rgba(255, 253, 250, 0.83) 50%, rgba(255, 253, 250, 0.42) 100%),
      url("./assets/hero-lisbon-azulejo.jpg") center / cover no-repeat;
  }

  h1 {
    font-size: clamp(3rem, 14vw, 4.4rem);
    line-height: 0.95;
  }

  .hero-summary {
    max-width: 420px;
  }

  .overview-band {
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .overview-item,
  .overview-item:first-child,
  .overview-item:last-child {
    border-radius: 0;
  }

  .overview-item:first-child {
    border-radius: 7px 7px 0 0;
  }

  .overview-item:last-child {
    border-radius: 0 0 7px 7px;
  }

  .section-shell {
    margin-top: 62px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }

  .view-controls {
    width: 100%;
  }

  .segment {
    flex: 1;
  }

  .day-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .day-image {
    grid-column: 2;
  }

  .day-main {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 22px;
  }

  .map-panel {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .route-map-wrap,
  .route-map,
  .map-fallback {
    min-height: 150px;
  }

  .booking-grid,
  .trip-map,
  .notes-section {
    grid-template-columns: 1fr;
  }

  .trip-map-frame,
  .trip-map-frame img {
    min-height: 430px;
  }

  .trip-stops {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .notes-section {
    margin-top: 70px;
    padding: 28px;
  }
}

@media (max-width: 520px) {
  .brand span:last-child {
    display: none;
  }

  .hero-actions,
  .booking-actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .text-link,
  .pass-toggle {
    width: 100%;
    justify-content: center;
  }

  .day-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .date-rail {
    padding: 18px 12px;
  }

  .weekday {
    font-size: 0.68rem;
  }

  .day-number {
    font-size: 3rem;
  }

  .day-main h3 {
    font-size: 2rem;
  }

  .section-heading h2,
  .notes-copy h2 {
    font-size: 2.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  .site-header,
  .mobile-nav,
  .hero-actions,
  .view-controls,
  .button,
  .booking-actions,
  .site-footer {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .hero {
    min-height: auto;
    padding: 32px 0;
    background: #fff;
  }

  .day-card,
  .booking-card,
  .trip-map,
  .notes-section {
    box-shadow: none;
    break-inside: avoid;
  }
}
