/* ==========================================================================
   kristinmorck.com – grundlayout
   Färger och typsnitt kommer från temafilen i css/themes/.
   ========================================================================== */

@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-600-italic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* Standardvärden – skrivs över av temat */
  --bg: #f6f1e9;
  --bg-alt: #efe8dc;
  --ink: #1f1b16;
  --ink-soft: #3b342c;
  --muted: #776c5f;
  --rule: #ddd2c2;
  --accent: #a2482b;
  --accent-ink: #fff;
  --selection: #ecd3c4;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Newsreader", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --title-weight: 400;
  --title-tracking: -0.015em;
  --title-style: normal;
  --kicker-case: uppercase;
  --radius: 2px;
  --img-filter: none;

  --wrap: 1180px;
  --narrow: 680px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.98rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--selection); }
img { max-width: 100%; height: auto; display: block; filter: var(--img-filter); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap.narrow, .narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--ink); color: var(--bg); padding: .5rem 1rem; }

/* ---------- Admin-list (syns bara inloggad) ---------- */
.adminbar { font: 500 .8rem/1 var(--font-ui); background: var(--ink); color: var(--bg); display: flex; gap: 1.25rem; padding: .6rem var(--gutter); flex-wrap: wrap; }
.adminbar a { color: inherit; text-decoration: none; opacity: .85; }
.adminbar a:hover { opacity: 1; color: inherit; }
.adminbar span { opacity: .6; margin-left: auto; }

/* ---------- Sidhuvud ---------- */
.site-header { border-bottom: 1px solid var(--rule); position: relative; z-index: 20; background: var(--bg); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 1rem; }
.wordmark {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: var(--title-weight);
  font-style: var(--title-style);
  letter-spacing: var(--title-tracking);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: clamp(1.2rem, 3vw, 2.4rem); font-family: var(--font-ui); font-size: .875rem; font-weight: 500; letter-spacing: .02em; }
.site-nav a { text-decoration: none; padding: .35rem 0; border-bottom: 1px solid transparent; }
.site-nav a[aria-current] { border-bottom-color: currentColor; }
.nav-search { display: inline-flex; }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .header-inner { min-height: 64px; }
  .wordmark { font-size: 1.35rem; }
  .nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px; background: none; border: 0; cursor: pointer; color: var(--ink); }
  .nav-toggle span { display: block; height: 1.5px; width: 22px; background: currentColor; margin-inline: auto; transition: transform .25s; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    padding: .5rem var(--gutter) 1.25rem;
    font-size: 1.05rem;
    display: none;
  }
  .site-nav.open { display: flex; animation: drop .2s ease-out; }
  .site-nav a { padding: .85rem 0; border-bottom: 1px solid var(--rule); }
  .site-nav a[aria-current] { border-bottom-color: var(--rule); color: var(--accent); }
  .site-nav a:last-child { border-bottom: 0; }
  .nav-search::after { content: "Sök"; margin-left: .6rem; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Gemensam typografi ---------- */
.kicker {
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: var(--kicker-case);
  color: var(--muted);
  margin: 0 0 .9rem;
  display: flex; flex-wrap: wrap; gap: .35rem .9rem;
}
.kicker span + span::before { content: "·"; margin-right: .9rem; opacity: .6; }
.page-title, .hero-title, .article-title, .section-head h2, .year, .card-title {
  font-family: var(--font-display);
  font-weight: var(--title-weight);
  letter-spacing: var(--title-tracking);
  font-style: var(--title-style);
}
.page-title { font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4.25rem); line-height: 1.04; margin: 0 0 1rem; }
.lead { font-size: 1.2em; line-height: 1.5; color: var(--ink-soft); max-width: 38em; margin: 0 0 1.5rem; }
.link-arrow { font-family: var(--font-ui); font-size: .85rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.link-arrow::after { content: " →"; transition: margin .2s; }
.link-arrow:hover::after { margin-left: .25rem; }
.btn {
  display: inline-block;
  font-family: var(--font-ui); font-size: .875rem; font-weight: 500; letter-spacing: .01em;
  background: var(--ink); color: var(--bg);
  padding: .85rem 1.4rem; border-radius: var(--radius); text-decoration: none;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--accent); color: var(--accent-ink); }

/* ---------- Startsida ---------- */
.hero { display: grid; grid-template-columns: 1fr; gap: 2.5rem; padding-block: clamp(3rem, 8vw, 7.5rem) clamp(2.5rem, 6vw, 5rem); align-items: end; }
.hero-title { font-size: clamp(2rem, 1.2rem + 3.6vw, 4rem); line-height: 1.1; margin: 0 0 2rem; max-width: 18em; text-wrap: balance; }
.hero-links { display: flex; gap: 1.75rem; align-items: center; margin: 0; }
.hero-portrait { margin: 0; }
.hero-portrait { max-width: 300px; }
.hero-portrait img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); }
@media (min-width: 900px) {
  .hero:has(.hero-portrait) { grid-template-columns: 1.6fr 1fr; gap: 5rem; }
  .hero-portrait { max-width: 380px; justify-self: end; width: 100%; }
}

.pubs { display: flex; gap: 1rem 2rem; align-items: baseline; flex-wrap: wrap; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding-block: 1.1rem; }
.pubs-label { font-family: var(--font-ui); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pubs ul { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 2rem; margin: 0; padding: 0; }
.pubs a { text-decoration: none; font-style: italic; font-size: 1.05rem; }

.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 1px solid var(--ink); padding-bottom: .9rem; margin-bottom: 2.25rem; }
.section-head h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin: 0; }

.latest-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .latest-grid { grid-template-columns: 1.55fr 1fr; gap: 4rem; } }
.latest-list { display: flex; flex-direction: column; }
.latest-list .card { padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.latest-list .card:first-child { padding-top: 0; }
.latest-list .card:last-child { border-bottom: 0; }

/* ---------- Kort ---------- */
.card-title { margin: 0 0 .6rem; line-height: 1.15; text-wrap: balance; }
.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { margin: 0; color: var(--ink-soft); }
.card-feature .card-media { display: block; margin-bottom: 1.5rem; overflow: hidden; border-radius: var(--radius); }
.card-feature .card-media img { width: 100%; aspect-ratio: 3/2; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card-feature:hover .card-media img { transform: scale(1.025); }
.card-feature .card-title { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); }
.card-feature .card-excerpt { font-size: 1.1em; }
.card-compact .card-title { font-size: 1.35rem; }
.card-compact .kicker { margin-bottom: .5rem; }

.post-list { display: flex; flex-direction: column; }
.card-row { display: grid; grid-template-columns: 1fr; gap: 1.25rem; padding-block: 2rem; border-bottom: 1px solid var(--rule); }
.card-row:first-child { padding-top: 0; }
.card-row .card-title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.card-row:has(.card-thumb) { grid-template-columns: 1fr 112px; }
.card-row .card-thumb { order: 2; }
.card-row .card-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
@media (min-width: 720px) {
  .card-row:has(.card-thumb) { grid-template-columns: 1fr 220px; gap: 3rem; }
  .card-row .card-thumb img { aspect-ratio: 4/3; }
}

/* ---------- Arkivlista ---------- */
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { border-bottom: 1px solid var(--rule); }
.archive-list a { display: grid; grid-template-columns: 1fr; gap: .2rem; padding-block: 1.05rem; text-decoration: none; }
.al-title { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.25; transition: color .2s; }
.archive-list a:hover .al-title { color: var(--accent); }
.al-meta { font-family: var(--font-ui); font-size: .8rem; color: var(--muted); display: flex; gap: .75rem; }
.al-year { font-variant-numeric: tabular-nums; }
@media (min-width: 720px) {
  .archive-list a { grid-template-columns: 1fr auto; align-items: baseline; gap: 2rem; }
  .al-meta { justify-content: flex-end; white-space: nowrap; }
}
.year-group { display: grid; gap: .5rem; margin-bottom: 3rem; }
.year { font-size: 1.1rem; margin: 0; color: var(--muted); font-variant-numeric: oldstyle-nums; }
@media (min-width: 900px) {
  .year-group { grid-template-columns: 140px 1fr; gap: 2rem; }
  .year { font-size: 2.25rem; line-height: 1; padding-top: .9rem; position: sticky; top: 1.5rem; align-self: start; }
}

/* ---------- Listsidor ---------- */
.page-head { padding-top: clamp(2.5rem, 7vw, 5.5rem); }
.search { display: flex; max-width: 560px; border-bottom: 1px solid var(--ink); margin: 1rem 0 1.75rem; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.1rem; padding: .7rem 0; color: var(--ink); outline: none; }
.search input::placeholder { color: var(--muted); font-style: italic; }
.search button { border: 0; background: none; font: 500 .85rem var(--font-ui); color: var(--ink); cursor: pointer; padding-inline: .75rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--font-ui); font-size: .82rem; }
.chips a { text-decoration: none; border: 1px solid var(--rule); padding: .45rem .9rem; border-radius: 999px; transition: all .2s; }
.chips a small { color: var(--muted); margin-left: .2rem; }
.chips a:hover { border-color: var(--ink); color: var(--ink); }
.chips a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips a[aria-current] small { color: inherit; opacity: .7; }
.result-count { font-family: var(--font-ui); font-size: .85rem; margin-bottom: 2rem; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 3rem; font-family: var(--font-ui); font-size: .875rem; }
.pager a { text-decoration: none; font-weight: 500; }

/* ---------- Artikel ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 50; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.draft-note { font: 500 .85rem var(--font-ui); background: var(--bg-alt); padding: .8rem 1rem !important; margin-top: 1.5rem; border-left: 3px solid var(--accent); }
.article-head { padding-top: clamp(2.5rem, 8vw, 6rem); padding-bottom: 2.5rem; text-align: center; }
.article-head .kicker { justify-content: center; }
.article-title { font-size: clamp(2.3rem, 1.4rem + 4vw, 4.4rem); line-height: 1.04; margin: 0 auto 1.25rem; text-wrap: balance; }
.article-sub { font-size: clamp(1.2rem, 1rem + .6vw, 1.45rem); font-style: italic; color: var(--ink-soft); line-height: 1.4; margin: 0 auto 1.5rem; max-width: 30em; text-wrap: balance; }
.article-meta { font-family: var(--font-ui); font-size: .8rem; color: var(--muted); display: flex; justify-content: center; gap: 1.2rem; margin: 0; }
.article-cover { margin: 0 auto 3.5rem; max-width: 1100px; }
.article-cover img { width: 100%; max-height: 78vh; object-fit: cover; border-radius: var(--radius); }
.article-cover figcaption, .prose figcaption { font-family: var(--font-ui); font-size: .78rem; color: var(--muted); margin-top: .7rem; line-height: 1.5; }

.prose { font-size: 1.12em; line-height: 1.72; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.35em; }
.prose p { margin: 0; }
.prose > p + p { margin-top: 1.1em; }
.single .prose > p:first-of-type::first-letter {
  float: left; font-family: var(--font-display); font-size: 4.1em; line-height: .82;
  padding: .08em .1em 0 0; color: var(--accent); font-weight: var(--title-weight);
}
.prose h2, .prose h3, .prose h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin-top: 2.2em; margin-bottom: 0; }
.prose h2 { font-size: 1.55em; }
.prose h3 { font-size: 1.25em; }
.prose h4 { font-family: var(--font-ui); font-size: .8em; letter-spacing: .1em; text-transform: uppercase; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .7em; }
.prose a { color: var(--accent); }
.prose blockquote { margin: 2em 0; padding: 0 0 0 1.5em; border-left: 2px solid var(--accent); font-style: italic; font-size: 1.12em; color: var(--ink-soft); }
.prose blockquote p + p { margin-top: .8em; }
.prose blockquote cite { display: block; margin-top: .8em; font-style: normal; font-family: var(--font-ui); font-size: .68em; letter-spacing: .04em; color: var(--muted); }
.prose blockquote cite::before { content: "— "; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose hr { border: 0; text-align: center; margin: 2.8em 0; height: auto; }
.prose hr::before { content: "✻ ✻ ✻"; letter-spacing: 1em; color: var(--muted); font-size: .8em; }
.prose figure { margin: 2.4em 0; }
@media (min-width: 900px) { .prose figure { margin-inline: -6rem; } }
.prose figure img { width: 100%; border-radius: var(--radius); }
.prose code { font-size: .85em; background: var(--bg-alt); padding: .1em .35em; border-radius: 3px; }
.prose strong { font-weight: 600; }

.original { margin-top: 3em !important; padding: 1.5rem 1.5rem 1.6rem; background: var(--bg-alt); border-radius: var(--radius); font-size: .9em; }
.original p { margin: 0 0 1rem; }
.article-end { margin-top: 3.5em !important; text-align: center; }
.fleuron { display: block; color: var(--accent); font-size: 1.2rem; margin-bottom: 2.25rem; }
.share { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; justify-content: center; align-items: center; font-family: var(--font-ui); font-size: .8rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1rem 0; hyphens: none; }
.share a, .share button { color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.share a:hover, .share button:hover { color: var(--accent); }
.more { border-top: 1px solid var(--rule); margin-top: 4rem; }
.more-grid { display: grid; gap: 2rem; }
@media (min-width: 720px) { .more-grid { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

/* ---------- Om ---------- */
.about { display: grid; gap: 2.5rem; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.about-portrait { margin: 0; }
.about-portrait img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); }
.about-portrait figcaption { font: .75rem var(--font-ui); color: var(--muted); margin-top: .6rem; }
.about-text { max-width: var(--narrow); }
.about-text .prose > p:first-of-type { font-size: 1.15em; }
.contact { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 2rem; }
.contact h2 { font-family: var(--font-ui); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 1.25rem; }
.contact p { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.social { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; gap: 1.5rem; flex-wrap: wrap; font-family: var(--font-ui); font-size: .875rem; }
.social a { text-decoration: none; }
@media (min-width: 900px) {
  .about:has(.about-portrait) { grid-template-columns: 340px 1fr; gap: 5rem; align-items: start; }
  .about-portrait { position: sticky; top: 2rem; }
}

/* ---------- Sidfot ---------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 3rem; padding-block: 3rem 2rem; font-family: var(--font-ui); font-size: .85rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-name { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 .25rem; letter-spacing: var(--title-tracking); font-style: var(--title-style); }
.footer-inner p { margin: 0; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; margin: 0; padding: 0; align-items: flex-start; }
.footer-links a { text-decoration: none; }
.footer-bottom { margin-top: 2.5rem; font-size: .75rem; }

.page-404 { padding-block: 6rem; }
.empty { text-align: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .site-footer, .share, .more, .progress, .adminbar { display: none !important; }
  body { background: #fff; color: #000; }
}
