/* =========================================================
   Totally Iceland — Design System
   Palette derived from brand logo
   ========================================================= */
:root {
  --navy: #123049;
  --navy-deep: #0c2436;
  --blue: #159fd6;
  --blue-deep: #0f7fae;
  --teal: #45c4bd;
  --teal-light: #a9e6df;
  --green: #8bd0a0;
  --sand: #f6a35c;
  --ink: #16324a;
  --ink-soft: #3f5c73;
  --bg: #ffffff;
  --bg-soft: #f3fafc;
  --bg-mist: #eaf5f8;
  --line: #dcebef;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(18, 48, 73, 0.08);
  --shadow-md: 0 10px 30px rgba(18, 48, 73, 0.12);
  --maxw: 1180px;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy);
  line-height: 1.18;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-top: 2em; }
h3 { font-size: 1.3rem; margin-top: 1.6em; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.4em; }
li { margin-bottom: 0.4em; }
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff;
  padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding-top: 10px; padding-bottom: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 42px; width: auto; }
.brand-text { display: none; }
.main-nav { display: none; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav a {
  color: var(--ink); font-weight: 600; font-size: 0.96rem;
  padding: 10px 12px; border-radius: 8px; display: block;
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  background: var(--bg-mist); color: var(--blue-deep); text-decoration: none;
}
.nav-toggle {
  background: var(--navy); color: #fff; border: none; border-radius: 8px;
  padding: 10px 14px; font-weight: 600; font-size: 0.95rem; cursor: pointer;
}
.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none; cursor: pointer; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: 0.9rem;
  color: var(--ink); display: flex; align-items: center; gap: 6px;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md);
  min-width: 170px; padding: 6px; list-style: none; margin: 0; z-index: 50;
}
.lang-menu li a { display: block; padding: 8px 10px; border-radius: 6px; font-size: 0.92rem; color: var(--ink);}
.lang-menu li a:hover { background: var(--bg-mist); text-decoration: none; }
.lang-menu .current { font-weight: 700; color: var(--blue-deep); }

@media (min-width: 900px) {
  .brand-text { display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--navy); }
  .main-nav { display: block; }
  .nav-toggle { display: none; }
}

/* mobile nav panel */
#mobile-nav {
  display: none; border-top: 1px solid var(--line); background: #fff;
}
#mobile-nav.open { display: block; }
#mobile-nav ul { list-style: none; margin: 0; padding: 10px 16px 16px; }
#mobile-nav a { display: block; padding: 10px 4px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { #mobile-nav { display: none !important; } }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 55%, #0a1d2c 100%);
  color: #fff; position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background: radial-gradient(60% 60% at 80% 10%, rgba(69,196,189,0.35), transparent 60%),
              radial-gradient(50% 50% at 10% 90%, rgba(21,159,214,0.28), transparent 60%);
}
.hero .container { position: relative; padding-top: 64px; padding-bottom: 64px; }
.hero-home .container { padding-top: 84px; padding-bottom: 84px; }
.hero h1 { color: #fff; max-width: 760px; }
.hero .lede { color: #d6ecf3; font-size: 1.15rem; max-width: 620px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: var(--teal-light);
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.78rem;
  margin-bottom: 14px;
}
.eyebrow::before { content: "◆"; font-size: 0.6rem; color: var(--sand); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  display: inline-block; padding: 13px 22px; border-radius: 999px; font-weight: 700;
  font-size: 0.95rem; text-decoration: none; transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--sand); color: #241205; }
.btn-primary:hover { background: #f7b477; }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.55); }
.btn-outline:hover { background: rgba(255,255,255,0.12); }
.btn-secondary { background: var(--blue); color: #fff; }
.btn-secondary:hover { background: var(--blue-deep); }

/* breadcrumb */
.breadcrumb {
  font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 10px;
}
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb .sep { margin: 0 6px; color: #9db3c1; }
.hero .breadcrumb, .hero .breadcrumb a { color: #b9d6e0; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-soft { background: var(--bg-soft); }
.section-mist { background: var(--bg-mist); }
.section-head { max-width: 700px; margin-bottom: 32px; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }

/* Card grid */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(1, 1fr); }
.grid-4 { grid-template-columns: repeat(1, 1fr); }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  height: 100%; transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-media {
  height: 150px; background: linear-gradient(135deg, var(--teal), var(--blue));
  position: relative; display: flex; align-items: flex-end; padding: 12px;
}
.card-media span {
  background: rgba(12,36,54,0.55); color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-top: 0; font-size: 1.15rem; }
.card-body p { color: var(--ink-soft); font-size: 0.95rem; flex: 1; }
.card-link { font-weight: 700; font-size: 0.92rem; margin-top: 6px; }

/* Icon feature list */
.feature-grid { display: grid; gap: 20px; grid-template-columns: repeat(1,1fr); }
@media (min-width: 720px) { .feature-grid { grid-template-columns: repeat(3,1fr); } }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.feature .num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg-mist);
  color: var(--blue-deep); display: flex; align-items: center; justify-content: center;
  font-weight: 800; margin-bottom: 12px;
}

/* Stat strip */
.stat-strip {
  display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; margin-top: 30px;
}
@media (min-width: 720px) { .stat-strip { grid-template-columns: repeat(4,1fr); } }
.stat { text-align: left; }
.stat .n { font-family: var(--font-head); font-size: 2rem; color: var(--teal-light); font-weight: 700; }
.stat .l { font-size: 0.85rem; color: #cfe7ee; }

/* ---------- Article layout ---------- */
.layout {
  display: grid; grid-template-columns: 1fr; gap: 40px; padding: 44px 0 70px;
}
@media (min-width: 980px) { .layout { grid-template-columns: minmax(0,1fr) 300px; } }
.article-body :is(h2,h3) { scroll-margin-top: 90px; }
.article-body h2 { border-top: 1px solid var(--line); padding-top: 1.2em; }
.article-body h2:first-child { border-top: none; padding-top: 0; }
.article-body img { border-radius: var(--radius-md); margin: 1.4em 0; }
.article-body blockquote {
  margin: 1.6em 0; padding: 18px 20px; background: var(--bg-mist); border-left: 4px solid var(--teal);
  border-radius: 0 10px 10px 0; color: var(--ink-soft); font-style: italic;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.95rem; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.article-body th { background: var(--bg-mist); font-family: var(--font-head); }
.article-body code { background: var(--bg-mist); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

.callout {
  background: var(--bg-mist); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 20px 22px; margin: 1.8em 0;
}
.callout h4 { margin-top: 0; }

.tip-box {
  background: #fff7ec; border: 1px solid #f3ddb4; border-radius: var(--radius-md);
  padding: 18px 20px; margin: 1.8em 0;
}
.tip-box strong { color: #93601b; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 22px; }
.side-card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 20px;
}
.side-card h4 { margin-top: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--blue-deep);}
.side-card ul { padding-left: 0; list-style: none; margin: 0; }
.side-card li { border-bottom: 1px solid var(--line); padding: 9px 0; margin: 0; }
.side-card li:last-child { border-bottom: none; }
.side-card a { font-weight: 600; }
.toc a { color: var(--ink); }

/* TOC */
.toc-list { padding-left: 0; list-style: none; margin: 0; }
.toc-list li { border: none; padding: 6px 0; font-size: 0.92rem; }
.toc-list a { color: var(--ink-soft); }
.toc-list a:hover { color: var(--blue-deep); }

/* Table of contents inline (mobile) */
details.toc-mobile { margin: 1.4em 0; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 4px 16px; background: var(--bg-soft); }
details.toc-mobile summary { cursor: pointer; font-weight: 700; padding: 12px 0; }

@media (min-width: 980px) { details.toc-mobile { display: none; } }

/* ---------- Hub page grid header ---------- */
.category-pill {
  display: inline-block; background: var(--bg-mist); color: var(--blue-deep);
  font-size: 0.75rem; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--blue-deep), var(--teal));
  color: #fff; border-radius: var(--radius-lg); padding: 44px; text-align: center;
  margin: 10px 0;
}
.cta-band h2 { color: #fff; margin-top: 0; }
.cta-band p { color: #eafbf8; max-width: 560px; margin: 0 auto 20px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #cfe3ec; padding: 50px 0 26px; margin-top: 40px; }
.footer-grid { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media (min-width: 780px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #b9d3de; font-size: 0.92rem; }
.site-footer a:hover { color: #fff; }
.footer-brand img { height: 40px; margin-bottom: 12px; }
.footer-brand p { color: #a9c4d1; font-size: 0.9rem; max-width: 320px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); margin-top: 36px; padding-top: 20px;
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: #9bb6c3;
}
.footer-bottom a { color: #9bb6c3; }
.footer-lang { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.footer-lang a {
  border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; padding: 4px 11px; font-size: 0.78rem;
}

/* Utility */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.small { font-size: 0.85rem; color: var(--ink-soft); }
