/* =============================================================================
   Lukra blog stylesheet
   Ported from _shell.html (design tokens, masthead, sections, post-body) and
   validating-lukra.html (chart-specific classes: overview chart, monthly line
   charts, small multiples, legend). Restyle everything from this one file.
============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;600;700&family=Inter:wght@400;500;600;700&family=Montserrat:wght@300&display=swap');

/* ---- design tokens (Lukra website style guide) ---- */
.lukra-root{
  --brand:#143219; --header:#2F855A; --primary:#4CAF50;
  --brown:#C2A679; --gray:#6B7280; --mist:#F3F4F6;
  --ink:#111827; --rule:#E5E7EB;
  --blue:#3B82F6; --orange:#F97316; --lukra:#2F855A;
  --display:"DM Sans",system-ui,sans-serif;
  --body:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
  --slogan:"Montserrat",system-ui,sans-serif;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0}
.lukra-root{margin:0;background:#fff;color:var(--ink);font-family:var(--body);
     font-size:17px;line-height:1.65;font-feature-settings:"kern","liga"}
.wrap{max-width:860px;margin:0 auto;padding:0 24px 96px}

/* ---- masthead band ---- */
.masthead{background:var(--brand);color:#fff;margin:0 0 0;padding:30px 24px 36px;
    border-bottom:4px solid var(--primary)}
.masthead .inner{max-width:812px;margin:0 auto}
.logoslot{height:30px;display:flex;align-items:center;margin-bottom:20px}
.logoslot svg{height:48px;width:auto;display:block}
.logoslot .wordmark{font-family:var(--display);font-weight:600;font-size:21px;
     letter-spacing:.02em;color:#fff}
.logoslot .slogan{font-family:var(--slogan);font-weight:300;font-size:12px;
     letter-spacing:.09em;color:#9ca3af;margin-left:14px}
.eyebrow{font-family:var(--body);font-size:12px;font-weight:600;letter-spacing:.14em;
         text-transform:uppercase;color:var(--brown);margin:0 0 12px}
.eyebrow:empty{display:none}
h1{font-family:var(--display);font-weight:700;font-size:clamp(28px,5vw,42px);line-height:1.08;
   letter-spacing:-.02em;margin:0 0 14px;color:#fff}
.stand{font-size:19px;line-height:1.5;color:#d7e3da;margin:0;max-width:64ch;font-weight:400}
.stand:empty{display:none}
.meta{font-family:var(--body);font-size:12.5px;color:#9fb3a6;margin-top:22px;
      padding-top:14px;border-top:1px solid rgba(255,255,255,.16);
      display:flex;flex-wrap:wrap;gap:6px 26px}
.meta b{color:#e9f0eb;font-weight:600}
.meta .date:empty{display:none}
.meta:has(.date:empty){display:none}
.meta .date:not(:empty)::before{content:"Published "}

/* ---- home landing CTAs (placeholder home page) ---- */
.home-links{display:flex;gap:14px;margin-top:28px;flex-wrap:wrap}
.btn{display:inline-block;font-family:var(--body);font-weight:600;font-size:14px;
    padding:11px 20px;border-radius:8px;text-decoration:none;letter-spacing:.01em}
.btn.primary{background:var(--primary);color:#fff}
.btn.primary:hover{background:#43a047}
.btn:not(.primary){background:transparent;color:#fff;border:1px solid rgba(255,255,255,.35)}
.btn:not(.primary):hover{border-color:#fff}
/* .btn.secondary — solid brown fill, for CTAs that shouldn't read as lower-
   priority than .primary (e.g. "Open the app"). Left .btn:not(.primary)
   above untouched since it may still be used for genuinely secondary
   actions elsewhere (e.g. a future post-footer CTA). */
.btn.secondary{background:var(--brown);color:var(--brand);border:none}
.btn.secondary:hover{background:#b3966a}

/* ---- hero panel ---- */
.hero{background:var(--mist);border:1px solid var(--rule);border-radius:12px;
      padding:22px 22px 18px;margin:34px 0 8px}
.hero-head{display:flex;justify-content:space-between;align-items:baseline;gap:16px;flex-wrap:wrap;margin-bottom:6px}
.hero-head h2{margin:0;border:0;padding:0;font-family:var(--display);font-weight:700;
     font-size:18px;letter-spacing:-.01em;color:var(--ink);text-transform:none}
.kicker{font-family:var(--body);font-size:12px;font-weight:600;color:var(--header);
     text-transform:uppercase;letter-spacing:.06em}
figure{margin:0} .wrap svg{width:100%;height:auto;display:block}
.cap{font-size:13px;color:var(--gray);margin:14px 2px 0;line-height:1.55}

/* ---- overview chart styling ---- */
.ovgrid{stroke:var(--rule);stroke-width:1}
.ovaxis{font-family:var(--body);font-size:11px;fill:var(--gray);text-anchor:middle}
.ovaxistitle{font-family:var(--body);font-size:11px;font-weight:600;fill:var(--gray);
     text-anchor:middle;letter-spacing:.04em;text-transform:uppercase}
.ovhi{fill:var(--brown);opacity:.13;rx:6}
.ovlabel{font-family:var(--body);font-size:13px;fill:var(--ink);text-anchor:end}
.ovlabel.hi{font-weight:700}
.ovband{stroke:#cfd6cf;stroke-width:6;stroke-linecap:round}
.ov01{fill:var(--blue)} .ov21{fill:var(--orange)}
.ovlk{fill:var(--lukra)}
.ovres{font-family:var(--body);font-size:12.5px;fill:var(--gray);text-anchor:end;
     font-variant-numeric:tabular-nums}
.ovres.hi{fill:var(--brand);font-weight:700}

/* ---- monthly line charts ---- */
.grid{stroke:var(--rule);stroke-width:1}
.ytick{font-family:var(--body);font-size:11px;fill:var(--gray);text-anchor:end;font-variant-numeric:tabular-nums}
.xtick{font-family:var(--body);font-size:11px;fill:var(--gray);text-anchor:middle}
.ylab{font-family:var(--body);font-size:11px;fill:var(--gray);text-anchor:middle;letter-spacing:.04em}
.lnlk{fill:none;stroke:var(--lukra);stroke-width:2.6;stroke-linejoin:round;stroke-linecap:round}
.ln01{fill:none;stroke:var(--blue);stroke-width:2.2;stroke-linejoin:round;stroke-linecap:round}
.ln21{fill:none;stroke:var(--orange);stroke-width:2.2;stroke-dasharray:5 4;stroke-linejoin:round;stroke-linecap:round}
.dtlk{fill:var(--lukra)} .dt01{fill:var(--blue)} .dt21{fill:var(--orange)}

/* ---- small multiples (every-run grid) ---- */
.smgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:16px 0 6px}
.sm{background:#fff;border:1px solid var(--rule);border-radius:10px;padding:10px 12px 4px}
.sm.heifer{background:#f7f1e6;border-color:#e7d9bf}
.smhead{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:2px}
.smname{font-family:var(--display);font-weight:600;font-size:12.5px;color:var(--ink);line-height:1.2}
.smname.hi{color:var(--brand)}
.smres{font-size:11px;color:var(--gray);font-variant-numeric:tabular-nums;white-space:nowrap}
.smres.hi{color:var(--brand);font-weight:700}
.sm .lnlk{stroke-width:2.2} .sm .ln01,.sm .ln21{stroke-width:1.7}
.smtick{font-family:var(--body);fill:var(--gray);font-size:9px}
.smtick.y{text-anchor:end} .smtick.x{text-anchor:middle}

/* ---- legend ---- */
.legend{font-family:var(--body);font-size:13px;color:var(--gray);display:flex;gap:20px;
        margin:12px 2px 0;flex-wrap:wrap}
.legend span{white-space:nowrap;display:inline-flex;align-items:center}
.legend i{display:inline-block;width:20px;height:0;border-top:3px solid;vertical-align:middle;margin-right:7px}
.legend .dash{border-top-style:dashed}

/* ---- sections ---- */
section{margin-top:48px}
h2{font-family:var(--display);font-weight:700;font-size:13px;letter-spacing:.08em;
   text-transform:uppercase;color:var(--header);margin:0 0 16px;padding-bottom:8px;
   border-bottom:2px solid var(--header);display:inline-block}
h3{font-family:var(--display);font-weight:600;font-size:19px;letter-spacing:-.01em;margin:28px 0 8px;color:var(--ink)}
p{margin:0 0 16px}
.lead-q{font-family:var(--display);font-size:21px;line-height:1.45;font-weight:500;color:var(--brand);
        border-left:3px solid var(--primary);padding:2px 0 2px 20px;margin:0 0 18px}
strong{font-weight:600}
code{font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;font-size:13.5px;
     background:var(--mist);padding:1.5px 6px;border-radius:5px;color:var(--brand)}
.eq{font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;font-size:13.5px;background:var(--mist);
    border-left:3px solid var(--primary);padding:13px 18px;border-radius:0 8px 8px 0;margin:0 0 18px;
    line-height:1.7;overflow-x:auto;color:var(--brand)}

/* ---- callout ---- */
.note{background:var(--mist);border-radius:10px;padding:18px 22px;margin:22px 0;font-size:15.5px;line-height:1.55}
.note .lbl{font-family:var(--body);font-size:11px;letter-spacing:.1em;text-transform:uppercase;
           color:var(--brown);font-weight:700;display:block;margin-bottom:6px}
.note.warm{background:#f7f1e6}

/* ---- "go deeper" disclosure ---- */
details.deep{border:1px solid var(--rule);border-radius:10px;margin:18px 0;background:#fff;overflow:hidden}
details.deep>summary{cursor:pointer;list-style:none;padding:14px 18px;font-family:var(--body);
     font-weight:600;font-size:14px;color:var(--header);display:flex;align-items:center;gap:10px;
     background:var(--mist)}
details.deep>summary::-webkit-details-marker{display:none}
details.deep>summary::before{content:"+";font-family:var(--display);font-weight:700;font-size:17px;
     color:var(--primary);width:16px;text-align:center}
details.deep[open]>summary::before{content:"–"}
details.deep>summary .tag{margin-left:auto;font-weight:500;font-size:11px;letter-spacing:.08em;
     text-transform:uppercase;color:var(--gray)}
details.deep .body{padding:18px 20px 4px}

/* ---- table ---- */
.tablewrap{overflow-x:auto;margin:8px 0 6px}
table{width:100%;border-collapse:collapse;font-family:var(--body);font-size:13.5px}
caption{font-size:12.5px;color:var(--gray);text-align:left;margin-bottom:10px}
th{font-weight:600;text-align:left;color:var(--gray);border-bottom:1.5px solid var(--ink);
   padding:8px 10px;font-size:11px;letter-spacing:.04em;text-transform:uppercase}
td{padding:8px 10px;border-bottom:1px solid var(--rule)}
td.n,th.n{text-align:right;font-variant-numeric:tabular-nums}
th:not(:first-child){text-align:right}
td.near{color:var(--header);font-weight:700}
tr.heifer td{background:#f7f1e6}
tr.heifer td:first-child{font-weight:700}

/* ---- lists ---- */
ul.clean{list-style:none;padding:0;margin:0 0 16px}
ul.clean li{position:relative;padding-left:22px;margin-bottom:11px}
ul.clean li::before{content:"";position:absolute;left:2px;top:10px;width:7px;height:7px;
                    background:var(--primary);border-radius:2px;transform:rotate(45deg)}

/* ---- references + footer ---- */
.refs{font-size:13px;line-height:1.75;color:var(--gray)}
.refs b{color:var(--ink);font-weight:600}
footer{margin-top:56px;border-top:1px solid var(--rule);padding-top:20px;
       font-size:12.5px;color:var(--gray);line-height:1.7}
footer b{color:var(--ink)}

/* ---- motion + responsive ---- */
.reveal{opacity:0;transform:translateY(10px);animation:rise .6s cubic-bezier(.2,.7,.2,1) forwards}
@keyframes rise{to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.reveal{animation:none;opacity:1;transform:none}}
@media (max-width:760px){.smgrid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:560px){
  .lukra-root{font-size:16px} .wrap{padding:0 16px 70px}
  .masthead{padding:26px 16px 30px}
  .ovlabel,.ovres{font-size:11px}
  .smgrid{grid-template-columns:1fr}
}
@media print{.reveal{animation:none;opacity:1;transform:none} .masthead{-webkit-print-color-adjust:exact}}
a{color:var(--header)}

/* ---- rendered-markdown content (.post-body wraps Hugo's markdown render) ---- */
.post-body{font-size:17px;line-height:1.65}
.post-body>*:first-child{margin-top:0}
.post-body h1{font-family:var(--display);font-weight:700;font-size:28px;letter-spacing:-.01em;color:var(--ink);margin:34px 0 12px}
.post-body h2{font-family:var(--display);font-weight:700;font-size:22px;letter-spacing:-.01em;color:var(--ink);text-transform:none;display:block;
     margin:36px 0 12px;padding-bottom:8px;border-bottom:1px solid var(--rule)}
.post-body h3{font-family:var(--display);font-weight:600;font-size:18px;color:var(--ink);margin:26px 0 6px}
.post-body p{margin:0 0 16px}
.post-body a{color:var(--header);text-decoration:underline;text-underline-offset:2px}
.post-body strong{font-weight:600}
.post-body ul,.post-body ol{margin:0 0 16px;padding-left:1.4em}
.post-body li{margin:7px 0}
.post-body ul li::marker{color:var(--primary)}
.post-body blockquote{margin:0 0 18px;padding:2px 0 2px 20px;border-left:3px solid var(--primary);
     font-family:var(--display);font-size:20px;line-height:1.5;color:var(--brand)}
.post-body blockquote p{margin:0 0 8px}
.post-body code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.92em;background:var(--mist);
     padding:1.5px 6px;border-radius:5px;color:var(--brand)}
.post-body pre{background:var(--mist);border-left:3px solid var(--primary);border-radius:0 8px 8px 0;
     padding:14px 18px;overflow-x:auto;margin:0 0 18px}
.post-body pre code{background:none;padding:0;color:var(--brand);font-size:13.5px;line-height:1.7}
.post-body img{max-width:100%;height:auto;display:block;border-radius:8px;margin:10px 0}
.post-body hr{border:0;border-top:1px solid var(--rule);margin:30px 0}
.post-body table{width:100%;border-collapse:collapse;font-size:14px;margin:6px 0 18px;display:block;overflow-x:auto}
.post-body th{font-weight:600;text-align:left;color:var(--gray);border-bottom:1.5px solid var(--ink);
     padding:8px 10px;font-size:12px;letter-spacing:.03em;text-transform:uppercase}
.post-body td{padding:8px 10px;border-bottom:1px solid var(--rule)}
.post-body .note,.post-body details.deep{margin-left:0;margin-right:0}

/* ---- blog index list ---- */
.postlist{list-style:none;margin:0;padding:0}
.postlist li{padding:22px 0;border-bottom:1px solid var(--rule)}
.postlist li:first-child{padding-top:0}
.postlist a{font-family:var(--display);font-weight:700;font-size:19px;color:var(--ink);
     text-decoration:none;letter-spacing:-.01em}
.postlist a:hover{color:var(--header)}
.postlist small{display:block;color:var(--gray);font-size:13.5px;margin-top:6px;line-height:1.5}

/* ---- sr-only utility (visually hidden, still in a11y tree) ---- */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;
    overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ---- homepage: flex column filling the viewport exactly (no scroll) ----
   Scoped to .lukra-home (added alongside .lukra-root only on index.html)
   so blog/post pages, which keep plain .lukra-root, are unaffected. */
.lukra-home{display:flex;flex-direction:column;min-height:100vh}

/* ---- homepage masthead band: same green as .masthead, horizontal
   logo+text layout instead of the stacked eyebrow/h1/stand used on posts */
.masthead-home-band{flex:0 0 auto} /* natural height, banner never stretches */
.masthead-home-band .inner{max-width:min(94vw, 2000px)} /* was fixed at 1040px —
  now scales fluidly with viewport width, capped at 2000px (2x the 1000px
  .page-card content width used on list/single pages). Applies to both the
  homepage and blog banners, since both share .masthead-home-band. */
.masthead-home-top{
    display:flex;
    align-items:center;
    gap:32px;
    flex-wrap:wrap;
}
.logoslot-lg{height:76px} /* was 60px (2x base) — bumped again for more presence */
.logoslot-lg svg{height:130px;width:auto} /* was 96px (2x base) — bumped to match */
.masthead-home-text{flex:1;min-width:260px}
.masthead-home-text .stand{margin-bottom:20px;max-width:100ch} /* overrides the
  base .stand{max-width:64ch} for this wider banner context — 100ch keeps the
  description readable on ultra-wide screens instead of stretching edge-to-edge */
.masthead-home-text .stand{margin-bottom:20px}

/* ---- homepage photo band: fills whatever height the banner didn't use,
   so banner + photo always sum to exactly one viewport, no scrollbar */
.masthead-home-photo{
    flex:1 1 auto;
    background-image:url("/images/dairy-background.png");
    background-size:cover;
    background-position:center;
}

/* ---- page-banner back button (list & post pages): pinned to the right
   of the fixed banner via margin-left:auto in the existing flex row */
.page-banner-back{margin-left:auto;white-space:nowrap}

/* ---- page-photo-framed / page-card: layered on top of the existing
   .masthead-home-photo (same fixed background as the homepage) to add a
   padded, rounded, independently-scrollable content card. Used by the
   blog list and every post; the homepage's .masthead-home-photo keeps no
   modifier, so its full-bleed look is unaffected by these rules. */
.page-photo-framed{display:flex;padding:28px;min-height:0}
.page-card{background:#fff;border-radius:16px;overflow-y:auto;
    box-shadow:0 10px 30px rgba(0,0,0,.25);min-height:0;
    /* fixed panel width instead of letting .page-photo-framed's padding
       determine it — same 1000px for both the list and single-post views */
    flex:0 1 1000px;width:100%;max-width:1000px;margin:0 auto}
.page-card .wrap{padding-top:32px} /* extra breathing room under the rounded
  top edge; .wrap's existing side/bottom padding is left as-is */

/* min-height:0 above is a standard flexbox fix: without it, nested flex
   items refuse to shrink below their content's natural height, and the
   .page-card's overflow-y:auto never kicks in — the whole page scrolls
   instead of just the card. */
.masthead-home-photo{min-height:0}

/* .lukra-home was min-height:100vh, which let the flex column grow taller
   than one screen when post content was long — that extra height leaked
   onto the body itself, so the whole page (including the "fixed" photo)
   scrolled instead of just .page-card. Locking it to height:100vh +
   overflow:hidden forces all overflow into .page-card's own scrollbar. */
.lukra-home{display:flex;flex-direction:column;height:100vh;overflow:hidden}

/* ---- page-banner left column: logo + back button stacked, right-aligned
   to each other. New — nothing existing did this two-item stacked-and-
   aligned layout. Only used inside page-banner.html (list/single/chart),
   not the homepage, so .masthead-home-top's own rule above is untouched. */
.page-banner-leftcol{display:flex;flex-direction:column;align-items:flex-end;gap:16px}
