/* Polar Chart — global design tokens, reset, header/footer, shared components.
   Source of truth: design-system-canonical.md (canonical merge of 3 Stitch generations). */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=Space+Grotesk:wght@600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block');

:root {
  /* Color tokens */
  --surface: #f6faf9;
  --surface-dim: #d7dbda;
  --surface-bright: #f6faf9;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f0f4f3;
  --surface-container: #ebefee;
  --surface-container-high: #e5e9e8;
  --surface-container-highest: #dfe3e2;
  --on-surface: #181c1c;
  --on-surface-variant: #3f4849;
  --inverse-surface: #2d3131;
  --inverse-on-surface: #eef1f0;
  --outline: #6f797a;
  --outline-variant: #bfc8c9;
  --hairline: #c7d3d1;
  --surface-tint: #26676d;
  --primary: #0b565b;
  --on-primary: #ffffff;
  --primary-container: #2e6e74;
  --on-primary-container: #afeef5;
  --secondary: #80560b;
  --on-secondary: #ffffff;
  --secondary-container: #ffc573;
  --brass-solid: #b8863b;
  --on-secondary-container: #794f03;
  --tertiary: #3a4d58;
  --on-tertiary: #ffffff;
  --tertiary-container: #54646d;
  --on-tertiary-container: #d6e5ef;
  --navy: #0f2a38;
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;
  --background: #f6faf9;
  --on-background: #181c1c;
  --surface-variant: #dfe3e2;

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --unit: 4px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --gutter: 24px;
  --space-lg: 24px;
  --space-xl: 48px;
  --margin-mobile: 16px;
  --margin-desktop: 48px;
  --container-max: 1200px;

  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--background);
  color: var(--on-background);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex-grow: 1; }

img { max-width: 100%; display: block; }

a {
  color: var(--primary);
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--brass-solid);
  text-decoration-thickness: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--on-surface);
  margin: 0 0 var(--space-md);
  line-height: 1.2;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
@media (min-width: 768px) {
  h1 { font-size: 48px; }
}

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) {
  h2 { font-size: 32px; }
}

h3 {
  font-size: 20px;
  font-weight: 600;
}
@media (min-width: 768px) {
  h3 { font-size: 24px; }
}

p { margin: 0 0 var(--space-md); }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--margin-mobile);
}
@media (min-width: 768px) {
  .container { padding: 0 var(--margin-desktop); }
}

/* Coordinate tag — the signature element */
.coordinate-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  border: 1px solid var(--outline);
  padding: 4px 12px;
}

.data-label {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- Header ---------- */
/* Base (mobile floor) height/type sizes; desktop scales ~1.25x, not the other way round,
   so the mobile header never shrinks below a comfortably tappable/readable size. */
.site-header {
  background: var(--inverse-surface);
  border-bottom: 1px solid var(--outline-variant);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (min-width: 768px) {
  .site-header .container { height: 80px; }
}
.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--surface-bright);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  white-space: nowrap;
}
@media (min-width: 768px) {
  .site-logo { font-size: 25px; }
}
.site-logo:hover { color: var(--surface-bright); }
.site-logo__mark { color: var(--inverse-primary, #93d1d7); }

.site-nav {
  display: none;
  gap: var(--space-xl);
}
@media (min-width: 768px) {
  .site-nav { display: flex; align-items: center; }
}
.site-nav > a {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--surface-variant);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
@media (min-width: 768px) {
  .site-nav > a { font-size: 15px; }
}
.site-nav > a:hover,
.site-nav > a.active {
  color: var(--secondary-container);
  border-bottom-color: var(--secondary-container);
}

/* Nav dropdowns — two silos (Polar Cruise Operators / Iceland Tour Operators).
   Desktop: hover or click reveals the panel. Mobile: same trigger becomes an
   accordion inside the slide-down mobile menu (no separate UI pattern). */
.nav-dropdown { position: relative; }
.nav-dropdown__trigger {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--surface-variant);
  background: none;
  border: none;
  padding: 0 0 4px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
@media (min-width: 768px) {
  .nav-dropdown__trigger { font-size: 15px; }
}
.nav-dropdown__caret { font-size: 10px; transition: transform 0.15s ease; }
.nav-dropdown.is-open .nav-dropdown__caret { transform: rotate(180deg); }
.nav-dropdown__trigger:hover,
.nav-dropdown.is-open .nav-dropdown__trigger {
  color: var(--secondary-container);
  border-bottom-color: var(--secondary-container);
}
.nav-dropdown__menu {
  display: none;
  flex-direction: column;
}
.nav-dropdown.is-open .nav-dropdown__menu { display: flex; }
@media (min-width: 768px) {
  .nav-dropdown:hover .nav-dropdown__menu { display: flex; }
  /* The 12px visual gap between trigger and menu would otherwise be a dead zone —
     the pointer leaves .nav-dropdown's hoverable box while crossing it, closing the
     menu before the cursor arrives. Padding-bottom extends the hoverable box through
     that gap; the matching negative margin keeps it from adding height to the nav row. */
  .nav-dropdown {
    padding-bottom: 12px;
    margin-bottom: -12px;
  }
  .nav-dropdown__menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--inverse-surface);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  }
}
.nav-dropdown__menu a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--surface-variant);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  white-space: nowrap;
}
@media (max-width: 767px) {
  .nav-dropdown__menu a { padding-left: var(--space-lg); white-space: normal; }
}
.nav-dropdown__menu a:hover,
.nav-dropdown__menu a.active {
  color: var(--secondary-container);
  background: rgba(255,255,255,0.06);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--outline-variant);
  color: var(--surface-bright);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  cursor: pointer;
}
@media (min-width: 768px) {
  .nav-toggle { display: none; }
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

.site-nav.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--inverse-surface);
  padding: var(--space-md) var(--margin-mobile) var(--space-lg);
  gap: var(--space-md);
  border-bottom: 1px solid var(--outline-variant);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary);
  color: var(--surface);
  border-top: 1px solid var(--outline);
  margin-top: auto;
}
.site-footer .container {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
@media (min-width: 768px) {
  .site-footer .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}
.site-footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 18px;
}
.site-footer__copy {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--surface-variant);
  margin-top: var(--space-sm);
  line-height: 1.6;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 13px;
}
.site-footer__links a {
  color: var(--surface-variant);
  text-decoration: underline;
}
.site-footer__links a:hover { color: var(--surface); }
.site-footer__disclosure {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--surface-variant);
  opacity: 0.85;
  max-width: 640px;
  line-height: 1.6;
}

/* ---------- Tables ---------- */
/* table-layout: fixed + wrapping by default keeps tables inside their container on desktop;
   overflow-x on the wrapper is a safety net for genuinely narrow screens, not the default path. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface-container-lowest);
}
table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 14px;
  text-align: left;
}
thead {
  background: var(--surface-container);
  color: var(--on-surface-variant);
}
th, td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  white-space: normal;
  overflow-wrap: break-word;
}
th:last-child, td:last-child { border-right: none; }
td.nowrap, th.nowrap { white-space: nowrap; }
tbody tr:hover { background: var(--surface-container-low); }
/* First column (attribute/operator label) gets a bit more room; remaining data columns
   split the rest evenly via table-layout: fixed. */
th:first-child, td:first-child { width: 22%; }
td.footnote { font-size: 11px; color: var(--outline); }

/* ---------- FAQ ---------- */
.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: var(--space-md) 0;
}
.faq summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  color: var(--on-surface);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-family: var(--font-mono);
  color: var(--primary);
  font-size: 20px;
  flex-shrink: 0;
}
.faq details[open] summary::after { content: '\2212'; }
.faq p { margin-top: var(--space-md); color: var(--on-surface-variant); }

/* ---------- Buttons / links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 10px 20px;
}
.btn-primary {
  background: var(--surface-tint);
  color: var(--on-primary);
}
.btn-primary:hover { opacity: 0.9; color: var(--on-primary); }
.link-arrow {
  color: var(--surface-tint);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.link-arrow:hover { text-decoration: underline; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface-container-lowest);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

/* ---------- Media (photo) components ---------- */
/* Wide banner photo under a hero's text (roundup + vs-page heroes). */
.hero-banner {
  margin-top: var(--space-lg);
  min-height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline);
}
@media (min-width: 768px) {
  .hero-banner { min-height: 320px; }
}
.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Two photos side by side (hub wildlife pair) — same pattern as the hub hero split image. */
.media-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  min-height: 200px;
}
@media (min-width: 768px) {
  .media-pair { min-height: 300px; }
}
.media-pair figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline);
}
.media-pair img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Icons ---------- */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  vertical-align: middle;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
/* Icons inside key-spec callouts (vs-pages) inherit the badge's text color and sit inline. */
.key-spec__badge { display: inline-flex; align-items: center; gap: 4px; }
.key-spec__badge .material-symbols-outlined { font-size: 14px; }

/* ---------- Breadcrumb ---------- */
/* flex-wrap so a long trail drops to a second line on narrow screens instead of
   overflowing or forcing horizontal scroll; the whole thing sits inside .container
   so it never touches the viewport edge. */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--outline);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 4px;
  column-gap: var(--space-sm);
  padding-top: var(--space-lg);
  padding-bottom: var(--space-md);
}
@media (min-width: 768px) {
  .breadcrumb { font-size: 13px; padding-top: var(--space-xl); }
}
.breadcrumb a {
  color: var(--outline);
  text-decoration: none;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: var(--radius-sm);
}
.breadcrumb a:hover {
  color: var(--brass-solid);
  text-decoration: underline;
  background: rgba(184, 134, 59, 0.12);
}
.breadcrumb span[aria-current] { color: var(--on-surface); }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
}
