/* Blog and recommendations.
   Uses the site's existing custom properties so both themes work without
   a second palette to maintain. */

.container-narrow { max-width: 46rem; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.hero-compact { padding: 3rem 0 2rem; }

/* --- breadcrumb --- */
.breadcrumb { margin: 1.5rem 0 0.5rem; font-size: 0.9rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem;
                 padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem;
                              color: var(--text-muted); }
.breadcrumb [aria-current="page"] { color: var(--text-muted); }

/* --- badges: post kind and provenance --- */
.post-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem;
               padding: 0; margin: 0.75rem 0; }
.badge {
    display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px;
    font-size: 0.8rem; font-weight: 600; text-decoration: none;
    border: 1px solid var(--border-color); color: var(--text-primary);
    background: var(--bg-secondary); line-height: 1.6;
}
a.badge:hover, a.badge:focus { border-color: var(--accent-color);
                               color: var(--accent-color); }
.badge-kind { border-color: var(--accent-color); color: var(--accent-color); }

/* Provenance is deliberately distinct from topic tags — a reader should be
   able to tell machine-compiled from lived experience at a glance. */
.badge-authorship { font-weight: 500; }
.badge-ai-generated,
.badge-ai-assisted { border-style: dashed; color: var(--text-secondary); }

/* --- topics --- */
.topic-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem;
              padding: 0; margin: 0.75rem 0; }
.topic {
    display: inline-block; padding: 0.15rem 0.55rem; border-radius: 4px;
    font-size: 0.8rem; text-decoration: none;
    background: var(--bg-tertiary); color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.topic:hover, .topic:focus { color: var(--accent-color);
                             border-color: var(--accent-color); }

/* --- filters --- */
.filters { margin: 0 0 1.5rem; }
.filters-label { font-size: 0.85rem; text-transform: uppercase;
                 letter-spacing: 0.05em; color: var(--text-muted);
                 margin: 0 0 0.5rem; }
.filters ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem;
              padding: 0; margin: 0; }
.filters a {
    display: inline-block; padding: 0.35rem 0.8rem; border-radius: 999px;
    border: 1px solid var(--border-color); text-decoration: none;
    color: var(--text-secondary); font-size: 0.9rem;
}
.filters a:hover, .filters a:focus { border-color: var(--accent-color);
                                     color: var(--accent-color); }
.filters a[aria-current="page"] {
    background: var(--accent-color); color: var(--text-inverse);
    border-color: var(--accent-color);
}
.count { opacity: 0.7; font-size: 0.85em; }

/* --- listing --- */
.blog-listing { padding: 1rem 0 4rem; }
.post-grid { display: grid; gap: 1.25rem;
             grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.post-card { border: 1px solid var(--border-color); border-radius: 10px;
             padding: 1.25rem; background: var(--bg-tertiary); }
.post-card-title { margin: 0 0 0.35rem; font-size: 1.15rem; }
.post-card-title a { text-decoration: none; color: var(--text-primary); }
.post-card-title a:hover, .post-card-title a:focus { color: var(--accent-color); }
.post-meta { color: var(--text-muted); font-size: 0.875rem; margin: 0; }
.post-summary { margin: 0.6rem 0 0; color: var(--text-secondary); }
.empty-state { color: var(--text-muted); padding: 2rem 0; }

/* --- single post --- */
.post { padding: 0 0 4rem; }
.post-header { margin: 1rem 0 1.5rem; }
.post-header h1 { margin: 0 0 0.4rem; }
.post-image { margin: 1.5rem 0; }
.post-image img { width: 100%; height: auto; border-radius: 10px; }
.post-image figcaption { color: var(--text-muted); font-size: 0.9rem;
                         margin-top: 0.5rem; }
.post-body { font-size: 1.05rem; line-height: 1.7; }
.post-body h2 { margin-top: 2rem; }
.post-body h3 { margin-top: 1.5rem; }
.post-body a { color: var(--accent-color); }
.post-body img { max-width: 100%; height: auto; }
.post-body blockquote {
    border-left: 3px solid var(--border-color); margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1rem; color: var(--text-secondary);
}
.post-body code { background: var(--bg-secondary); padding: 0.1rem 0.35rem;
                  border-radius: 4px; font-size: 0.92em; }
.post-body pre { background: var(--bg-secondary); padding: 1rem;
                 border-radius: 8px; overflow-x: auto; }
.post-footer { margin-top: 2.5rem; padding-top: 1.25rem;
               border-top: 1px solid var(--border-color); }

/* --- provenance note --- */
.provenance {
    border: 1px dashed var(--border-color); border-radius: 10px;
    padding: 0.9rem 1.1rem; margin: 1.25rem 0; background: var(--bg-secondary);
}
.provenance-heading { font-size: 0.85rem; text-transform: uppercase;
                      letter-spacing: 0.05em; color: var(--text-muted);
                      margin: 0 0 0.35rem; }
.provenance p { margin: 0; color: var(--text-secondary); font-size: 0.95rem; }

.sources { margin-top: 2.5rem; padding-top: 1.25rem;
           border-top: 1px solid var(--border-color); }
.sources h2 { font-size: 1.1rem; }
.sources ul { color: var(--text-secondary); font-size: 0.95rem; }

/* --- products --- */
.products { padding: 1rem 0 4rem; }
.review-note { color: var(--text-muted); font-size: 0.9rem; }
.product-category { margin: 2.5rem 0 0; }
.product-category h3 { border-bottom: 1px solid var(--border-color);
                       padding-bottom: 0.5rem; }
.product-list { list-style: none; padding: 0; margin: 1rem 0 0;
                display: grid; gap: 1rem; }
.product { border: 1px solid var(--border-color); border-radius: 10px;
           padding: 1.25rem; background: var(--bg-tertiary); }
.product-head { display: flex; flex-wrap: wrap; align-items: baseline;
                gap: 0.6rem; }
.product-head h4 { margin: 0; font-size: 1.1rem; }
.product-head a { color: var(--text-primary); }
.product-head a:hover, .product-head a:focus { color: var(--accent-color); }
.price { color: var(--text-muted); font-size: 0.9rem; }
.status { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
          padding: 0.15rem 0.5rem; border-radius: 4px;
          border: 1px solid var(--border-color); color: var(--text-secondary); }
.product-superseded, .product-withdrawn { opacity: 0.75; }

.product-detail { margin: 0.85rem 0 0; }
.product-detail dt { font-size: 0.8rem; text-transform: uppercase;
                     letter-spacing: 0.04em; color: var(--text-muted);
                     margin-top: 0.7rem; }
.product-detail dd { margin: 0.15rem 0 0; color: var(--text-secondary); }
.reviewed { margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.reviewed-stale { color: var(--text-primary); font-weight: 600; }

/* Focus must stay visible — WCAG 2.4.7. */
.badge:focus-visible, .topic:focus-visible, .filters a:focus-visible,
.post-card-title a:focus-visible, .product-head a:focus-visible {
    outline: 3px solid var(--accent-color); outline-offset: 2px;
}

@media (max-width: 640px) {
    .post-grid { grid-template-columns: 1fr; }
    .post-body { font-size: 1rem; }
}

/* --- news: a list of links and summaries, not an article ---------------- */

.news-latest { padding: 1rem 0 2rem; }
.news-latest-header h2 { margin-bottom: 0.25rem; }
.news-latest-header h2 a { color: inherit; text-decoration: none; }
.news-latest-header h2 a:hover,
.news-latest-header h2 a:focus { color: var(--accent-color);
                                 text-decoration: underline; }

/* The editorial note above the list. Set apart so it doesn't read as one of
   the stories. */
.news-note {
    border-left: 3px solid var(--accent-color);
    padding: 0.25rem 0 0.25rem 1rem;
    margin: 1.5rem 0 2rem;
    color: var(--text-secondary);
}
.news-note p { margin: 0 0 0.75rem; }
.news-note p:last-child { margin-bottom: 0; }

.news-list { list-style: none; padding: 0; margin: 0; counter-reset: news; }
.news-item {
    padding: 1.25rem 0;
    border-top: 1px solid var(--border-color);
}
.news-item:last-child { border-bottom: 1px solid var(--border-color); }
.news-item-title { margin: 0 0 0.25rem; font-size: 1.15rem; line-height: 1.35; }
.news-item-title a { text-decoration: none; }
.news-item-title a:hover, .news-item-title a:focus { text-decoration: underline; }
/* External destination is the point of this page — make it visible rather
   than a surprise. */
.news-item-title a::after {
    content: " ↗"; font-size: 0.85em; color: var(--text-muted);
}
.news-item-source {
    margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.news-item-summary { margin: 0; color: var(--text-secondary); }

.news-permalink { margin: 1.5rem 0 0; font-size: 0.9rem; }

.also-considered {
    margin: 2rem 0 0; padding: 1rem 1.25rem;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 8px; font-size: 0.92rem; color: var(--text-secondary);
}
.also-heading { font-size: 0.95rem; margin: 0 0 0.5rem; }
.also-considered p { margin: 0; }

.news-archive { padding: 2rem 0; border-top: 1px solid var(--border-color); }
.edition-card {
    padding: 1.25rem; border: 1px solid var(--border-color);
    border-radius: 8px; background: var(--bg-tertiary);
}
.edition-card-title { margin: 0 0 0.35rem; font-size: 1.05rem; }
.edition-card-title a { text-decoration: none; }
.edition-card-title a:hover, .edition-card-title a:focus { text-decoration: underline; }

.news-about { padding: 1rem 0 3rem; color: var(--text-secondary); }
.news-about h2 { font-size: 1.1rem; }

/* --- newsletter signup -------------------------------------------------- */

.newsletter {
    margin: 2rem 0; padding: 1.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color); border-radius: 10px;
}
.newsletter-heading { margin: 0 0 0.5rem; font-size: 1.25rem; }
.newsletter-blurb { margin: 0 0 1rem; color: var(--text-secondary); }

.newsletter-form {
    display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end;
}
.newsletter-field { display: flex; flex-direction: column; gap: 0.3rem;
                    flex: 1 1 16rem; }
.newsletter-field label { font-size: 0.9rem; font-weight: 600; }
.newsletter-form input[type="email"] {
    padding: 0.65rem 0.8rem; font-size: 1rem; font-family: inherit;
    color: var(--text-primary); background: var(--bg-primary);
    border: 1px solid var(--border-color); border-radius: 6px;
    min-height: 44px;   /* WCAG 2.5.5 target size */
}
.newsletter-form input[type="email"]:focus-visible,
.newsletter .btn:focus-visible {
    outline: 3px solid var(--accent-color); outline-offset: 2px;
}
.newsletter .btn { min-height: 44px; }
.newsletter-fallback { margin: 0; }
.newsletter-note {
    margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--text-muted);
}

@media (max-width: 480px) {
    .newsletter-form { flex-direction: column; align-items: stretch; }
    .newsletter .btn { width: 100%; }
}

/* --- fix: the site's bare `header` selector leaks into content ----------- */

/* style.css styles `header` unqualified — sticky, z-index 100, nav-coloured
   background. That is intended for the site header, but it also catches the
   <header> inside an <article>, giving post and edition headers a grey bar
   that sticks to the top of the viewport while you scroll. Scope it back. */
main header {
    background-color: transparent;
    box-shadow: none;
    position: static;
    z-index: auto;
}

/* --- projects ----------------------------------------------------------- */

.project-card {
    padding: 1.25rem; border: 1px solid var(--border-color);
    border-radius: 8px; background: var(--bg-tertiary);
}
.project-card-ask { margin: 0.75rem 0 0; font-size: 0.92rem; }

/* Status is the honest bit — an idea should not look like a shipped thing. */
.badge-status { border-style: dashed; }
.badge-released { border-style: solid; border-color: var(--accent-color);
                  color: var(--accent-color); }
.badge-testing, .badge-building { color: var(--text-secondary); }
.badge-idea, .badge-paused { color: var(--text-muted); }

.project-facts {
    display: grid; grid-template-columns: max-content 1fr;
    gap: 0.35rem 1rem; margin: 2rem 0 0; padding-top: 1rem;
    border-top: 1px solid var(--border-color); font-size: 0.92rem;
}
.project-facts dt { color: var(--text-muted); }
.project-facts dd { margin: 0; }

.project-teasers { list-style: none; padding: 0; margin: 1.5rem 0; }
.project-teasers li {
    padding: 1rem 0; border-top: 1px solid var(--border-color);
}
.project-teasers li:last-child { border-bottom: 1px solid var(--border-color); }
.project-teasers li > a { font-weight: 600; font-size: 1.1rem; }
.project-teasers .teaser-kind {
    font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.04em; margin-left: 0.35rem;
}
.project-teasers p { margin: 0.35rem 0 0; color: var(--text-secondary); }

.projects-note { padding: 2rem 0 3rem; border-top: 1px solid var(--border-color); }

/* --- current asks -------------------------------------------------------
   Kept visually quiet on purpose. These are real requests, but a home page
   that shouts about what it needs reads as a fundraising letter. */
.asks { padding: 1rem 0 2rem; }
.asks-heading { font-size: 1.15rem; margin-bottom: 0.75rem; }
.asks-list { list-style: none; padding: 0; margin: 0; }
.asks-list > li {
    padding: 1rem 1.25rem; border-left: 3px solid var(--accent-color);
    background: var(--bg-secondary); border-radius: 0 8px 8px 0;
}
.asks-list > li + li { margin-top: 0.75rem; }
.asks-list p { margin: 0 0 0.75rem; color: var(--text-secondary); }
.asks-list p:last-child { margin-bottom: 0; }

/* Project renders are square 800px OpenSCAD exports on a pale ground — cap
   the height so a model does not push the text off the first screen. */
.project-page .post-image img {
    max-height: 26rem;
    width: auto;
    margin: 0 auto;
    display: block;
}
.project-page .post-image {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

/* --- release progress ---------------------------------------------------- */

.release {
    margin: 2rem 0; padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color); border-radius: 10px;
}
.release h2 { margin-top: 0; font-size: 1.15rem; }
.release-stage { margin: 0 0 1rem; color: var(--text-secondary); }
.release-count { margin: 0 0 0.6rem; font-size: 1.05rem; }

.release-bar {
    height: 12px; border-radius: 999px; overflow: hidden;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
}
.release-bar > span {
    display: block; height: 100%; background: var(--accent-color);
    min-width: 2px;
}
.release-note, .release-updated {
    margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--text-muted);
}
.release-blocked {
    margin: 1rem 0 0; padding: 0.75rem 1rem;
    border-left: 3px solid var(--accent-color);
    background: var(--bg-tertiary); border-radius: 0 6px 6px 0;
    font-size: 0.95rem;
}

.release-steps { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.release-step {
    padding: 0.75rem 0; border-top: 1px solid var(--border-color);
}
.release-step p { margin: 0.3rem 0 0; color: var(--text-secondary);
                  font-size: 0.92rem; }
/* Status as a word, not a colour — colour alone fails WCAG 1.4.1 and is
   exactly the thing this site should not get wrong. */
.release-step-status {
    display: inline-block; min-width: 5.5rem;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted);
}
.release-current .release-step-status { color: var(--accent-color); font-weight: 700; }
.release-done > strong { color: var(--text-muted); }

/* --- news, before there is any news -------------------------------------- */

.news-soon { padding: 1rem 0 2.5rem; }
.beat-list { margin: 1.25rem 0 0; }
.beat-list dt {
    font-weight: 600; margin-top: 1.1rem;
    padding-top: 1.1rem; border-top: 1px solid var(--border-color);
}
.beat-list dt:first-child { border-top: none; padding-top: 0; margin-top: 0.5rem; }
.beat-list dd { margin: 0.3rem 0 0; color: var(--text-secondary); }

/* --- images in posts ------------------------------------------------------
   Renders are square 800px exports on a pale ground. Unconstrained they fill
   the viewport and push the text off the first screen, which for a render
   that is illustrating a point rather than being the point is backwards. */
.post .post-image img,
.post-body img {
    max-height: 22rem;
    width: auto;
    max-width: 100%;
    margin: 1.5rem auto;
    display: block;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
}
.post .post-image {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

/* --- "you can have this today" ------------------------------------------
   The most useful fact about a project is whether a reader can get hold of
   it. It was three pages deep in prose; it belongs on the first screen. */
.btn-small { padding: 0.35rem 0.85rem; font-size: 0.9rem; }
.teaser-get, .card-get { margin: 0.6rem 0 0; }
.project-get { margin: 1.25rem 0; }
.teaser-caveat {
    display: block; margin-top: 0.35rem;
    font-size: 0.85rem; color: var(--text-muted);
}

/* --- contributor terms --------------------------------------------------- */
.contrib-terms { padding: 1rem 0 2rem; }
.terms-list { margin: 1.25rem 0; }
.terms-list dt {
    font-weight: 600; margin-top: 1.1rem; padding-top: 1.1rem;
    border-top: 1px solid var(--border-color);
}
.terms-list dt:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.terms-list dd { margin: 0.3rem 0 0; color: var(--text-secondary); }

/* Multi-step availability. Getting hold of something is not always one click,
   and a single button that skips a required step sends people to a page
   telling them they are not allowed in. */
.get-steps { list-style: none; padding: 0; margin: 1rem 0 0; }
.get-steps > li { margin-bottom: 0.9rem; }
.get-steps .btn { margin-bottom: 0.2rem; }
.teaser-get .btn + .btn, .card-get .btn + .btn { margin-left: 0.4rem; }
