/* HyggeHous — warm Nordic editorial theme. Mobile first, no framework, CLS-safe ad slots. */
@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-latin.woff2') format('woff2');
  font-weight: 500 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light;
  --head-bg: rgba(250, 246, 239, .94);
  --forest-surface: #2f4a3a;
  --button-ink: #fff;
  --cream: #faf6ef;
  --paper: #fffdf9;
  --sand: #efe6d8;
  --line: #e4d9c7;
  --ink: #2a2622;
  --muted: #6f655b;
  --forest: #2f4a3a;
  --forest-2: #3d5d4a;
  --ember: #b8592f;
  --ember-soft: #f6e3d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42, 38, 34, .05), 0 8px 24px -12px rgba(42, 38, 34, .18);
  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --wrap: 1240px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --cream: #211e19;
  --paper: #2c2822;
  --sand: #363027;
  --line: #514638;
  --ink: #eee4d5;
  --muted: #bfb19e;
  --forest: #b3c6a4;
  --forest-2: #c7d5bc;
  --forest-surface: #28372d;
  --ember: #e7ab77;
  --ember-soft: #413023;
  --button-ink: #211e19;
  --head-bg: rgba(33, 30, 25, .96);
  --shadow: 0 1px 2px #0003, 0 10px 28px -12px #0008;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: clip; } /* last-resort guard against sideways panning on phones (clip keeps position: sticky working) */
body { margin: 0; background: var(--cream); color: var(--ink); font: 17px/1.6 var(--sans); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, video, iframe, embed, object, table { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ember); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 650; line-height: 1.18; letter-spacing: -.01em; margin: 0 0 .5em; font-variation-settings: 'opsz' 96; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--forest); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-head { position: sticky; top: 0; z-index: 40; background: var(--head-bg); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--forest); letter-spacing: -.02em; white-space: nowrap; }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo span em { font-style: normal; color: var(--ember); }
.head-search { margin-left: auto; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--forest); }
.head-search:hover { background: var(--sand); }
.head-search svg { width: 20px; height: 20px; }
.head-search { flex-shrink: 0; }
.theme-toggle { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 50%; color: var(--forest); background: var(--paper); cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--sand); color: var(--ember); }
.theme-toggle:focus-visible, .head-search:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-sun, [data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }
[data-theme="dark"] .logo svg path[fill="#2f4a3a"] { fill: var(--forest); }
[data-theme="dark"] .logo svg path[stroke] { stroke: var(--ember); }
[data-theme="dark"] .logo svg path[fill="#faf6ef"] { fill: var(--cream); }
[data-theme="dark"] .ad.is-placeholder ins { background: repeating-linear-gradient(135deg, var(--sand), var(--sand) 10px, var(--paper) 10px, var(--paper) 20px); border-color: var(--line); color: var(--muted); }
[data-theme="dark"] :is(.skip, .lead-main, .next-up, .site-foot, .pager span[aria-current]) { background: var(--forest-surface); }
[data-theme="dark"] .prose .center a, [data-theme="dark"] .prose a.button { color: var(--button-ink); }
@media (max-width: 380px) { .head-row { gap: 10px; } }
.nav { border-top: 1px solid var(--line); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a { display: block; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--forest); border-bottom-color: var(--ember); }
@media (min-width: 900px) {
  .head-row { height: 68px; }
  .nav { border-top: 0; flex: 1; min-width: 0; }
  .site-head .wrap.split { display: flex; align-items: center; gap: 24px; }
  .site-head .wrap.split .head-row { flex: none; }
}

/* ---------- ads ---------- */
.ad { position: relative; margin: 28px auto; text-align: center; clear: both; }
.ad::before { content: 'Advertisement'; display: block; font: 600 10px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #a39684; margin-bottom: 6px; }
.ad ins { display: block; min-height: 280px; }
.ad.ad-top ins { min-height: 100px; }
.ad.ad-side ins { min-height: 600px; }
.ad.ad-feed { grid-column: 1 / -1; }
.ad.is-placeholder ins { background: repeating-linear-gradient(135deg, var(--sand), var(--sand) 10px, #f3ece0 10px, #f3ece0 20px); border: 1px dashed #cdbfa9; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #9a8b75; font: 600 12px var(--sans); }
.ad.is-placeholder ins::after { content: attr(data-placement) ' · responsive ad'; }
@media (min-width: 760px) { .ad.ad-top ins { min-height: 90px; } .ad ins { min-height: 250px; } }

/* ---------- cards ---------- */
.card { display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(42,38,34,.06), 0 16px 32px -14px rgba(42,38,34,.28); }
.card .thumb { aspect-ratio: 3 / 2; background: var(--sand); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.card h3 { font-size: 19px; margin: 0; }
.card:hover h3 { color: var(--ember); }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip { display: inline-block; align-self: flex-start; font: 700 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ember); }
.grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid.g3 { grid-template-columns: repeat(3, 1fr); } .grid.g4 { grid-template-columns: repeat(4, 1fr); } .grid.g4 .card h3 { font-size: 17px; } }

/* ---------- home ---------- */
.hero-band { padding: 26px 0 8px; }
.lead { display: grid; gap: 22px; }
.lead-main { position: relative; display: block; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: var(--forest); color: #fff; }
.lead-main .thumb { aspect-ratio: 4 / 3; }
.lead-main .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lead-main .over { position: absolute; inset: auto 0 0 0; padding: 70px 22px 22px; background: linear-gradient(transparent, rgba(20, 24, 20, .86)); }
.lead-main h2 { font-size: 27px; color: #fff; margin: 8px 0 6px; }
.lead-main p { margin: 0; color: rgba(255,255,255,.86); font-size: 15px; }
.lead-main .chip { color: #ffd9c2; }
.lead-main:hover h2 { color: #ffe7d8; }
.lead-side { display: grid; gap: 16px; }
.mini { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.mini .thumb { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--sand); }
.mini .thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini h3 { font-size: 17px; margin: 4px 0 0; }
@media (min-width: 980px) {
  .lead { grid-template-columns: 1.6fr 1fr; }
  .lead-main .thumb { aspect-ratio: 16 / 11; }
  .lead-main h2 { font-size: 36px; }
  .mini { grid-template-columns: 140px 1fr; }
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 44px 0 16px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.section-head h2 { font-size: 26px; margin: 0; }
.section-head a { font-weight: 700; font-size: 14px; color: var(--forest); white-space: nowrap; }
.intro { text-align: center; padding: 34px 0 10px; }
.intro h1 { font-size: clamp(30px, 5vw, 48px); color: var(--forest); margin-bottom: 8px; }
.intro p { color: var(--muted); margin: 0 auto; max-width: 640px; }

/* ---------- article ---------- */
/* only vertical padding here: the .wrap side padding must survive (it was being reset to 0 on mobile) */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 24px; padding-bottom: 40px; }
@media (min-width: 1100px) { .article-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.post { max-width: 760px; margin: 0 auto; width: 100%; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--forest); font-weight: 600; }
.post h1 { font-size: clamp(30px, 4.6vw, 46px); margin: 6px 0 12px; }
.dek { font-size: 20px; line-height: 1.5; color: var(--muted); margin: 0 0 14px; font-family: var(--serif); font-weight: 400; font-variation-settings: 'opsz' 24; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; }
.meta b { color: var(--ink); font-weight: 600; }
.hero-img { margin: 22px -18px 8px; }
.hero-img img { width: 100%; aspect-ratio: auto; background: var(--sand); }
@media (min-width: 760px) { .hero-img { margin: 24px 0 8px; } .hero-img img { border-radius: var(--radius); } }
.prose { font-size: 19px; line-height: 1.75; overflow-wrap: break-word; }
.prose table { display: block; overflow-x: auto; }
.prose pre { overflow-x: auto; white-space: pre-wrap; }
@media (max-width: 599px) { .prose { font-size: 18px; } .dek { font-size: 18px; } }
.prose > * { margin: 0 0 1.15em; }
.prose h2 { font-size: 28px; margin: 1.6em 0 .55em; }
.prose h3 { font-size: 22px; margin: 1.4em 0 .5em; }
.prose a { color: var(--forest); text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: 3px; }
.prose img { width: 100%; border-radius: 12px; background: var(--sand); margin: 1.4em 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--ember); font-family: var(--serif); font-size: 22px; color: var(--forest); }
.prose .center { text-align: center; }
.prose .center a, .prose a.button { display: inline-block; background: var(--ember); color: #fff; text-decoration: none; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 16px; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; }
.gallery { margin: 40px 0 10px; }
.gallery h2 { font-size: 26px; }
.gallery figure { margin: 0 0 18px; }
.gallery img { width: 100%; border-radius: 12px; background: var(--sand); }
.gallery figcaption { font-size: 13px; color: var(--muted); padding-top: 6px; }
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 30px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.share a, .share button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--ember); color: var(--ember); }
.next-up { display: grid; grid-template-columns: 1fr; gap: 0; border-radius: 18px; overflow: hidden; background: var(--forest); color: #fff; box-shadow: var(--shadow); margin: 30px 0; }
.next-up .thumb { aspect-ratio: 16 / 9; }
.next-up .thumb img { width: 100%; height: 100%; object-fit: cover; }
.next-up .txt { padding: 20px 22px 24px; }
.next-up small { font: 700 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #ffd9c2; }
.next-up h2 { color: #fff; font-size: 26px; margin: 8px 0 6px; }
.next-up p { margin: 0; color: rgba(255,255,255,.85); }
.next-up:hover h2 { color: #ffe7d8; }
@media (min-width: 760px) { .next-up { grid-template-columns: 1.1fr 1fr; align-items: center; } .next-up .thumb { aspect-ratio: auto; height: 100%; } }
.aside { display: none; }
@media (min-width: 1100px) {
  .aside { display: block; }
  .aside .sticky { position: sticky; top: 92px; }
  .aside .ad { margin-top: 0; }
}
.popular { background: var(--paper); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-top: 24px; }
.popular h2 { font-size: 19px; margin-bottom: 12px; }
.popular ol { list-style: none; counter-reset: p; margin: 0; padding: 0; display: grid; gap: 14px; }
.popular li { counter-increment: p; display: grid; grid-template-columns: 28px 1fr; gap: 8px; font-weight: 600; font-size: 15px; line-height: 1.35; }
.popular li::before { content: counter(p); font-family: var(--serif); font-size: 24px; color: var(--ember); line-height: 1; }

/* ---------- listing / pagination ---------- */
.list-head { padding: 30px 0 4px; }
.list-head h1 { font-size: clamp(30px, 4.5vw, 44px); color: var(--forest); margin-bottom: 6px; }
.list-head p { color: var(--muted); margin: 0; max-width: 680px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 40px 0; flex-wrap: wrap; }
.pager a, .pager span { min-width: 42px; height: 42px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.pager span[aria-current] { background: var(--forest); color: #fff; border-color: var(--forest); }
.pager a:hover { border-color: var(--ember); }

/* ---------- search ---------- */
.search-box { display: flex; gap: 8px; margin: 18px 0 26px; }
.search-box input { flex: 1; min-width: 0; color: var(--ink); font: inherit; font-size: 18px; padding: 14px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); outline: none; }
.search-box input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(47,74,58,.15); }
.search-count { color: var(--muted); font-size: 14px; margin-bottom: 14px; }

/* ---------- static pages ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 30px 0 60px; }
.page h1 { font-size: 40px; color: var(--forest); }

/* ---------- footer ---------- */
.site-foot { background: var(--forest); color: rgba(255,255,255,.82); margin-top: 60px; padding: 46px 0 30px; font-size: 15px; }
.site-foot a:hover { color: #ffd9c2; }
.foot-grid { display: grid; gap: 30px; grid-template-columns: 1fr; }
.foot-grid h3 { color: #fff; font-size: 17px; margin-bottom: 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-foot .logo { color: #fff; }
.site-foot .copy { margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.15); font-size: 13px; color: rgba(255,255,255,.6); }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
