/* MilanZurich.com
   Type system: Jura Bold for the hero H1 only; Inter Regular for every
   other title and body text. Accent #96001C — a deep Italian/Swiss red,
   echoing SBB's livery and Milan's terracotta, at the saturation of the
   reference brief rather than the earlier softer coral. */

:root {
  --bg: #FFFFFF;
  --surface: #F4F1EE;
  --surface-2: #FBF9F8;
  --ink: #17140F;
  --muted: #6B655F;
  --accent: #96001C;
  --accent-dark: #6E0715;
  --white: #FFFFFF;

  --font-head: 'Jura', sans-serif;
  --font-body: 'Inter', sans-serif;

  --container: 1180px;
  --r-lg: 32px;
  --r-md: 24px;
  --r-sm: 14px;
  --shadow: 0 24px 60px rgba(23,20,15,0.12);
  --shadow-sm: 0 10px 28px rgba(23,20,15,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 28px; }

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  font-family: var(--font-body);
}
h2 { font-size: 2.1875rem; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head p { color: var(--muted); font-size: 1.1rem; margin-top: 14px; }

section { padding: 96px 0; }
.section-alt { background: var(--surface); }

/* ---------- Placeholder photo treatment (see delivery notes for real assets) ---------- */
.ph {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ink) 0%, #3a332f 55%, var(--accent) 150%);
  color: var(--white);
}
.ph::before {
  content: "";
  position: absolute; inset: 0;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(115deg, rgba(255,255,255,0.08) 0 2px, transparent 2px 34px);
}
.ph-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 18px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  background: linear-gradient(0deg, rgba(0,0,0,0.55), transparent);
}
.ph.ph-2 { background: linear-gradient(135deg, var(--accent) 0%, #5c1420 60%, var(--ink) 150%); }
.ph.ph-3 { background: linear-gradient(135deg, #3a332f 0%, var(--ink) 55%, var(--accent-dark) 150%); }

/* ---------- Header ---------- */
header.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(23,20,15,0.06);
}
.nav-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 12px 28px;
  max-width: var(--container);
  margin: 0 auto;
}
.logo {
  display: inline-flex; align-items: center;
  text-decoration: none;
  white-space: nowrap;
}
.logo img { height: 54px; width: auto; display: block; }
nav.primary-nav { justify-self: center; }
nav.primary-nav ul { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
nav.primary-nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  position: relative;
}
nav.primary-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform 0.2s;
}
nav.primary-nav a:hover::after { transform: scaleX(1); }

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--ink); border: 1.5px solid var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--white); }

.nav-toggle {
  display: none; width: 32px; height: 24px; position: relative;
  background: none; border: none; cursor: pointer; padding: 0;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; position: absolute; left: 0; right: 0; height: 2px; background: var(--ink);
  transition: transform 0.2s, background 0.2s;
}
.nav-toggle span { top: 11px; }
.nav-toggle span::before { top: -8px; }
.nav-toggle span::after { top: 8px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(8px) rotate(45deg); background: var(--accent); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-8px) rotate(-45deg); background: var(--accent); }

@media (max-width: 860px) {
  .nav-grid { grid-template-columns: auto auto auto; }
  nav.primary-nav { display: none; }
  .header-cta { display: none; }
  .nav-toggle { display: block; }
  #nav-panel.open {
    display: flex; flex-direction: column; gap: 18px;
    padding: 20px 28px 28px; background: var(--bg);
    border-top: 1px solid rgba(23,20,15,0.06);
  }
  #nav-panel.open ul { display: flex; flex-direction: column; gap: 16px; list-style: none; margin: 0; padding: 0; }
  #nav-panel.open a { text-decoration: none; font-weight: 500; color: var(--ink); font-size: 1.05rem; }
  #nav-panel.open .btn { color: var(--white); width: fit-content; }
}
#nav-panel:not(.open) { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 16px 0 72px; }
.hero-media {
  position: relative;
  height: 54vh; min-height: 380px; max-height: 500px;
  display: flex; align-items: flex-end;
  max-width: var(--container); margin: 0 auto;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.hero-video {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(135deg, rgba(23,20,15,0.62) 0%, rgba(150,0,28,0.5) 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: var(--container); margin: 0 auto; padding: 0 48px 96px; width: 100%; }
.hero-text { max-width: 720px; color: var(--white); }
.hero-text h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 4.8vw, 4.4rem);
  line-height: 0.98;
  color: var(--white);
}
.hero-text h1 .h1-sub { display: block; }

.hero-card {
  position: relative; z-index: 5;
  max-width: var(--container); margin: -64px auto 0;
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 20px 30px;
}
@media (min-width: 861px) {
  /* The HST widget sizes its internal fields off window.innerWidth, not this
     container's own width — capped at --container (1180px) it squeezes its
     fields on wide desktop viewports. Break it out wider so the widget has
     room to lay itself out unsquished. */
  .hero-card {
    width: min(1600px, calc(100vw - 48px));
    max-width: min(1600px, calc(100vw - 48px));
  }
}
.hero-card-label { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); font-weight: 600; margin-bottom: 14px; }

.hero-stats {
  display: flex; justify-content: center;
  max-width: 640px; margin: 40px auto 0;
}
.hero-stat {
  flex: 1; text-align: center; padding: 0 20px;
  border-left: 1px solid rgba(23,20,15,0.12);
}
.hero-stat:first-child { border-left: none; }
.hero-stat strong { display: block; font-size: 1.7rem; font-weight: 700; color: var(--ink); }
.hero-stat span { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 640px) {
  .hero-stats { flex-direction: column; gap: 20px; max-width: 320px; }
  .hero-stat { border-left: none; border-top: 1px solid rgba(23,20,15,0.12); padding: 16px 0 0; }
  .hero-stat:first-child { border-top: none; padding-top: 0; }
}

/* ---------- What to know (route info) ---------- */
.route-info { max-width: 760px; margin: 0 auto; }
.route-info h2 { text-align: center; margin-bottom: 32px; }
.route-info p { margin: 0 0 20px; color: var(--ink); font-size: 1.1rem; line-height: 1.7; }
.route-info p:last-child { margin-bottom: 0; }

/* ---------- Stations (card grid) ---------- */
#stations { padding-top: 28px; }
.stations-layout { display: block; }

.station-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 18px;
  height: 640px;
}
.station-tile {
  border-radius: var(--r-md); position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--ink);
}
.station-tile.large { grid-row: 1 / 4; grid-column: 1; }
.station-tile picture, .station-tile img {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.station-tile::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(23,20,15,0.8) 0%, rgba(23,20,15,0.25) 45%, rgba(23,20,15,0.05) 65%, transparent 100%);
}
.station-badge {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  background: var(--white); color: var(--ink);
  font-size: 0.76rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; letter-spacing: 0.01em;
}
.station-name {
  position: absolute; left: 20px; bottom: 20px; right: 20px; z-index: 2;
  color: var(--white);
}
.station-name h3 { font-size: 1.4rem; font-weight: 600; color: var(--white); margin: 0; }
.station-name span { font-size: 0.9rem; opacity: 0.92; display: block; margin-top: 6px; }
@media (max-width: 760px) {
  .station-grid { grid-template-columns: 1fr; grid-template-rows: none; height: auto; }
  .station-tile { height: 240px; }
  .station-tile.large { grid-row: auto; height: 300px; }
}

/* ---------- Route (icon grid + diagram) ---------- */
.route-title { text-align: center; margin: 0 auto 40px; }
.route-diagram { margin: 0 auto 56px; max-width: 920px; }
.route-diagram svg { width: 100%; height: auto; }
.route-diagram .stop-label { font-size: 11px; fill: var(--ink); font-family: var(--font-body); }
.route-diagram .stop-dot { fill: var(--accent); }
.route-diagram .stop-line { stroke: var(--accent); stroke-width: 2; }

.route-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.route-tile {
  background: var(--white); border-radius: var(--r-md); padding: 28px 26px;
  border: 1px solid rgba(23,20,15,0.08); box-shadow: var(--shadow-sm);
}
.route-tile.hi {
  background: var(--accent); color: var(--white); border-color: var(--accent);
  display: flex; flex-direction: column; justify-content: center; min-height: 280px;
}
.route-tile h3 { font-size: 1.05rem; font-weight: 600; }
.route-tile p { font-size: 0.95rem; margin: 10px 0 0; opacity: 0.85; }
.route-tile.hi h3 { color: var(--white); }
.route-tile.hi p { opacity: 0.95; }

.route-tile.photo {
  position: relative; overflow: hidden; padding: 0; min-height: 280px;
  display: flex; align-items: flex-end;
}
.route-tile.photo picture, .route-tile.photo img {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.route-tile.photo::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(23,20,15,0.82) 0%, rgba(23,20,15,0.2) 55%, transparent 100%);
}
.route-badge {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  background: var(--white); color: var(--ink);
  font-size: 0.76rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; letter-spacing: 0.01em;
}
.route-text { position: relative; z-index: 2; padding: 26px; color: var(--white); }
.route-text h3 { color: var(--white); }
.route-text p { opacity: 0.92; }
@media (max-width: 760px) { .route-tile.hi { min-height: 0; } }
@media (max-width: 760px) { .route-grid { grid-template-columns: 1fr; } }

/* ---------- Train options (3-card row) ---------- */
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 40px; }
.option-card { border-radius: var(--r-md); overflow: hidden; background: var(--white); border: 1px solid rgba(23,20,15,0.08); box-shadow: var(--shadow-sm); }
.option-media { height: 170px; position: relative; overflow: hidden; background: var(--ink); }
.option-media picture, .option-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.option-body { padding: 22px 22px 26px; }
.option-body .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); font-weight: 600; }
.option-body h3 { font-size: 1.2rem; font-weight: 600; margin-top: 8px; }
.option-body .fig { font-size: 1.6rem; margin-top: 10px; color: var(--ink); font-weight: 700; }
.option-body p { font-size: 0.95rem; color: var(--muted); margin-top: 8px; }
@media (max-width: 860px) { .option-grid { grid-template-columns: 1fr; } }

/* ---------- Trains intro + class breakdown ---------- */
.trains-intro { max-width: 820px; margin: 0 auto 32px; color: var(--ink); font-size: 1.1rem; }
.trains-intro p { margin: 0 0 14px; }
.trains-intro ul { margin: 0 0 14px; padding-left: 20px; }
.trains-intro li { margin-bottom: 8px; }
.trains-intro a { color: var(--accent); text-decoration: underline; }
.trains-intro b { color: var(--ink); }

.travel-times { max-width: 820px; margin: 0 auto 48px; background: var(--white); border: 1px solid rgba(23,20,15,0.08); border-radius: var(--r-md); padding: 26px 28px; box-shadow: var(--shadow-sm); }
.travel-times h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; }
.travel-times-grid { display: flex; gap: 32px; flex-wrap: wrap; }
.travel-times-grid div { flex: 1; min-width: 140px; }
.travel-times-grid strong { display: block; font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.travel-times-grid span { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

.class-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto auto; gap: 24px; margin: 8px 0 40px; }
.class-card {
  display: grid; grid-template-rows: subgrid; grid-row: span 4;
  background: var(--white); border: 1px solid rgba(23,20,15,0.08); border-radius: var(--r-md); padding: 28px 28px 8px; box-shadow: var(--shadow-sm);
}
.class-card h3 { font-size: 1.25rem; font-weight: 600; }
.class-card .class-sub { font-size: 0.95rem; color: var(--muted); margin: 10px 0 4px; }
.class-tier { border-top: 1px solid rgba(23,20,15,0.1); padding: 18px 0; }
.class-tier h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); font-weight: 600; margin: 0 0 10px; }
.class-tier p { font-size: 0.95rem; color: var(--ink); margin: 0; }
@media (max-width: 760px) { .class-grid { grid-template-columns: 1fr; } }

.fares-note { max-width: 780px; margin: 0 auto; background: var(--surface); border-radius: var(--r-md); padding: 28px 28px 24px; font-size: 0.98rem; color: var(--ink); }
.fares-note h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 12px; }
.fares-note p { margin: 0; }
.fares-note b { color: var(--accent); font-weight: 700; }

/* ---------- Operator comparison table ---------- */
.table-scroll { overflow-x: auto; border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.operator-table { width: 100%; border-collapse: collapse; min-width: 720px; background: var(--white); }
.operator-table th, .operator-table td { text-align: left; padding: 16px 22px; font-size: 0.92rem; border-bottom: 1px solid rgba(23,20,15,0.08); vertical-align: top; }
.operator-table thead th { background: var(--ink); color: var(--white); font-weight: 600; font-size: 0.86rem; }
.operator-table tbody th { font-weight: 600; color: var(--ink); background: var(--surface); white-space: nowrap; }
.operator-table tbody tr:last-child td, .operator-table tbody tr:last-child th { border-bottom: none; }
.operator-table .stat { font-weight: 600; color: var(--accent); }

/* ---------- Attractions (Milan / Zurich cards) ---------- */
.attractions-city { margin-bottom: 48px; }
.attractions-city:last-child { margin-bottom: 0; }
.attractions-city h3 { font-size: 1.6rem; margin-bottom: 20px; }
.attractions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.attraction-card {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  min-height: 220px; box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-end;
  background: var(--ink);
}
.attraction-card picture, .attraction-card img {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.attraction-card::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(23,20,15,0.82) 0%, rgba(23,20,15,0.2) 55%, transparent 100%);
}
.attraction-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: var(--white); color: var(--ink);
  font-size: 0.72rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
}
.attraction-text { position: relative; z-index: 2; padding: 20px; color: var(--white); }
.attraction-text h4 { color: var(--white); font-size: 1.05rem; font-weight: 600; margin: 0; }
.attraction-text p { font-size: 0.88rem; opacity: 0.92; margin: 8px 0 0; }
@media (max-width: 860px) { .attractions-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .attractions-grid { grid-template-columns: 1fr; } }

/* ---------- Good to know (pull quote + FAQ) ---------- */
#faq { padding-top: 32px; }
.quote-card {
  background: var(--accent); color: var(--white);
  border-radius: var(--r-lg); padding: 36px 40px; position: relative;
  max-width: 700px; margin: 0 auto 48px;
}
.quote-card .qmark {
  font-family: var(--font-head); font-size: 3.4rem; line-height: 1; opacity: 0.4; display: block; margin-bottom: -6px;
}
.quote-card p { font-size: 1.25rem; font-weight: 400; }
@media (max-width: 760px) { .quote-card { padding: 32px 26px; } .quote-card p { font-size: 1.1rem; } }

.faq-title { text-align: center; max-width: 780px; margin: 0 auto 28px; }
.faq { max-width: 780px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid rgba(23,20,15,0.12); }
.faq-item h3 { margin: 0; font-weight: 400; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 20px 4px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; color: var(--ink);
}
.faq-q .plus { font-size: 1.3rem; color: var(--accent); transition: transform 0.2s; flex-shrink: 0; }
.faq-item[data-open="true"] .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.faq-a p { padding: 0 4px 20px; color: var(--muted); margin: 0; max-width: 680px; font-size: 1.02rem; }

/* ---------- CTA band ---------- */
.cta-band { padding: 0 0 96px; }
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: 340px; max-width: var(--container); margin: 0 auto; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.cta-media { position: relative; overflow: hidden; background: var(--ink); }
.cta-media picture, .cta-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cta-panel { background: var(--accent); color: var(--white); display: flex; flex-direction: column; justify-content: center; padding: 56px; }
.cta-panel h2 { color: var(--white); font-size: 2.1rem; }
.cta-panel p { margin-top: 14px; opacity: 0.92; max-width: 420px; font-size: 1.05rem; }
.cta-panel .btn { margin-top: 24px; background: var(--white); color: var(--accent); width: fit-content; }
.cta-panel .btn:hover { background: var(--ink); color: var(--white); }
@media (max-width: 760px) { .cta-grid { grid-template-columns: 1fr; } .cta-media { height: 220px; } .cta-panel { padding: 40px 28px; } }

/* ---------- Footer ---------- */
footer.site-footer { background: var(--ink); color: rgba(255,255,255,0.82); padding: 72px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-grid h4 { font-size: 0.98rem; font-weight: 600; color: var(--white); margin-bottom: 16px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { text-decoration: none; color: rgba(255,255,255,0.75); font-size: 0.95rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-brand p { font-size: 0.92rem; margin-top: 14px; max-width: 340px; opacity: 0.75; }
.footer-book-btn { display: block; width: fit-content; margin-top: 20px; }
.footer-legal { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 28px; font-size: 0.84rem; opacity: 0.68; }
.footer-legal p { margin: 0 0 10px; }
.footer-legal a { text-decoration: underline; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Legal page (privacy.html) ---------- */
.legal-page { max-width: 720px; margin: 0 auto; padding: 80px 28px 100px; }
.legal-back { font-size: 0.9rem; color: var(--accent); text-decoration: none; }
.legal-page h1 { font-family: var(--font-head); font-weight: 700; font-size: 2.6rem; margin: 24px 0 20px; }
.legal-page h2 { font-size: 1.2rem; font-weight: 600; margin: 32px 0 8px; }
.legal-page p { color: var(--muted); font-size: 1.02rem; }

/* ---------- Utility: scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }
