/* Lisbon to Porto Train — azulejo tile / two-rivers design system */

:root {
  --azulejo-900: #11324a;
  --azulejo-800: #163f5c;
  --azulejo-700: #1f5478;
  --azulejo-600: #2c6a92;
  --azulejo-500: #3f83ab;
  --azulejo-300: #8fbdd4;
  --azulejo-200: #cfe6ef;
  --azulejo-100: #e9f3f7;
  --cream: #f8f2e6;
  --cream-deep: #f1e8d6;
  --white: #fffdf8;
  --ink: #1c2b33;
  --ink-soft: #52646d;
  --line: #ddd0b3;
  --terracotta: #c15a34;
  --terracotta-dark: #9b4325;
  --gold: #c99a45;
  --radius: 14px;
  --shadow: 0 12px 30px -12px rgba(17, 50, 74, 0.28);
  --maxw: 1340px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  color: var(--azulejo-900);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--azulejo-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}
section { padding: 72px 0; }
.section-head { max-width: 700px; margin: 0 auto 40px; text-align: center; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }
.kicker {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta-dark);
  font-weight: 600;
  margin-bottom: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--terracotta);
  color: var(--white);
  box-shadow: 0 8px 20px -8px rgba(155, 67, 37, 0.55);
}
.btn-primary:hover { background: var(--terracotta-dark); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 253, 248, 0.55);
}
.btn-ghost:hover { background: rgba(255, 253, 248, 0.12); }
.btn-outline {
  background: transparent;
  color: var(--azulejo-700);
  border: 1.5px solid var(--azulejo-500);
  padding: 10px 20px;
}
.btn-outline:hover { background: var(--azulejo-100); }

/* ---------- Header ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--azulejo-900);
  border-bottom: 1px solid rgba(255, 253, 248, 0.08);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
}
.brand-mark {
  width: auto;
  height: 42px;
  display: block;
  flex: none;
}
nav.primary-nav {
  display: flex;
  gap: 14px;
  justify-self: center;
  flex-wrap: nowrap;
  min-width: 0;
}
nav.primary-nav a {
  color: rgba(255, 253, 248, 0.85);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}
nav.primary-nav a:hover { color: var(--white); }
.header-cta { justify-self: end; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 8px;
  justify-self: end;
}
.nav-toggle svg { width: 24px; height: 24px; }
.mobile-panel {
  display: none;
}

@media (max-width: 1060px) {
  .header-cta .btn { padding: 8px 14px; font-size: 0.85rem; }
}

@media (max-width: 860px) {
  .header-inner { grid-template-columns: auto 1fr auto; height: 62px; }
  nav.primary-nav { display: none; }
  .nav-toggle { display: block; }
  .header-cta { display: none; }
  .mobile-panel {
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--azulejo-800);
    padding: 10px 16px 22px;
    box-shadow: var(--shadow);
  }
  .mobile-panel.open { display: block; }
  .mobile-panel a {
    display: block;
    padding: 12px 0;
    color: var(--white);
    border-bottom: 1px solid rgba(255, 253, 248, 0.1);
    font-weight: 500;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--azulejo-800);
  color: var(--white);
  padding: 64px 0 80px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(45deg, transparent 46%, rgba(255,255,255,0.55) 46%, rgba(255,255,255,0.55) 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(255,255,255,0.55) 46%, rgba(255,255,255,0.55) 54%, transparent 54%);
  background-size: 46px 46px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  animation: tileWipe 1.1s ease-out both;
}
@keyframes tileWipe {
  from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
  to { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; align-items: stretch; }
}
.hero h1 { color: var(--white); }
.hero-sub {
  font-size: 1.12rem;
  color: rgba(255, 253, 248, 0.88);
  max-width: 540px;
}
.hero-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.stat-panel { margin-top: 0; }
@media (max-width: 900px) { .stat-panel { margin-top: 36px; } }
.stat-panel-label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255, 253, 248, 0.55);
  margin-bottom: 14px;
}
.stat-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (max-width: 900px) { .stat-strip { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: rgba(255, 253, 248, 0.08);
  border: 1px solid rgba(255, 253, 248, 0.16);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat b { display: block; font-family: "Fraunces", serif; font-size: 1.5rem; color: var(--white); }
.stat span { font-size: 0.82rem; color: rgba(255, 253, 248, 0.72); }

#firebird-search-widget { min-height: 210px; }

/* ---------- Widget strip (standalone booking section) ---------- */
.widget-strip {
  background: var(--cream-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 40px 0;
}
.widget-strip .container { max-width: 1324px; padding: 0 26px; }
.widget-strip .section-head { margin-bottom: 16px; }

/* ---------- Route text + map placeholder ---------- */
.route-columns {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 44px;
  align-items: stretch;
}
@media (max-width: 860px) {
  .route-columns { grid-template-columns: 1fr; }
}
.route-text { text-align: left; }
.route-text .kicker, .route-text h2, .route-text p { margin-left: 0; }
.map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}
.map-placeholder img {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 26px rgba(17, 50, 74, 0.22));
}

/* ---------- Rail link (scroll-driven train, route -> stations) ---------- */
.route-stations-wrap { position: relative; }
.rail-link {
  position: absolute;
  z-index: 4;
  pointer-events: none;
}
@media (max-width: 860px) {
  .rail-link { display: none; }
}
.rail-link-svg { display: block; overflow: visible; }
.rail-link-path {
  fill: none;
  stroke: var(--azulejo-300);
  stroke-width: 3;
  stroke-dasharray: 2 11;
  stroke-linecap: round;
}
.rail-link-train {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  offset-distance: 0%;
  offset-rotate: 0deg;
  offset-anchor: 50% 50%;
}
.rail-link-train svg { width: 18px; height: 18px; }
@supports not (offset-path: path("M0 0")) {
  .rail-link-train { display: none; }
}

/* ---------- Comparison table ---------- */
.compare-wrap { overflow-x: auto; margin-top: 30px; }
table.compare {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 640px;
}
table.compare th, table.compare td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--cream-deep);
  font-size: 0.95rem;
}
table.compare thead th {
  background: var(--azulejo-100);
  color: var(--azulejo-900);
  font-family: "Fraunces", serif;
  font-weight: 600;
}
table.compare tr:last-child td { border-bottom: none; }
table.compare a.btn-outline { font-size: 0.85rem; padding: 8px 16px; white-space: nowrap; }

/* ---------- Two-column feature blocks ---------- */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--azulejo-100); color: var(--azulejo-700);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.card-icon svg { width: 18px; height: 18px; }

.station-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 30px; }
@media (max-width: 800px) { .station-grid { grid-template-columns: 1fr; } }
.station-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.station-card h3 { color: var(--azulejo-900); }
.station-card .tag {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--azulejo-100);
  color: var(--azulejo-700);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  font-weight: 600;
}
.station-addr {
  list-style: none;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--cream-deep);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.station-addr li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.station-addr svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  color: var(--terracotta);
}
.station-addr strong { color: var(--ink); }

/* ---------- Transport comparison (train highlighted) ---------- */
.transport-compare { display: flex; flex-direction: column; gap: 18px; margin-top: 34px; }
.transport-row {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
}
.transport-row:not(.transport-row--winner) { opacity: 0.82; }
.transport-row--winner {
  position: relative;
  display: block;
  background: var(--azulejo-900);
  border-color: var(--azulejo-900);
  box-shadow: var(--shadow);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.transport-row--winner:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -14px rgba(17, 50, 74, 0.55);
  text-decoration: none;
}
.transport-badge {
  position: absolute;
  top: -12px;
  left: 26px;
  background: var(--terracotta);
  color: var(--white);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}
.transport-row-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.transport-row-head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.1rem;
  flex: 1;
}
.transport-row--winner h3 { color: var(--white); }
.transport-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--azulejo-100);
  color: var(--azulejo-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.transport-icon svg { width: 21px; height: 21px; }
.transport-row--winner .transport-icon { background: rgba(255, 253, 248, 0.15); color: var(--white); }
.transport-total {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--cream-deep);
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.transport-row--winner .transport-total { background: rgba(255, 253, 248, 0.15); color: var(--white); }
.transport-steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-chip {
  background: var(--cream-deep);
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.transport-row--winner .step-chip { background: rgba(255, 253, 248, 0.12); color: var(--white); }
.step-arrow { color: var(--line); font-size: 1rem; flex: none; }
.transport-row--winner .step-arrow { color: rgba(255, 253, 248, 0.4); }
.step-chip--cta {
  background: var(--terracotta);
  color: var(--white);
  font-weight: 600;
}
.transport-row--winner:hover .step-chip--cta { background: var(--terracotta-dark); }
.step-arrow--cta { color: rgba(255, 253, 248, 0.7); }
@media (max-width: 640px) {
  .transport-row { padding: 20px; }
}

/* ---------- Luggage diagram ---------- */
.luggage-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 44px;
  align-items: center;
  margin-top: 34px;
}
@media (max-width: 760px) { .luggage-layout { grid-template-columns: 1fr; } }
.luggage-diagram {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.luggage-svg { width: 100%; max-width: 220px; height: auto; }
.bag-body path, .bag-body rect, .bag-body line { stroke: var(--azulejo-700); }
.bag-dims line { stroke: var(--terracotta-dark); }
.bag-dims text { fill: var(--terracotta-dark); font-family: "Work Sans", sans-serif; }
.luggage-depth-note { font-size: 0.82rem; color: var(--ink-soft); font-style: italic; }
.fact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.fact-list li { padding-left: 22px; position: relative; color: var(--ink-soft); font-size: 0.95rem; }
.fact-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terracotta);
}
.fact-list strong { color: var(--ink); }

/* ---------- Accessibility stepper ---------- */
.stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 36px;
}
.stepper::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 6%;
  right: 6%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--azulejo-300) 0 8px, transparent 8px 14px);
  z-index: 0;
}
@media (max-width: 860px) {
  .stepper { grid-template-columns: 1fr; gap: 26px; }
  .stepper::before {
    top: 0;
    bottom: 0;
    left: 15px;
    right: auto;
    width: 2px;
    height: auto;
    background: repeating-linear-gradient(180deg, var(--azulejo-300) 0 8px, transparent 8px 14px);
  }
}
.stepper-item { position: relative; text-align: center; }
@media (max-width: 860px) { .stepper-item { text-align: left; padding-left: 56px; } }
.stepper-num {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--azulejo-700);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 auto 12px;
}
@media (max-width: 860px) { .stepper-num { position: absolute; left: 0; top: 0; margin: 0; } }
.stepper-icon { color: var(--terracotta); margin-bottom: 8px; }
.stepper-icon svg { width: 24px; height: 24px; margin: 0 auto; display: block; }
@media (max-width: 860px) { .stepper-icon svg { margin: 0 0 6px; } }
.stepper-item h4 { margin-bottom: 4px; font-size: 1rem; }
.stepper-item p { font-size: 0.87rem; color: var(--ink-soft); margin-bottom: 0; }

/* ---------- Ticket-styled tips card ---------- */
.ticket-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 240px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 34px;
}
.ticket-card::before, .ticket-card::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--cream-deep);
  border-radius: 50%;
  right: 240px;
  transform: translateX(-50%);
}
.ticket-card::before { top: -13px; }
.ticket-card::after { bottom: -13px; }
.ticket-main { padding: 30px 34px; display: flex; flex-direction: column; gap: 22px; }
.ticket-row { display: flex; gap: 14px; align-items: flex-start; }
.ticket-row-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--azulejo-100);
  color: var(--azulejo-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.ticket-row-icon svg { width: 17px; height: 17px; }
.ticket-row h4 { margin: 0 0 4px; font-size: 1rem; color: var(--azulejo-900); }
.ticket-row p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }
.ticket-stub {
  position: relative;
  background: linear-gradient(165deg, rgba(193, 90, 52, 0.12), rgba(193, 90, 52, 0.05));
  box-shadow: inset 1px 0 0 rgba(155, 67, 37, 0.12);
  border-left: 2px dashed var(--terracotta);
  border-radius: 0 var(--radius) var(--radius) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 28px 22px;
}
.ticket-stub-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--terracotta-dark);
}
.ticket-stub .btn { white-space: nowrap; }
.ticket-stub-note { font-size: 0.78rem; color: var(--ink-soft); }
@media (max-width: 720px) {
  .ticket-card { grid-template-columns: 1fr; }
  .ticket-card::before, .ticket-card::after { display: none; }
  .ticket-stub {
    border-left: none;
    border-top: 2px dashed var(--terracotta);
    border-radius: 0 0 var(--radius) var(--radius);
  }
}

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 30px auto 0; }
details.faq-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 20px;
  margin-bottom: 12px;
}
details.faq-item summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  color: var(--azulejo-900);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--terracotta);
  flex: none;
}
details.faq-item[open] summary::after { content: "\2212"; }
details.faq-item p { padding-bottom: 16px; color: var(--ink-soft); }

/* ---------- Footer ---------- */
footer {
  background: var(--azulejo-900);
  color: rgba(255, 253, 248, 0.78);
  padding: 46px 0 30px;
  font-size: 0.88rem;
}
footer .container { max-width: var(--maxw); }
footer a { color: rgba(255, 253, 248, 0.9); text-decoration: underline; }
footer p { margin: 0 0 12px; }
.footer-links { margin-top: 18px; display: flex; gap: 18px; flex-wrap: wrap; }
.section-alt { background: var(--cream-deep); }
.muted { color: var(--ink-soft); }
