/*
Theme Name: Forlomme
Theme URI: https://digitalforlomme.dk
Author: Digital Forlomme
Description: Roligt, redaktionelt block-tema til digitalforlomme.dk. Fraunces + DM Sans, OKLCH grøn palette, orange CTA, terracotta reserveret til indsigt. Afløser SeedProd-temaet seed4.
Version: 0.2.5
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: forlomme
*/

/* =====================================================================
   FONTE — self-hostet (samme df-fonts-upload som reskin-siderne bruger,
   så browseren henter hver font ÉN gang). Same-origin => Real Cookie
   Banner gater dem ikke, og GDPR er ren. Variable fonts, latin dækker æøå.
   ===================================================================== */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('https://digitalforlomme.dk/wp-content/uploads/df-fonts/fraunces.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('https://digitalforlomme.dk/wp-content/uploads/df-fonts/dm-sans.woff2') format('woff2'); }

/* =====================================================================
   TOKENS  (OKLCH primær, hex-fallback for gamle browsere)
   Fallback-teknik: hex-linje FØRST, oklch-linje bagefter overskriver
   i moderne browsere. Kilde: oplæggets sektion 10.
   ===================================================================== */
:root {
  --df-primary: #185b37;   --df-primary: oklch(42% 0.09 155);
  --df-primary-mid: #87b094; --df-primary-mid: oklch(72% 0.06 155);
  --df-primary-light: #d6ebdc; --df-primary-light: oklch(92% 0.03 155);

  --df-cta: #e78100;       --df-cta: oklch(70% 0.17 62);
  --df-cta-hover: #cf7300; --df-cta-hover: oklch(64% 0.16 62);
  --df-cta-text: #34260f;  --df-cta-text: oklch(20% 0.05 62);

  --df-accent: #de4f44;    --df-accent: oklch(62% 0.18 28);
  --df-accent-light: #ffe2dc; --df-accent-light: oklch(94% 0.04 28);
  --df-accent-border: #f0c9c1; --df-accent-border: oklch(88% 0.06 28);

  --df-success: #308639;   --df-success: oklch(55% 0.14 145);
  --df-warning: #dc8900;   --df-warning: oklch(70% 0.16 70);

  --df-surface: #f8fbf9;   --df-surface: oklch(98.5% 0.004 155);
  --df-surface-alt: #eef3ef; --df-surface-alt: oklch(96% 0.008 155);
  --df-border: #d2dad4;    --df-border: oklch(88% 0.012 155);

  --df-text: #0e1310;      --df-text: oklch(18% 0.01 155);
  --df-text-2: #59635d;    --df-text-2: oklch(45% 0.015 155);
  --df-text-3: #868c88;    --df-text-3: oklch(62% 0.01 155);

  --df-on-dark: #f7fbf8;   --df-on-dark: oklch(98% 0.01 155);
  --df-on-dark-2: #bcd4c4; --df-on-dark-2: oklch(82% 0.03 155);

  --df-content: 1140px;
  --df-radius: 14px;
  --df-radius-band: 16px;
}

/* =====================================================================
   BASE
   ===================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--df-surface);
  color: var(--df-text);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: -0.01em;
  line-height: 1.12;
  color: var(--df-text);
}
a { color: var(--df-primary); }

/* Ingen hvid søm mellem header / indhold / footer: .dfa-sektionerne styrer
   selv deres spacing (fuld-bredde farvede bånd), så nulstil blocktemaets
   auto-margin (blockGap) mellem de tre top-regioner. `:where` i core-reglen
   har 0 specificitet, så denne vinder uden !important. */
.wp-site-blocks > * { margin-block: 0; }

/* Samme problem ÉT niveau inde: post-content er et flow-layout, og den
   ledende <style>-blok i .dfa-siderne tæller som :first-child. Så bliver
   selve .dfa til `* + *` og arver block-gap som en top-margin — en cream
   stribe under headeren, tydeligst mod det grønne hero-bånd. Nulstil den,
   så .dfa altid ligger flush. Rammer kun .dfa-sider (blogindlæg beholder
   deres afsnits-spacing). */
.wp-block-post-content > .dfa { margin-block: 0; }

/* =====================================================================
   LAYOUT
   ===================================================================== */
.df-container { max-width: var(--df-content); margin: 0 auto; padding: 0 24px; }
.df-section { padding: 72px 0; }
/* Fuld-bredde bånd: baggrund spænder 100vw, indhold holdes i .df-container.
   Kanonisk breakout (jf. landingpage-instruks). ALDRIG overflow-x:hidden her. */
.df-bleed {
  width: 100vw; position: relative; left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw;
}
.df-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--df-primary);
}

/* =====================================================================
   HEADER / NAV  (sticky, CSS-only mega-menu + mobil-hamburger, ingen JS)
   ===================================================================== */
.df-header-outer { background: var(--df-surface); border-bottom: 1px solid var(--df-border); position: sticky; top: 0; z-index: 200; }
.df-header { display: flex; align-items: center; gap: 20px; padding-top: 12px; padding-bottom: 12px; position: relative; }
.df-header__logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.df-header__logo img { height: 40px; width: auto; display: block; }

/* Skjult checkbox der driver mobil-menuen (label = .df-burger) */
.df-navtoggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.df-nav { margin-left: auto; }
.df-menu { list-style: none; display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; }
.df-menu > li { position: relative; }
.df-menu > li > a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; font-size: 15px; font-weight: 500; color: var(--df-text-2); text-decoration: none; border-radius: 9px; white-space: nowrap; }
.df-menu > li > a:hover, .df-menu > li:focus-within > a { color: var(--df-text); background: var(--df-surface-alt); }
.df-has-sub > a::after { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .5; flex-shrink: 0; }

.df-sub { list-style: none; margin: 0; padding: 7px; position: absolute; top: calc(100% + 4px); left: 0; min-width: 234px; background: #fff; border: 1px solid var(--df-border); border-radius: var(--df-radius); box-shadow: 0 14px 40px rgba(14,19,16,.12); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .16s ease, transform .16s ease; }
.df-menu > li:hover > .df-sub, .df-menu > li:focus-within > .df-sub { opacity: 1; visibility: visible; transform: translateY(0); }
.df-sub li { margin: 0; }
.df-sub a { display: block; padding: 9px 12px; font-size: 14px; font-weight: 500; color: var(--df-text-2); text-decoration: none; border-radius: 8px; white-space: nowrap; }
.df-sub a:hover { background: var(--df-surface-alt); color: var(--df-primary); }

.df-header__cta { flex-shrink: 0; }

/* Hamburger — kun mobil */
.df-burger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--df-border); background: transparent; cursor: pointer; flex-shrink: 0; }
.df-burger span { display: block; width: 18px; height: 2px; margin: 0 auto; background: var(--df-text); border-radius: 2px; }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.df-cta {
  display: inline-block; background: var(--df-cta); color: var(--df-cta-text);
  font-weight: 600; font-size: 15px; padding: 11px 22px; border-radius: 999px;
  text-decoration: none; border: none; cursor: pointer;
}
.df-cta:hover { background: var(--df-cta-hover); color: var(--df-cta-text); }
.df-btn-ghost {
  display: inline-block; background: transparent; color: var(--df-primary);
  font-weight: 600; font-size: 15px; padding: 11px 22px; border-radius: 999px;
  text-decoration: none; border: 1px solid var(--df-border); cursor: pointer;
}
.df-btn-ghost:hover { border-color: var(--df-primary-mid); }

/* =====================================================================
   HERO
   ===================================================================== */
.df-hero { background: var(--df-surface); }
.df-hero__inner { padding: 72px 0; position: relative; overflow: hidden; }
.df-hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; margin: 18px 0 20px; max-width: 18ch; }
.df-hero__sub { font-size: 18px; color: var(--df-text-2); max-width: 54ch; margin: 0 0 28px; }
.df-hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.df-hero__decor { position: absolute; top: -120px; right: -90px; width: 340px; height: 340px; border-radius: 50%; background: var(--df-primary-light); opacity: .55; z-index: 0; }
.df-hero__inner > *:not(.df-hero__decor) { position: relative; z-index: 1; }

/* =====================================================================
   CARDS
   ===================================================================== */
.df-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.df-card { background: #fff; border: 1px solid var(--df-border); border-radius: var(--df-radius); padding: 26px 28px; }
.df-card h3 { font-size: 1.25rem; font-weight: 600; margin: 0 0 8px; }
.df-card p { font-size: 15px; color: var(--df-text-2); margin: 0 0 16px; }
.df-card__link { color: var(--df-primary); font-weight: 600; font-size: 14px; text-decoration: none; }

/* Kursuskort */
.df-course { display: flex; flex-direction: column; }
.df-course__head { display: flex; justify-content: space-between; align-items: start; }
.df-course h4 { font-size: 1.3rem; font-weight: 600; margin: 12px 0 0; }
.df-course__meta { display: flex; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--df-text-2); }
.df-course__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--df-border); }
.df-course__price { font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 600; }
.df-pill-scarce { font-size: 12px; font-weight: 600; color: var(--df-accent); background: var(--df-accent-light); padding: 4px 10px; border-radius: 999px; }

/* =====================================================================
   FAQ
   ===================================================================== */
.df-faq { background: #fff; border: 1px solid var(--df-border); border-radius: var(--df-radius); overflow: hidden; }
.df-faq details { border-bottom: 1px solid var(--df-border); }
.df-faq details:last-child { border-bottom: none; }
.df-faq summary { list-style: none; cursor: pointer; padding: 16px 20px; font-size: 15px; font-weight: 500; color: var(--df-text); display: flex; justify-content: space-between; gap: 12px; }
.df-faq summary::-webkit-details-marker { display: none; }
.df-faq summary::after { content: "+"; color: var(--df-primary); font-size: 18px; }
.df-faq details[open] summary::after { content: "\2013"; }
.df-faq__a { padding: 0 20px 16px; font-size: 14px; color: var(--df-text-2); margin: 0; }

/* =====================================================================
   GRØNT BÅND (upsell / CTA)
   ===================================================================== */
.df-band { background: var(--df-primary); position: relative; overflow: hidden; }
.df-band__inner { padding: 56px 0; position: relative; z-index: 1; }
.df-band h2, .df-band h3 { color: var(--df-on-dark); }
.df-band p { color: var(--df-on-dark-2); }
.df-band__decor { position: absolute; top: -80px; right: -40px; width: 280px; height: 280px; border-radius: 50%; background: oklch(50% 0.12 155); opacity: .3; z-index: 0; }

/* =====================================================================
   BLOG-TEASERS
   ===================================================================== */
.df-teasers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.df-teaser { background: #fff; border: 1px solid var(--df-border); border-radius: var(--df-radius); padding: 24px 26px; }
.df-teaser h4 { font-size: 1.15rem; font-weight: 600; margin: 0; line-height: 1.3; }
.df-teaser__meta { font-size: 12px; color: var(--df-text-3); margin-top: 16px; }

/* =====================================================================
   ARKIV / KATEGORI (archive.html + index.html) — kort-grid m. featured image
   ===================================================================== */
.df-archive__heading { font-family: 'Fraunces', Georgia, serif; font-size: clamp(1.8rem, 3.6vw, 2.4rem); font-weight: 700; margin: 0 0 8px; }
.df-archive__desc { font-size: 16px; color: var(--df-text-2); max-width: 62ch; margin: 0 0 28px; }
.df-archive .wp-block-post-template { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 0; padding: 0; list-style: none; }
.df-archive .wp-block-post { background: #fff; border: 1px solid var(--df-border); border-radius: var(--df-radius); overflow: hidden; display: flex; flex-direction: column; margin: 0; transition: box-shadow .2s ease, transform .2s ease; }
.df-archive .wp-block-post:hover { box-shadow: 0 8px 24px rgba(24,91,55,.08); transform: translateY(-2px); }
.df-archive__img { margin: 0; }
.df-archive__img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--df-surface-alt); }
.df-archive__cat { margin: 0; padding: 20px 22px 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.df-archive__cat a { color: var(--df-primary); text-decoration: none; }
.df-archive__title { margin: 0; padding: 8px 22px 0; font-family: 'Fraunces', Georgia, serif; font-size: 18px; font-weight: 600; line-height: 1.35; }
.df-archive__title a { color: var(--df-text); text-decoration: none; }
.df-archive__title a:hover { color: var(--df-primary); }
.df-archive__excerpt { margin: 0; padding: 10px 22px 0; font-size: 14px; color: var(--df-text-2); line-height: 1.6; flex-grow: 1; }
.df-archive__date { margin: 0; padding: 14px 22px 20px; font-size: 12px; color: var(--df-text-3); }
.df-archive__pagination { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 36px; font-size: 14px; }
.df-archive__pagination a, .df-archive__pagination .current { color: var(--df-primary); text-decoration: none; }
@media (max-width: 1024px) { .df-archive .wp-block-post-template { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .df-archive .wp-block-post-template { grid-template-columns: 1fr; } }

/* =====================================================================
   FOOTER
   ===================================================================== */
.df-footer-outer { background: var(--df-text); color: var(--df-on-dark-2); }
.df-footer { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.1fr; gap: 40px; padding-top: 56px; padding-bottom: 40px; }
.df-footer__brand { font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 800; color: var(--df-on-dark); }
.df-footer__brand-col p { font-size: 14px; color: var(--df-on-dark-2); line-height: 1.65; margin: 12px 0 18px; max-width: 34ch; }
.df-footer__col-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--df-primary-mid); margin-bottom: 14px; }
.df-footer__col a { display: block; font-size: 14px; color: var(--df-on-dark-2); text-decoration: none; margin-bottom: 9px; }
.df-footer__col a:hover { color: var(--df-on-dark); }
.df-footer__addr, .df-footer__cvr { font-size: 14px; color: var(--df-on-dark-2); margin: 0 0 9px; line-height: 1.6; }
.df-footer__lead { color: var(--df-cta) !important; font-weight: 600; margin-top: 6px; }
.df-footer__lead:hover { color: var(--df-cta-hover) !important; }

/* Sociale ikoner (inline SVG, ingen Font Awesome) */
.df-social { display: flex; gap: 10px; }
.df-social a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; color: var(--df-on-dark-2); transition: background .15s ease, color .15s ease, border-color .15s ease; }
.df-social a:hover { background: var(--df-primary); border-color: var(--df-primary); color: #fff; }
.df-social svg { width: 17px; height: 17px; fill: currentColor; }

/* Bundlinje */
.df-footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 28px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.10); font-size: 13px; color: var(--df-on-dark-2); }
.df-footer-bottom__links { display: flex; gap: 18px; }
.df-footer-bottom a { color: var(--df-on-dark-2); text-decoration: none; }
.df-footer-bottom a:hover { color: var(--df-on-dark); }

/* =====================================================================
   POST / SINGLE
   ===================================================================== */
.df-post-title { max-width: 760px; margin: 56px auto 24px; padding: 0 24px; }
.df-post-title h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; }

/* ---------------------------------------------------------------------
   AIOSEO EEAT — auto-indsat forfatter-bio efter blogindlæg.
   Pluginet (author-bio/global.css) rendrede boksen fuld-bredde med en
   hård sort 1px-ramme, 12px padding og 120px-avatar — den brød ud af
   760px-læsespalten og matchede intet andet på siden. Vi spejler i
   stedet den in-content .dfa-art__author-card: surface-alt-flade, blød
   ramme, 16px-radius, rund 64px-avatar, Fraunces-navn — og holder den i
   samme centrerede spalte som brødteksten.
   Alle regler scopes under .wp-block-post-content, så de out-specificerer
   pluginets egne 1-3-klasses-regler uanset stylesheet-rækkefølge.
   --------------------------------------------------------------------- */
.wp-block-post-content .aioseo-author-bio-compact {
  max-width: 760px;
  margin: 40px auto 48px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  color: var(--df-text);
  background: var(--df-surface-alt);
  border: 1px solid var(--df-border);
  border-radius: var(--df-radius-band);
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-left {
  flex-shrink: 0;
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-left .aioseo-author-bio-compact-image {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--df-primary-light);
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-right {
  min-width: 0;
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-header {
  margin: 0 0 6px;
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-header .author-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--df-text);
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-main {
  font-size: 15px;
  line-height: 1.6;
  color: var(--df-text-2);
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-main .author-bio-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 12px;
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-main .author-bio-link a {
  color: var(--df-primary);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-main .author-bio-link a:hover {
  text-decoration: underline;
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-main .author-bio-link a + a {
  min-width: 0;
  min-height: 0;
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-main .author-bio-link svg {
  width: 15px;
  height: 15px;
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-main .author-bio-link svg path {
  fill: var(--df-primary);
}
.wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-footer:empty {
  display: none;
}

@media (max-width: 560px) {
  .wp-block-post-content .aioseo-author-bio-compact {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 22px;
  }
  .wp-block-post-content .aioseo-author-bio-compact .aioseo-author-bio-compact-main .author-bio-link {
    justify-content: center;
  }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 980px) {
  .df-burger { display: flex; }
  .df-header__cta { margin-left: auto; }
  .df-nav {
    position: absolute; top: 100%; left: 0; right: 0; margin-left: 0;
    background: var(--df-surface); border-bottom: 1px solid var(--df-border);
    box-shadow: 0 18px 40px rgba(14,19,16,.12);
    max-height: calc(100vh - 66px); overflow-y: auto; display: none;
  }
  .df-navtoggle:checked ~ .df-nav { display: block; }
  .df-menu { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 12px 16px; }
  .df-menu > li > a { padding: 12px 8px; font-size: 16px; }
  .df-has-sub > a::after { margin-left: auto; }
  .df-sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; background: transparent;
    padding: 0 0 8px 12px; min-width: 0;
  }
  .df-sub a { padding: 8px; color: var(--df-text-2); }
}
@media (max-width: 860px) {
  .df-footer { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .df-section { padding: 48px 0; }
}
@media (max-width: 560px) {
  .df-footer { grid-template-columns: 1fr; gap: 28px; }
  .df-footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
}
