/* ==========================================================================
   Color Fiind — blog theme
   Shared by the blog listing (blog/index.php) and every article
   (blog/posts/YYYY/MM/<slug>/index.html).

   Theme: light by default, dark via [data-theme="dark"] on <html>.
   The toggle reads and writes the SAME localStorage key the main site uses
   ("theme"), so switching theme on a palette page carries over to the blog and
   back. No second preference to manage.

   Typography: Fraunces for display, Source Serif 4 for article body,
   Inter for interface. Loaded from Google Fonts in the page <head>.
   ========================================================================== */

:root{
  --bg:#FAF8F5; --surface:#FFFFFF; --ink:#14161A; --ink-soft:#3A3F47;
  --muted:#6B7280; --line:#E7E2DA; --hover:#F3EFE9; --accent:#1B57F6;
  --shadow:0 1px 2px rgba(20,22,26,.04), 0 8px 24px rgba(20,22,26,.06);
  --serif-display:"Fraunces",Georgia,"Times New Roman",serif;
  --serif-body:"Source Serif 4",Georgia,serif;
  --sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}
[data-theme="dark"]{
  --bg:#0E0F12; --surface:#16181D; --ink:#F2F3F5; --ink-soft:#C9CDD4;
  --muted:#9BA1AC; --line:#262A31; --hover:#1C1F25; --accent:#6B93FF;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{background:var(--bg);color:var(--ink);font-family:var(--sans);
  line-height:1.6;-webkit-font-smoothing:antialiased;
  transition:background .25s ease,color .25s ease}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}

/* ------------------------------------------------------------------ topbar */
.topbar{border-bottom:1px solid var(--line);background:var(--bg);position:sticky;
  top:0;z-index:50}
.topbar-in{max-width:1180px;margin:0 auto;padding:18px 32px;display:flex;
  align-items:center;justify-content:space-between;gap:24px}
.brand{font-family:var(--serif-display);font-weight:600;font-size:24px;
  letter-spacing:-.02em;display:flex;align-items:baseline;gap:1px}
.brand em{font-style:italic;font-weight:400}
.brand .dot{color:var(--accent)}
.topnav{display:flex;gap:24px;font-size:14px;font-weight:500;color:var(--muted);
  align-items:center}
.topnav a:hover{color:var(--ink)}
.theme-btn{background:var(--surface);border:1px solid var(--line);color:var(--muted);
  font:600 12.5px/1 var(--sans);padding:8px 13px;border-radius:999px;cursor:pointer;
  transition:.18s;white-space:nowrap}
.theme-btn:hover{color:var(--ink);border-color:var(--muted)}
@media(max-width:760px){
  .topbar-in{padding:15px 20px}
  .topnav a:not(.theme-btn){display:none}
}

/* ------------------------------------------------------------------ footer */
.blog-footer{margin-top:72px;border-top:1px solid var(--line);padding:40px 32px 56px}
.blog-footer-in{max-width:1180px;margin:0 auto;display:grid;
  grid-template-columns:1.6fr 1fr 1fr;gap:40px}
.blog-footer h2{font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);margin-bottom:14px}
.blog-footer p{color:var(--muted);font-size:13.5px;line-height:1.7;max-width:44ch}
.blog-footer ul{list-style:none;display:flex;flex-direction:column;gap:3px}
.blog-footer li a{font-size:13.5px;color:var(--muted);font-weight:500;display:block;padding:5px 0}
.blog-footer li a:hover{color:var(--ink)}
.blog-footer-base{max-width:1180px;margin:34px auto 0;padding-top:20px;
  border-top:1px solid var(--line);font-size:12.5px;color:var(--muted)}
@media(max-width:760px){.blog-footer{padding:32px 20px 44px}
  .blog-footer-in{grid-template-columns:1fr;gap:28px}}

/* ----------------------------------------------------------------- byline */
.avatar{width:34px;height:34px;border-radius:50%;flex:0 0 auto;display:grid;
  place-items:center;color:#fff;font:700 12.5px/1 var(--sans);letter-spacing:.02em}
.byline{display:flex;align-items:center;gap:11px}
.byline-text{font-size:12.5px;line-height:1.35}
.byline-text strong{display:block;font-weight:700;font-size:13px}
.byline-text span{color:var(--muted)}

/* ==========================================================================
   LISTING (blog/index.php)
   ========================================================================== */
.layout{max-width:1180px;margin:0 auto;padding:48px 32px 40px;display:grid;
  grid-template-columns:248px 1fr;gap:72px;align-items:start}
@media(max-width:960px){.layout{grid-template-columns:1fr;gap:40px;padding:32px 20px 24px}}

.rail{position:sticky;top:96px}
@media(max-width:960px){.rail{position:static}}
.rail-logo{font-family:var(--serif-display);font-size:42px;font-weight:600;
  line-height:1.02;letter-spacing:-.03em;margin-bottom:16px}
.rail-logo em{font-style:italic;font-weight:400;display:block}
.rail-tag{color:var(--muted);font-size:14.5px;line-height:1.65;max-width:30ch;
  padding-bottom:24px;border-bottom:1px solid var(--line);margin-bottom:20px}
.rail-nav{display:flex;flex-direction:column;gap:2px}
.rail-nav a{font-size:14.5px;font-weight:500;color:var(--muted);padding:8px 12px;
  border-radius:9px;transition:.16s;display:flex;justify-content:space-between;
  align-items:center;gap:10px}
.rail-nav a:hover{background:var(--hover);color:var(--ink)}
.rail-nav a.active{color:var(--ink);font-weight:700;background:var(--hover)}
.rail-nav a span{font-size:12px;color:var(--muted);font-weight:600}

.stream-head{display:flex;align-items:baseline;justify-content:space-between;
  gap:20px;margin-bottom:32px;flex-wrap:wrap}
.stream-head h1{font-family:var(--serif-display);font-size:32px;font-weight:600;
  letter-spacing:-.02em;line-height:1.15}
.stream-head .meta{font-size:13px;color:var(--muted)}

.cards{display:grid;grid-template-columns:1fr 1fr;gap:44px 36px}
@media(max-width:820px){.cards{grid-template-columns:1fr;gap:40px}}
.card{display:flex;flex-direction:column}
.card-media{display:block;aspect-ratio:16/10;border-radius:14px;overflow:hidden;
  background:var(--hover);border:1px solid var(--line);margin-bottom:18px}
.card-media img{width:100%;height:100%;object-fit:cover;
  transition:transform .5s cubic-bezier(.2,.7,.3,1)}
.card:hover .card-media img{transform:scale(1.035)}
.eyebrow{font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--accent);margin-bottom:9px;display:block}
.card-title{font-family:var(--serif-display);font-size:23px;font-weight:600;
  line-height:1.24;letter-spacing:-.015em;margin-bottom:10px}
.card:hover .card-title{text-decoration:underline;text-decoration-thickness:1.5px;
  text-underline-offset:4px}
.card-excerpt{color:var(--muted);font-size:14.5px;line-height:1.62;margin-bottom:18px}
.card .byline{margin-top:auto}
.pager{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:56px}
.pager a,.pager span{padding:9px 15px;border:1px solid var(--line);border-radius:10px;
  font:600 13px/1 var(--sans);color:var(--muted);background:var(--surface)}
.pager a:hover{color:var(--ink);border-color:var(--muted)}
.pager .current{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.empty-state{text-align:center;padding:64px 20px;color:var(--muted)}
.empty-state h2{font-family:var(--serif-display);font-size:24px;font-weight:600;
  color:var(--ink);margin-bottom:10px}
.empty-state a{color:var(--accent);font-weight:600;text-decoration:underline;
  text-underline-offset:3px}

/* ==========================================================================
   ARTICLE
   ========================================================================== */
.wrap{max-width:1180px;margin:0 auto;padding:0 32px}
@media(max-width:720px){.wrap{padding:0 20px}}

.article-head{padding:52px 0 0}
.crumbs{font-size:13px;color:var(--muted);margin-bottom:24px;display:flex;
  gap:9px;flex-wrap:wrap;align-items:center}
.crumbs a:hover{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.crumbs .sep{opacity:.45}
.display{font-family:var(--serif-display);font-weight:500;
  font-size:clamp(36px,5.2vw,60px);line-height:1.07;letter-spacing:-.028em;
  max-width:20ch;margin-bottom:24px}
.article-meta{display:flex;align-items:center;gap:12px;padding-bottom:36px;
  flex-wrap:wrap}
.article-meta .avatar{width:38px;height:38px;font-size:13px}
.article-meta .who{font-size:14px;font-weight:700}
.article-meta .when{font-size:13.5px;color:var(--muted)}

.hero{aspect-ratio:16/9;border-radius:18px;overflow:hidden;background:var(--hover);
  border:1px solid var(--line);margin-bottom:60px}
.hero img{width:100%;height:100%;object-fit:cover}
@media(max-width:900px){.hero{aspect-ratio:16/10;margin-bottom:44px}}

.article-grid{display:grid;grid-template-columns:236px minmax(0,1fr);
  gap:64px;align-items:start;padding-bottom:24px}
@media(max-width:900px){.article-grid{grid-template-columns:1fr;gap:34px}}
.rail-sticky{position:sticky;top:96px;display:flex;flex-direction:column;gap:24px}
@media(max-width:900px){.rail-sticky{position:static}}
.rail-card{background:var(--surface);border:1px solid var(--line);
  border-radius:14px;padding:18px 20px}
.rail-title{font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);margin-bottom:14px}
.share-row{display:flex;gap:9px}
.share-row a{width:36px;height:36px;border-radius:9px;border:1px solid var(--line);
  display:grid;place-items:center;color:var(--ink-soft);transition:.16s;
  font-size:14px;font-weight:700}
.share-row a:hover{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.toc{display:flex;flex-direction:column;gap:1px}
.toc a{font-size:13.5px;color:var(--muted);padding:7px 10px;border-radius:8px;
  border-left:2px solid transparent;transition:.16s;line-height:1.45}
.toc a:hover{color:var(--ink);background:var(--hover)}
.toc a.on{color:var(--ink);font-weight:700;border-left-color:var(--accent);
  background:var(--hover)}

.prose{font-family:var(--serif-body);font-size:19px;line-height:1.78;
  color:var(--ink-soft);max-width:68ch}
.prose > * + *{margin-top:1.35em}
.prose .lede{font-size:22px;line-height:1.62;color:var(--ink)}
.prose h2{font-family:var(--serif-display);font-size:31px;font-weight:600;
  line-height:1.2;letter-spacing:-.02em;color:var(--ink);margin-top:2.1em;
  scroll-margin-top:96px}
.prose h3{font-family:var(--sans);font-size:17px;font-weight:700;color:var(--ink);
  margin-top:1.9em;letter-spacing:-.005em;scroll-margin-top:96px}
.prose ul,.prose ol{padding-left:1.35em}
.prose li{margin-top:.5em}
.prose strong{font-weight:700;color:var(--ink)}
.prose a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.prose blockquote{border-left:3px solid var(--accent);padding-left:22px;
  font-style:italic;color:var(--ink)}
.prose img{border-radius:14px;margin:1.6em 0}
.prose figure{margin:1.8em 0}
.prose figcaption{font-family:var(--sans);font-size:13px;color:var(--muted);
  margin-top:10px;text-align:center}
.prose code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:.86em;background:var(--hover);padding:2px 6px;border-radius:5px}
.prose table{width:100%;border-collapse:collapse;font-family:var(--sans);
  font-size:14.5px;margin:1.6em 0}
.prose th,.prose td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line)}
.prose th{font-size:11px;text-transform:uppercase;letter-spacing:.06em;
  color:var(--muted);font-weight:700}

/* --------------------------------------------------------- related posts */
.article-foot{border-top:1px solid var(--line);padding:44px 0 0}
.article-foot h2{font-family:var(--serif-display);font-size:24px;font-weight:600;
  letter-spacing:-.015em;margin-bottom:26px}
.more{display:grid;grid-template-columns:repeat(3,1fr);gap:26px}
@media(max-width:820px){.more{grid-template-columns:1fr}}
.more .card-media{aspect-ratio:16/10;margin-bottom:14px}
.more .card-title{font-size:17px;line-height:1.3}

/* ------------------------------------------------------- follow / social */
.follow-card{background:var(--surface);border:1px solid var(--line);
  border-radius:14px;padding:18px 20px}
.follow-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.follow-row a{display:inline-flex;align-items:center;gap:7px;padding:8px 13px;
  border:1px solid var(--line);border-radius:999px;font-size:13px;font-weight:600;
  color:var(--ink-soft);transition:.16s}
.follow-row a:hover{background:var(--ink);color:var(--bg);border-color:var(--ink)}
