/* ============================================================
   Applied Architecture Series
   Supplemental styles layered on top of site.css.
   Load order: site.css first (tokens, fonts, header/footer,
   newsletter, .cta-button), then this file.
   Scope: everything here is namespaced to series elements so it
   never collides with the general brief/article styles in site.css.
   ============================================================ */

/* ── Article Header (dark hero) ── */
.article-header {
    background: var(--ink);
    padding: 4.5rem 3rem 3.5rem;
    border-top: 4px solid var(--acid);
}
.article-header-inner { max-width: 940px; margin: 0 auto; }
.article-kicker {
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--acid);
    margin-bottom: 1.1rem;
}
.article-title {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--bg);
    line-height: 1.08;
    letter-spacing: -.025em;
    margin-bottom: 1rem;
    max-width: 700px;
}
.article-subtitle {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-style: italic;
    color: rgba(244,244,240,.55);
    max-width: 600px;
    line-height: 1.55;
    margin-bottom: 2.25rem;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    font-family: var(--font-mono);
    font-size: .65rem;
    color: rgba(244,244,240,.4);
    text-transform: uppercase;
    letter-spacing: .1em;
    border-top: 1px solid rgba(244,244,240,.12);
    padding-top: 1rem;
}

/* ── Article Body ── */
.article-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 3.5rem 2rem 2rem;
}
.article-body p {
    font-size: 1.0rem;
    line-height: 1.78;
    color: var(--text, #2a2a2a);
    margin-bottom: 1rem;
}
.article-body p:last-child { margin-bottom: 0; }
.article-body p strong { color: var(--ink); font-weight: 600; }

/* ── Lede ── */
.lede {
    font-size: 1.12rem;
    line-height: 1.75;
    color: var(--ink);
    font-weight: 400;
    margin-bottom: 2.25rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--ink);
}

/* ── Section ── */
.section { margin-bottom: 2.75rem; }
.section-label {
    font-family: var(--font-mono);
    font-size: .62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--cobalt);
    margin-bottom: .5rem;
}
.section-heading {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 3vw, 1.6rem);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -.015em;
    line-height: 1.22;
    margin-bottom: 1.1rem;
}

/* ── Pull Quote ── */
.pull-quote {
    border-left: 3px solid var(--cobalt);
    margin: 2rem 0;
    padding: .85rem 1.5rem;
    background: rgba(0,71,255,.04);
    border-radius: 0 4px 4px 0;
}
.pull-quote p {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--ink);
    line-height: 1.55;
    margin: 0;
    font-weight: 400;
}

/* ── Inline links inside the body ── */
.article-body a:not(.cta-button) {
    color: var(--cobalt);
    border-bottom: 1px solid rgba(0,71,255,.35);
}
.article-body a:not(.cta-button):hover {
    border-bottom-color: var(--cobalt);
}

/* ── Contrast table (before / after) ── */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: .5rem 0 .5rem;
    font-size: .9rem;
}
.article-body caption {
    caption-side: bottom;
    text-align: left;
    font-family: var(--font-mono);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    padding-top: .85rem;
}
.article-body thead th {
    font-family: var(--font-mono);
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    text-align: left;
    color: var(--ink);
    border-bottom: 2px solid var(--ink);
    padding: .55rem .9rem .55rem 0;
    vertical-align: bottom;
}
.article-body thead th.col-after { color: var(--cobalt); }
.article-body tbody th {
    font-family: var(--font-body);
    font-weight: 600;
    text-align: left;
    color: var(--ink);
    border-bottom: 1px solid var(--rule);
    padding: .65rem .9rem .65rem 0;
    vertical-align: top;
    line-height: 1.45;
    width: 22%;
}
.article-body tbody td {
    border-bottom: 1px solid var(--rule);
    padding: .65rem .9rem .65rem 0;
    vertical-align: top;
    line-height: 1.5;
    color: var(--text, #2a2a2a);
    font-size: .86rem;
}
.article-body td.col-after {
    background: rgba(0,71,255,.03);
    padding-left: .9rem;
}

/* ── Diagram Wrapper ── */
.diagram-wrap {
    max-width: 940px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
}
.diagram-label {
    font-family: var(--font-mono);
    font-size: .62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .13em;
    color: var(--muted);
    margin-bottom: .65rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.diagram-label::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 2px;
    background: var(--cobalt);
    flex-shrink: 0;
}
.diagram {
    background: #fff;
    border: 1px solid rgba(17,17,17,.08);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    font-family: var(--font-body);
}

/* ── Diagram 1: Layer Stack ── */
.arch-d-header {
    background: var(--ink);
    padding: .8rem 1.25rem;
    border-top: 3px solid var(--cobalt);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.arch-d-header span { font-family: var(--font-mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(244,244,240,.4); }
.arch-d-header strong { font-family: var(--font-mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: var(--acid); font-weight: 600; }
.arch-layer-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    min-height: 52px;
    border-bottom: 1px solid rgba(17,17,17,.06);
    padding: .55rem 1rem;
    gap: .85rem;
}
.arch-layer-row:last-child { border-bottom: none; }
.aln { font-family: var(--font-mono); font-size: .58rem; font-weight: 600; color: var(--cobalt); text-align: center; }
.ala { font-family: var(--font-heading); font-size: .92rem; font-weight: 600; color: var(--ink); line-height: 1.2; }
.alb { font-size: .7rem; color: var(--muted); line-height: 1.45; margin-top: .18rem; }
.altag {
    font-family: var(--font-mono);
    font-size: .57rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
    padding: .2rem .55rem; border-radius: 3px; white-space: nowrap;
}
.al7 { border-left: 3px solid var(--cobalt); }
.al6 { border-left: 3px solid #3366cc; background: rgba(0,71,255,.02); }
.al5 { border-left: 3px solid #999; }
.asec { border-left: 3px solid var(--acid); background: rgba(223,255,0,.03); }

/* ── Diagram 2: Cycle ── */
.spdr {
    display: grid;
    grid-template-columns: 1fr 28px 1fr 28px 1fr 28px 1fr;
    align-items: stretch;
    padding: 1.5rem;
    gap: 0;
}
.spdr-step {
    background: var(--bg);
    border: 1px solid rgba(17,17,17,.08);
    border-radius: 5px;
    padding: 1.1rem;
}
.spdr-num { font-family: var(--font-mono); font-size: .57rem; font-weight: 600; color: var(--cobalt); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .25rem; }
.spdr-name { font-family: var(--font-heading); font-size: .95rem; font-weight: 600; color: var(--ink); margin-bottom: .4rem; line-height: 1.2; }
.spdr-desc { font-size: .72rem; color: var(--muted); line-height: 1.5; }
.spdr-arrow { display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--cobalt); opacity: .4; }
.spdr-step.highlight { border-color: var(--cobalt); border-width: 1.5px; }
.spdr-step.highlight .spdr-num { color: var(--ink); }

/* ── Diagram 3: Use Case Grid ── */
.uc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .6rem;
    padding: 1.25rem;
}
.uc-card { border-radius: 5px; overflow: hidden; border: 1px solid rgba(17,17,17,.07); }
.uc-header {
    padding: .4rem .7rem;
    font-family: var(--font-mono);
    font-size: .57rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: #fff;
}
.uc-body { padding: .65rem .7rem; background: #fff; }
.uc-body h4 { font-family: var(--font-body); font-size: .72rem; font-weight: 700; color: var(--ink); margin-bottom: .2rem; }
.uc-body p { font-size: .65rem; color: var(--muted); line-height: 1.45; margin: 0; }

/* ── Rule ── */
.rule { border: none; border-top: 1px solid var(--rule); margin: 2.75rem 0; }

/* ── Article End ── */
.article-end {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2rem 3.5rem;
}
.article-end-inner {
    border-top: 2px solid var(--ink);
    padding-top: 1.75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}
.end-col h4 { font-family: var(--font-heading); font-size: .95rem; font-weight: 600; color: var(--ink); margin-bottom: .45rem; }
.end-col p { font-size: .78rem; color: var(--muted); line-height: 1.65; margin: 0; }
.end-col a { color: var(--cobalt); border-bottom: 1px solid rgba(0,71,255,.35); }

/* ── Responsive ── */
@media (max-width: 760px) {
    .article-header { padding: 3rem 1.5rem 2.5rem; }
    .diagram-wrap { padding: 0 1rem; }
    .spdr {
        grid-template-columns: 1fr;
        gap: .6rem;
    }
    .spdr-arrow { transform: rotate(90deg); height: 18px; }
    .uc-grid { grid-template-columns: repeat(2, 1fr); }
    .arch-layer-row { grid-template-columns: 32px 1fr; }
    .arch-layer-row .altag { display: none; }
    .article-end-inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .article-body table { font-size: .82rem; }
    .article-body tbody th { width: auto; }
}

@media (max-width: 460px) {
    .uc-grid { grid-template-columns: 1fr; }
}

/* ── Print ── */
@media print {
    body { background: white; }
    .site-header, .site-footer, .newsletter-band { display: none; }
    .diagram-wrap, .section { page-break-inside: avoid; }
}
