/*
 * Case studies inside WordPress (single-case-study.php, page-case-studies.php), on top of
 * site.css and case-study.css from the static site.
 *
 * The static pages had hand-written sections; here each section's body is rich text moved over
 * from the Elementor pages (paragraphs, lists, tables, accordions, diagrams, images), so .cs-body
 * styles all of those. The rest adapts the static layout to the theme header and to longer copy.
 */

/* the theme header sits above the page instead of floating over it */
.cs .cs-hero { padding-top: clamp(48px, 5.5vw, 80px); padding-bottom: clamp(48px, 5.5vw, 80px); }
.cs .blk + .blk { margin-top: clamp(56px, 6vw, 88px); }
.cs .hub-hero .kicker { color: var(--hi); }

/* WordPress headlines are longer than the static ones */
.cs .cs-display { max-width: 24ch; font-size: clamp(38px, 4.6vw, 70px); line-height: 1.02; }
.cs .hub-hero .cs-display { max-width: 19ch; font-size: clamp(42px, 5.8vw, 88px); line-height: 0.98; }
.cs .cs-meta { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.cs .blk-h { max-width: 26ch; }

/* ---------- section bodies ---------- */
.cs-body { max-width: 72ch; overflow-wrap: break-word; }
.cs-body a { overflow-wrap: anywhere; }
.cs-body > * + * { margin-top: 18px; }
.cs-body p, .cs-body li { font-size: clamp(16px, 1.2vw, 17.5px); line-height: 1.72; color: var(--ink-2); }
.cs-body .cs-lead { font-size: clamp(18px, 1.45vw, 21px); line-height: 1.6; color: var(--ink); }
.cs-body strong { color: var(--ink); font-weight: 600; }
.cs-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cs-body h3 { margin-top: 36px; font-size: clamp(20px, 1.7vw, 24px); line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; color: var(--ink); }
.cs-body h4 { margin-top: 26px; font-size: 17px; line-height: 1.35; font-weight: 600; color: var(--ink); }
.cs-body > h3:first-child, .cs-body > h4:first-child { margin-top: 0; }
.cs-body h3 + *, .cs-body h4 + * { margin-top: 10px; }
.cs-body ul, .cs-body ol { padding-left: 0; list-style: none; }
.cs-body li { position: relative; padding-left: 26px; }
.cs-body li + li { margin-top: 8px; }
.cs-body ul > li::before { content: ""; position: absolute; left: 4px; top: 0.72em; width: 8px; height: 8px; border-radius: 2px; background: var(--gold); }
.cs-body ol { counter-reset: cs-ol; }
.cs-body ol > li { counter-increment: cs-ol; }
.cs-body ol > li::before { content: counter(cs-ol, decimal-leading-zero); position: absolute; left: 0; top: 0.3em; font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.cs-body blockquote { margin: 0; padding: 22px 26px; border-left: 3px solid var(--gold); border-radius: 0 14px 14px 0; background: var(--cream); }
.cs-body blockquote p { font-family: var(--serif); font-size: clamp(20px, 1.8vw, 24px); line-height: 1.4; color: var(--ink); }

/* tables */
.cs-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.cs-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.cs-table th, .cs-table td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
/* the header row: the table's very first row (in <thead>, or the first row of a table without one) */
.cs-table table > :first-child > tr:first-child > * { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); background: var(--cream); }
.cs-table tr:last-child > * { border-bottom: 0; }
.cs-table td:first-child { font-weight: 600; color: var(--ink); }

/* accordions */
.cs-acc { border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.cs-acc + .cs-acc { margin-top: 10px; }
.cs-acc summary { position: relative; padding: 18px 52px 18px 22px; cursor: pointer; list-style: none; font-size: 16.5px; font-weight: 600; color: var(--ink); }
.cs-acc summary::-webkit-details-marker { display: none; }
.cs-acc summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--black); font-size: 17px; line-height: 1; transition: transform 300ms var(--ease); }
.cs-acc[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.cs-acc-body { padding: 0 22px 20px; }
.cs-acc-body > * + * { margin-top: 14px; }

/* architecture diagrams kept as text */
.cs-diagram { margin: 0; padding: 22px 24px; overflow-x: auto; border-radius: 16px; background: var(--black); color: rgba(255,255,255,0.86); font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre; }
.cs-diagram code { font: inherit; color: inherit; background: none; padding: 0; }

/* images */
.cs-figure { margin: 0; }
.cs-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.cs-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cs-gallery .cs-figure + .cs-figure { margin-top: 0; }
.cs-figure figcaption { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }
/* live product screenshots: full width, one after another, so the UI stays readable */
.cs-gallery.cs-shots { grid-template-columns: 1fr; gap: 28px; }
.cs-shots .cs-figure img { box-shadow: 0 30px 60px -36px rgba(0,0,0,0.45); }

/* related-service cards */
.cs-link-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.cs-link-card img { display: block; width: 100%; max-width: 360px; height: auto; margin-bottom: 12px; border-radius: 10px; }
.cs-link-card a { font-weight: 600; text-decoration: none; }
.cs-link-card span { font-size: 14px; color: var(--ink-3); }

/* ---------- result: highlights are words, not numbers ---------- */
.cs .mets-text .met-v { font-size: clamp(30px, 2.7vw, 42px); line-height: 1.05; }
@media (min-width: 861px) { .cs .mets-text { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }

/* ---------- hub cards ---------- */
.cs .cc-summary { font-family: inherit; font-size: 14.5px; letter-spacing: 0; text-transform: none; line-height: 1.55; color: var(--ink-3); }
.cs .cc-proof-text b { font-family: inherit; font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }

/* theme compatibility: Bootstrap and the theme style bare elements inside the content */
.cs .mark { background-color: transparent; }
.cs .cs-body table { margin: 0; }
.cs .cs-body p { margin-bottom: 0; }
.cs .cs-body h3, .cs .cs-body h4 { font-family: var(--sans); margin-bottom: 0; }
.cs .formcard .fi { color: var(--hi) !important; }
