/* =====================================================================
   Hypogen v2 — blog listing (page-blog.php) and single post (single.php).
   A style layer over the existing bp-/sp- markup (JS: AJAX listing, TOC
   scroll-spy, subscribe form keep working). Loaded after blog-page.css /
   single-post.css; every rule is prefixed with "html body .bp-page / .sp-page" so it also beats
   the Customizer "Additional CSS" (post 587), which restyles bp-/sp- with
   two-class selectors and prints after all theme styles.
   ===================================================================== */

.bp-page, .sp-page {
    --hg-bg: #0B0D0F;
    --hg-surface: #121518;
    --hg-surface-2: #181C20;
    --hg-surface-3: #20252A;
    --hg-line: rgba(247, 247, 247, .08);
    --hg-line-2: rgba(247, 247, 247, .14);
    --hg-text: #F7F7F7;
    --hg-muted: rgba(247, 247, 247, .66);
    --hg-muted-2: rgba(247, 247, 247, .46);
    --hg-accent: #FF9626;
    --hg-accent-2: #FFB35F;
    --hg-accent-soft: rgba(255, 150, 38, .12);
    --hg-accent-line: rgba(255, 150, 38, .32);
    --hg-radius: 20px;
    --hg-font: "SFUIDisplay", "SF UI Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --hg-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    background: var(--hg-bg);
    font-family: var(--hg-font);
    -webkit-font-smoothing: antialiased;
}
html body .bp-page .cp-container, html body .sp-page .cp-container { max-width: 1360px; padding-left: clamp(16px, 4vw, 40px); padding-right: clamp(16px, 4vw, 40px); }

/* Shared: breadcrumbs as a mono kicker */
html body .bp-page .bp-listing__breadcrumbs, html body .sp-page .sp-hero__breadcrumbs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-start;
    font-family: var(--hg-mono); font-size: 12px; line-height: 18px; letter-spacing: .08em; text-transform: uppercase; color: var(--hg-muted-2); margin: 0;
}
html body .bp-page .bp-listing__crumb, html body .sp-page .sp-hero__crumb { color: var(--hg-muted-2); font-size: inherit; font-weight: 400; text-decoration: none; transition: color .2s; }
html body .bp-page a.bp-listing__crumb:hover, html body .sp-page a.sp-hero__crumb:hover { color: var(--hg-text); }
html body .bp-page .bp-listing__crumb--current, html body .sp-page .sp-hero__crumb--current { color: var(--hg-accent); }
html body .bp-page .bp-listing__crumb-sep, html body .sp-page .sp-hero__crumb-sep { color: var(--hg-line-2); }

/* =====================================================================
   BLOG LISTING
   ===================================================================== */
html body .bp-page .bp-listing { padding: 150px 0 clamp(72px, 9vw, 128px); }
html body .bp-page .bp-listing__intro { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; text-align: left; max-width: 900px; margin: 0 0 clamp(36px, 4vw, 56px); }
html body .bp-page .bp-listing__heading { font-size: clamp(36px, 5vw, 64px); line-height: 1.05; font-weight: 500; letter-spacing: -.03em; text-align: left; text-wrap: balance; margin: 0; color: var(--hg-text); }
html body .bp-page .bp-listing__heading span { color: var(--hg-accent); }
html body .bp-page .bp-listing__heading br { display: inline; } /* blog-page.css hides it on mobile, gluing words together */
html body .bp-page .bp-listing__desc { font-size: 18px; line-height: 1.55; color: var(--hg-muted); text-align: left; max-width: 680px; margin: 0; }

/* Toolbar: search pill + category segmented control in one bar */
html body .bp-page .bp-listing__toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px; margin-bottom: 24px; border-radius: 999px; background: var(--hg-surface); border: 1px solid var(--hg-line);
}
html body .bp-page .bp-listing__search { box-sizing: border-box; min-width: 0; max-width: 100%; margin: 0; flex: 0 1 360px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--hg-surface-3); }
html body .bp-page .bp-listing__search:focus-within { box-shadow: 0 0 0 1px var(--hg-accent-line); }
html body .bp-page .bp-listing__search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--hg-text); font: 400 15px/1 var(--hg-font); outline: none; padding: 0; }
html body .bp-page .bp-listing__search-input::placeholder { color: var(--hg-muted-2); }
html body .bp-page .bp-listing__filters { display: flex; flex-wrap: wrap; gap: 4px; }
html body .bp-page .bp-listing__filter { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 999px; font-size: 14px; color: var(--hg-muted); background: none; text-decoration: none; transition: background-color .2s, color .2s; }
html body .bp-page .bp-listing__filter:hover { color: var(--hg-text); }
html body .bp-page .bp-listing__filter.is-active { background: var(--hg-accent); color: #0B0D0F; }

/* Cards */
html body .bp-page .bp-listing__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; }
html body .bp-page .bp-listing__card {
    display: flex; flex-direction: column; padding: 8px; border-radius: var(--hg-radius);
    background: var(--hg-surface); border: 1px solid var(--hg-line); transition: border-color .25s, transform .25s;
}
html body .bp-page .bp-listing__card:hover { border-color: var(--hg-accent-line); transform: translateY(-2px); }
html body .bp-page .bp-listing__img-wrap { display: block; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--hg-surface-2); }
html body .bp-page .bp-listing__img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
html body .bp-page .bp-listing__card:hover .bp-listing__img { transform: scale(1.03); }
html body .bp-page .bp-listing__card-content { display: flex; flex-direction: column; gap: 12px; padding: 20px 16px 8px; flex: 1; }
html body .bp-page .bp-listing__title { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 500; letter-spacing: -.01em; }
html body .bp-page .bp-listing__title-link { color: var(--hg-text); text-decoration: none; }
html body .bp-page .bp-listing__title-link:hover { color: var(--hg-accent); }
html body .bp-page .bp-listing__meta { order: -1; display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--hg-mono); font-size: 12px; line-height: 18px; color: var(--hg-muted-2); }
html body .bp-page .bp-listing__meta > * { font-size: inherit; font-weight: 400; color: inherit; }
html body .bp-page .bp-listing__read { color: var(--hg-accent); }
html body .bp-page .bp-listing__excerpt { margin: 0; font-size: 15px; line-height: 1.6; color: var(--hg-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
html body .bp-page .bp-listing__card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 8px 4px; padding: 14px 8px 8px; border-top: 1px solid var(--hg-line); }
html body .bp-page .bp-listing__views { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--hg-muted-2); }
html body .bp-page .bp-listing__share { display: flex; align-items: center; gap: 6px; }
html body .bp-page .bp-listing__share-label { font-size: 13px; color: var(--hg-muted-2); margin-right: 4px; }
html body .bp-page .bp-listing__share-link { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; opacity: .8; transition: opacity .2s, transform .2s; }
html body .bp-page .bp-listing__share-link:hover { opacity: 1; transform: translateY(-1px); }
html body .bp-page .bp-listing__share-link svg { width: 28px; height: 28px; }

/* Show more */
html body .bp-page .bp-listing__more-wrap { margin-top: 24px; }
html body .bp-page .bp-listing__more {
    display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; border-radius: 999px;
    border: 1px solid var(--hg-line-2); background: var(--hg-surface); color: var(--hg-text); font-size: 15px; font-weight: 500; text-decoration: none; transition: border-color .2s, background-color .2s;
}
html body .bp-page .bp-listing__more:hover { border-color: var(--hg-accent); background: var(--hg-accent-soft); }
html body .bp-page .bp-listing__empty { padding: 48px 24px; border-radius: var(--hg-radius); border: 1px dashed var(--hg-line-2); text-align: center; color: var(--hg-muted); font-size: 16px; }

@media (max-width: 860px) {
    html body .bp-page .bp-listing { padding-top: 120px; }
    html body .bp-page .bp-listing__toolbar { border-radius: 20px; flex-direction: column; align-items: stretch; }
    html body .bp-page .bp-listing__search { flex: none; width: 100%; }
    html body .bp-page .bp-listing__filters { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    html body .bp-page .bp-listing__filter { flex: none; }
}

/* =====================================================================
   SINGLE POST
   ===================================================================== */
html body .sp-page .sp-hero { padding: 140px 0 0; }
html body .sp-page .sp-hero__layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center;
    padding: clamp(24px, 3vw, 40px); border-radius: 28px; background: var(--hg-surface); border: 1px solid var(--hg-line);
}
html body .sp-page .sp-hero--no-image .sp-hero__layout { grid-template-columns: minmax(0, 1fr); }
html body .sp-page .sp-hero__content { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
html body .sp-page .sp-hero__label {
    display: inline-flex; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--hg-accent-line); background: var(--hg-accent-soft);
    -webkit-text-fill-color: var(--hg-accent-2); color: var(--hg-accent-2); font-size: 13px; font-weight: 500; margin: 0;
}
html body .sp-page .sp-hero__title { margin: 0; font-size: clamp(32px, 3.6vw, 52px); line-height: 1.08; font-weight: 500; letter-spacing: -.025em; text-wrap: balance; color: var(--hg-text); }
html body .sp-page .sp-hero__title-accent { color: var(--hg-accent); }
html body .sp-page .sp-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-top: 20px; border-top: 1px solid var(--hg-line); width: 100%; font-size: 14px; color: var(--hg-muted); }
html body .sp-page .sp-hero__author { color: var(--hg-text); }
html body .sp-page .sp-hero__read { color: var(--hg-accent); }
html body .sp-page .sp-hero__media { border-radius: 18px; overflow: hidden; background: var(--hg-surface-2); aspect-ratio: 16 / 11; }
html body .sp-page .sp-hero__img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

/* Article: sticky aside (TOC + subscribe) + reading column */
html body .sp-page .sp-article { padding: clamp(40px, 5vw, 72px) 0 clamp(72px, 9vw, 128px); }
html body .sp-page .sp-article__layout { grid-template-columns: 280px minmax(0, 780px); gap: clamp(32px, 5vw, 72px); justify-content: center; }
html body .sp-page .sp-article--no-toc .sp-article__layout { grid-template-columns: minmax(0, 780px); }
html body .sp-page .sp-article__aside { width: auto; top: 112px; display: flex; flex-direction: column; gap: 16px; }

html body .sp-page .sp-toc { padding: 22px; border-radius: 18px; background: var(--hg-surface); border: 1px solid var(--hg-line); }
html body .sp-page .sp-toc__title { margin: 0 0 14px; font-family: var(--hg-mono); font-size: 12px; line-height: 18px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; color: var(--hg-accent); }
html body .sp-page .sp-toc__title::before { content: "// "; opacity: .6; }
html body .sp-page .sp-toc__list { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--hg-line); margin: 0; padding: 0; }
html body .sp-page .sp-toc__link { display: block; margin-left: -1px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; font-size: 14px; line-height: 1.4; color: var(--hg-muted); text-decoration: none; transition: color .2s, border-color .2s; }
html body .sp-page .sp-toc__link:hover { color: var(--hg-text); }
html body .sp-page .sp-toc__link.is-active { color: var(--hg-text); border-left-color: var(--hg-accent); font-weight: 400; }

html body .sp-page .sp-subscribe,
html body .sp-page .sp-toc + .sp-subscribe {
    margin: 0; padding: 24px 22px; border-radius: 18px; border: 1px solid var(--hg-accent-line);
    background: radial-gradient(120% 90% at 100% 0%, rgba(255, 150, 38, .28), transparent 60%), var(--hg-surface);
}
html body .sp-page .sp-toc + .sp-subscribe { margin-top: 0; }
html body .sp-page .sp-subscribe__heading { font-size: 20px; line-height: 1.25; font-weight: 500; letter-spacing: -.01em; color: var(--hg-text); }
html body .sp-page .sp-subscribe__text { font-size: 14px; line-height: 1.5; color: var(--hg-muted); }
html body .sp-page .sp-subscribe__input { height: 46px; border-radius: 999px; padding: 0 16px; background: var(--hg-surface-3); border: 1px solid var(--hg-line-2); color: var(--hg-text); font-size: 14px; }
html body .sp-page .sp-subscribe__input::placeholder { color: var(--hg-muted-2); }
html body .sp-page .sp-subscribe__input:focus { border-color: var(--hg-accent); outline: none; }
html body .sp-page .sp-subscribe__btn { min-height: 46px; border-radius: 999px; padding: 4px 4px 4px 18px; background: var(--hg-accent); color: #0B0D0F; font-size: 14px; font-weight: 500; }
html body .sp-page .sp-subscribe__btn:hover { background: var(--hg-accent-2); }
html body .sp-page .sp-subscribe__btn-icon { width: 38px; height: 38px; border-radius: 50%; background: #0B0D0F; }
html body .sp-page .sp-subscribe__btn-icon svg path { stroke: var(--hg-accent); }

/* Reading column: no card, comfortable type */
html body .sp-page .sp-content__body { --sp-card-pad: clamp(20px, 3vw, 40px); padding: 0; background: none; border: 0; border-radius: 0; font-size: 17px; line-height: 1.75; color: rgba(247, 247, 247, .82); }
html body .sp-page .sp-content__body > * + * { margin-top: 20px; }
html body .sp-page .sp-content__body b, html body .sp-page .sp-content__body strong { color: var(--hg-text); font-weight: 500; }
html body .sp-page .sp-content__body .has-lead-font-size { font-size: clamp(20px, 2vw, 24px); line-height: 1.5; color: var(--hg-text); letter-spacing: -.01em; }
html body .sp-page .sp-content__body a { color: var(--hg-accent-2); text-decoration: underline; text-decoration-color: var(--hg-accent-line); text-underline-offset: 3px; }
html body .sp-page .sp-content__body a:hover { text-decoration-color: currentColor; }
html body .sp-page .sp-content__body > h2,
html body .sp-page .sp-content__body > h2:first-child,
html body .sp-page .sp-content__body > .sp-article__anchor:first-child + h2 { font-size: clamp(26px, 2.4vw, 32px); line-height: 1.2; font-weight: 500; letter-spacing: -.02em; color: var(--hg-text); scroll-margin-top: 110px; }
html body .sp-page .sp-content__body > * + h2 { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--hg-line); }
html body .sp-page .sp-content__body > h3 { font-size: 22px; line-height: 1.3; font-weight: 500; color: var(--hg-text); }
html body .sp-page .sp-content__body > * + h3 { margin-top: 36px; }
html body .sp-page .sp-content__body > h4, html body .sp-page .sp-content__body > h5, html body .sp-page .sp-content__body > h6 { color: var(--hg-text); font-weight: 500; }
html body .sp-page .sp-content__body > ul li::before { background-color: var(--hg-accent); border-radius: 2px; }
html body .sp-page .sp-content__body > ol > li::before { color: var(--hg-accent); font-family: var(--hg-mono); }
html body .sp-page .sp-content__body > ul li + li, html body .sp-page .sp-content__body > ol li + li { margin-top: 8px; }
html body .sp-page .sp-content__body > .wp-block-quote { padding: 20px 24px; border-left: 0; border-radius: 16px; background: var(--hg-accent-soft); border: 1px solid var(--hg-accent-line); color: var(--hg-text); font-style: normal; }
html body .sp-page .sp-content__body > .wp-block-pullquote { border: 0; padding: 32px 0; border-top: 1px solid var(--hg-accent-line); border-bottom: 1px solid var(--hg-accent-line); font-size: 24px; line-height: 1.4; color: var(--hg-text); }
html body .sp-page .sp-content__body figure img { border-radius: 16px; }
html body .sp-page .sp-content__body figcaption { color: var(--hg-muted-2); }
html body .sp-page .sp-content__body .wp-block-table { border: 1px solid var(--hg-line); border-radius: 16px; overflow-x: auto; }
html body .sp-page .sp-content__body table { border-collapse: collapse; width: 100%; }
html body .sp-page .sp-content__body td, html body .sp-page .sp-content__body th { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--hg-line); vertical-align: top; }
html body .sp-page .sp-content__body tr:last-child td { border-bottom: 0; }
html body .sp-page .sp-content__body thead td, html body .sp-page .sp-content__body thead th { background: var(--hg-surface-2); color: var(--hg-text); font-weight: 500; }
html body .sp-page .sp-content__body .wp-block-separator { border: 0; border-top: 1px solid var(--hg-line); margin: 40px 0; }
html body .sp-page .sp-content__body code { background: var(--hg-surface-3); border-radius: 6px; padding: .1em .4em; }
html body .sp-page .sp-content__body pre { background: var(--hg-surface); border: 1px solid var(--hg-line); border-radius: 16px; }

/* TL;DR block: grey slab → accent card */
html body .sp-page .sp-content__body > .sp-tldr {
    margin: 32px 0; padding: clamp(24px, 3vw, 36px); border-radius: 20px;
    background: radial-gradient(100% 120% at 0% 0%, rgba(255, 150, 38, .14), transparent 60%), var(--hg-surface);
    border: 1px solid var(--hg-accent-line);
}
html body .sp-page .sp-tldr h2, html body .sp-page .sp-tldr .wp-block-heading { margin: 0 0 18px; padding: 0; border: 0; font-family: var(--hg-mono); font-size: 14px; line-height: 20px; letter-spacing: .1em; text-transform: uppercase; color: var(--hg-accent); }
html body .sp-page .sp-tldr h2::before { content: "// "; opacity: .6; }
html body .sp-page .sp-tldr li, html body .sp-page .sp-tldr p { font-size: 16px; line-height: 1.6; color: rgba(247, 247, 247, .86); }
html body .sp-page .sp-tldr li + li { margin-top: 10px; }

@media (max-width: 1024px) {
    html body .sp-page .sp-hero { padding-top: 110px; }
    html body .sp-page .sp-hero__layout { grid-template-columns: minmax(0, 1fr); }
    html body .sp-page .sp-hero__media { order: -1; }
    html body .sp-page .sp-article__layout, html body .sp-page .sp-article--no-toc .sp-article__layout { grid-template-columns: minmax(0, 1fr); }
    html body .sp-page .sp-article__aside { position: static; }
}
@media (max-width: 600px) {
    html body .sp-page .sp-hero__layout { padding: 16px; border-radius: 22px; }
    html body .sp-page .sp-content__body { font-size: 16px; }
}
