/* ================================================
   CASE STUDY TEMPLATE
   Shared by design-system.html, hr-forms.html and recruiter-summary.html.
   Sections: A Summary · B Sprint 0 · C Heuristic audit ·
             D Testing · E System · F Impact
   ================================================ */

/* ── PAGE-SPECIFIC LAYOUT ─────────────────────── */

/* Intro panel */
.ds-intro {
    background: var(--surface);
    border: var(--stroke) solid var(--border-soft);
    border-radius: var(--r);
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
@media (min-width: 768px) {
    .ds-intro { grid-template-columns: 1fr 1fr; }
    .ds-intro-left { border-right: var(--stroke) solid var(--border-soft); }
}
.ds-intro-left,
.ds-intro-right { padding: 28px; }

.ds-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--white);
    margin-bottom: 10px;
}
.ds-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--pink);
    margin-bottom: 18px;
}
.ds-intro-right p {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.78;
}

/* Stat pills row */
.ds-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: var(--stroke) solid var(--border-soft);
}
.ds-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(255,255,255,0.04);
    border: var(--stroke) solid var(--border-card);
    border-radius: var(--r);
    padding: 8px 14px;
    flex: 1;
    min-width: 80px;
}
.ds-stat-num {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--white);
}
.ds-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Content sections */
.ds-section {
    margin-top: 10px;
}

/* Section label, reuse global but inline here */
.ds-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

/* Full-width image panel */
.ds-image-panel {
    background: var(--surface);
    border: var(--stroke) solid var(--border-soft);
    border-radius: var(--r);
    overflow: hidden;
}
.ds-image-panel img {
    width: 100%;
    display: block;
}

/* Image with caption */
.ds-image-caption {
    padding: 16px 20px;
    border-top: var(--stroke) solid var(--border-soft);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.caption-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--white);
}
.caption-body {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.65;
}

/* Two-col layout for a section */
.ds-two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 768px) {
    .ds-two-col { grid-template-columns: 1fr 1fr; }
}

/* Text content panel */
.ds-text-panel {
    background: var(--surface);
    border: var(--stroke) solid var(--border-soft);
    border-radius: var(--r);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ds-text-panel h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.01em;
}
.ds-text-panel p {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.72;
}

/* Tag cluster */
.ds-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.ds-tag {
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255,255,255,0.04);
    border: var(--stroke) solid var(--border-card);
    border-radius: var(--r);
    padding: 3px 8px;
}

/* Role badge */
.ds-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pink);
    background: rgba(255, 183, 197, 0.08);
    border: var(--stroke) solid rgba(255, 183, 197, 0.3);
    border-radius: var(--r);
    padding: 4px 10px;
    width: fit-content;
}

/* Process steps */
.ds-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.ds-step {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
    border-bottom: var(--stroke) solid var(--border-soft);
}
.ds-step:last-child { border-bottom: none; }
.step-num {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--pink);
    letter-spacing: 0.06em;
    padding-top: 2px;
}
.step-content h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 3px;
}
.step-content p {
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.6;
}

/* URL link */
.ds-url {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--pink);
    display: block;
    margin-bottom: 16px;
    word-break: break-all;
}

/* Bottom spacer */
.ds-bottom { padding-bottom: 80px; }

.ds-intro {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.ds-intro-left,
.ds-intro-right { padding: clamp(24px, 4vw, 48px); }

.ds-title {
    max-width: 13ch;
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.ds-subtitle {
    max-width: 60ch;
    font-size: 0.75rem;
    line-height: 1.5;
    letter-spacing: 0.12em;
}

.ds-role-badge { margin: 8px 0 0; }

.ds-intro-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.ds-intro-right p {
    max-width: 62ch;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.75;
}

.ds-intro-right p + p { margin-top: 0 !important; }

.ds-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.ds-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--pink);
    border-radius: var(--r);
    background: var(--pink);
    color: #171717;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.ds-action.secondary {
    background: transparent;
    color: var(--white);
    border-color: var(--border-card);
}

.ds-action:hover,
.ds-action:focus-visible { color: #171717; background: #ffd0da; }

.ds-action.secondary:hover,
.ds-action.secondary:focus-visible { color: var(--pink); }

.ds-action:focus-visible,
.ds-artifact-link:focus-visible,
.ds-case-nav a:focus-visible {
    outline: 3px solid var(--pink);
    outline-offset: 3px;
}

.ds-facts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 24px;
}

.ds-stat { min-width: 0; }

.ds-case-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 18px 0 28px;
    padding: 14px 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    background: var(--surface);
}

.ds-case-nav a {
    min-height: 24px;
    color: var(--white);
    font-size: 0.82rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ds-section { margin-top: 36px; scroll-margin-top: 24px; }

.ds-section-label {
    margin-bottom: 12px;
    color: var(--pink);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.ds-section-heading {
    max-width: 24ch;
    margin: 0 0 16px;
    color: var(--white);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.16;
    letter-spacing: -0.025em;
}

.ds-section-intro {
    max-width: 74ch;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

.ds-text-panel {
    height: 100%;
    border-radius: 8px;
    padding: clamp(20px, 3vw, 30px);
}

.ds-text-panel h3 { font-size: 1rem; }
.ds-text-panel p { font-size: 0.9rem; }

.ds-artifact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ds-artifact-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface);
}

.ds-artifact-link {
    display: flex;
    min-height: 220px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f4f6f8;
}

.ds-artifact-link img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: contain;
    object-position: center top;
}

.ds-artifact-link.portrait img {
    object-fit: cover;
    object-position: center top;
}

.ds-artifact-caption {
    padding: 16px 18px 18px;
    border-top: 1px solid var(--border-soft);
}

.ds-artifact-caption h3 {
    margin-bottom: 6px;
    color: var(--white);
    font-size: 0.95rem;
}

.ds-artifact-caption p {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.6;
}

.ds-artifact-caption span {
    display: inline-block;
    margin-top: 10px;
    color: var(--pink);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ds-accessibility-note {
    border-left: 4px solid var(--pink);
    background: rgba(255, 183, 197, 0.07);
}

.ds-bottom-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 36px;
    padding: clamp(22px, 4vw, 36px);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface);
}

.ds-bottom-cta h2 {
    margin-bottom: 8px;
    color: var(--white);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.ds-bottom-cta p { max-width: 60ch; color: var(--muted); line-height: 1.6; }

@media (max-width: 640px) {
    .ds-artifact-grid { grid-template-columns: 1fr; }
    .ds-artifact-link { min-height: 190px; }
    .ds-artifact-link img { height: 240px; }
    .ds-case-nav { gap: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .ds-action { transition: none; }
}

/* ── TEMPLATE ADDITIONS ───────────────────────── */

/* Stronger text contrast on case-study pages (~12:1 on --surface, WCAG AAA) */
.cs-page { --muted: rgba(255,255,255,0.86); }

/* Unfilled metric slot. Search the HTML for "cs-placeholder" to find every one. */
.cs-placeholder {
    display: inline;
    padding: 0 4px;
    border: 1px dashed var(--pink);
    border-radius: var(--r);
    background: transparent;
    color: var(--pink);
    font-weight: 700;
    font-size: inherit;
    letter-spacing: 0;
    text-transform: none;
}

.ds-section-label .cs-letter {
    display: inline-block;
    margin-right: 6px;
    color: var(--white);
}

/* Core impact metric in the summary hero */
.cs-impact {
    margin-top: 24px;
    padding: 18px 20px;
    border-left: 4px solid var(--pink);
    background: rgba(255, 183, 197, 0.07);
    border-radius: var(--r);
}
.cs-impact-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.cs-impact-value {
    margin-top: 6px;
    color: var(--white);
    font-size: clamp(1.25rem, 2.6vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.cs-three-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 900px) {
    .cs-three-col { grid-template-columns: repeat(3, 1fr); }
}

.cs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 18px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
}
.cs-list strong { color: var(--white); }

/* Persona cards */
.cs-persona {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cs-persona-head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cs-persona-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: var(--pink);
}
.cs-persona-type {
    color: var(--pink);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.cs-persona dl { display: grid; gap: 12px; }
.cs-persona dt {
    margin-bottom: 4px;
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.cs-persona dd { color: var(--muted); font-size: 0.9rem; line-height: 1.65; }

/* Audit and testing tables */
.cs-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface);
}
.cs-table-wrap:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.cs-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.88rem;
    line-height: 1.6;
}
.cs-table caption {
    padding: 14px 18px;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: left;
    caption-side: bottom;
    border-top: 1px solid var(--border-soft);
}
.cs-table th,
.cs-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: top;
}
.cs-table thead th {
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.04);
}
.cs-table tbody th { color: var(--white); font-weight: 700; width: 24%; }
.cs-table td { color: var(--muted); }
.cs-table tbody tr:last-child > * { border-bottom: none; }

/* Research insight quote */
.cs-quote {
    margin: 0;
    padding: 20px 22px;
    border-left: 4px solid var(--pink);
    background: rgba(255, 183, 197, 0.07);
    border-radius: var(--r);
}
.cs-quote p { color: var(--white); font-size: 1.05rem; line-height: 1.6; }
.cs-quote footer { margin-top: 10px; color: var(--muted); font-size: 0.82rem; }

/* Recruiter summary page */
.cs-case-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 768px) {
    .cs-case-links { grid-template-columns: 1fr 1fr; }
}
.cs-case-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface);
    color: var(--white);
    text-decoration: none;
}
.cs-case-link:hover { border-color: var(--pink); }
.cs-case-link:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.cs-case-link h3 { font-size: 1.05rem; }
.cs-case-link p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.cs-case-link span { color: var(--pink); font-size: 0.82rem; font-weight: 700; }

/* Let grid columns shrink so wide tables scroll inside their wrapper */
.ds-two-col > *,
.cs-three-col > * { min-width: 0; }

/* Brand colour swatches (design-system.html) */
.cs-brand { margin-bottom: 16px; }
.cs-swatches {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.cs-swatches li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}
.cs-swatches li.cs-swatch-primary { grid-column: 1 / -1; }
.cs-swatches strong { display: block; color: var(--white); font-size: 0.86rem; }
.cs-swatch {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.25);
}
.cs-swatch-primary .cs-swatch { width: 56px; height: 56px; }
.cs-eu-flag { display: block; width: 96px; height: auto; border-radius: 2px; }

/* Phone screen gallery (mares-case-study.html) */
.cs-phones {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.cs-phones figure { margin: 0; }
.cs-phones img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 22px;
    border: 1px solid var(--border-card);
}
.cs-phones figcaption { margin-top: 10px; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.cs-phones figcaption b { display: block; color: var(--white); font-size: 0.92rem; }
@media (max-width: 480px) {
    .cs-phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Figma embed */
.cs-embed { border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; background: var(--surface); }
.cs-embed iframe { display: block; width: 100%; height: min(70vh, 560px); border: 0; }

/* cScribe: title logo, user flow, desktop screens, logo panel */
.cs-title-logo { display: block; }
.cs-title-logo img { display: block; width: 40px; height: auto; margin-bottom: 14px; }
.cs-flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; counter-reset: none; }
.cs-flow li { position: relative; display: grid; gap: 6px; align-content: start; padding: 16px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; font-size: 0.86rem; line-height: 1.5; color: var(--muted); }
.cs-flow li strong { color: var(--white); font-size: 0.95rem; }
.cs-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 22px; color: var(--pink); font-weight: 700; }
.cs-flow-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pink); color: #121212; font-weight: 800; font-size: 0.85rem; }
.cs-screens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cs-screens figure { margin: 0; }
.cs-screens img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border-soft); }
.cs-screens figcaption { margin-top: 10px; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.cs-screens figcaption b { display: block; color: var(--white); font-size: 0.92rem; }
.cs-logo-row { display: flex; gap: 20px; align-items: center; padding: 18px; margin-bottom: 12px; background: #FFFFFF; border-radius: 10px; }
.cs-logo-row img { height: 96px; width: auto; }
.cs-logo-row--clear { background: none; padding: 0; }
@media (max-width: 1024px) {
    .cs-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cs-flow li:nth-child(3)::after { display: none; }
}
@media (max-width: 640px) {
    .cs-flow, .cs-screens { grid-template-columns: 1fr; }
    .cs-flow li::after { display: none; }
}

/* Microsoft 365: IA diagram, wide shots, email */
.cs-ia { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; padding: 20px; }
.cs-ia-top { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; border-bottom: 1px dashed var(--border-soft); }
.cs-ia-top span { padding: 8px 14px; border-radius: 6px; background: #2C4390; color: #FFFFFF; font-weight: 700; font-size: 0.86rem; }
.cs-ia-top span.is-active { background: var(--pink); color: #121212; }
.cs-ia-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.cs-ia-levels > div { position: relative; padding: 14px 16px; border-left: 3px solid var(--pink); background: rgba(255,255,255,0.03); border-radius: 0 8px 8px 0; }
.cs-ia-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pink); font-weight: 700; }
.cs-ia-node { margin-top: 6px; color: var(--white); font-weight: 700; }
.cs-ia-note { margin-top: 4px; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.cs-wide-shot { margin: 12px 0 0; }
.cs-wide-shot img, .cs-email-shot img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border-soft); background: #FFFFFF; }
.cs-wide-shot figcaption { margin-top: 10px; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.cs-wide-shot figcaption b { display: block; color: var(--white); font-size: 0.92rem; }
.cs-email-shot { margin: 0; max-width: 420px; }
@media (max-width: 767px) {
    .cs-ia-levels { grid-template-columns: 1fr; }
}

/* Artemis: vision simulation gallery */
.cs-sims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cs-sims figure { margin: 0; }
.cs-sims img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border-soft); }
.cs-sims figcaption { margin-top: 8px; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.cs-sims figcaption b { display: block; color: var(--white); font-size: 0.9rem; }
@media (max-width: 1024px) { .cs-sims { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .cs-sims { grid-template-columns: 1fr; } }

/* Microsoft 365 hero: short title + product chips */
.ms-arrow { color: var(--pink); }
.ms-products { list-style: none; padding: 0; margin: 4px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.ms-products li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--border-soft); color: var(--white); font-size: 0.85rem; font-weight: 600; }
.ms-products li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
