/* ==========================================
   BYTEFRAME — BLOG
   Index listing (/blog) + article layout (/blog/<slug>)
   Loaded after styles.css, so the .blog-card rules there are the
   base and everything here is a deliberate override.
   blog.css
   ========================================== */

/* Screen-reader-only. Used for <caption> on the price tables, which need a
   programmatic label but would be redundant next to the heading above them. */
.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ─── LISTING CARDS ──────────────────────── */
/* Cards are typographic — no cover art. There are no post photographs, and a
   generated gradient plate reads as filler at this size. The category pill and
   the heading carry the card, the same way .service-card works. */
.bl-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1.25rem, 3vw, 1.75rem); }

/* Five posts fill two rows exactly: two leads at span 6, three at span 4. */
.bl-grid .blog-card { grid-column: span 4; }
.bl-grid .blog-card--lead { grid-column: span 6; }

/* styles.css gives .blog-card a span-3 default sized for the homepage teaser
   row. The related-posts grid is only three columns wide, so that default made
   every card span the whole row. */
.bl-related-grid .blog-card { grid-column: auto; }

.blog-card { position: relative; }
.blog-card:hover { border-color: var(--red); }
.bl-card-link { display: block; height: 100%; }

/* Corner numeral, the same device .service-card uses via data-num. */
.bl-grid .blog-card::after {
    content: attr(data-num);
    position: absolute; top: 1.4rem; right: 1.6rem;
    font-family: var(--font-display); font-size: .75rem; font-weight: 800;
    letter-spacing: .05em; color: var(--light-2);
    pointer-events: none;
}

.bl-card-inner {
    height: 100%; padding: clamp(1.4rem, 3vw, 1.75rem);
    display: flex; flex-direction: column; align-items: flex-start; gap: .7rem;
}
.blog-card--lead .bl-card-inner { padding: clamp(1.6rem, 3.5vw, 2.15rem); }

/* Icon plate at .service-icon scale. Deliberately small and inline: the earlier
   full-width gradient covers read as filler above the heading. */
.bl-card-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .2rem; }
.bl-icon {
    width: 44px; height: 44px; border-radius: var(--r-md); flex-shrink: 0;
    background: rgba(193,57,26,.08); color: var(--red);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--dur-base) var(--ease-standard);
}
.bl-icon svg { width: 21px; height: 21px; }
.blog-card:hover .bl-icon { background: rgba(193,57,26,.15); }

/* Meta and call to action sit in a ruled footer so the card has structure
   rather than four stacked paragraphs. */
.bl-card-foot {
    width: 100%; margin-top: auto; padding-top: 1rem;
    border-top: 1px solid var(--light-2);
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; flex-wrap: wrap;
}

/* One dark lead card for contrast, matching .service-card--cta. */
.blog-card--dark { background: var(--ink); border-color: var(--ink); }
.blog-card--dark:hover { border-color: var(--red); }
.bl-grid .blog-card--dark::after { color: rgba(255,255,255,.2); }
.blog-card--dark .bl-card-inner h2,
.blog-card--dark .bl-card-inner h3 { color: var(--paper); }
.blog-card--dark .bl-excerpt { color: rgba(255,255,255,.62); }
.blog-card--dark .bl-meta { color: rgba(255,255,255,.45); }
.blog-card--dark .bl-more { color: var(--red-light); }
.blog-card--dark .bl-card-foot { border-top-color: rgba(255,255,255,.13); }
.blog-card--dark .blog-category { background: rgba(255,255,255,.1); color: #f0846c; }
.blog-card--dark .bl-icon { background: rgba(255,255,255,.09); color: var(--red-light); }
.blog-card--dark:hover .bl-icon { background: rgba(255,255,255,.15); }

.bl-card-inner h2,
.bl-card-inner h3 {
    font-family: var(--font-display); font-weight: 700; line-height: 1.32;
    color: var(--dark); font-size: 1.12rem;
}
.blog-card--lead .bl-card-inner h2,
.blog-card--lead .bl-card-inner h3 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); }
.bl-excerpt { font-size: .92rem; color: var(--mid); line-height: 1.7; }
.blog-card--lead .bl-excerpt { font-size: .97rem; }

.bl-meta { font-size: .78rem; color: var(--mid); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.bl-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; flex-shrink: 0; }

.bl-more {
    margin-top: auto; padding-top: .9rem;
    display: inline-flex; align-items: center; gap: .45rem;
    font-family: var(--font-display); font-size: .85rem; font-weight: 700; color: var(--red);
    transition: gap var(--dur-fast) var(--ease-standard);
}
.blog-card:hover .bl-more { gap: .75rem; }
.bl-more svg { width: 15px; height: 15px; }

@media (max-width: 1000px) {
    .bl-grid .blog-card,
    .bl-grid .blog-card--lead { grid-column: span 6; }
}
@media (max-width: 680px) {
    .bl-grid .blog-card,
    .bl-grid .blog-card--lead { grid-column: span 12; }
}

/* ─── ARTICLE: HERO ──────────────────────── */
.article-hero {
    background: #000;
    padding: clamp(7.5rem, 14vw, 10rem) 0 clamp(3rem, 7vw, 4.5rem);
    position: relative; overflow: hidden;
}
.article-hero-bg {
    position: absolute; inset: 0; pointer-events: none;
}
.article-hero-bg::after {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 75% 30%, rgba(193,57,26,.15) 0%, transparent 55%),
        radial-gradient(ellipse at 5% 85%, rgba(30,58,95,.10) 0%, transparent 50%);
}
.article-hero .container { position: relative; z-index: 1; }
.article-hero-inner { max-width: 820px; }

.bl-crumbs {
    display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
    font-size: .8rem; color: rgba(255,255,255,.55); margin-bottom: 1.5rem;
}
.bl-crumbs a { color: rgba(255,255,255,.75); transition: color var(--dur-fast) var(--ease-standard); }
.bl-crumbs a:hover { color: var(--red-light); }
.bl-crumb-sep { opacity: .4; }
.bl-crumb-current { color: rgba(255,255,255,.45); }

.article-category {
    display: inline-block;
    padding: .32rem .8rem; margin-bottom: 1.1rem;
    background: rgba(193,57,26,.18); border: 1px solid rgba(193,57,26,.35);
    color: #f0846c;
    font-family: var(--font-display); font-size: .72rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; border-radius: var(--r-sm);
}
.article-title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 5vw, 3.05rem); font-weight: 800;
    line-height: 1.14; color: var(--paper); margin-bottom: 1.25rem;
}
.article-deck { font-size: clamp(1rem, 2vw, 1.18rem); color: rgba(255,255,255,.68); line-height: 1.75; max-width: 680px; }

.article-byline {
    display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
    margin-top: 2rem; padding-top: 1.75rem;
    border-top: 1px solid rgba(255,255,255,.1);
}
.article-byline img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.byline-name { font-family: var(--font-display); font-weight: 700; font-size: .92rem; color: var(--paper); }
.byline-name a { color: inherit; }
.byline-name a:hover { color: var(--red-light); }
.byline-meta { font-size: .8rem; color: rgba(255,255,255,.5); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .15rem; }

/* ─── ARTICLE: LAYOUT ────────────────────── */
.article-wrap { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(3.5rem, 8vw, 5.5rem); }
.article-layout {
    display: grid; grid-template-columns: 220px minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem); align-items: start;
}

/* Table of contents — plain anchors, so it works on the first paint with no JS. */
.article-toc { position: sticky; top: 100px; }
.article-toc h2 {
    font-family: var(--font-display); font-size: .72rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--mid);
    margin-bottom: .9rem;
}
.article-toc ol { list-style: none; display: flex; flex-direction: column; }
.article-toc a {
    display: block; padding: .42rem 0 .42rem .9rem;
    border-left: 2px solid var(--light-2);
    font-size: .85rem; line-height: 1.45; color: var(--mid);
    transition: color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.article-toc a:hover { color: var(--red); border-left-color: var(--red); }

@media (max-width: 1000px) {
    .article-layout { grid-template-columns: 1fr; gap: 2rem; }
    .article-toc {
        position: static;
        border: 1.5px solid var(--light-2); border-radius: var(--r-lg);
        padding: 1.25rem 1.35rem; background: var(--white);
    }
}

/* ─── ARTICLE: PROSE ─────────────────────── */
.article-prose { max-width: 720px; }
.article-prose > p { color: var(--mid); line-height: 1.85; margin-bottom: 1.15rem; font-size: 1.02rem; }
.article-prose > p.lead { font-size: 1.14rem; color: var(--dark); font-weight: 500; line-height: 1.8; margin-bottom: 1.75rem; }
.article-prose h2 {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3vw, 1.6rem); font-weight: 800; line-height: 1.25;
    color: var(--dark); margin: 3rem 0 .9rem;
    scroll-margin-top: 96px;
}
.article-prose h3 {
    font-family: var(--font-display);
    font-size: 1.08rem; font-weight: 700;
    color: var(--dark); margin: 1.9rem 0 .55rem;
    scroll-margin-top: 96px;
}
.article-prose ul, .article-prose ol { margin: 0 0 1.3rem 1.3rem; }
.article-prose ul { list-style: disc; }
.article-prose ol { list-style: decimal; }
.article-prose li { color: var(--mid); line-height: 1.8; margin-bottom: .55rem; padding-left: .25rem; }
.article-prose li::marker { color: var(--red); }
.article-prose a { color: var(--red); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.article-prose a:hover { color: var(--red-dark); }
.article-prose strong { color: var(--dark); font-weight: 700; }
.article-prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .87em; padding: .12em .4em;
    background: var(--light); border: 1px solid var(--light-2); border-radius: var(--r-sm);
    color: var(--dark);
}
.article-prose hr { border: none; border-top: 1px solid var(--light-2); margin: 2.5rem 0; }
.article-prose blockquote {
    margin: 1.75rem 0; padding: .35rem 0 .35rem 1.35rem;
    border-left: 3px solid var(--red);
    font-size: 1.05rem; line-height: 1.75; color: var(--dark); font-weight: 500;
}

/* ─── ARTICLE: FURNITURE ─────────────────── */
.bl-takeaways {
    background: var(--light); border: 1.5px solid var(--light-2);
    border-radius: var(--r-lg); padding: clamp(1.35rem, 3vw, 1.85rem);
    margin-bottom: 2.5rem;
}
.article-prose .bl-takeaways h2 {
    font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
    font-weight: 700; color: var(--red); margin: 0 0 .9rem;
}
.bl-takeaways ul { margin: 0 0 0 1.15rem; list-style: disc; }
.bl-takeaways li { color: var(--dark-3); font-size: .95rem; line-height: 1.7; margin-bottom: .5rem; }
.bl-takeaways li:last-child { margin-bottom: 0; }

.bl-callout {
    display: flex; gap: 1rem; align-items: flex-start;
    margin: 2rem 0; padding: 1.25rem 1.35rem;
    background: rgba(193,57,26,.06);
    border: 1px solid rgba(193,57,26,.18);
    border-radius: var(--r-lg);
}
.bl-callout-icon { flex-shrink: 0; color: var(--red); margin-top: .15rem; line-height: 0; }
.bl-callout-icon svg { width: 20px; height: 20px; }
.article-prose .bl-callout p { margin: 0; font-size: .94rem; line-height: 1.75; color: var(--dark-3); }
.article-prose .bl-callout p + p { margin-top: .6rem; }

/* Tables scroll inside their own box rather than widening the page. */
.bl-table-wrap { overflow-x: auto; margin: 1.75rem 0; border: 1.5px solid var(--light-2); border-radius: var(--r-lg); }
.bl-table-wrap table { border-collapse: collapse; width: 100%; min-width: 540px; font-size: .9rem; }
.bl-table-wrap th, .bl-table-wrap td { padding: .8rem 1rem; text-align: left; vertical-align: top; line-height: 1.6; }
.bl-table-wrap thead th {
    font-family: var(--font-display); font-size: .74rem; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase; color: var(--dark);
    background: var(--light); border-bottom: 1.5px solid var(--light-2);
}
.bl-table-wrap tbody tr + tr td { border-top: 1px solid var(--light-2); }
.bl-table-wrap td { color: var(--mid); }
.bl-table-wrap td:first-child { color: var(--dark); font-weight: 600; }

/* ─── ARTICLE: AUTHOR CARD ───────────────── */
.bl-author {
    display: flex; gap: 1.25rem; align-items: flex-start;
    max-width: 720px; margin-top: 3.5rem; padding-top: 2rem;
    border-top: 1px solid var(--light-2);
}
.bl-author img { width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.bl-author h2 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: .15rem; }
.bl-author-role { font-size: .84rem; color: var(--red); font-weight: 600; margin-bottom: .6rem; }
.bl-author p { font-size: .92rem; color: var(--mid); line-height: 1.75; }
.bl-author a { color: var(--red); font-weight: 600; }
.bl-author a:hover { text-decoration: underline; }

/* ─── RELATED POSTS ──────────────────────── */
.bl-related { background: var(--light); padding: clamp(3rem, 7vw, 4.5rem) 0; }
.bl-related-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.bl-related-head h2 { font-family: var(--font-display); font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 800; color: var(--dark); }
.bl-related-head a { font-family: var(--font-display); font-size: .85rem; font-weight: 700; color: var(--red); }
.bl-related-head a:hover { text-decoration: underline; }
.bl-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 1000px) { .bl-related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px)  { .bl-related-grid { grid-template-columns: 1fr; } }

/* ─── INDEX HERO NOTE ────────────────────── */
.bl-hero-note {
    display: inline-flex; align-items: center; gap: .6rem;
    margin-top: 1.75rem; padding: .55rem 1rem;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
    border-radius: 99px; font-size: .82rem; color: rgba(255,255,255,.7);
}
.bl-hero-note svg { width: 15px; height: 15px; color: var(--red-light); flex-shrink: 0; }
