/* =========================================================
   core.css – struktur og layout. Farver/typografi kommer fra
   templates/<navn>/style.css via variablerne herunder.
   ========================================================= */
:root {
  --c-bg: #fff; --c-surface: #f4f4f4; --c-ink: #222; --c-muted: #666; --c-line: #ddd;
  --c-accent: #0b7d76; --c-accent-ink: #fff;
  --c-header-bg: rgba(20,24,28,.92); --c-header-ink: #fff; --c-menu-bg: #1d2226; --c-menu-ink: #fff;
  --c-hero-ink: #fff; --hero-overlay: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.45));
  --hero-fallback: #2b3238;
  --map-sea: transparent; --map-land: #d9dcde; --map-visited: var(--c-accent); --map-stroke: #fff; --map-point: #e8a33d; --map-home: #c0392b;
  --f-body: system-ui, sans-serif; --f-head: var(--f-body);
  --radius: 4px; --wrap: 1180px; --header-h: 76px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--c-bg); color: var(--c-ink); font: 1.0625rem/1.65 var(--f-body); }
img { max-width: 100%; height: auto; }
a { color: var(--c-accent); text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.2; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; z-index: 100; } .skip:focus { left: 1rem; top: 1rem; background: #fff; color: #000; padding: .5rem 1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.wrap.narrow, .narrow-text { max-width: 760px; }
.narrow-text { margin: 0 auto 2.5rem; }
.empty { color: var(--c-muted); }
.btn { display: inline-block; padding: .7em 1.4em; background: var(--c-accent); color: var(--c-accent-ink); text-decoration: none; border: 0; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.1); }
.btn-quiet { background: transparent; color: var(--c-ink); border: 1px solid var(--c-line); }

/* ---------- Header + menu ---------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 50; color: var(--c-header-ink); transition: background-color .25s; }
.site-header.scrolled, body.hero-none .site-header { background: var(--c-header-bg); backdrop-filter: blur(6px); }
.bar { max-width: calc(var(--wrap) + 10rem); margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2.5rem); height: var(--header-h); display: flex; align-items: center; gap: 2rem; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; flex-shrink: 0; }
.brand img { max-height: calc(var(--header-h) - 26px); width: auto; }
.brand-name { font-family: var(--f-head); font-size: 1.35rem; font-weight: 700; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.menu-d0 { display: flex; gap: .25rem; }
.menu li { position: relative; }
.menu a { display: block; color: inherit; text-decoration: none; padding: .6rem .8rem; white-space: nowrap; }
.menu-d0 > li > a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.has-sub > a::after { content: ""; display: inline-block; width: .38em; height: .38em; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-.2em); margin-left: .5em; opacity: .7; }
.menu-d1, .menu-d2 { position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--c-menu-bg); color: var(--c-menu-ink); padding: .4rem 0; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s; }
.menu-d2 { top: 0; left: 100%; }
.menu-d1 a, .menu-d2 a { padding: .5rem 1.1rem; }
.menu-d1 a:hover, .menu-d2 a:hover { background: rgba(127,127,127,.15); }
.menu-d1 .has-sub > a::after { transform: rotate(-45deg); }
.menu li:hover > ul, .menu li:focus-within > ul, .menu li.open > ul { opacity: 1; visibility: visible; transform: none; }
.sub-toggle { display: none; }
.admin-link { color: inherit; font-size: .85rem; opacity: .75; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; background: none; border: 0; color: inherit; cursor: pointer; position: relative; }
.nav-toggle span:first-child, .nav-toggle span:first-child::before, .nav-toggle span:first-child::after { position: absolute; left: 10px; width: 24px; height: 2px; background: currentColor; content: ""; transition: transform .2s; }
.nav-toggle span:first-child { top: 21px; }
.nav-toggle span:first-child::before { left: 0; top: -7px; } .nav-toggle span:first-child::after { left: 0; top: 7px; }
.nav-open .nav-toggle span:first-child { background: transparent; }
.nav-open .nav-toggle span:first-child::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:first-child::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav { position: fixed; inset: var(--header-h) 0 0; background: var(--c-menu-bg); color: var(--c-menu-ink); flex-direction: column; align-items: stretch; padding: 1rem clamp(1rem, 4vw, 2rem) 3rem; overflow-y: auto; display: none; }
  .nav-open .main-nav { display: flex; }
  .nav-open { overflow: hidden; }
  .nav-open .site-header { background: var(--c-menu-bg); }
  .menu-d0 { flex-direction: column; }
  .menu li { border-bottom: 1px solid rgba(127,127,127,.2); }
  .menu a { padding: .9rem .25rem; font-size: 1.1rem; }
  .has-sub > a { padding-right: 3.5rem; }
  .has-sub > a::after { display: none; }
  .sub-toggle { display: block; position: absolute; right: 0; top: .35rem; width: 44px; height: 44px; background: none; border: 0; color: inherit; cursor: pointer; }
  .sub-toggle::before { content: ""; position: absolute; inset: 0; margin: auto; width: 10px; height: 10px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
  .open > .sub-toggle::before { transform: rotate(225deg); }
  .menu-d1, .menu-d2 { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: transparent; display: none; padding: 0 0 .5rem 1rem; min-width: 0; }
  .menu li:hover > ul, .menu li:focus-within > ul { display: none; }
  .menu li.open > ul { display: block; }
  .menu-d1 li { border: 0; }
  .menu-d1 a { font-size: 1rem; padding: .55rem .25rem; }
}

/* ---------- Hero ---------- */
.hero { position: relative; display: grid; align-items: end; color: var(--c-hero-ink); background: var(--hero-overlay), var(--hero-img, none) center/cover no-repeat, var(--hero-fallback); }
.hero-large { min-height: min(88vh, 900px); }
.hero-small { min-height: clamp(300px, 46vh, 480px); }
.hero-inner { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: calc(var(--header-h) + 2rem) clamp(1rem, 4vw, 2.5rem) clamp(2rem, 6vh, 4.5rem); }
.hero-title { margin: 0; font-size: clamp(2.2rem, 6vw, 4.6rem); overflow-wrap: anywhere; }
.hero-small .hero-title { font-size: clamp(2rem, 4.5vw, 3.4rem); }
.hero-sub { margin: .75rem 0 0; font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 40ch; opacity: .92; }
body.hero-none .site-main { padding-top: calc(var(--header-h) + 2rem); }
.site-main { padding-bottom: 4rem; }
.site-main > .wrap:first-child, .hero + .site-main > .wrap:first-child { padding-top: clamp(2rem, 5vw, 3.5rem); }
.preview-banner, .draft-note { background: #fff4d6; color: #5b4500; padding: .6rem 1rem; text-align: center; font-size: .95rem; }
.draft-note { margin: 1.5rem 0 0; border-radius: var(--radius); }
.edit-link { margin-top: 3rem; font-size: .9rem; }

/* ---------- Tekst ---------- */
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.75rem; margin: 2.2rem 0 .6rem; }
.prose h3 { font-size: 1.35rem; margin: 1.8rem 0 .5rem; }
.prose h4 { font-size: 1.1rem; margin: 1.5rem 0 .4rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 3px solid var(--c-accent); font-size: 1.15rem; color: var(--c-muted); }
.inline-figure { margin: 2rem 0; }
.inline-figure img { width: 100%; display: block; border-radius: var(--radius); }
figcaption { font-size: .9rem; color: var(--c-muted); margin-top: .4rem; }

/* ---------- Galleri + lightbox ---------- */
.gallery-wrap { margin-top: 3rem; }
.gallery { columns: 3 260px; column-gap: 1rem; }
.gallery figure { margin: 0 0 1rem; break-inside: avoid; }
.gallery img { width: 100%; display: block; border-radius: var(--radius); }
.gallery a { display: block; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(8,10,12,.94); display: grid; grid-template-columns: 60px 1fr 60px; align-items: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; grid-column: 2; }
.lightbox img { max-height: 84vh; max-width: 100%; object-fit: contain; }
.lightbox figcaption { color: #ddd; }
.lightbox button { background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; height: 60px; }
.lb-prev { grid-column: 1; grid-row: 1; } .lb-next { grid-column: 3; grid-row: 1; }
.lb-close { position: absolute; top: .5rem; right: 1rem; }
.lb-open { overflow: hidden; }

/* ---------- Forside ---------- */
.front-intro { margin: 0 auto 3rem; font-size: 1.15rem; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 1.25rem; }
.section-title a { color: inherit; text-decoration: none; }
.front-travel { margin-bottom: 4rem; }
.more { margin-top: 1.25rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1.25rem; }
.tile { position: relative; display: grid; min-height: 280px; color: #fff; text-decoration: none; border-radius: var(--radius); overflow: hidden; background: var(--hero-fallback); isolation: isolate; }
.tile-img { position: absolute; inset: 0; background: center/cover no-repeat; z-index: -1; transition: transform .5s; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent 35%, rgba(0,0,0,.7)); }
.tile:hover .tile-img, .tile:focus-visible .tile-img { transform: scale(1.04); }
.tile-body { align-self: end; padding: 1.25rem; display: grid; gap: .2rem; }
.tile-type { font-size: .85rem; opacity: .85; }
.tile-title { font-family: var(--f-head); font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.empty-front { text-align: center; padding: 3rem 0; }

/* ---------- Rejser ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--c-line); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.stat { background: var(--c-bg); padding: 1.1rem 1.25rem; display: grid; }
.stat-num { font-family: var(--f-head); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.05; color: var(--c-accent); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--c-muted); font-size: .95rem; }
@media (max-width: 640px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.worldmap { position: relative; background: var(--map-sea); border-radius: var(--radius); min-height: 120px; }
.map-svg { display: block; width: 100%; height: auto; }
.country { fill: var(--map-land); stroke: var(--map-stroke); stroke-width: .5; transition: fill .15s; }
.country.visited { fill: var(--map-visited); }
.country:hover { fill: var(--map-hover, var(--c-muted)); }
.country.visited:hover { opacity: 1 !important; }
.map-point { fill: var(--map-point); stroke: #fff; stroke-width: 1; }
.map-home { fill: var(--map-home); stroke: #fff; stroke-width: 1.5; }
.map-tip { position: absolute; pointer-events: none; background: rgba(15,18,20,.9); color: #fff; padding: .3rem .6rem; border-radius: 3px; font-size: .85rem; white-space: nowrap; z-index: 2; }
.map-tip[hidden] { display: none; }
.map-error { padding: 2rem; text-align: center; color: var(--c-muted); }
.compact .worldmap { max-height: 440px; overflow: hidden; }

.fun-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.5rem 2rem; margin: 2.5rem 0; }
.fact h3 { font-size: .95rem; font-weight: 600; color: var(--c-muted); margin: 0 0 .3rem; font-family: var(--f-body); }
.fact p { margin: 0; }
.fact-big { font-family: var(--f-head); font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.fact-note { color: var(--c-muted); font-size: .92rem; }
.continents { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.continents li { font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--c-line); }
.continents li.on { background: var(--c-accent); color: var(--c-accent-ink); border-color: var(--c-accent); }
.continents li.off { color: var(--c-muted); }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 2rem 3rem; margin-bottom: 3rem; }
.chart { margin: 0; }
.chart figcaption { font-family: var(--f-head); font-size: 1.2rem; font-weight: 700; color: var(--c-ink); margin: 0 0 1rem; }
.bars-v { display: flex; align-items: flex-end; gap: 4px; height: 200px; overflow-x: auto; padding-bottom: 1.6rem; }
.bar-v { flex: 1 0 28px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar-fill { width: 100%; height: var(--h); background: var(--c-accent); border-radius: 2px 2px 0 0; min-height: 2px; }
.bar-val { font-size: .75rem; color: var(--c-muted); }
.bar-lbl { position: absolute; bottom: -1.5rem; font-size: .75rem; color: var(--c-muted); }
.bars-h { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.bars-h li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 2.5rem; align-items: center; gap: .6rem; font-size: .95rem; }
.bh-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-track { height: 10px; background: var(--c-surface); border-radius: 5px; overflow: hidden; }
.bh-fill { display: block; height: 100%; width: var(--w); background: var(--c-accent); border-radius: 5px; }
.bh-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--c-muted); }

.travel-list { margin-top: 1rem; }
.list-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.list-head h2 { margin: 0; font-size: 1.8rem; }
.list-head .count { color: var(--c-muted); font-weight: 400; font-size: 1.1rem; }
.filter input { font: inherit; padding: .55rem .8rem; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-bg); color: var(--c-ink); min-width: 260px; }
.table-scroll { overflow-x: auto; }
.travel-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.travel-table th, .travel-table td { text-align: left; padding: .7rem .75rem; border-bottom: 1px solid var(--c-line); }
.travel-table th { font-size: .9rem; color: var(--c-muted); font-weight: 600; }
.travel-table .num { text-align: right; }
.travel-table .note { color: var(--c-muted); }
.travel-table tbody tr:hover { background: var(--c-surface); }
.flag { font-size: 1.15em; }

/* ---------- Opskrift ---------- */
.recipe-head { display: grid; gap: 1.25rem; justify-items: start; margin-bottom: 2.5rem; max-width: 760px; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 0; margin: 0; border: 1px solid var(--c-line); border-radius: var(--radius); }
.recipe-meta div { padding: .7rem 1.4rem; border-right: 1px solid var(--c-line); }
.recipe-meta div:last-child { border-right: 0; }
.recipe-meta dt { font-size: .85rem; color: var(--c-muted); }
.recipe-meta dd { margin: 0; font-weight: 700; font-size: 1.1rem; }
.recipe-intro { font-size: 1.15rem; }
.recipe-body { display: grid; grid-template-columns: minmax(260px, 1fr) 1.7fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 820px) { .recipe-body { grid-template-columns: 1fr; } }
.recipe-body h2 { font-size: 1.6rem; margin: 0 0 1rem; }
.recipe-body h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.ingredients { position: sticky; top: calc(var(--header-h) + 1rem); background: var(--c-surface); padding: 1.5rem; border-radius: var(--radius); }
@media (max-width: 820px) { .ingredients { position: static; } }
.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients ul:empty { display: none; }
.ingredients li { border-bottom: 1px solid var(--c-line); }
.ingredients li:last-child { border-bottom: 0; }
.ingredients label { display: flex; gap: .7rem; align-items: baseline; padding: .5rem 0; cursor: pointer; }
.ingredients input { accent-color: var(--c-accent); width: 1.05rem; height: 1.05rem; flex-shrink: 0; transform: translateY(2px); }
.ingredients input:checked + span { text-decoration: line-through; color: var(--c-muted); }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps:empty { display: none; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.4rem 3.4rem; min-height: 2.5rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -.1rem; width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: 50%; background: var(--c-accent); color: var(--c-accent-ink); font-family: var(--f-head); font-weight: 700; }
.recipe-tips { margin-top: 2rem; padding: 1.25rem 1.5rem; border-left: 3px solid var(--c-accent); background: var(--c-surface); }
.recipe-tips h3 { margin-top: 0; }
.recipe-tips .prose p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--c-line); padding: 2rem 0; color: var(--c-muted); font-size: .92rem; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Print (opskrifter) ---------- */
@media print {
  .site-header, .site-footer, .no-print, .edit-link, .lightbox, .preview-banner { display: none !important; }
  .hero { min-height: 0 !important; background: none !important; color: #000; }
  .hero-inner { padding: 0 0 1rem; }
  body { font-size: 11pt; }
  .ingredients { position: static; background: none; padding: 0; }
  .recipe-body { grid-template-columns: 1fr 1.6fr; }
  .steps li::before { background: none; color: #000; border: 1px solid #000; }
}

/* ---------- Link-fliser på forsiden ---------- */
.tile-ext { position: absolute; top: .8rem; right: .8rem; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.45) center/16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E"); }
.tile-image-only::after { display: none; }
.tile-image-only .tile-img { background-color: var(--c-surface); }
