/* ============================================================
   Nothing, at Length — a broadside for the Duke of Daedaly
   ============================================================ */

:root{
  --ink:#111010;
  --soft:#6b6660;
  --faint:#a9a49c;
  --line:#e4e0d8;
  --paper:#ffffff;
  --serif:"EB Garamond",Garamond,"Adobe Garamond Pro",Baskerville,"Times New Roman",serif;
  --wrap:680px;
}

*{ box-sizing:border-box; margin:0; padding:0; }

/* Kill scroll-anchoring so the collapsing masthead can't create a
   scroll<->layout feedback loop (the flicker fix, hard-won). */
html,body,.stage,.feed{ overflow-anchor:none; }
html{ -webkit-text-size-adjust:100%; }

body{
  background:var(--paper); color:var(--ink); font-family:var(--serif);
  font-size:18px; line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

a{ color:inherit; }

.stage{ position:relative; }

/* fixed reference point the collapsing masthead cannot move */
#sentinel{ position:absolute; top:96px; left:0; width:1px; height:1px; pointer-events:none; }

/* ---------- frozen / condensing masthead ---------- */
.masthead{
  position:sticky; top:0; z-index:50;
  background:var(--paper);
  border-bottom:1px solid var(--line);
  display:flex; flex-direction:column; align-items:center;
  padding:clamp(28px,5vw,46px) 20px clamp(14px,2vw,18px);
  transition:padding .26s ease;
}
.masthead.no-anim, .masthead.no-anim *{ transition:none !important; }

.cameo{
  display:block; margin:0 auto;
  width:clamp(80px,13vw,100px); height:auto;
  transition:width .26s ease, margin .26s ease;
}
.cameo img{ display:block; width:100%; height:auto; }

.nameplate{
  font-style:italic; font-weight:400; text-align:center;
  font-size:clamp(1.9rem,6vw,2.9rem); line-height:1.05;
  margin:clamp(10px,1.6vw,16px) 0 0;
  padding-bottom:clamp(14px,2vw,20px);
  border-bottom:1.5px solid var(--ink);
  transition:font-size .26s ease, margin .26s ease, padding .26s ease;
  color:var(--ink); text-decoration:none;
}
.nameplate a{ color:inherit; text-decoration:none; }
.masthead.small .nameplate{ padding-bottom:clamp(8px,1.2vw,12px); }

/* nav row under the nameplate */
.topnav{
  margin-top:clamp(10px,1.4vw,14px);
  display:flex; gap:1.4rem; justify-content:center; flex-wrap:wrap;
  font-size:.82rem; letter-spacing:.14em; text-transform:uppercase;
  transition:margin .26s ease, max-height .26s ease, opacity .2s ease;
  max-height:40px; overflow:hidden;
}
.topnav a{ color:var(--soft); text-decoration:none; padding-bottom:2px; }
.topnav a:hover{ color:var(--ink); }
.topnav a.nav-current{
  color:var(--ink);
  font-weight:600;
}

/* condensed state */
.masthead.small{ padding:9px 20px 8px; }
.masthead.small .cameo{ width:52px; margin:0; }
.masthead.small .nameplate{ font-size:1.3rem; margin:.15rem 0 0; }
.masthead.small .topnav{ max-height:0; opacity:0; margin:0; }

/* ---------- feed ---------- */
.feed{ max-width:var(--wrap); margin:0 auto; padding:8px 20px 120px; }
.card{
  padding:26px 0; border-bottom:1px solid var(--line);
}
.card a{ text-decoration:none; color:inherit; display:block; }
.card:hover .card-title{ text-decoration:underline; text-underline-offset:3px; }
.card-date{ font-size:.8rem; letter-spacing:.14em; text-transform:uppercase; color:var(--faint); }
.card-title{ font-size:clamp(1.5rem,4vw,1.95rem); line-height:1.15; margin:.35rem 0 .3rem; font-weight:500; }
.card-teaser{ color:var(--soft); font-style:italic; }

/* pagination */
.pagination{ max-width:var(--wrap); margin:0 auto; padding:0 20px 80px;
  display:flex; justify-content:space-between; font-style:italic; color:var(--soft); }
.pagination a{ text-decoration:none; }
.pagination a:hover{ color:var(--ink); }

/* ---------- single post / page ---------- */
.reader{ max-width:var(--wrap); margin:0 auto; padding:40px 20px 120px; }

/* modest, left-aligned page heading (Privacy, Terms, etc.) — deliberately
   smaller and left-set so it reads as a document title, not a second masthead */
.page-title{
  font-size:clamp(1.6rem,3.5vw,2.1rem);
  font-weight:500; line-height:1.15;
  margin:0 0 1.4rem;
  padding-bottom:.6rem;
  border-bottom:1px solid var(--line);
}
.post-head{ text-align:center; margin-bottom:36px; }
.post-date{ font-size:.8rem; letter-spacing:.14em; text-transform:uppercase; color:var(--faint); }
.post-title{ font-size:clamp(2rem,5vw,2.8rem); line-height:1.1; margin:.4rem 0 0; font-weight:500; }
.post-content{ font-size:1.12rem; line-height:1.7; }
.post-content p{ margin:0 0 1.2em; }
.post-content ul,.post-content ol{ margin:0 0 1.2em; padding-left:1.4em; }
.post-content li{ margin:0 0 .5em; padding-left:.2em; }
.post-content li:last-child{ margin-bottom:0; }
.post-content ul{ list-style-position:outside; }
.post-content em{ font-style:italic; }
.post-content h2,.post-content h3{ margin:1.6em 0 .5em; font-weight:500; }
.post-content blockquote{ margin:1.2em 0; padding-left:1.2em; border-left:2px solid var(--line); font-style:italic; color:var(--soft); }
.post-content a{ text-decoration:underline; text-underline-offset:2px; }
.post-content img{ max-width:100%; height:auto; }

/* (drop cap removed — posts open with salutations, which the drop cap fought) */

/* ---------- comments ---------- */
.comments{ max-width:var(--wrap); margin:0 auto; padding:0 20px 120px; }
.comments-title{ font-style:italic; font-size:1.4rem; text-align:center;
  padding-top:30px; border-top:1px solid var(--line); margin-bottom:20px; }

/* ---------- footer ---------- */
.site-foot{ border-top:1px solid var(--line); padding:40px 20px; text-align:center;
  color:var(--faint); font-size:.9rem; font-style:italic; }
.foot-nav{ margin-bottom:14px; display:flex; gap:1.2rem; justify-content:center; flex-wrap:wrap;
  font-style:normal; font-size:.78rem; letter-spacing:.12em; text-transform:uppercase; }
.foot-nav a{ color:var(--soft); text-decoration:none; }
.foot-nav a:hover{ color:var(--ink); }
.foot-line{ }

/* keep everything tidy on small screens */
@media (max-width:520px){
  body{ font-size:17px; }
}

/* ---------- Koenig editor card support (required by Ghost) ---------- */
.kg-width-wide{
  position:relative;
  width:100%;
  max-width:min(85vw,1000px);
  margin-left:50%;
  transform:translateX(-50%);
}
.kg-width-full{
  position:relative;
  width:100vw;
  max-width:100vw;
  margin-left:50%;
  transform:translateX(-50%);
}
.kg-width-full img{ width:100%; }

/* image + gallery + embed card basics */
.kg-image{ max-width:100%; height:auto; margin:0 auto; display:block; }
figure.kg-card{ margin:1.4em 0; }
figcaption{ text-align:center; font-size:.85rem; color:var(--soft); font-style:italic; padding-top:.5em; }
.kg-embed-card{ display:flex; justify-content:center; }
.kg-gallery-container{ display:flex; flex-direction:column; margin:0 auto; max-width:1040px; width:100vw; }
.kg-gallery-row{ display:flex; flex-direction:row; justify-content:center; }
.kg-gallery-image img{ display:block; margin:0; width:100%; height:100%; }

/* custom font support hooks (so Ghost's font settings can override if ever used) */
body{ font-family:var(--gh-font-body, var(--serif)); }
.nameplate,.post-title,.card-title,.comments-title{ font-family:var(--gh-font-heading, var(--serif)); }
