/* EuroRail Times — shared site chrome (Phase 1)
   Variables, reset, language bar, nav, footer (homepage + blog patterns).
   Page-specific styles stay inline or in blog.css.
   Load BEFORE page CSS; mobile-fix.css loads LAST.
   Cache: bump ?v= when changing this file. */
:root{
  --steel:    #1C2B3A;
  --steel-mid:#253545;
  --steel-lgt:#2E4055;
  --amber:    #E8A020;
  --amber-dim:#C4881A;
  --amber-text:#7A4F00;    /* amber TEXT on light surfaces: 7.1:1 on #fff, 6.2:1 on --amber-pale (WCAG AA) */
  --amber-on-dark:#E8A020; /* amber text on dark steel surfaces: 6.5:1 on --steel, 4.8:1 on --steel-lgt */
  --amber-pale:#F5EFE4;
  --chalk:    #EEF1F4;
  --chalk-dk: #D8DEE6;
  --signal-r: #C0392B;
  --signal-g: #27AE60;
  --signal-o: #E67E22;
  --ink:      #1A2530;
  --ink-mid:  #3D5166;
  --muted:    #5A7085;
  --white:    #FFFFFF;
  --mono:     'JetBrains Mono', monospace;
  /* Shared content rail — keep nav/lang/sections/footer on one left edge */
  --page-max: 1200px;
  --page-gutter: 24px;
  --page-gutter-sm: 16px;
}

/* Metric-matched fallback — reduces CLS when DM Sans swaps in */
@font-face{font-family:'DM Sans Fallback';src:local('Arial'),local('Helvetica Neue'),local('Helvetica');size-adjust:103%;ascent-override:95%;descent-override:30%;line-gap-override:0%}@font-face{font-family:'DM Serif Fallback';src:local('Georgia'),local('Times New Roman');size-adjust:108%;ascent-override:92%;descent-override:22%;line-gap-override:0%}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{font-family:'DM Sans','DM Sans Fallback',sans-serif;background:var(--chalk);color:var(--ink);line-height:1.6;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  overflow-x:clip}
a,button,[role="button"]{-webkit-tap-highlight-color:transparent}

/* Shared content rail helpers (opt-in + overrides for mismatched max-widths) */
.wrap,
.hero-inner,
.aff-inner,
.newsletter-inner,
.footer-grid,
.footer-bar,
.lang-inner,
.nav-inner,
.foot-inner,
.foot-bot,
.sleep-near .ayb-inner,
.calc-card{
  max-width:var(--page-max);
  margin-left:auto;
  margin-right:auto;
  width:100%;
  box-sizing:border-box;
}

/* ─── LANGUAGE BAR ─── */
.lang-bar{background:var(--steel);border-bottom:1px solid rgba(255,255,255,.07);
  padding:6px var(--page-gutter)}
.lang-inner{max-width:var(--page-max);margin:0 auto;display:flex;justify-content:flex-end;align-items:center;gap:6px;flex-wrap:wrap}
.lang-btn{background:none;border:1px solid transparent;color:rgba(255,255,255,.5);
  font:500 .72rem 'DM Sans',sans-serif;padding:3px 10px;border-radius:4px;cursor:pointer;
  letter-spacing:.04em;transition:all .2s;text-decoration:none}
.lang-btn:hover{color:var(--amber);border-color:rgba(232,160,32,.3)}
.lang-btn.active{color:var(--amber);border-color:var(--amber);background:rgba(232,160,32,.1)}
.lang-sep{color:rgba(255,255,255,.2);font-size:.7rem}

/* ─── NAV ───
   Gutters on <nav>, not inside .nav-inner — matches .section/.hero/.lang-bar
   (avoids 24px inward drift vs headings/content at desktop widths). */
nav:not(.footer-social){background:var(--steel-mid);position:sticky;top:0;z-index:100;border-bottom:3px solid var(--amber);
  padding:0 var(--page-gutter)}
.nav-inner{max-width:var(--page-max);margin:0 auto;display:flex;align-items:center;
  justify-content:space-between;padding:0;height:58px}
.logo{font-family:'DM Serif Display',serif;font-size:1.3rem;color:var(--white);
  text-decoration:none;display:flex;align-items:center;gap:10px;letter-spacing:-.01em}
.logo-mark{width:32px;height:32px;background:var(--amber);border-radius:6px;
  display:flex;align-items:center;justify-content:center;font-size:1rem;flex-shrink:0}
.logo sup{font-family:'DM Sans',sans-serif;font-size:.6rem;font-weight:700;
  background:var(--amber);color:var(--steel);padding:1px 5px;border-radius:3px;
  margin-left:4px;vertical-align:top;margin-top:4px}
.nav-links{display:flex;gap:0;list-style:none}
.nav-links a{color:rgba(255,255,255,.7);text-decoration:none;font-size:.84rem;
  font-weight:500;padding:0 16px;height:58px;display:flex;align-items:center;
  border-bottom:3px solid transparent;margin-bottom:-3px;transition:all .2s}
.nav-links a:hover,.nav-links a.active{color:var(--white);border-bottom-color:var(--amber)}
.nav-ticket{background:var(--amber);color:var(--steel);border:none;border-radius:6px;
  padding:8px 20px;font:.85rem/1 'DM Sans',sans-serif;font-weight:700;cursor:pointer;
  transition:background .2s}
.nav-ticket:hover{background:var(--amber-dim)}

/* ─── FOOTER (shared grid rail) ───
   Brand spans full width; HELP | SCHEDULES | COMPARE | STATION GUIDES
   share one 4-col row with equal gutters (--page-gutter). */
footer{background:var(--steel);border-top:3px solid var(--amber);padding:48px var(--page-gutter) 32px;display:block}
.footer-grid{width:100%}
/* Guides/operators compact footers: light chrome so legal links stay AA (not dark-on-steel) */
footer:has(.footer-aff){
  background:var(--white) !important;
  border-top:1px solid var(--chalk-dk);
  padding:26px var(--page-gutter) 28px;
  color:var(--muted);
  font-size:.85rem;
}
footer:has(.footer-aff) a{
  color:var(--ink-mid) !important;
  text-decoration:none;
}
footer:has(.footer-aff) a:hover{color:var(--amber-text) !important}
.footer-aff{
  color:var(--muted);
}
.footer-aff a{
  color:var(--ink-mid) !important;
  text-decoration:underline;
  text-underline-offset:2px;
  text-decoration-color:rgba(61,81,102,.45);
}
.footer-aff a:hover{
  color:var(--amber-text) !important;
  text-decoration-color:var(--amber-text);
}
.footer-grid{
  max-width:var(--page-max);margin:0 auto 36px;
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.05fr) minmax(0,1.05fr) minmax(0,1.35fr);
  column-gap:var(--page-gutter);
  row-gap:28px;
  align-items:start;
}
/* Brand chrome above the link columns */
.f-brand{
  grid-column:1 / -1;
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:10px 24px;
}
.f-brand .logo{font-size:1.1rem;margin:0}
.f-brand > p{
  font-size:.8rem;color:rgba(255,255,255,.58);line-height:1.55;
  max-width:520px;margin:0;flex:1 1 240px;
}
/* Homepage legacy: HELP nested inside .f-brand — promote into the 4-col rail */
.f-brand:has(> .f-help){display:contents}
.f-brand:has(> .f-help) > .logo,
.f-brand:has(> .f-help) > p{grid-column:1 / -1}
.f-brand:has(> .f-help) > p{max-width:520px;margin:0}
.f-brand .f-help{margin-top:0}
.f-col h4{
  color:var(--white);font:.7rem/1.2 var(--mono);text-transform:uppercase;
  letter-spacing:.1em;margin:0 0 12px;
}
.f-col ul{list-style:none;margin:0;padding:0}
.f-col li{margin:0 0 8px;line-height:1.45}
.f-col li:last-child{margin-bottom:0}
.f-col a{
  color:rgba(255,255,255,.62);font-size:.8rem;line-height:1.45;
  text-decoration:none;transition:color .2s;
  display:inline-flex;align-items:center;gap:6px;
}
.f-col a:hover{color:var(--amber)}
.f-col a svg{flex-shrink:0;width:12px;height:12px;display:block}
.f-stations-list{
  display:grid;
  grid-template-columns:1fr 1fr;
  column-gap:var(--page-gutter);
  row-gap:0;
  align-items:start;
}
.f-stations-list li{margin:0 0 8px}
.f-stations-list li:last-child{margin-bottom:0}
/* Bottom strip: logo+social left, © right — same rail as .footer-grid / nav */
.footer-bar{
  --footer-muted:rgba(255,255,255,.55);
  max-width:var(--page-max);
  margin:0 auto;
  padding-top:20px;
  padding-left:0;
  padding-right:0;
  border-top:1px solid rgba(255,255,255,.1);
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:
    "social copy";
  align-items:center;
  column-gap:24px;
  row-gap:12px;
  width:100%;
  box-sizing:border-box;
}
.footer-bar:has(.footer-logo){
  grid-template-areas:
    "brand copy"
    "social copy";
}
.footer-bot{
  grid-area:copy;
  justify-self:end;
  align-self:center;
  border:none;
  padding:0;
  margin:0;
  max-width:min(52ch,100%);
  display:flex;
  gap:12px 16px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
  text-align:right;
  font-size:.75rem;
  color:var(--footer-muted,rgba(255,255,255,.55));
}
.footer-bot a{
  color:rgba(255,255,255,.55);
  text-decoration:underline;
  text-decoration-color:rgba(255,255,255,.2);
}
.footer-bot a:hover{color:var(--amber);text-decoration-color:var(--amber)}
/* Station pages: flatten logo+© into the bar grid */
.footer-bar > .footer-inner{display:contents}
.footer-bar .footer-logo{
  grid-area:brand;
  justify-self:start;
  align-self:end;
}
.footer-bar > .footer-inner > span{
  grid-area:copy;
  justify-self:end;
  align-self:center;
  text-align:right;
  max-width:min(42ch,100%);
  font-size:.75rem;
  color:var(--footer-muted,rgba(255,255,255,.55));
}
.footer-bar .foot-bot,
.footer-bar .fin{
  grid-area:copy;
  justify-self:end;
  align-self:center;
  margin:0;
  border:none;
  padding:0;
  max-width:min(52ch,100%);
  display:flex;
  flex-wrap:wrap;
  gap:12px 16px;
  justify-content:flex-end;
  align-items:center;
  text-align:right;
  font-size:.75rem;
  color:var(--footer-muted,rgba(255,255,255,.55));
}
nav.footer-social,
.footer-social{
  grid-area:social;
  justify-self:start;
  align-self:center;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:10px 14px;
  margin:0;
  padding:0 !important;
  width:auto;
  max-width:none;
  height:auto;
  position:static !important;
  top:auto !important;
  z-index:auto !important;
  background:transparent !important;
  border:none !important;
  border-bottom:none !important;
  box-shadow:none;
}
@media (max-width:700px){
  .footer-bar,
  .footer-bar:has(.footer-logo){
    grid-template-columns:1fr;
    grid-template-areas:
      "brand"
      "social"
      "copy";
    justify-items:start;
  }
  .footer-bar:not(:has(.footer-logo)){
    grid-template-areas:
      "social"
      "copy";
  }
  .footer-bot,
  .footer-bar .foot-bot,
  .footer-bar .fin,
  .footer-bar > .footer-inner > span{
    justify-self:start;
    text-align:left;
    max-width:none;
  }
  nav.footer-social,
  .footer-social{
    width:auto;
    max-width:100%;
  }
}
/* Icons match muted © / @handle — not stark white */
.footer-social a.fsoc:link,
.footer-social a.fsoc:visited,
.footer-social a[aria-label]:link,
.footer-social a[aria-label]:visited{color:var(--footer-muted,rgba(255,255,255,.55))}
.footer-social a.fsoc,
.footer-social a[aria-label]{
  color:var(--footer-muted,rgba(255,255,255,.55));display:inline-flex;width:36px;height:36px;
  align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.2);
  border-radius:8px;text-decoration:none;transition:color .2s,border-color .2s,background .2s;
}
.footer-social a.fsoc:hover,
.footer-social a.fsoc:focus-visible,
.footer-social a[aria-label]:hover,
.footer-social a[aria-label]:focus-visible{
  color:var(--amber);border-color:var(--amber);background:rgba(232,160,32,.1);
}
.footer-social svg{width:18px;height:18px;display:block;fill:currentColor}
.footer-social-handle{
  color:var(--footer-muted,rgba(255,255,255,.55));
  font-size:.8rem;letter-spacing:.02em;margin-left:2px;
}
@media (max-width:900px){
  :root{--page-gutter:20px}
  .footer-grid{
    grid-template-columns:1fr 1fr;
    column-gap:var(--page-gutter);
    row-gap:28px;
  }
  .f-brand{grid-column:1 / -1}
  .f-brand:has(> .f-help) > .logo,
  .f-brand:has(> .f-help) > p{grid-column:1 / -1}
  .f-brand > p{max-width:none}
}
@media (max-width:560px){
  :root{--page-gutter:var(--page-gutter-sm)}
  .footer-grid{grid-template-columns:1fr;gap:24px}
  .f-stations-list{grid-template-columns:1fr 1fr;column-gap:16px}
}

/* ─── FOOTER (blog compact) ─── */
.foot-inner{max-width:var(--page-max);margin:0 auto;display:flex;justify-content:space-between;gap:24px;flex-wrap:wrap;align-items:center}
.foot-inner .logo{font-size:1.05rem}
.foot-links a{color:rgba(255,255,255,.55);text-decoration:none;font-size:.82rem;margin-left:16px}
.foot-links a:hover{color:var(--amber)}
.foot-bot{max-width:var(--page-max);margin:18px auto 0;border-top:1px solid rgba(255,255,255,.1);padding-top:14px;font-size:.75rem;color:rgba(255,255,255,.55);text-align:center}

/* a11y skip + main landmark helpers — hidden until keyboard focus */
.skip-link{
  position:absolute;left:-9999px;top:auto;width:1px;height:1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;z-index:10000;
  text-decoration:none;color:inherit;
}
.skip-link:focus,
.skip-link:focus-visible{
  position:fixed;left:16px;top:16px;width:auto;height:auto;
  padding:10px 14px;background:var(--amber,#E8A020);color:var(--steel,#1C2B3A);
  font:700 .9rem/1.2 'DM Sans',sans-serif;border-radius:6px;
  overflow:visible;clip:auto;white-space:normal;
  outline:2px solid var(--steel,#1C2B3A);outline-offset:2px;
  text-decoration:none;box-shadow:0 4px 14px rgba(28,43,58,.25);
}

/* Stay22 After-you-book — steel/amber brand panel */
.ayb{
  margin:28px 0;padding:22px 20px;
  background:var(--white,#fff);
  border:1px solid rgba(28,43,58,.14);
  border-top:3px solid var(--amber,#E8A020);
  border-radius:10px;
  box-shadow:0 1px 0 rgba(28,43,58,.04);
}
.ayb-pre{
  font:.68rem 'JetBrains Mono',monospace;letter-spacing:.14em;text-transform:uppercase;
  color:var(--amber-dim,#C4881A);margin:0 0 8px;
}
.ayb-title{
  font-family:'DM Serif Display',serif;font-size:1.28rem;color:var(--steel,#1C2B3A);
  margin:0 0 6px;line-height:1.25;
}
.ayb-sub{
  font-size:.84rem;color:var(--ink-mid,#3D5166);margin:0 0 16px;line-height:1.45;max-width:42ch;
}
.ayb-btns{display:flex;flex-wrap:wrap;gap:10px;margin:0}
.ayb-btn{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:44px;padding:11px 18px;border-radius:8px;
  font:.85rem 'DM Sans',sans-serif;font-weight:700;text-decoration:none;
  transition:background .15s,border-color .15s,color .15s;
  flex:0 1 auto;
}
.ayb-btn--primary{background:var(--amber,#E8A020);color:var(--steel,#1C2B3A)}
.ayb-btn--primary:hover{background:var(--amber-dim,#C4881A)}
.ayb-btn--steel{background:var(--steel,#1C2B3A);color:#fff}
.ayb-btn--steel:hover{background:var(--steel-lgt,#2E4055)}
/* Reset site-wide `nav{}` chrome — partner row must never inherit sticky navy bar */
.ayb-links,
nav.ayb-links{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px;
  margin:14px 0 0;padding:0;list-style:none;
  background:transparent !important;
  border:none !important;
  border-bottom:none !important;
  position:static !important;
  top:auto !important;
  z-index:auto !important;
  height:auto !important;
  min-height:0 !important;
  box-shadow:none !important;
}
.ayb-links-label{
  flex:1 0 100%;
  font:.65rem 'JetBrains Mono',monospace;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted,#5A7085);margin:2px 0 0;
}
.ayb-links a{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:40px;padding:8px 14px;
  font-size:.8rem;font-weight:700;color:var(--steel,#1C2B3A) !important;
  text-decoration:none;border-radius:8px;
  background:#fff !important;
  border:1.5px solid rgba(28,43,58,.28) !important;
  box-shadow:0 1px 0 rgba(28,43,58,.04);
}
.ayb-links a:hover,
.ayb-links a:focus-visible{
  color:var(--steel,#1C2B3A) !important;
  background:var(--amber-pale,#FEF3DC) !important;
  border-color:var(--amber,#E8A020) !important;
}
.ayb-kit{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;
  margin:16px 0 0;padding:12px 0 0;
  background:transparent;
  border-top:1px solid rgba(28,43,58,.1);
  font-size:.8rem;color:var(--ink-mid,#3D5166);line-height:1.4;
}
.ayb-kit-label{
  font:.65rem 'JetBrains Mono',monospace;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted,#5A7085);font-weight:600;margin-right:2px;
}
.ayb-kit a{
  color:var(--steel,#1C2B3A);font-weight:600;text-decoration:none;
  border-bottom:1px solid rgba(28,43,58,.28);
  min-height:44px;display:inline-flex;align-items:center;
}
.ayb-kit a:hover{color:var(--amber-dim,#C4881A);border-bottom-color:var(--amber,#E8A020)}
.ayb-kit-sep{opacity:.35;user-select:none}
@media(max-width:560px){
  .ayb{padding:18px 16px}
  .ayb-title{font-size:1.15rem}
  .ayb-sub{font-size:.8rem;margin-bottom:14px}
  .ayb-btns{gap:8px}
  .ayb-btn{flex:1 1 calc(50% - 8px);min-width:132px}
  .ayb-links,.ayb-links.ayb-links{gap:8px;margin-top:12px}
  .ayb-links a{background:#fff !important;color:var(--steel,#1C2B3A) !important}
  .ayb-kit{margin-top:14px;padding-top:12px;flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px 12px}
  .ayb-kit-sep{display:none}
}

/* Sleep near station (homepage) — same language */
.sleep-near{
  padding:32px var(--page-gutter,24px);
  background:var(--white,#fff);
  border-top:1px solid rgba(28,43,58,.1);
  border-bottom:1px solid rgba(28,43,58,.06);
}
.sleep-near .ayb-inner{max-width:var(--page-max,1200px);margin:0 auto}
.sleep-near .ayb-btns{margin-bottom:0}

/* Station hotels panel — same content rail as .wrap (no double gutter) */
.station-hotels{
  width:min(100% - 2 * var(--page-gutter,24px), var(--page-max,1200px));
  max-width:var(--page-max,1200px);
  margin:0 auto 32px;
  padding:0;
  box-sizing:border-box;
}
.station-hotels .ayb{margin:0}
/* Sleep near station (homepage) — same language */
.sleep-near{
  padding:32px var(--page-gutter);
  background:var(--white,#fff);
  border-top:1px solid rgba(28,43,58,.1);
  border-bottom:1px solid rgba(28,43,58,.06);
}
.sleep-near .ayb-inner{max-width:var(--page-max);margin:0 auto}
.sleep-near .ayb-btns{margin-bottom:0}

/* Station hotels panel — same content rail as .wrap (no double gutter) */
.station-hotels{
  width:min(100% - 2 * var(--page-gutter), var(--page-max));
  max-width:var(--page-max);
  margin:0 auto 32px;
  padding:0;
  box-sizing:border-box;
}
.station-hotels .ayb{margin:0}
/* Headings / rows — prevent odd inward wraps and orphaned edges */
.sec-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:28px}
.sec-title,article h2,article h3{
  overflow-wrap:break-word;
  word-break:normal;
  hyphens:manual;
  text-wrap:balance;
}
.see-all{flex-shrink:0}
.kl-search-card{margin-left:0;margin-right:0;max-width:min(1040px,100%);box-sizing:border-box}
.kl-sub-bar{padding-left:0;padding-right:0;box-sizing:border-box}
.kl-grid{min-width:0}
.kl-field{min-width:0}
.container{max-width:var(--page-max);margin-left:auto;margin-right:auto;
  padding-left:var(--page-gutter);padding-right:var(--page-gutter);box-sizing:border-box}

/* Operator chip strip under map — keep side gutters when .wrap is full-bleed */
.op-guides-rail{
  width:min(100% - 2 * var(--page-gutter), var(--page-max));
  max-width:var(--page-max);
  margin-left:auto;
  margin-right:auto;
}

@media (max-width:600px){
  :root{--page-gutter:var(--page-gutter-sm)}
  nav{padding-left:var(--page-gutter);padding-right:var(--page-gutter)}
  .nav-inner{padding:0;height:54px}
  .lang-bar{padding-left:var(--page-gutter);padding-right:var(--page-gutter)}
  .sec-head{flex-direction:column;align-items:flex-start;gap:10px;margin-bottom:20px}
  .sec-title{text-wrap:pretty}
  .kl-search-card{margin-left:0;margin-right:0}
}

/* === VISUAL-P0-2026-07-28 === */

/* Guide chrome — align with homepage brand; prevent TimesBlog clash */
.guide-header{background:var(--white);border-bottom:1px solid var(--chalk-dk);padding:12px 0;position:sticky;top:0;z-index:10}
.guide-chrome{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}
.guide-chrome .logo{font-family:'DM Serif Display',serif;font-size:1.15rem;text-decoration:none;color:var(--ink)!important;display:inline-flex;align-items:center;gap:8px;flex-shrink:0;white-space:nowrap;letter-spacing:-.01em}
.guide-chrome .logo-mark{width:28px;height:28px;background:var(--amber);border-radius:6px;display:inline-flex;align-items:center;justify-content:center;font-size:.85rem;flex-shrink:0;line-height:1}
.guide-chrome .logo sup{font-family:'DM Sans',sans-serif;font-size:.55rem;font-weight:700;background:var(--amber);color:var(--steel);padding:2px 5px;border-radius:3px;margin-left:2px;letter-spacing:.04em;line-height:1;vertical-align:middle;display:inline-block}
.guide-chrome-actions{display:flex;align-items:center;gap:12px;margin-left:auto;flex-shrink:0;min-width:0}
.guide-blog-link{color:var(--ink);text-decoration:none;font-weight:600;font-size:.9rem;padding:6px 2px;white-space:nowrap}
.guide-chrome .btn{flex-shrink:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
@media (max-width:480px){
  .guide-blog-link{display:none}
  .guide-chrome .logo{font-size:1.05rem;gap:6px}
  .guide-chrome .logo-mark{width:26px;height:26px;font-size:.8rem}
  .guide-chrome .btn{padding:8px 12px;font-size:.78rem}
}

/* Cookie consent — the banner height is published as --cookie-banner-h by app.js; keep primary Search reachable and never hidden by it */
html.has-cookie-banner{scroll-padding-bottom:calc(var(--cookie-banner-h,110px) + 16px)}
html.has-cookie-banner .hero,
html.has-cookie-banner #search-section.hero{
  padding-bottom:calc(var(--cookie-banner-h,110px) + 16px + env(safe-area-inset-bottom, 0px));
}
#cookie-consent-banner{
  box-sizing:border-box;
}

/* Deferred hero extras — below first viewport */
/* Specificity must beat later inline `.wrap{max-width:1200px}` (same element). */
/* Same navy as the search hero so the photo can fade in; 1px gold under stats, not a rail. */
.aa-pax-age-wrap[hidden],
.kl-field[hidden],
.aa-return-date-wrap[hidden],
#aa-tickets-section[hidden]{display:none!important}
#search-section.hero{
  min-height:0!important;
  align-items:stretch;
  flex-direction:column;
  padding-bottom:24px;
}
#search-section .hero-deferred{
  background:transparent;
  padding:10px 0 0;
  border-bottom:none;
}
#search-section .hero-deferred > .wrap.hero-deferred-inner,
#search-section .wrap.hero-deferred-inner{
  max-width:min(1040px,100%);
  margin:0 auto;
  padding:0;
}
#search-section .hero-secondary{margin-top:14px}
#search-section .hero-secondary > div{margin-bottom:0}
.hero-deferred{background:#0F1822;padding:22px 24px 28px;border-bottom:1px solid var(--amber)}
.hero-deferred > .wrap.hero-deferred-inner,
.wrap.hero-deferred-inner{
  max-width:min(920px,100%);
  width:100%;
  margin-left:auto;
  margin-right:auto;
  box-sizing:border-box;
}
/* Kids reminder lives inside the white search card, not the navy stats band */
.kl-search-card .kl-alert,
.kl-search-card .kl-search-reminder{
  width:100%;
  max-width:100%;
  margin:12px 0 0;
  box-sizing:border-box;
  align-items:flex-start;
  flex-wrap:nowrap;
  gap:10px;
}
.kl-search-card .kl-alert > span:not(.kl-alert-icon){
  flex:1 1 auto;
  min-width:0;
  white-space:normal;
  overflow-wrap:anywhere;
  text-wrap:pretty;
  line-height:1.45;
}
.kl-search-card .kl-alert-icon{flex:0 0 auto;line-height:1.3}
.kl-search-card .kl-alert a{
  color:#8A4B00;
  font-weight:600;
  text-decoration:underline;
  text-underline-offset:2px;
}
.hero-deferred .hero-stats{
  margin-top:0;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px 16px;
  width:100%;
  justify-items:center;
  text-align:center;
}
.hero-deferred .hstat{min-width:0}
/* Align Multi-City / Rail Pass pills with search card rail (EN homepage) */
.hero .hero-secondary{
  max-width:min(1040px,100%);
  width:100%;
  margin-left:auto;
  margin-right:auto;
  box-sizing:border-box;
}
@media (max-width:600px){
  .hero-deferred .hero-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 12px}
}
/* Search homepage: size the photo to the form + stats, not the viewport.
   (Old min-height:100svh left a huge empty gap above the 30+ operators row.) */
@media (min-width:900px){
  #search-section.hero,
  .hero:has(> .hero-deferred),
  .hero:has(.hero-deferred){
    min-height:0
  }
}

/* === VISUAL-P1C-ROUTE-SEO-INTRO-2026-07-28 === */
/* Long .route-seo-intro inherits body --ink (#1A2530) on navy hero → ghosted/overlapping
   leftover copy behind chips & form. Keep in DOM for SEO; hide from first-fold visuals.
   Chip rows use inline display:flex and stay visible. */
.hero .route-seo-intro:not([style*="display:flex"]){
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
  color:transparent!important;
}
/* Chip CTA row: ensure contrast on dark hero */
.hero .route-seo-intro[style*="display:flex"]{
  position:relative;
  z-index:3;
  margin-top:10px;
  margin-bottom:12px;
}

/* === VISUAL-P1B-GUIDE-FOLD-2026-07-28 === */
/* Money-guide first fold: brand + H1 + short support + chip CTA; prose deferred */
.guide-fold-trim .crumb{margin:22px 0 8px}
.guide-fold-trim .cat{margin-bottom:8px}
.guide-fold-trim h1{margin-bottom:10px;font-size:clamp(1.55rem,4.2vw,2.15rem);line-height:1.15}
.guide-fold-trim > .updated:first-of-type,
.guide-fold-trim .guide-fold-support{margin:-2px 0 14px;font-size:.9rem;line-height:1.45;color:var(--muted)}
.guide-fold-trim #route-booking-strip{margin:0 0 26px!important}
.guide-fold-trim .guide-fold-deferred{margin-top:8px}
.guide-fold-trim .guide-fold-deferred > .intro{margin-top:0}
/* Push long SEO intro / Cost table just under the first viewport (home/route hero pattern) */
@media (max-width:700px){
  .guide-fold-trim h1{font-size:1.55rem;margin-bottom:8px}
  .guide-fold-trim .crumb{margin:16px 0 6px}
  .guide-fold-trim #route-booking-strip{margin-bottom:max(28px, calc(100svh - 420px))!important}
}
@media (min-width:701px){
  .guide-fold-trim #route-booking-strip{margin-bottom:max(32px, calc(100svh - 400px))!important}
}

/* === VISUAL-P2-GUIDE-TEMPLATE-2026-07-30 === */
/* Stronger guide brand lockup + slight page atmosphere (keep EuroRail amber/steel) */
.guide-header{background:linear-gradient(180deg,#FFFFFF 0%,#F7F9FB 100%);border-bottom:1px solid var(--chalk-dk);box-shadow:0 1px 0 rgba(28,43,58,.04)}
.guide-chrome .logo{color:var(--steel)!important;font-weight:400}
.guide-chrome .logo-mark{background:var(--steel);box-shadow:inset 0 0 0 2px var(--amber)}
.guide-chrome .logo-mark{filter:none}
.guide-chrome .logo sup{background:var(--steel);color:var(--amber);border:1px solid rgba(232,160,32,.45)}
.guide-fold-trim .cat{background:var(--steel);color:var(--amber);letter-spacing:.06em}
.guide-fold-trim #route-booking-strip.tip{
  background:rgba(28,43,58,.04);
  border:1px solid var(--chalk-dk);
  border-left:3px solid var(--amber);
  border-radius:10px;
  padding:12px 14px;
}
body.guide-page,
main.guide-fold-trim{background-image:linear-gradient(180deg,rgba(28,43,58,.015),transparent 220px)}

/* === HOMEPAGE HERO VISUAL 2026-08-18 ===
   Search homepages only (#search-section). Sharper Europe photo, contrast overlay,
   gold rail-map motif on the right. Does not change blog/guide .hero. */
#search-section.hero .hero-photo-img{
  object-position:72% 42%;
  filter:contrast(1.16) saturate(1.12) brightness(.96);
}
#search-section.hero .hero-photo::after{
  background:
    linear-gradient(180deg, rgba(15,24,34,.38) 0%, transparent 22%, transparent 52%, rgba(15,24,34,.88) 84%, #0F1822 100%),
    linear-gradient(105deg, rgba(15,24,34,.86) 0%, rgba(15,24,34,.72) 34%, rgba(15,24,34,.42) 58%, rgba(15,24,34,.18) 82%, rgba(15,24,34,.12) 100%);
}
/* Kill the dashed yellow “rail” hairline at the photo/stats seam */
#search-section.hero::after{
  content:none;
  display:none;
  height:0;
  background:none;
}
#search-section.hero::before{
  background:url('/assets/img/hero-rail-map.svg') right 2% 46% / min(54vw,680px) auto no-repeat;
  opacity:.55;
  -webkit-mask-image:linear-gradient(105deg,transparent 0 40%,#000 62%);
  mask-image:linear-gradient(105deg,transparent 0 40%,#000 62%);
}
#search-section.hero .kl-search-card{
  box-shadow:0 28px 70px rgba(0,0,0,.48), 0 0 0 1px rgba(232,160,32,.38);
}
#search-section.hero .hero-secondary .stab{
  border-color:rgba(232,160,32,.42)!important;
  background:rgba(15,24,34,.35)!important;
}
/* Return tab is live (two one-way lists). Do not hide it with !important. */
#search-section #aa-tickets-section[hidden],
.hero #aa-tickets-section[hidden],
#aa-tickets-section[hidden]{display:none!important}
#search-section #aa-tickets-section,
.hero #aa-tickets-section{
  background:#fff!important;
  padding:14px 16px 12px!important;
  margin:12px 0 0!important;
  border-radius:14px;
  box-shadow:0 10px 32px rgba(10,25,47,.14)
}
#search-section #aa-tickets-section .wrap,
.hero #aa-tickets-section .wrap{max-width:none;width:100%;padding:0;margin:0}
#aa-tickets-section .sec-head{margin-bottom:8px!important}
#aa-tickets-section .sec-title{font-size:1.15rem}
.aa-trust{font-size:.78rem;color:#4a5b6b;margin:10px 0 0;line-height:1.45}
@media (max-width:700px){
  #search-section.hero::before{opacity:.2;background-size:min(90vw,420px)}
  #search-section.hero .hero-photo-img{object-position:62% 48%}
}

/* ---- C46 amber text contrast layer (WCAG 1.4.3). Brand amber --amber/--amber-dim stays for borders, fills,
   hover backgrounds and decorative marks; only TEXT on light surfaces uses --amber-text. Higher specificity than
   per-page inline <style> and !important only for inline style="" attributes, so no HTML bulk edit is needed.
   Logotype (.logo em / .logo span) is exempt from 1.4.3 and keeps the brand colour. ---- */
html body .sec-pre,html body .gc-cat,html body .ayb-pre,html body .aff-label,html body .gm-cat,
html body .gm-tip strong,html body .gm-grid-num,html body .calc-30s-kicker,html body .calc-30s-links a,
html body .mc-leg-num,html body .others a,html body .postcard .more{color:var(--amber-text)}
html [style*="color:var(--amber-dim)"]{color:var(--amber-text) !important}
html [style*="color:var(--amber,"]{color:var(--amber-text) !important}
html [style*="color:var(--amber)"]{color:var(--amber-text) !important}
html .api-section .sec-pre,html .api-section [style*="color:var(--amber"],html footer [style*="color:var(--amber"],
html .hero [style*="color:var(--amber"],html [class*="dark"] [style*="color:var(--amber"]{color:var(--amber-on-dark) !important}
html body .calc-section > .wrap .sec-head .sec-pre,html body #operators-strip a{color:var(--amber-on-dark) !important}

/* C46 keyboard focus: the search inputs set outline:none and had no replacement indicator (WCAG 2.4.7) */
html body .kl-input:focus-visible,html body .kl-select:focus-visible,html body .kl-input[type=date]:focus{outline:2px solid var(--amber-text,#7A4F00);outline-offset:3px;border-radius:4px}
/* C50 short-phone hero (<=480px wide AND <=700px tall, e.g. 320x568): bring the FROM/TO fields into the first screen.
   Same content, tighter vertical rhythm; larger phones are untouched. */
@media (max-width:480px) and (max-height:700px){
  html body #search-section.hero{padding-top:12px}
  html body #search-section .hero-inner{padding-top:8px}
  html body #search-section .kl-grid{gap:6px}
  html body #search-section .hero-pre{margin-bottom:8px;letter-spacing:.06em}
  html body #search-section #hero-title{font-size:1.4rem;line-height:1.15;margin-bottom:6px}
  html body #search-section .hero-sub{font-size:.85rem;line-height:1.35;margin-bottom:12px}
}

/* T-08 phone hero fold: the Search button (and its card) must sit inside the first viewport, also above the ~114 px cookie banner,
   at 390x844 and 360x800. Same content; only vertical rhythm is tightened. Fields stay >= 44 px tall, inputs 16 px. */
@media (max-width:600px){
  html body #search-section.hero{padding-top:20px}
  html body #search-section .hero-inner{padding-top:0}
  html body #search-section .hero-pre{margin-bottom:10px}
  html body #search-section #hero-title{margin-bottom:8px}
  html body #search-section .hero-sub{margin-bottom:14px;line-height:1.45}
  html body #search-section.hero .kl-search-card{padding:0 16px 14px!important}
  html body #search-section .search-tabs{margin:0 -16px 8px!important}
  html body #search-section .kl-grid{gap:8px;padding:10px 12px}
  html body #search-section .kl-swap-btn{min-height:32px}
}

/* C50 single primary CTA colour: route pages shipped the Search button as #FF5722 with white text (about 3.2:1) while the
   rest of the site uses brand amber with steel text (6.5:1). One shared rule, no HTML edit. */
html body .kl-btn{background:var(--amber);color:var(--steel)}
html body .kl-btn:hover{background:var(--amber-dim)}
html body .kl-btn:focus-visible{outline:2px solid var(--steel);outline-offset:3px}

/* BLOCK 18 neutral/semantic text tokens (AA): --muted 4.4-3.8:1 on chalk -> >=4.8:1; green text 2.9:1 -> 5:1; small grey labels on steel/chalk */
html:root{--muted:#4B6073;--signal-g:#1A7F43}
html body .hstat-l{color:rgba(255,255,255,.62)}
html body .kl-alert span{color:var(--amber-text)}
html body .crumb{color:var(--muted)}
html body .calc-section > .wrap > p[style*="--muted"],html body #operators-strip p[style*="--muted"]{color:rgba(255,255,255,.72) !important}
/* C63 mobile touch targets (WCAG 2.5.8 AA: >= 24x24 CSS px; language switcher must be reachable)
   - 8 language buttons did not fit on phones (3 off-screen at 320 px, 2 at 390 px, bar not scrollable).
   - footer/quick links were 14-19 px tall. */
@media (max-width:480px){
  html body .lang-inner{flex-wrap:nowrap;justify-content:space-between;gap:0}
  html body .lang-inner .lang-sep{display:none}
  html body .lang-inner .lang-btn{flex:1 1 0;min-width:0;padding-left:0;padding-right:0;text-align:center}
}
@media (max-width:900px){
  html body footer a{display:inline-block;padding-top:3px;padding-bottom:3px}
  html body .see-all,html body .qlink{display:inline-block;min-height:24px;box-sizing:border-box}
  html body .see-all{padding-top:3px;padding-bottom:3px}
}
html body .hero .crumbs,html body .hero-inner .crumbs{color:rgba(255,255,255,.62)}
html body footer:not(:has(.footer-aff)) .ert-cookie-link{color:rgba(255,255,255,.72)}

/* BLOCK 24 legal-page header nav: 6 links overflowed phones (the last link was off-screen at 390 px); wrap and keep 24 px targets */
html body nav.top{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;row-gap:2px}
html body nav.top a{padding-top:4px;padding-bottom:4px}

/* W4-2 phone link targets: standalone links (breadcrumbs, back link, "Operator guides", station card CTAs, header Blog link)
   get a >= 24 px box without touching body-text line-height. In-sentence paragraph links are left alone (inline-text case). */
@media (max-width:900px){
  html body .crumb a,html body .crumbs a,
  html body a[href$="/operators/"][style*="DM Serif Display"],
  html body a[href="/blog/"][style*="margin-left:auto"],
  html body a[target="_blank"][style*="margin-top:auto"]{display:inline-flex;align-items:center;min-height:24px;box-sizing:border-box}
}

/* === W11-3 tables START === */
/* Phone: simple content tables (class t-cards, added by scripts/ert_w11_table_labels.py) become stacked cards. */
@media (max-width:600px){
  html body table.t-cards{display:block;width:100%;min-width:0;max-width:100%;overflow:visible;border:0;background:none}
  html body .price-wrap table.t-cards{min-width:0}
  html body .facttable-wrap:has(table.t-cards){overflow-x:visible}
  html body table.t-cards thead,
  html body table.t-cards tr:not(:has(td)){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
  html body table.t-cards tbody{display:block}
  html body table.t-cards tr{display:block;margin:0 0 12px;padding:4px 14px;border:1px solid var(--chalk-dk,#d9e1ea);border-radius:10px;background:var(--white,#fff);box-sizing:border-box}
  html body table.t-cards td,
  html body table.t-cards th[scope=row]{display:flex;justify-content:space-between;align-items:baseline;gap:14px;width:auto;padding:8px 0;border:0;border-bottom:1px solid var(--chalk-dk,#d9e1ea);text-align:right;overflow-wrap:anywhere;box-sizing:border-box}
  html body table.t-cards tr > :last-child{border-bottom:0}
  html body table.t-cards td::before{content:attr(data-label);flex:0 0 38%;max-width:38%;text-align:left;font-size:.72rem;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--muted,#5b6b7d)}
  html body table.t-cards td:not([data-label])::before{content:none}
  /* first cell = card title (its column header would be redundant) */
  html body table.t-cards td:first-child,
  html body table.t-cards th[scope=row]{display:block;text-align:left;font-weight:700;color:var(--ink,#16202c);padding-top:10px}
  html body table.t-cards td:first-child::before{content:none}
  html body table.t-cards td:last-child:has(> button),
  html body table.t-cards td:last-child:has(> a.bk){justify-content:flex-end}
}
/* === W11-3 END === */
