/* ==========================================================================
   Blog layer — structural styles only (feed, cards, article, TOC, help box,
   help form). Each site's theme.css gives the look.
   ========================================================================== */
.feed { display: grid; gap: clamp(22px, 3vw, 36px); }
.feed-filter { display: flex; flex-wrap: wrap; gap: 10px; }
.feed-filter button { font-family: var(--f-label); font-size: 13px; font-weight: 600; letter-spacing: .04em; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line-strong); color: var(--heading); transition: background-color .3s, color .3s, border-color .3s; }
.feed-filter button:hover { border-color: var(--accent); }
.feed-filter button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(18px, 2.4vw, 30px); }
.feed article.card[hidden] { display: none !important; }
.card { position: relative; min-width: 0; }
.card-link { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: transform .45s var(--ease-out), box-shadow .45s; }
.card-link:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-art { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.card-art svg { width: 70%; height: 70%; }
.card-num { position: absolute; left: 16px; bottom: 10px; font-family: var(--f-display); font-size: 28px; color: var(--accent); opacity: .85; }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 24px; flex: 1; }
.card-body h3 { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.2; overflow-wrap: anywhere; }
.card-body p { color: var(--muted); font-size: 15px; margin: 0; }
.card-meta { margin-top: auto; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.tag { align-self: flex-start; display: inline-block; font-family: var(--f-label); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.dot-sep { opacity: .6; }

/* Article */
.read-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 120; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.post-hero { position: relative; padding: calc(var(--header-h) + clamp(40px, 6vw, 80px)) 0 clamp(40px, 6vw, 70px); overflow: hidden; }
.post-hero .ph-art { position: absolute; inset: 0; pointer-events: none; }
.post-hero .container { position: relative; }
.post-hero h1 { font-size: clamp(34px, 5.4vw, 72px); line-height: 1.05; max-width: 18ch; margin: 12px 0 18px; overflow-wrap: break-word; hyphens: auto; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; color: var(--muted); margin-top: 18px; }
.post-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(30px, 5vw, 80px); padding-top: clamp(30px, 5vw, 60px); padding-bottom: clamp(40px, 6vw, 80px); align-items: start; }
.toc-wrap { position: sticky; top: calc(var(--header-h-small) + 24px); }
.toc-title { font-family: var(--f-label); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; padding: 7px 10px; border-left: 2px solid var(--line); font-size: 14.5px; line-height: 1.35; color: var(--muted); transition: color .3s, border-color .3s, background-color .3s; }
.toc a::before { content: counter(toc, decimal-leading-zero); font-variant-numeric: tabular-nums; opacity: .7; }
.toc a:hover, .toc a.is-active { color: var(--heading); border-left-color: var(--accent); }
.post-body { max-width: 72ch; font-size: clamp(16.5px, 1.2vw, 18.5px); line-height: 1.75; min-width: 0; }
.post-body h2 { font-size: clamp(26px, 2.8vw, 38px); line-height: 1.15; margin: 2.2em 0 .6em; scroll-margin-top: calc(var(--header-h-small) + 24px); }
.post-body h2:first-child { margin-top: 0; }
.post-body h3 { font-size: clamp(20px, 1.8vw, 24px); margin: 1.6em 0 .4em; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.1em; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li { margin-bottom: .45em; }
.post-body .tip { margin: 1.6em 0; padding: 20px 22px; border-radius: var(--radius); background: var(--surface-2); border-left: 4px solid var(--accent); }
.post-body .tip strong:first-child { display: block; font-family: var(--f-label); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.post-body .checklist { list-style: none; padding: 0; }
.post-body .checklist li { position: relative; padding-left: 30px; }
.post-body .checklist li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.post-body figure { margin: 2em 0; }
.post-body figure svg { width: 100%; height: auto; }
.post-body figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.help-box { margin: 2.2em 0; padding: clamp(22px, 3vw, 34px); border-radius: var(--radius-lg); background: var(--surface); border: 1.5px solid var(--accent); box-shadow: var(--shadow); }
.help-kicker { display: block; font-family: var(--f-label); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.help-title { font-family: var(--f-display); font-size: clamp(22px, 2.2vw, 30px); color: var(--heading); line-height: 1.2; margin: 8px 0 8px; }
.help-text { color: var(--muted); margin: 0 0 18px; }
.help-box .btn { white-space: normal; text-align: center; }
.related-title { font-size: clamp(28px, 3.4vw, 44px); margin-bottom: 30px; }
.next-article { margin-top: clamp(30px, 5vw, 60px); padding-top: 26px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.next-article a { font-family: var(--f-display); font-size: clamp(22px, 2.6vw, 34px); color: var(--heading); line-height: 1.2; }
.next-article a:hover { color: var(--accent); }
.np-label { font-family: var(--f-label); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 999px) {
  .post-layout { grid-template-columns: 1fr; }
  .toc-wrap { position: static; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
}

/* Help page */
.help-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(30px, 5vw, 80px); align-items: start; }
.help-aside { position: sticky; top: calc(var(--header-h-small) + 24px); padding: clamp(22px, 3vw, 34px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.help-aside h2 { font-size: clamp(24px, 2.4vw, 32px); margin-bottom: 12px; }
.help-contact { display: grid; gap: 8px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.help-contact p { margin: 0; }
.help-contact address { font-style: normal; }
.topics { border: 0; margin: 0; padding: 0; min-width: 0; }
.topics legend { font-family: var(--f-label); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: var(--label-case); color: var(--muted); margin-bottom: 12px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 11px 18px; border-radius: 999px; border: 1.5px solid var(--line-strong); font-size: 14.5px; font-weight: 600; color: var(--heading); background: var(--surface); transition: background-color .3s, color .3s, border-color .3s; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.topic-err { display: none; margin: 10px 0 0; font-size: 13px; color: var(--error, #c0392b); }
.topics.invalid .topic-err { display: block; }
.topics.invalid .chip span { border-color: var(--error, #c0392b); }
#help-success .ref { display: inline-block; margin: 16px 0 22px; padding: 10px 18px; border: 1.5px dashed var(--accent); border-radius: var(--radius); font-family: var(--f-label); font-weight: 700; letter-spacing: .12em; color: var(--accent); }
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-aside { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .card-link, .card-link:hover { transition: none; transform: none; }
}
