/* Case-study pages: the guide layout (contents list + sections) and the Purple Askepott
   case-study blocks. The guide rules started as the inline copy in caveau-ai-agents-tech.php;
   here they use the site tokens so they hold in the light theme too (the old gold tints are
   gone, and the contents heading uses --accent-readable, which passes AA in both themes). */

/* Small copper text: the site copper is 3.2:1 on white, so light mode gets a darker one (5.9:1). */
:root, [data-theme="dark"] { --pa-copper: #d4a574; }
[data-theme="light"] { --pa-copper: #8a5a22; }

/* ── Guide layout ─────────────────────────────────────────────────────────── */
.guide-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.guide-toc {
    position: sticky; top: 6rem;
    background: var(--bg-card-solid); border: 1px solid var(--border-hover); border-radius: var(--radius);
    padding: 1.4rem; max-height: calc(100vh - 8rem); overflow-y: auto;
}
.guide-toc h2 {
    margin: 0 0 0.9rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--accent-readable);
}
.guide-toc ul { list-style: none; margin: 0; padding: 0; }
.guide-toc li { margin-bottom: 0.2rem; }
.guide-toc a {
    display: block; padding: 0.3rem 0.5rem; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 0.86rem; text-decoration: none;
}
.guide-toc a:hover, .guide-toc a.active { color: var(--heading); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.guide-toc a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.guide-content { min-width: 0; }
.guide-section { margin-bottom: 3.25rem; scroll-margin-top: 6rem; }
.guide-section h2 {
    margin: 0 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-hover);
    font-size: 1.7rem; color: var(--heading);
}
.guide-section h3 { margin: 1.6rem 0 0.6rem; font-size: 1.15rem; color: var(--heading); }
.guide-section p, .guide-section li { color: var(--text); line-height: 1.7; }
.guide-section p { margin: 0 0 1rem; }
.guide-section ul, .guide-section ol { margin: 0.5rem 0 1rem; padding-left: 1.25rem; }
.guide-section li { margin-bottom: 0.4rem; }
.guide-note {
    margin: 1rem 0; padding: 1rem 1.25rem; border-left: 3px solid var(--copper);
    border-radius: 0 var(--radius) var(--radius) 0; background: color-mix(in srgb, var(--copper) 9%, transparent);
}
.guide-note p:last-child { margin-bottom: 0; }

/* ── Purple Askepott case study ───────────────────────────────────────────── */
.pa-hero .suite-hero__inner { max-width: none; }
.pa-hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 3rem; align-items: center; }
.pa-label {
    display: inline-block; margin: 0 0 1.1rem; padding: 0.35rem 0.75rem; border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 250, 240, 0.28); color: #fffaf0; font-size: 0.78rem; letter-spacing: 0.02em;
}
.pa-safety { margin: 1.4rem 0 0; color: var(--text-secondary); font-size: 0.9rem; }
.pa-safety a { color: var(--text-bright); }

.pa-plate { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(133, 133, 160, 0.3); background: var(--surface); }
.pa-plate img { display: block; width: 100%; height: auto; }
.pa-plate figcaption { padding: 0.7rem 0.95rem 0.8rem; color: var(--text-secondary); font-size: 0.82rem; line-height: 1.5; }
.pa-plate figcaption strong { display: block; color: var(--heading); font-weight: 600; }
.suite-hero .pa-plate { border-color: rgba(255, 250, 240, 0.22); background: #16161f; }
.suite-hero .pa-plate figcaption { color: #c7bdad; }
.suite-hero .pa-plate figcaption strong { color: #fffaf0; }
.pa-plate--narrow { max-width: 30rem; margin-inline: auto; }

.pa-prose { max-width: 46rem; }
.pa-prose p { color: var(--text); line-height: 1.75; font-size: 1.04rem; margin: 0 0 1.1rem; }
.pa-prose strong { color: var(--heading); }

.pa-audiences { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.pa-audience { display: flex; flex-direction: column; background: var(--bg-card-solid); border: 1px solid var(--border-hover); border-radius: var(--radius); overflow: hidden; }
.pa-audience img { display: block; width: 100%; height: auto; }
.pa-audience__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.pa-audience h3 { margin: 0; font-size: 1.05rem; color: var(--heading); }
.pa-audience p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; flex: 1; }
.pa-audience a { color: var(--accent-readable); font-size: 0.86rem; font-weight: 600; }

.pa-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.pa-points li { background: var(--bg-card-solid); border: 1px solid var(--border-hover); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.pa-points strong { display: block; margin-bottom: 0.35rem; color: var(--heading); }
.pa-points span { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; }

/* A labelled estimate: every measured figure on the page lives in one of these. */
.pa-estimate { max-width: 54rem; margin: 2rem auto 0; padding: 1.6rem 1.75rem; background: var(--bg-card-solid); border: 1px solid var(--border-hover); border-top: 4px solid var(--copper); border-radius: var(--radius); }
.pa-estimate__label { margin: 0 0 0.4rem; color: var(--pa-copper); font: 700 0.75rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; }
.pa-estimate__intro { margin: 0 0 1rem; color: var(--text); }
.pa-estimate table { width: 100%; border-collapse: collapse; }
.pa-estimate th, .pa-estimate td { padding: 0.75rem 0.9rem 0.75rem 0; border-bottom: 1px solid var(--border-hover); text-align: left; vertical-align: top; }
.pa-estimate thead th { color: var(--text-secondary); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pa-estimate tbody th { color: var(--text); font-weight: 600; font-size: 0.95rem; }
.pa-estimate td { color: var(--text); font-family: var(--font-mono); font-size: 0.95rem; white-space: nowrap; }
.pa-estimate td:last-child { color: var(--accent-readable); font-weight: 600; }
.pa-estimate__method { margin: 1rem 0 0; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; }

.pa-status {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.6rem; border-radius: var(--radius-pill);
    border: 1px solid color-mix(in srgb, var(--copper) 55%, transparent); color: var(--pa-copper);
    font: 600 0.7rem/1.4 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.pa-status::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; border: 1.5px solid currentColor; }
.pa-dark { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.pa-dark article { background: var(--bg-card-solid); border: 1px dashed color-mix(in srgb, var(--copper) 45%, transparent); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.pa-dark h3 { margin: 0.65rem 0 0.4rem; font-size: 1.02rem; color: var(--heading); }
.pa-dark p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

.pa-limits { max-width: 46rem; padding: 1.2rem 1.4rem; border-left: 3px solid var(--copper); background: var(--bg-card-solid); border-radius: 0 var(--radius) var(--radius) 0; }
.pa-limits ul { margin: 0; padding-left: 1.1rem; }
.pa-limits li { color: var(--text); line-height: 1.65; margin-bottom: 0.35rem; }

.pa-next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.pa-next a { display: block; padding: 1.2rem 1.3rem; border-radius: var(--radius); border: 1px solid var(--border-hover); background: var(--bg-card-solid); color: var(--text); text-decoration: none; }
.pa-next a:hover { border-color: var(--accent); }
.pa-next a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pa-next strong { display: block; color: var(--heading); margin-bottom: 0.3rem; }
.pa-next span { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }
.pa-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

@media (max-width: 1100px) {
    .pa-audiences, .pa-points, .pa-dark { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .guide-layout { grid-template-columns: 1fr; }
    .guide-toc { position: static; max-height: none; }
    .pa-hero__grid { grid-template-columns: 1fr; gap: 2rem; }
    .pa-next { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .pa-audiences, .pa-points, .pa-dark { grid-template-columns: 1fr; }
    .pa-estimate { padding: 1.2rem 1rem; }
    .pa-estimate th, .pa-estimate td { padding-right: 0.5rem; }
    .pa-estimate td { white-space: normal; font-size: 0.88rem; }
}
