/* Shared styles for Spanish Luxury Trains */
:root {
  /* Editorial (default) — ivory + charcoal + brass */
  --bg: #f6f1e7;
  --bg-soft: #ede5d3;
  --ink: #1a1613;
  --ink-soft: #4a423a;
  --muted: #8a8277;
  --line: rgba(26, 22, 19, 0.15);
  --accent: #9c6e32;
  --accent-deep: #6b4a1f;
  --surface: #fffdf7;
  --font-display: "Cormorant Garamond", "Garamond", "EB Garamond", Georgia, serif;
  --font-sans: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Fira Code", monospace;
}

[data-aesthetic="andalusian"] {
  --bg: #f3e8d6;
  --bg-soft: #e9d9bd;
  --ink: #2a1810;
  --ink-soft: #4e2f1f;
  --muted: #8c6a4f;
  --line: rgba(42, 24, 16, 0.18);
  --accent: #c0532a;
  --accent-deep: #8a3a1a;
  --surface: #faf1e0;
  --font-display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
}

[data-aesthetic="minimal"] {
  --bg: #fafaf8;
  --bg-soft: #f0efeb;
  --ink: #111110;
  --ink-soft: #404038;
  --muted: #85847c;
  --line: rgba(17, 17, 16, 0.12);
  --accent: #1f3d34;
  --accent-deep: #132722;
  --surface: #ffffff;
  --font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-sans: "Söhne", "Inter Tight", -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container { max-width: 1360px; margin: 0 auto; padding: 0 48px; }
@media (max-width: 720px) { .container { padding: 0 24px; } }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.02;
  text-wrap: balance;
}
.prose { max-width: 62ch; text-wrap: pretty; color: var(--ink-soft); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.ghost { border-color: var(--line); }

/* Logo */
.logo {
  display: inline-flex; align-items: center;
  line-height: 1;
  white-space: nowrap;
}
.logo-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--accent);
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.01em;
  line-height: 1;
}
.logo-text small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 400;
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; min-height: var(--nav-h, 72px); box-sizing: border-box; }
.subnav { position: sticky; top: var(--nav-h, 72px); z-index: 40; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-links { display: flex; gap: 32px; font-size: 13px; letter-spacing: 0.02em; }
.nav-links a { color: var(--ink-soft); transition: color 0.2s; }
.nav-links a:hover { color: var(--accent-deep); }
.nav-right { display: flex; align-items: center; gap: 20px; }
.lang-toggle {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.18em;
  display: inline-flex; gap: 6px;
  border: 1px solid var(--line); border-radius: 100px;
  padding: 6px 12px;
}
.lang-toggle button { padding: 2px 6px; color: var(--muted); }
.lang-toggle button.active { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) { .nav-links { display: none; } }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 100px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.status-Available { color: #2d6a4f; border-color: #2d6a4f40; }
.status-Limited { color: #b45309; border-color: #b4530940; }
.status-Waitlist { color: #94402b; border-color: #94402b40; }

/* ============================================================
   Mobile / web-app layer
   ============================================================ */

/* Comfortable tap targets + no blue tap flash + smooth momentum scroll */
@media (hover: none) {
  a, button { -webkit-tap-highlight-color: transparent; }
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* Hide scrollbars on the sticky sub-nav tab strip but keep it scrollable */
.subnav .container { -ms-overflow-style: none; scrollbar-width: none; }
.subnav .container::-webkit-scrollbar { display: none; }

/* ---- Phone layout (<=760px) ---- */
@media (max-width: 760px) {
  .container { padding: 0 18px; }

  /* Collapse every multi-column inline grid to a single column.
     (Inline styles can't be hit by normal rules — match the style attr.) */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  /* In alternating image/text cards, force image-first source order */
  a[style*="grid-template-columns"] > div[style*="order"] { order: 0 !important; }

  /* Tame the big vertical rhythm */
  section { padding-top: 60px !important; padding-bottom: 60px !important; }
  footer  { margin-top: 64px !important; padding-block: 56px !important; }

  /* Hero a touch shorter, less top padding under the fixed bar */
  .hero { min-height: 78vh !important; }
  .hero .container { padding-top: 92px !important; padding-bottom: 48px !important; }

  /* Fluid headlines so nothing overflows */
  .display { letter-spacing: 0; }

  /* Selected grids that read better as two columns on phones */
  .grid-2-mobile { grid-template-columns: 1fr 1fr !important; gap: 14px !important; }

  /* Inquiry card + step strip */
  .inq-card { padding: 24px 18px !important; min-height: 0 !important; }
  .inq-steps { flex-wrap: wrap; gap: 8px 12px !important; }
  .inq-steps .inq-sep { display: none; }

  /* Schedule rows as stacked cards */
  .sched-head { display: none !important; }
}

/* ============================================================
   App shell: compact top bar, bottom tab bar, safe areas
   ============================================================ */
.nav { padding-top: env(safe-area-inset-top); }

/* Mobile-only / desktop-only helpers */
.only-mobile { display: none; }
@media (max-width: 900px) {
  .only-desktop { display: none !important; }
  .only-mobile  { display: flex; }

  /* Compact the wordmark so it fits beside the controls */
  .logo-text > span:first-child { font-size: 13px !important; letter-spacing: 0.12em !important; }
  .logo-text small, .logo-text > span:last-child { display: none !important; }
  .nav-inner { padding: 12px 0 !important; min-height: 56px !important; }

  /* Leave room for the fixed bottom tab bar */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* Bottom tab bar (rendered only on mobile via .only-mobile) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; justify-content: space-around; align-items: stretch;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 9px 4px 7px;
  color: var(--muted);
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
}
.tabbar a .tab-ico { width: 22px; height: 22px; display: block; }
.tabbar a:active { color: var(--accent-deep); }
.tabbar a.active { color: var(--accent-deep); }
