/* ===== Design tokens (brief §2 + stitch-export/expedition_journal/DESIGN.md) ===== */
:root {
  --color-primary: #0E2A3D;       /* ink-navy */
  --color-primary-dark: #071620;
  --color-bg-ice: #E7F1F5;        /* icy pale blue */
  --color-bg: #FFFFFF;
  --color-accent: #D97A3E;        /* burnt-orange */
  --color-accent-dark: #B85F28;
  --color-text: #1B2529;          /* graphite */
  --color-text-muted: #4C5D66;
  --color-border: #C9D8DE;
  --color-border-soft: rgba(27, 37, 41, 0.1);

  --max-width: 1160px;
  --radius: 6px;
  --radius-sm: 4px;

  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', -apple-system, Segoe UI, Arial, sans-serif;

  --section-gap: 4rem;      /* 64px, tightened from journal's 80px for mobile-first economy */
  --gutter: 1.5rem;
}

@media (min-width: 768px) {
  :root { --section-gap: 5rem; }
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-primary); letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }
a { color: var(--color-primary); text-decoration: none; }

@media (min-width: 768px) {
  h1 { font-size: 3.25rem; }
  h2 { font-size: 2.25rem; }
}

.container {
  /* Prevents a last child's own margin-bottom from collapsing through this
     box and adding stray extra space below the section (e.g. a trailing <p>'s
     margin-bottom leaking past the section boundary) — keeps section-to-section
     gaps pixel-exact instead of off by whatever the last child's margin happens
     to be. */
  display: flow-root;
  max-width: var(--max-width);
  /* margin-left/right only, not the "margin: 0 auto" shorthand — that shorthand
     also zeroes margin-top, which beat the sitewide "section + section" spacing
     rule on every plain <section class="container"> (this class's specificity
     is higher than 3 type selectors) and was the real cause of the inconsistent
     section-to-section gaps reported in Round 3. */
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--gutter);
}
/* A trailing <p>'s own margin-bottom (grid/flex children never have this
   problem) otherwise adds an extra ~16px to some sections and not others,
   which is exactly the inconsistent-gap symptom reported in Round 3. */
.container > *:last-child { margin-bottom: 0; }

/* Section-to-section rhythm: every top-level section contributes HALF a
   section-gap as its own top+bottom padding (not external margin). Two
   adjacent sections' padding then sums to one full section-gap, and — because
   it's padding, not margin — a background-color section's own content always
   has breathing room before its color boundary (Round 4 fix #1: cards/buttons
   were sitting flush against the color transition line when spacing was
   margin-based instead). This replaces the old margin-based approach, which
   also had a second, separate bug (Round 4 fix #2): a stray
   "main > .container > * + *" rule added an unwanted extra 80px between an
   H2 and the very next element specifically on sections where the section
   itself carried the .container class (Ships & Fleet, Price & Value, etc.)
   but not on section-tint sections (whose .container is one level deeper) —
   producing exactly the "some headings have a huge gap, others don't"
   inconsistency reported. Removed rather than scoped, since default heading
   margins already provide the right amount of heading-to-content spacing. */
main > section.container,
main > .hero { padding-top: calc(var(--section-gap) / 2); padding-bottom: calc(var(--section-gap) / 2); }

/* ===== Links & focus/hover states (sitewide) ===== */
a, button, summary, .btn {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}
/* Inline body links (inside prose, not nav/footer/buttons/cards) need a visible
   resting state — the base ink-navy link color reads as almost identical to
   the graphite body text color with no underline, making these links
   invisible until hovered. */
main p a:not(.btn), main li a:not(.btn) { text-decoration: underline; text-decoration-color: var(--color-border); text-underline-offset: 2px; }
a:not(.btn):hover { color: var(--color-accent); text-decoration: underline; text-decoration-color: var(--color-accent-dark); }
a:focus-visible, button:focus-visible, summary:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===== Buttons / CTA vocabulary (brief §9.2 — exactly these 3 strings sitewide) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.95em 1.9em;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(0); box-shadow: none; }
/* Small arrow glyph marking a button as an outbound link (Visit Website,
   Visit Swan Hellenic, etc.) — never applied to internal "Read Full Review"
   or "Compare" buttons. */
.btn--external::after { content: '\2197'; margin-left: 0.5em; font-size: 1.1em; line-height: 1; }
.btn-primary {
  background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 122, 62, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover { background: linear-gradient(180deg, #E28648 0%, var(--color-accent-dark) 100%); box-shadow: 0 8px 20px rgba(217, 122, 62, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.btn-primary:active { background: var(--color-accent-dark); box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2); }
.btn-secondary { background: #fff; color: var(--color-primary); border-color: var(--color-border); box-shadow: 0 2px 8px rgba(14, 42, 61, 0.08); }
.btn-secondary:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); box-shadow: 0 6px 16px rgba(14, 42, 61, 0.22); transform: translateY(-2px); }
.btn-secondary:active { background: var(--color-primary-dark); box-shadow: none; }

/* ===== Header ===== */
.site-header { background: var(--color-primary); position: sticky; top: 0; z-index: 50; }
.site-header .container { height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.site-logo { display: flex; align-items: center; }
.site-logo__img { height: 48px; width: auto; display: block; }
@media (min-width: 768px) { .site-logo__img { height: 60px; } .site-header .container { height: 96px; } }

.site-nav { display: none; }
/* Child selector, not descendant — a plain ".site-nav ul" would also match the
   nested .nav-dropdown__menu <ul> and, at higher specificity than
   ".nav-dropdown__menu { display: none }", force every submenu permanently
   visible regardless of the is-open class. That was the real Round 2 fix #1 bug. */
.site-nav > ul { display: flex; align-items: center; gap: 1.75rem; list-style: none; }
.site-nav a { color: #E7F1F5; font-size: 0.95rem; font-weight: 600; }
.site-nav a:hover { color: var(--color-accent); text-decoration: none; }
.site-nav a.active { color: var(--color-accent); }
/* "Reviews"/"Guides" are dropdown-only category labels — no page of their own
   to link to (unlike "Versus", which legitimately points to `/`) — so they're
   a button that only opens the menu, not an <a>. */
.nav-dropdown__trigger {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  color: #E7F1F5;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.nav-dropdown__trigger:hover { color: var(--color-accent); }

.nav-dropdown { position: relative; }
.nav-dropdown__menu {
  display: none;
  position: absolute;
  /* top is set inline by js/nav.js — computed from the header's actual bottom edge,
     since the header's flex-centered nav row means top:100% here would land
     mid-header instead of below it (see Round 2 fix #1). */
  left: 0;
  min-width: 240px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem;
  box-shadow: 0 8px 24px rgba(14, 42, 61, 0.15);
}
.nav-dropdown.is-open .nav-dropdown__menu { display: block; }
.nav-dropdown__menu li { list-style: none; }
.nav-dropdown__menu a { display: block; color: var(--color-text); padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); font-weight: 500; font-size: 0.9rem; }
.nav-dropdown__menu a:hover { background: var(--color-bg-ice); color: var(--color-primary); text-decoration: none; }

.nav-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}
.nav-toggle:hover { color: var(--color-accent); }

.mobile-nav {
  display: none;
  background: var(--color-primary-dark);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; padding: 0.5rem var(--gutter) 1rem; }
.mobile-nav > ul > li { border-bottom: 1px solid rgba(255,255,255,0.08); }
.mobile-nav a { display: block; padding: 0.85rem 0.25rem; color: #E7F1F5; font-weight: 600; }
.mobile-nav a:hover { color: var(--color-accent); text-decoration: none; }
.mobile-nav__label { display: block; padding: 0.85rem 0.25rem; color: #E7F1F5; font-weight: 600; }
.mobile-nav .mobile-sub { padding-left: 1rem; }
.mobile-nav .mobile-sub a { font-weight: 400; font-size: 0.92rem; padding: 0.6rem 0.25rem; }

@media (min-width: 1024px) {
  .site-nav { display: block; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ===== Footer ===== */
.site-footer { background: var(--color-primary); color: #C9D8DE; padding: var(--section-gap) 0 2rem; margin-top: calc(var(--section-gap) / 2); }
.site-footer .container { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1em; }
.site-footer p { color: #9FB4BE; font-size: 0.9rem; }
.site-footer ul { list-style: none; }
.site-footer li + li { margin-top: 0.6em; }
.site-footer a { color: #C9D8DE; font-size: 0.9rem; }
.site-footer a:hover { color: var(--color-accent); text-decoration: underline; }
.footer-disclaimer { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 2rem; padding-top: 1.5rem; font-size: 0.82rem; color: #7E93A0; }

.footer-sitemap__grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.footer-sitemap__heading { color: #fff; font-weight: 600; font-size: 0.88rem; margin: 1em 0 0.5em; }
.footer-sitemap__heading:first-child { margin-top: 0; }

@media (min-width: 640px) {
  .footer-sitemap__grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
  .site-footer .container { grid-template-columns: 1.6fr 1fr 1.8fr; align-items: start; }
}

/* ===== Breadcrumbs ===== */
.breadcrumbs { padding: 0.9rem 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; gap: 0.4em; font-size: 0.85rem; color: var(--color-text-muted); }
.breadcrumbs li { display: flex; align-items: center; gap: 0.4em; }
.breadcrumbs li + li::before { content: '/'; color: var(--color-border); }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs [aria-current="page"] { color: var(--color-accent); font-weight: 600; }

/* ===== Hero ===== */
.hero { position: relative; background-size: cover; background-position: center; color: #fff; }
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(7,22,32,0.55), rgba(7,22,32,0.75));
}
.hero .container { position: relative; z-index: 1; padding-top: 4rem; padding-bottom: 4rem; text-align: center; max-width: 760px; }
.hero h1 { color: #fff; }
.hero p { color: #E7F1F5; font-size: 1.1rem; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; font-weight: 700; color: var(--color-accent); margin-bottom: 1em; }

/* ===== Cards ===== */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card__image { aspect-ratio: 4 / 3; overflow: hidden; }
.card__image img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card--top-pick { border-color: var(--color-accent); border-width: 2px; position: relative; }
/* Alternatives cards vary in text length — pin the CTA to the same baseline on every card. */
.card-grid .card__body .btn { margin-top: auto; align-self: center; }
.badge-corner { position: absolute; top: 1rem; left: 1rem; z-index: 1; }
/* display:inline-block, not the sitewide "img { display:block }" reset — a
   block-level icon always starts its own line, which is exactly why the
   Technical Specifications table's ship icon (and every other icon-inline
   usage in running text) rendered stacked above its label instead of beside it. */
.icon-inline { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 0.4em; }
.badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3em 0.7em;
  border-radius: var(--radius-sm);
}
.spec-list { list-style: none; margin: 1em 0; }
.spec-list li { display: flex; align-items: flex-start; gap: 0.6em; padding: 0.4em 0; font-size: 0.92rem; }
.spec-list img { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; color: var(--color-primary); }

.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

/* ===== Comparison tables — stacked cards on mobile, table on desktop (brief §4.2, one approach sitewide) ===== */
.compare-wrap { overflow-x: auto; }
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: fixed;
}
.compare th, .compare td {
  width: 33.333%;
  padding: 0.9em 1em;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}
.compare th:last-child, .compare td:last-child { border-right: none; }
.compare thead th { background: var(--color-primary); color: #fff; font-family: var(--font-body); font-weight: 600; }
.compare thead th:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.2); }
.compare tbody tr:nth-child(even) { background: var(--color-bg-ice); }
.compare th:first-child, .compare td:first-child { font-weight: 600; }

@media (max-width: 767px) {
  .compare { table-layout: auto; }
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare td { display: block; width: 100%; }
  .compare tr {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
  }
  .compare tbody tr:nth-child(even) { background: none; }
  /* Grid, not flex space-between — a fixed label column keeps every row's
     label and value starting at the same x-position instead of the value's
     start point drifting with each label's own text width. */
  .compare td {
    border-bottom: 1px solid var(--color-border-soft);
    border-right: none;
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: start;
    gap: 0.25rem 1rem;
    padding: 0.9em 1rem;
  }
  .compare td:last-child { border-bottom: none; }
  .compare td::before { content: attr(data-label); font-weight: 700; color: var(--color-text-muted); }
}

/* ===== FAQ accordion (native details/summary sitewide, brief §6 pattern) ===== */
.faq-list { display: grid; gap: 0.75rem; }
@media (min-width: 768px) { .faq-list { grid-template-columns: 1fr 1fr; gap: 1rem; } }
.faq-list details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.faq-list summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; font-size: 1.3rem; color: var(--color-accent); flex-shrink: 0; }
.faq-list details[open] summary::after { content: '\2212'; }
.faq-list details p { margin-top: 0.75rem; color: var(--color-text-muted); }

/* ===== Utility ===== */
.text-muted { color: var(--color-text-muted); }
/* Half section-gap top+bottom, same padding-based contributor pattern as
   "main > section.container" above — a plain section's content and a tinted
   section's content each keep breathing room from their own color boundary. */
.section-tint { background: var(--color-bg-ice); padding: calc(var(--section-gap) / 2) 0; margin-top: 0; }
.two-col { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .two-col { grid-template-columns: 1fr 1fr; } }
/* Operator-A/Operator-B comparison blocks (Ships & Fleet, Destinations, Onboard
   Experience) — a left accent rule separates the two columns; kept in the mobile
   stacked layout too since it reads fine per-block there, not just as a divider. */
.two-col--compare > div { border-left: 3px solid var(--color-accent); padding-left: 1.25rem; }

/* ===== Related Comparisons tiles ===== */
.related-card { text-decoration: none; color: inherit; transition: border-color 150ms ease, transform 150ms ease; }
.related-card:hover, .related-card:focus-visible { border-color: var(--color-accent); transform: translateY(-2px); text-decoration: none; }
.related-card .card__body { align-items: center; text-align: center; justify-content: center; }
.related-card h3 { margin: 0; }
.verdict-box { background: var(--color-bg-ice); border-left: 4px solid var(--color-accent); border-radius: var(--radius); padding: 2rem; }
/* Two buttons side by side, in genuinely equal-width grid columns — flex-grow
   with flex-basis:auto (the previous approach) only equalizes the space ADDED
   to each button, not their final width, so a longer label still rendered
   wider than a shorter one (487px vs 545px in practice). Grid's 1fr/1fr forces
   the two columns to match regardless of each label's own text length. */
.verdict-box__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.5rem; }
.verdict-box__actions .btn { justify-content: center; }
@media (max-width: 480px) { .verdict-box__actions { grid-template-columns: 1fr; } }

/* Quick outbound links to each operator's own site, shown right under the
   hero intro — same equal-width grid pattern as .verdict-box__actions. */
.hero__actions { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-top: 1.5rem; max-width: 360px; margin-left: auto; margin-right: auto; }
.hero__actions .btn { justify-content: center; white-space: nowrap; }
@media (min-width: 768px) { .hero__actions { grid-template-columns: 1fr 1fr; max-width: 640px; } }
.pros-cons { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .pros-cons { grid-template-columns: 1fr 1fr; } }
.pros-cons ul { list-style: none; }
.pros-cons li { padding-left: 1.4em; position: relative; margin-bottom: 0.6em; }
.pros-cons .pros li::before { content: '+'; position: absolute; left: 0; color: #2E7D4F; font-weight: 700; }
.pros-cons .cons li::before { content: '\2212'; position: absolute; left: 0; color: var(--color-accent-dark); font-weight: 700; }
