/* Gudsnavnet i Danmark – responsive stylesheet (mobile first) */
:root {
  --bg: #f8f4ec;
  --surface: #ffffff;
  --surface-2: #f1eadd;
  --ink: #2b211c;
  --muted: #6d6058;
  --line: #e4dacb;
  --accent: #6e1b1b;
  --accent-ink: #ffffff;
  --gold: #a87b1f;
  --focus: #c48a1a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 35, 20, .06), 0 4px 16px rgba(60, 35, 20, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hebrew: "SBL Hebrew", "Times New Roman", "David", "Noto Serif Hebrew", serif;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16110e;
    --surface: #211a16;
    --surface-2: #2b221d;
    --ink: #f2e9de;
    --muted: #b6a797;
    --line: #3a2f28;
    --accent: #e3907f;
    --accent-ink: #1b1210;
    --gold: #e0b75e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 600; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h2 { font-size: 1.35rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
.tetra { font-family: var(--hebrew); font-size: 1.2em; direction: rtl; unicode-bidi: isolate; color: var(--gold); font-weight: 600; white-space: nowrap; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(0,0,0,.08); }
@media (prefers-color-scheme: dark) { .topbar { background: #3a1513; color: #f2e9de; } }
.topbar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; flex: 1; }
.brand-mark { font-family: var(--hebrew); font-size: 1.15rem; background: rgba(255,255,255,.14); border-radius: 10px; padding: 2px 8px; color: #f0cf7a; line-height: 1.6; }
.brand-text { font-family: var(--serif); font-size: clamp(.95rem, 4.2vw, 1.15rem); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: none; gap: 4px; }
.topnav a { color: inherit; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: .95rem; opacity: .9; }
.topnav a[aria-current="page"], .topnav a:hover { background: rgba(255,255,255,.16); opacity: 1; }
.lang { position: relative; display: flex; align-items: center; flex: none; background: rgba(0,0,0,.18); border-radius: 999px; }
.lang svg { position: absolute; left: 10px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; pointer-events: none; }
.lang-code { font: 700 .85rem/1 var(--sans); letter-spacing: .04em; padding: 12px 28px 12px 34px; min-height: 40px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 14px center, right 9px center; background-size: 5px 5px; background-repeat: no-repeat; }
.lang select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; font-size: 16px; }
.lang select option { color: #2b211c; background: #fff; }
.lang:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bottom tab bar (mobile) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tabbar-h); color: var(--muted); text-decoration: none; font-size: .72rem; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .brand { flex: 0 1 auto; margin-right: auto; }
}

main { max-width: 1100px; margin: 0 auto; padding: 0 16px 32px; outline: none; }
.narrow { max-width: 720px; margin: 0 auto; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px 32px; border-top: 1px solid var(--line); }
.footer a { color: inherit; }

/* Home */
.hero { position: relative; margin: 0 -16px; overflow: hidden; background: #2a1715; }
.hero img { width: 100%; height: clamp(220px, 46vw, 420px); object-fit: cover; opacity: .55; }
.hero-text { position: absolute; inset: auto 0 0 0; padding: 20px 16px 22px; color: #fff; background: linear-gradient(transparent, rgba(20,8,6,.85)); }
.hero-text h1 { color: #fff; margin-bottom: .25em; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.hero-text p { margin: 0; max-width: 46ch; font-size: 1rem; opacity: .95; }
@media (min-width: 760px) { .hero { margin: 16px 0 0; border-radius: var(--radius); } .hero-text { padding: 32px; } }

.search { position: relative; margin: 20px 0 8px; }
.search input { width: 100%; font: inherit; font-size: 1.05rem; padding: 14px 16px 14px 46px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); -webkit-appearance: none; }
.search svg { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); stroke: var(--muted); fill: none; stroke-width: 2; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; gap: 8px; }
.section-head h2 { margin: 0; }
.regions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 760px) { .regions { grid-template-columns: repeat(4, 1fr); } }
.region-card { position: relative; display: block; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: #fff; background: #3a1a17; aspect-ratio: 4 / 3; box-shadow: var(--shadow); }
.region-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .6; transition: transform .3s; }
.region-card:hover img { transform: scale(1.04); }
.region-card span { position: absolute; left: 12px; right: 12px; bottom: 10px; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; line-height: 1.2; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.region-card small { display: block; font-family: var(--sans); font-weight: 400; font-size: .8rem; opacity: .9; }

.intro { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-top: 24px; }
.intro p { margin: 0 0 .6em; }
.intro p:last-child { margin: 0; }

.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.btn.secondary { background: var(--surface-2); color: var(--ink); }

/* Place list */
.list-head { position: sticky; top: 56px; z-index: 5; background: var(--bg); padding: 12px 0 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.list-head .search { margin: 0 0 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; padding: 8px 14px; min-height: 40px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.count { color: var(--muted); font-size: .9rem; margin: 8px 0 4px; }
.letter { font-family: var(--serif); color: var(--gold); font-weight: 700; font-size: 1rem; margin: 18px 0 6px; padding-left: 4px; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 760px) { .plist { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .plist { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pitem a { display: flex; align-items: center; gap: 12px; padding: 8px; padding-right: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); min-height: 72px; }
.pitem a:hover { border-color: var(--accent); }
.pitem img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-2); }
.pitem .meta { min-width: 0; flex: 1; }
.pitem strong { display: block; font-family: var(--serif); font-size: 1.05rem; }
.pitem small { display: block; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem .chev { color: var(--muted); flex: none; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Place detail */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; margin: 16px 0 8px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 36px; }
.crumbs a:hover { color: var(--accent); }
.tabs { position: sticky; top: 56px; z-index: 5; background: var(--bg); display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 16px; margin: 0 -16px 8px; }
.tabs::-webkit-scrollbar { display: none; }
.sec { margin: 8px 0 28px; }
.sec > h2 { padding-top: 8px; }
.prose p { margin: 0 0 .9em; }
.prose em { font-style: italic; }
.figs { display: grid; gap: 10px; margin: 6px 0 20px; }
.figs.two { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .figs.many { grid-template-columns: repeat(3, 1fr); } }
.figs.many { grid-template-columns: repeat(2, 1fr); }
.figw { margin: 0; min-width: 0; }
.figw figcaption { font-size: .85rem; color: var(--muted); padding: 6px 2px 0; }
.fig { margin: 0; padding: 0; border: 0; background: var(--surface-2); border-radius: 10px; overflow: hidden; cursor: zoom-in; display: block; width: 100%; }
.fig img { width: 100%; height: auto; }
.figs.one .fig img { max-height: 70vh; width: auto; margin: 0 auto; }
.figs.two .fig, .figs.many .fig { aspect-ratio: 1; }
.figs.two .fig img, .figs.many .fig img { width: 100%; height: 100%; object-fit: cover; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 24px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 28px 0 8px; }
.pager a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--surface); min-height: 64px; }
.pager a small { display: block; color: var(--muted); font-size: .8rem; }
.pager a strong { font-family: var(--serif); }
.pager .next { text-align: right; grid-column: 2; }

/* Info pages */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.card h2 { margin-top: 0; }
.card address { font-style: normal; }
dl.info { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; }
.note { color: var(--muted); font-size: .9rem; }
.video { display: grid; gap: 16px; align-items: start; }
@media (min-width: 560px) { .video { grid-template-columns: 140px 1fr; } }
.video img { border-radius: 8px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(10, 6, 4, .94); display: flex; align-items: center; justify-content: center; padding: 16px; touch-action: pinch-zoom; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lb-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Danmarkskort på forsiden */
.muted-small { color: var(--muted); font-size: .9rem; }
.dkmap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
@media (min-width: 760px) { .dkmap { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; padding: 16px; gap: 20px; } }
.dkmap-svg svg { display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.dkmap .land { fill: var(--surface-2); stroke: var(--line); stroke-width: .6; stroke-linejoin: round; }
.dkmap .inset { fill: none; stroke: var(--line); stroke-width: .6; stroke-dasharray: 2 1.5; }
.dkmap .dot { fill: var(--accent); stroke: var(--surface); stroke-width: .7; opacity: .85; }
.dkmap .dot.on { fill: var(--gold); opacity: 1; }
.dkmap-panel { min-height: 96px; min-width: 0; }
@media (min-width: 760px) { .dkmap-panel { position: sticky; top: 76px; } }
.map-hint { color: var(--muted); margin: 8px 4px; font-size: .95rem; }
.map-near { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
.map-cards { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.map-card { display: flex; align-items: center; gap: 12px; padding: 8px; padding-right: 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--bg); }
.map-card:hover { border-color: var(--accent); }
.map-card img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-2); }
.map-card .meta { flex: 1; min-width: 0; }
.map-card strong { display: block; }
.map-card small { display: block; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-card .chev { color: var(--muted); font-size: 1.4rem; }
.map-card.big { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; }
.map-pics { display: grid; gap: 3px; background: var(--line); overflow: hidden; flex: none; }
.map-pics img { width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 0; display: block; background: var(--surface-2); }
.map-pics.n1 { grid-template-rows: clamp(200px, 55vw, 280px); }
.map-pics.n2 { grid-template-rows: repeat(2, clamp(130px, 38vw, 175px)); }
.map-pics.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: clamp(170px, 45vw, 230px) clamp(100px, 26vw, 130px); }
.map-pics.n3 img:first-child { grid-column: 1 / -1; }
.map-card.big .meta { padding: 10px 14px 12px; }
.map-card.big strong { font-family: var(--serif); font-size: 1.15rem; }
.map-card.big small { white-space: normal; }
.map-card.big .chev { display: none; }

/* Lille kort på stedets side */
.place-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.place-head h1 { flex: 1; min-width: 0; }
.minimap { flex: none; width: 72px; display: block; padding: 4px; margin-top: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.minimap:hover { border-color: var(--accent); }
@media (min-width: 760px) { .minimap { width: 88px; } }
.minimap svg { display: block; width: 100%; height: auto; }
.minimap .land { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.2; stroke-linejoin: round; }
.minimap .inset { fill: none; stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 3 2; }
.minimap .halo { fill: var(--accent); opacity: .25; }
.minimap .here { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }

/* Del-menu */
.share-wrap { position: relative; }
.share-menu { position: absolute; z-index: 20; bottom: calc(100% + 8px); right: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(40, 20, 10, .18); padding: 6px; display: grid; }
.share-menu[hidden] { display: none; }
.share-menu a, .share-menu button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; text-align: left; border-radius: 8px; cursor: pointer; }
.share-menu a:hover, .share-menu button:hover { background: var(--surface-2); }
