/* The blog's reading styles (2026-11-05): the library filters, the article's reading layout and prose, the
   contents list, the progress bar, previous/next, and the security-alerts sign-up (pop-up and end block).
   Colours come from the --pp-* tokens in app.css and the white-on-black alphas the site already uses; no new
   brand colours. Public Tailwind is precompiled, so new looks live here, never in new utility classes.
   Everything is readable and usable without JavaScript; public/js/blog.js only enhances. */

/* ── Library filters: search + Topic / Where dropdowns ─────────────────────────── */
.bf { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: stretch; position: relative; }
.bf-search { position: relative; display: flex; flex: 1 1 22rem; min-width: 0; max-width: 36rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.15); border-radius: 0.75rem; transition: border-color .2s; }
.bf-search:focus-within { border-color: var(--pp-blue); box-shadow: 0 0 0 3px rgba(0,85,255,0.18); }
.bf-search-icon { position: absolute; left: 0.95rem; top: 50%; width: 1.1rem; height: 1.1rem; transform: translateY(-50%); color: rgba(255,255,255,0.4); pointer-events: none; }
.bf-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff;
    font-size: 1rem; padding: 0.8rem 0.75rem 0.8rem 2.6rem; -webkit-appearance: none; appearance: none; }
.bf-search input::placeholder { color: rgba(255,255,255,0.32); }
.bf-search input::-webkit-search-decoration, .bf-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.bf-search button { margin: 0.3rem; padding: 0 1.1rem; border-radius: 0.55rem; background: #fff; color: var(--pp-dark);
    font-weight: 600; font-size: 0.875rem; cursor: pointer; transition: background .2s; }
.bf-search button:hover { background: rgba(255,255,255,0.78); }
.bf-search button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.bf-menus { display: flex; gap: 0.75rem; flex: 0 1 auto; }
.bf-menu { position: relative; }
.bf-menu > summary { list-style: none; display: flex; align-items: center; gap: 0.6rem; height: 100%; min-height: 3.1rem;
    padding: 0 1rem; border: 1px solid rgba(255,255,255,0.15); border-radius: 0.75rem; background: rgba(255,255,255,0.04);
    color: #fff; cursor: pointer; user-select: none; white-space: nowrap; transition: border-color .2s, background .2s; }
.bf-menu > summary::-webkit-details-marker { display: none; }
.bf-menu > summary:hover { border-color: rgba(255,255,255,0.35); }
.bf-menu > summary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bf-menu[open] > summary { border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.07); }
.bf-k { font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.bf-v { font-size: 0.9375rem; font-weight: 500; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-chev { width: 1rem; height: 1rem; color: rgba(255,255,255,0.55); transition: transform .2s; flex: none; }
.bf-menu[open] .bf-chev { transform: rotate(180deg); }

.bf-panel { position: absolute; z-index: 40; top: calc(100% + 0.5rem); left: 0; width: 20rem; max-width: calc(100vw - 3rem);
    max-height: min(26rem, 62vh); overflow-y: auto; overscroll-behavior: contain; padding: 0.4rem;
    background: #121214; border: 1px solid rgba(255,255,255,0.12); border-radius: 0.9rem;
    box-shadow: 0 24px 48px rgba(0,0,0,0.55); }
.bf-panel ul { list-style: none; margin: 0; padding: 0; }
.bf-panel a { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 0.55rem;
    color: rgba(255,255,255,0.72); font-size: 0.9375rem; text-decoration: none; }
.bf-panel a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.bf-panel a:focus-visible { outline: 2px solid #fff; outline-offset: -2px; color: #fff; }
.bf-panel a[aria-current="page"] { color: #fff; font-weight: 600; background: rgba(0,85,255,0.14); }
.bf-name { flex: 1; min-width: 0; }
.bf-count { font-size: 0.8125rem; color: rgba(255,255,255,0.45); font-variant-numeric: tabular-nums; }
.bf-check { width: 0.95rem; height: 0.95rem; flex: none; visibility: hidden; color: #6f9dff; }
.bf-panel a[aria-current="page"] .bf-check { visibility: visible; }
.bf-group { margin: 0.6rem 0.75rem 0.3rem; padding-top: 0.6rem; border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.45); }

@media (max-width: 640px) {
    .bf-search { flex-basis: 100%; max-width: none; }
    .bf-menus { flex: 1 1 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); position: relative; }
    /* On a phone each list opens across the whole filter row, not inside its half. */
    .bf-menu { position: static; min-width: 0; }
    /* The label sits above the value so a long place name still fits half a 320px screen. */
    .bf-menu > summary { position: relative; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.15rem;
        min-width: 0; min-height: 3.4rem; padding: 0.45rem 2.2rem 0.45rem 0.9rem; }
    .bf-k { font-size: 0.625rem; }
    .bf-v { max-width: 100%; }
    .bf-chev { position: absolute; right: 0.8rem; top: 50%; margin-top: -0.5rem; }
    .bf-menu[open] .bf-chev { transform: rotate(180deg); }
    .bf-panel { width: auto; left: 0; right: 0; max-width: none; }
}

/* ── Article: reading layout ───────────────────────────────────────────────────── */
.art-head, .art-layout, .art-cover {
    --measure: 40rem; --toc: 14rem; --gap: 4.5rem;
    margin-inline: auto; padding-inline: 1.5rem; max-width: calc(var(--measure) + 3rem); }
.art-cover { max-width: calc(56rem + 3rem); }
@media (min-width: 1200px) {
    .art-head.has-toc, .art-layout.has-toc, .art-cover.has-toc { max-width: calc(var(--toc) + var(--gap) + var(--measure) + 3rem); }
    /* The title block spans the full reading width, left-aligned with the contents column, at a headline measure. */
    .art-head.has-toc > * { max-width: 50rem; }
    .art-layout.has-toc { display: grid; grid-template-columns: var(--toc) minmax(0, var(--measure)); column-gap: var(--gap); align-items: start; }
}

/* The reading column: min-width 0 lets long words, code and tables shrink inside the grid instead of widening it. */
.art-main { min-width: 0; }

/* app.css sets overflow-x:hidden on html and body, which makes body a scroll container that never scrolls, so a
   sticky element inside it never sticks. overflow-x:clip hides the same sideways overflow without creating a scroll
   container. Only on pages that load this stylesheet, and only where clip is supported (else: as before). */
@supports (overflow-x: clip) {
    html:has(.art-layout.has-toc), html:has(.art-layout.has-toc) body { overflow-x: clip; }
}

/* The contents list: a quiet sticky column (wide screens), a collapsible block (phones and tablets). */
.art-toc { display: none; }
@media (min-width: 1200px) {
    .art-toc { display: block; position: sticky; top: 8rem; max-height: calc(100vh - 10rem); overflow-y: auto; padding-right: 0.25rem; }
    .art-toc-mobile { display: none; }
}
.art-toc-label { font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 0.9rem; }
.art-toc ol, .art-toc-mobile ol { list-style: none; margin: 0; padding: 0; }
.art-toc ol { border-left: 1px solid rgba(255,255,255,0.1); }
.art-toc a { display: block; margin-left: -1px; padding: 0.4rem 0 0.4rem 1rem; border-left: 2px solid transparent;
    color: rgba(255,255,255,0.55); font-size: 0.875rem; line-height: 1.45; text-decoration: none; transition: color .2s, border-color .2s; }
.art-toc a:hover { color: #fff; }
.art-toc a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; color: #fff; }
.art-toc a.is-active { color: #fff; border-left-color: var(--pp-blue); }

.art-toc-mobile { margin-bottom: 2.25rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 0.9rem; background: rgba(255,255,255,0.025); }
.art-toc-mobile > summary { list-style: none; display: flex; align-items: center; gap: 1rem;
    padding: 0.95rem 1.15rem; cursor: pointer; color: #fff; font-weight: 600; font-size: 0.9375rem; }
.art-toc-mobile > summary::-webkit-details-marker { display: none; }
.art-toc-mobile > summary span { margin-left: auto; font-weight: 400; font-size: 0.8125rem; color: rgba(255,255,255,0.5); }
.art-toc-mobile > summary::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 1.5px solid rgba(255,255,255,0.6);
    border-bottom: 1.5px solid rgba(255,255,255,0.6); transform: rotate(45deg) translateY(-2px); flex: none; }
.art-toc-mobile[open] > summary::after { transform: rotate(225deg) translateY(-2px); }
.art-toc-mobile > summary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 0.9rem; }
.art-toc-mobile nav { padding: 0 1.15rem 1rem; }
.art-toc-mobile ol { counter-reset: s; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 0.6rem; }
.art-toc-mobile li { counter-increment: s; }
.art-toc-mobile a { display: flex; gap: 0.75rem; padding: 0.5rem 0; color: rgba(255,255,255,0.72); font-size: 0.9375rem; text-decoration: none; line-height: 1.45; }
.art-toc-mobile a::before { content: counter(s); color: rgba(255,255,255,0.45); font-variant-numeric: tabular-nums; min-width: 1.1rem; }
.art-toc-mobile a:hover, .art-toc-mobile a:focus-visible { color: #fff; }

/* Reading progress: a 2px line at the very top, filled by blog.js. Hidden until the script runs. */
.art-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1100; pointer-events: none; opacity: 0; }
.art-progress.is-on { opacity: 1; }
.art-progress span { display: block; height: 100%; background: var(--pp-blue); transform-origin: 0 50%; transform: scaleX(0); }

/* ── Prose: rendered markdown, dark theme, long-form rhythm ────────────────────── */
.blog-prose { color: rgba(255,255,255,0.78); font-size: 1.125rem; line-height: 1.78; overflow-wrap: break-word; }
.blog-prose > :first-child { margin-top: 0; }
.blog-prose h2 { color: #fff; font-weight: 700; font-size: 1.7rem; line-height: 1.25; letter-spacing: -0.02em;
    margin: 3.2rem 0 1rem; padding-top: 0.25rem; scroll-margin-top: 7.5rem; }
.blog-prose h3 { color: #fff; font-weight: 600; font-size: 1.25rem; line-height: 1.35; margin: 2.2rem 0 0.75rem; scroll-margin-top: 7.5rem; }
.blog-prose h4 { color: rgba(255,255,255,0.92); font-weight: 600; font-size: 1.05rem; margin: 1.8rem 0 0.6rem; }
.blog-prose p { margin-bottom: 1.4rem; }
.blog-prose a { color: #6f9dff; text-decoration: underline; text-decoration-color: rgba(111,157,255,0.45); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.blog-prose a:hover { color: #9dbcff; text-decoration-color: currentColor; }
.blog-prose a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 2px; }
.blog-prose strong { color: rgba(255,255,255,0.95); font-weight: 600; }
.blog-prose ul, .blog-prose ol { margin: 0 0 1.4rem 1.4rem; padding-left: 0.2rem; }
.blog-prose ul { list-style: disc; }
.blog-prose ol { list-style: decimal; }
.blog-prose li { margin-bottom: 0.55rem; padding-left: 0.25rem; }
.blog-prose li::marker { color: rgba(255,255,255,0.45); }
.blog-prose li > ul, .blog-prose li > ol { margin-top: 0.55rem; margin-bottom: 0; }
.blog-prose blockquote { border-left: 2px solid var(--pp-blue); padding: 0.2rem 0 0.2rem 1.4rem; margin: 2rem 0;
    color: rgba(255,255,255,0.7); font-size: 1.15rem; line-height: 1.7; }
.blog-prose blockquote p:last-child { margin-bottom: 0; }
.blog-prose code { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 0.12em 0.4em;
    font-size: 0.86em; color: #ffb780; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.blog-prose pre { background: #0c0c10; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 1.1rem 1.3rem; overflow-x: auto; margin: 2rem 0;
    font-size: 0.9rem; line-height: 1.6; }
.blog-prose pre code { background: none; border: none; padding: 0; color: rgba(255,255,255,0.82); font-size: inherit; }
.blog-prose img { border-radius: 12px; margin: 2rem 0; }
.blog-prose hr { border: 0; border-top: 1px solid rgba(255,255,255,0.1); margin: 3rem 0; }
/* Tables (first used by the PHP2Shell post, 2026-10-21): full width; scroll sideways on narrow phones instead of squashing. */
.blog-prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 2rem 0; font-size: 0.95rem; line-height: 1.5;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; overflow: hidden; }
@media (max-width: 640px) { .blog-prose table { display: block; overflow-x: auto; } }
.blog-prose thead th { background: rgba(255,255,255,0.05); color: #fff; font-weight: 600; text-align: left; }
.blog-prose th, .blog-prose td { padding: 0.75rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.08); vertical-align: top; }
.blog-prose th + th, .blog-prose td + td { border-left: 1px solid rgba(255,255,255,0.06); }
.blog-prose tbody tr:last-child td { border-bottom: none; }
.blog-prose tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.blog-prose td strong { color: #fff; }
@media (max-width: 640px) {
    .blog-prose { font-size: 1.0625rem; line-height: 1.75; }
    .blog-prose h2 { font-size: 1.45rem; margin-top: 2.6rem; }
}

/* ── Previous / next ───────────────────────────────────────────────────────────── */
.art-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,0.08);
    border-top: 1px solid rgba(255,255,255,0.08); border-bottom: 1px solid rgba(255,255,255,0.08); padding-inline: 0 !important; }
.art-pager > * { background: var(--pp-dark); }
.art-pager-link { display: flex; flex-direction: column; gap: 0.45rem; padding: 1.6rem 1.5rem; text-decoration: none; transition: background .2s; }
.art-pager-link.is-next { text-align: right; align-items: flex-end; }
.art-pager-link:hover { background: #111113; }
.art-pager-link:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.art-pager-k { font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.art-pager-t { color: #fff; font-weight: 600; line-height: 1.4; max-width: 30rem; }
.art-pager-link:hover .art-pager-t { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 640px) {
    .art-pager { grid-template-columns: 1fr; }
    .art-pager-none { display: none; }
    .art-pager-link.is-next { text-align: left; align-items: flex-start; }
}

/* ── Security-alerts sign-up: shared form, end-of-article block, pop-up ────────── */
.ba-eyebrow { font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin-bottom: 0.9rem; }
.ba-lede { color: rgba(255,255,255,0.68); font-size: 1rem; line-height: 1.65; max-width: 36rem; }

.blog-alerts .sa-form { margin-top: 1.5rem; }
.blog-alerts .sa-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 0.6rem; align-items: end; }
.blog-alerts .sa-field { display: flex; flex-direction: column; min-width: 0; }
.blog-alerts .sa-field .label { display: block; font-size: 0.8125rem; font-weight: 500; color: rgba(255,255,255,0.65); margin-bottom: 0.45rem; }
.blog-alerts .sa-field .label span { color: rgba(255,255,255,0.42); font-weight: 400; }
.blog-alerts .sa-field input { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.15); border-radius: 0.75rem;
    padding: 0.8rem 1rem; color: #fff; font-size: 1rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.blog-alerts .sa-field input::placeholder { color: rgba(255,255,255,0.3); }
.blog-alerts .sa-field input:focus { border-color: var(--pp-blue); box-shadow: 0 0 0 3px rgba(0,85,255,0.2); }
.blog-alerts .sa-field input[aria-invalid="true"] { border-color: #f87171; }
.blog-alerts .sa-button { height: 3.05rem; padding: 0 1.4rem; border-radius: 0.75rem; background: var(--pp-blue); color: #fff;
    font-weight: 600; font-size: 0.9375rem; white-space: nowrap; cursor: pointer; transition: background .2s; }
.blog-alerts .sa-button:hover { background: var(--pp-blue-dark); }
.blog-alerts .sa-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.blog-alerts .sa-error { margin-top: 0.75rem; color: #fca5a5; font-size: 0.875rem; }
.blog-alerts .sa-consent { margin-top: 0.9rem; font-size: 0.8125rem; line-height: 1.55; color: rgba(255,255,255,0.5); }
.blog-alerts .sa-consent a { color: rgba(255,255,255,0.75); text-decoration: underline; text-underline-offset: 3px; }
.blog-alerts .sa-form > p.text-white\/30 { color: rgba(255,255,255,0.4); }
@media (max-width: 720px) {
    .blog-alerts .sa-row { grid-template-columns: 1fr; }
    .blog-alerts .sa-button { width: 100%; }
}

.ba-end { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid rgba(255,255,255,0.1); }
.ba-end-title { color: #fff; font-weight: 700; font-size: 1.6rem; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 0.75rem; }

/* The pop-up: a native modal <dialog>, opened only by blog.js. */
.ba-dialog { width: min(36rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); margin: auto; padding: 0; overflow: auto;
    color: #fff; background: #0f0f11; border: 1px solid rgba(255,255,255,0.12); border-radius: 1.1rem;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6); }
.ba-dialog::backdrop { background: rgba(0,0,0,0.62); }
.ba-dialog[open] { animation: ba-in .28s cubic-bezier(.2,.7,.2,1); }
@keyframes ba-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.ba-inner { position: relative; padding: 2.25rem 2rem 1.6rem; }
.ba-close { position: absolute; top: 0.9rem; right: 0.9rem; width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
    border-radius: 999px; color: rgba(255,255,255,0.65); cursor: pointer; transition: background .2s, color .2s; }
.ba-close svg { width: 1.15rem; height: 1.15rem; }
.ba-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ba-close:focus-visible, .ba-later:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ba-title { font-size: 1.6rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.025em; margin: 0 2rem 0.9rem 0; outline: none; }
.ba-dialog .blog-alerts .sa-row { grid-template-columns: 1fr 1fr; }
.ba-dialog .blog-alerts .sa-button { grid-column: 1 / -1; width: 100%; }
.ba-later { display: block; margin: 1.1rem auto 0; padding: 0.4rem 0.8rem; font-size: 0.875rem; color: rgba(255,255,255,0.55);
    text-decoration: underline; text-underline-offset: 3px; cursor: pointer; border-radius: 0.4rem; }
.ba-later:hover { color: #fff; }
@media (max-width: 520px) {
    .ba-inner { padding: 2rem 1.25rem 1.25rem; }
    .ba-title { font-size: 1.35rem; }
    .ba-dialog .blog-alerts .sa-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .ba-dialog[open] { animation: none; }
    .bf-chev, .art-toc a, .bf-search { transition: none; }
}
