/* =========================================================================
   Blog listing — superpower.com/blog-inspired layout on the reference tokens.
   Light paper hero + search bar, category filter pills, "Top articles"
   featured row, minimal editorial cards (rounded media, badge, meta, title).
   Loaded only on post archive views (see inc/refsite.php).
   ========================================================================= */

/* ---------- Hero (light, on paper, under the fixed light header) --------- */
.blogHero {
  background: var(--paper);
  padding: calc(84px + clamp(36px, 5vw, 72px)) 0 clamp(28px, 3.5vw, 48px);
}
body.admin-bar .blogHero { padding-top: calc(84px + 32px + clamp(36px, 5vw, 72px)); }
@media screen and (max-width: 782px) { body.admin-bar .blogHero { padding-top: calc(84px + 46px + clamp(36px, 5vw, 72px)); } }

.blogHeroInner { max-width: 860px; }
.blogHero .innerCrumbs { margin-bottom: 26px; }
.blogHero .innerCrumbs a { color: #2d7752; }
.blogHero .innerCrumbs a:hover { color: var(--pine); }
.blogHero .innerCrumbs span[aria-hidden] { color: #9bb0a6; }
.blogHero .innerCrumbs .isCurrent { color: var(--ink); }

.blogHeroKicker {
  display: inline-block; margin-bottom: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: #427c5d;
}
.blogHeroTitle {
  margin: 0; color: var(--ink); font-weight: 560;
  font-size: clamp(36px, 5vw, 64px); line-height: 1.05; letter-spacing: -.02em;
  max-width: 18ch;
}
.blogHeroSub {
  margin: 18px 0 0; color: #45554e; max-width: 56ch;
  font-size: clamp(15px, 1.3vw, 17.5px); line-height: 1.65;
}

/* Inline action bar — the superpower "subscribe bar" shape, wired to search. */
.blogSearch {
  display: flex; align-items: center; gap: 8px; margin-top: 30px;
  max-width: 520px; padding: 6px 6px 6px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 18px 40px -28px rgba(6, 31, 25, .35);
  transition: border-color .2s, box-shadow .2s;
}
.blogSearch:focus-within { border-color: var(--green); box-shadow: 0 18px 40px -24px rgba(75, 159, 112, .45); }
.blogSearch input[type="search"] {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 0;
  font-size: 16px; color: var(--ink); font-family: inherit; /* ≥16px: no iOS focus zoom */
}
.blogSearch input[type="search"]::placeholder { color: #8a978f; }
.blogSearch input[type="search"]:focus { outline: none; }
.blogSearch button {
  flex: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 0; border-radius: 999px; padding: 12px 22px;
  background: var(--forest-deep); color: #eaf6ee;
  font-family: inherit; font-size: 14.5px; font-weight: 560; letter-spacing: .01em;
  transition: background .2s;
}
.blogSearch button:hover { background: var(--pine); }
.blogSearch button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- Category filter pills ---------------------------------------- */
.blogFilters {
  display: flex; gap: 8px; margin-top: clamp(26px, 3.5vw, 40px);
  overflow-x: auto; padding-bottom: 6px; scrollbar-width: none;
}
.blogFilters::-webkit-scrollbar { display: none; }
.blogFilters a {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--line); background: #fff; color: #34433c;
  font-size: 14px; font-weight: 540; white-space: nowrap;
  transition: border-color .2s, color .2s, background .2s;
}
.blogFilters a:hover { border-color: var(--green); color: var(--pine); }
.blogFilters a.isActive { background: var(--forest-deep); border-color: var(--forest-deep); color: #fff; }
.blogFilters a .count { color: #8a978f; font-size: 12.5px; font-weight: 500; }
.blogFilters a.isActive .count { color: #9bd1ae; }
.blogFilters a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- Listing sections --------------------------------------------- */
.blogWrap { padding-block: clamp(20px, 3vw, 40px) clamp(56px, 7vw, 104px); background: var(--paper); }
.blogSection + .blogSection { margin-top: clamp(48px, 6vw, 84px); }
.blogSectionHead { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: clamp(22px, 3vw, 34px); }
.blogSectionHead h2 {
  margin: 0; color: var(--ink); font-weight: 560; letter-spacing: -.015em;
  font-size: clamp(23px, 2.6vw, 32px); line-height: 1.1;
}
.blogSectionKicker {
  display: block; margin-bottom: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #427c5d;
}

/* ---------- Grids --------------------------------------------------------- */
.blogFeatureGrid, .blogGrid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 36px) clamp(18px, 2.4vw, 28px);
}
@media (max-width: 900px) { .blogFeatureGrid, .blogGrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .blogFeatureGrid, .blogGrid { grid-template-columns: 1fr; } }

/* ---------- Cards — minimal editorial (no box, rounded media) ------------- */
.blogCard { display: flex; flex-direction: column; min-width: 0; }
.blogCardMedia {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  aspect-ratio: 16 / 10; border-radius: 20px; margin-bottom: 16px;
  background: linear-gradient(150deg, var(--mint), #cfe3d6);
  border: 1px solid rgba(16, 35, 29, .07);
}
.blogCardMedia img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1);
}
.blogCard:hover .blogCardMedia img { transform: scale(1.045); }
@media (prefers-reduced-motion: reduce) { .blogCard:hover .blogCardMedia img { transform: none; } }
.blogCardBadge {
  position: absolute; left: 12px; top: 12px; z-index: 1;
  padding: 6px 13px; border-radius: 999px;
  background: rgba(251, 250, 246, .92); color: var(--pine);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  box-shadow: 0 6px 18px -8px rgba(6, 31, 25, .4);
}
.blogCardMeta {
  display: flex; align-items: center; gap: 9px; margin-bottom: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.blogCardMeta .dot { width: 3.5px; height: 3.5px; border-radius: 50%; background: #b9c7c0; }
.blogCardTitle {
  margin: 0; font-size: 19px; font-weight: 560; line-height: 1.32; letter-spacing: -.01em;
}
.blogCardTitle a { color: var(--ink); text-decoration: none; transition: color .2s; }
.blogCardTitle a:hover { color: #1f6b47; }
.blogCardTitle a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
.blogCardExcerpt {
  margin: 9px 0 0; color: #566761; font-size: 14.5px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Featured ("Top articles") variant — larger media and type. */
.blogCard.isFeature .blogCardMedia { aspect-ratio: 4 / 3; border-radius: 24px; }
.blogCard.isFeature .blogCardTitle { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.25; }
.blogCard.isFeature .blogCardExcerpt { -webkit-line-clamp: 3; font-size: 15px; }

/* =========================================================================
   Single post — superpower.com-style article.
   ========================================================================= */

/* ---------- Title band: copy left, rounded feature image right ----------- */
.postHero {
  background: var(--ivory);
  border-bottom: 1px solid rgba(16, 35, 29, .07);
  padding: calc(84px + clamp(32px, 4.5vw, 64px)) 0 clamp(36px, 5vw, 64px);
}
body.admin-bar .postHero { padding-top: calc(84px + 32px + clamp(32px, 4.5vw, 64px)); }
@media screen and (max-width: 782px) { body.admin-bar .postHero { padding-top: calc(84px + 46px + clamp(32px, 4.5vw, 64px)); } }

.postHeroGrid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(28px, 4vw, 64px); align-items: center;
}
.postHeroGrid.isTextOnly { grid-template-columns: minmax(0, 860px); }
/* Stacked hero reads title → image → share/AI actions (not actions first). */
@media (max-width: 860px) {
  .postHeroGrid { grid-template-columns: 1fr; gap: 20px; }
  .postHeroCopy { display: contents; }
  .postHeroCopy .innerCrumbs { margin-bottom: 0; }
  .postHeroMedia { order: 3; }
  .postActions { order: 4; margin-top: 4px; }
}

.postHeroCopy .innerCrumbs { margin-bottom: 22px; }
.postHeroCopy .innerCrumbs a { color: #2d7752; }
.postHeroCopy .innerCrumbs a:hover { color: var(--pine); }
.postHeroCopy .innerCrumbs span[aria-hidden] { color: #9bb0a6; }
.postHeroCopy .innerCrumbs .isCurrent { color: var(--ink); }
.postHeroTitle {
  margin: 0; color: var(--ink); font-weight: 560;
  font-size: clamp(30px, 3.8vw, 52px); line-height: 1.08; letter-spacing: -.02em;
  max-width: 20ch;
}
.postHeroMedia {
  margin: 0; overflow: hidden; border-radius: clamp(18px, 2vw, 26px);
  border: 1px solid rgba(16, 35, 29, .08);
  box-shadow: 0 40px 80px -48px rgba(6, 31, 25, .5);
}
.postHeroMedia img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }

/* ---------- Share + Summarize-with-AI action rows ------------------------ */
.postActions { display: flex; flex-wrap: wrap; gap: 28px 48px; margin-top: clamp(28px, 3.5vw, 44px); }
.postActionLabel {
  display: block; margin-bottom: 11px; color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.postActionRow { display: flex; flex-wrap: wrap; gap: 8px; }
.shareBtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); background: #fff; color: #34433c;
  font-size: 14px; font-weight: 640; font-family: inherit;
  transition: border-color .2s, color .2s, background .2s;
}
.shareBtn svg { width: 17px; height: 17px; }
/* Touch devices get full 44px tap targets. */
@media (pointer: coarse) {
  .shareBtn { width: 44px; height: 44px; }
  .aiPill { padding: 12px 18px; }
}
.shareBtn:hover { border-color: var(--green); color: var(--pine); }
.shareBtn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.shareBtn.isCopied { border-color: var(--green); background: var(--mint); color: var(--pine); }
.shareBtn.isCopied::after {
  content: "Copied"; position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  padding: 5px 10px; border-radius: 8px; background: var(--forest-deep); color: #eaf6ee;
  font-size: 11.5px; font-weight: 560; white-space: nowrap;
}
.aiPill {
  display: inline-flex; align-items: center; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: #34433c; text-decoration: none;
  font-size: 13.5px; font-weight: 540; transition: border-color .2s, color .2s;
}
.aiPill:hover { border-color: var(--green); color: var(--pine); }
.aiPill:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- Body: sticky byline sidebar + prose --------------------------- */
.postBody { background: var(--paper); padding-block: clamp(48px, 6vw, 96px); }
.postLayout {
  display: grid; grid-template-columns: 260px minmax(0, 720px);
  gap: clamp(36px, 5vw, 88px); justify-content: center; align-items: start;
}
@media (max-width: 860px) { .postLayout { grid-template-columns: minmax(0, 720px); } }
.postAside { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 860px) {
  .postAside { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
  .postAside .postPromo { flex: 1 1 250px; }
}
.postAsideLabel {
  display: block; margin-bottom: 6px; color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.postByline strong { display: block; color: var(--ink); font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.postBylineMeta { display: block; margin-top: 5px; color: var(--muted); font-size: 13.5px; }
.postPromo {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none;
  padding: 20px 22px; border-radius: 18px; color: #eaf6ee;
  background:
    radial-gradient(120% 140% at 85% -20%, #1c5a40 0%, rgba(28, 90, 64, 0) 60%),
    linear-gradient(150deg, #0b3026, #061f19);
  box-shadow: 0 26px 52px -32px rgba(6, 31, 25, .65);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s;
}
.postPromo:hover { transform: translateY(-3px); box-shadow: 0 34px 62px -32px rgba(6, 31, 25, .7); }
@media (prefers-reduced-motion: reduce) { .postPromo:hover { transform: none; } }
.postPromo strong { font-size: 15.5px; font-weight: 560; line-height: 1.35; letter-spacing: -.01em; }
.postPromo span { display: inline-flex; align-items: center; gap: 7px; color: #9bd1ae; font-size: 13.5px; font-weight: 560; }
.postPromo:hover span { color: #dcf7e5; }

/* Superpower-style oversized lede: the first paragraph opens big and dark. */
.postMain .innerProse > p:first-child {
  color: var(--ink); font-weight: 540;
  font-size: clamp(19px, 2.1vw, 27px); line-height: 1.42; letter-spacing: -.015em;
  margin-bottom: 1.4em;
}

/* ---------- Related articles slider --------------------------------------- */
.relatedWrap {
  background: var(--paper); border-top: 1px solid rgba(16, 35, 29, .07);
  padding-block: clamp(48px, 6vw, 88px);
}
.relatedHead {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-bottom: clamp(24px, 3vw, 36px);
}
.relatedHead h2 {
  margin: 0; color: var(--ink); font-weight: 560; letter-spacing: -.015em;
  font-size: clamp(24px, 3vw, 38px); line-height: 1.1;
}
.relatedNav { display: flex; gap: 8px; }
.relatedArrow {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 17px; font-family: inherit;
  transition: border-color .2s, color .2s, opacity .2s;
}
.relatedArrow:hover:not(:disabled) { border-color: var(--green); color: var(--pine); }
.relatedArrow:disabled { opacity: .35; cursor: default; }
.relatedArrow:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.relatedTrack {
  display: flex; gap: clamp(18px, 2.4vw, 28px);
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-bottom: 6px;
}
.relatedTrack::-webkit-scrollbar { display: none; }
.relatedTrack .blogCard { flex: 0 0 clamp(250px, 27vw, 340px); scroll-snap-align: start; }
@media (max-width: 620px) { .relatedTrack .blogCard { flex-basis: 82vw; } }

/* ---------- Prev / next --------------------------------------------------- */
.postNav {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(36px, 4vw, 56px); padding-top: 26px; border-top: 1px solid var(--line);
}
.postNav a { color: var(--pine); text-decoration: none; font-weight: 560; font-size: 15px; max-width: 42ch; }
.postNav a:hover { color: var(--ink); }
