/* ============================================================
   case-study.css — the single case-study template page.
   In WordPress this becomes single-portfolio.php; every project reuses
   this one layout via the portfolio_items ACF fields (see work.html).
   Reuses .testimonials__* and .btn-arrow from css/home.css so the quote
   card and arrow badges match the rest of the site.
   Dock and footer are shared across every page and live in
   css/global.css instead of being duplicated here.
   ============================================================ */

/* ============================================================
   1. CS-HERO — title + meta
   ============================================================ */
/* Same two-column structure as .ab-hero (about.html) / .work-hero: 50%/46%
   percentage flex-basis, not fixed px caps — this is the standard hero
   layout for every page banner on the site. */
.cs-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(32px, 6vw, 80px);
    background: #ffffff;
    overflow: hidden;
    padding: clamp(110px, 13vw, 160px) clamp(24px, 6vw, 96px) clamp(48px, 6vw, 64px);
}

.cs-hero__inner {
    position: relative;
    z-index: 1;
    flex: 0 0 50%;
    max-width: 50%;
}

/* ---- right-side visual panel ---- */
.cs-hero__visual {
    position: relative;
    z-index: 1;
    flex: 0 0 46%;
    max-width: 46%;
    border-radius: 24px;
    overflow: hidden;
    /* Initial state — wipes open top-to-bottom via js/case-study.js, same
       clip-path mechanic as .about__image-mask / .print-cta__visual. */
    clip-path: inset(0% 0 100% 0);
    will-change: clip-path;
}

.cs-hero__visual-img {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
}

.cs-hero__breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-muted);
}
.cs-hero__bc-link { color: var(--color-muted); text-decoration: none; transition: color 0.2s; }
.cs-hero__bc-link:hover { color: var(--color-fg); }
.cs-hero__bc-sep { opacity: 0.4; }
.cs-hero__bc-current { color: var(--color-fg); font-weight: 700; }

.cs-hero__eyebrow {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 16px;
}

.cs-hero__headline {
    margin: 0 0 18px;
    font-family: "Karla", sans-serif;
    font-size: clamp(36px, 5.5vw, 64px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--color-fg);
}

.cs-hero__sub {
    margin: 0 0 32px;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.65;
    color: var(--color-muted);
    max-width: 640px;
}

.cs-hero__meta {
    list-style: none;
    margin: 0 0 28px;
    padding: clamp(20px, 3vw, 28px) 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    border-top: 1px solid rgba(14, 27, 51, 0.1);
    border-bottom: 1px solid rgba(14, 27, 51, 0.1);
}

.cs-hero__meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cs-hero__meta-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.cs-hero__meta-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-fg);
}

.cs-hero__link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px 6px 6px 22px;
    border-radius: 999px;
    border: 1px solid rgba(14, 27, 51, 0.15);
    color: var(--color-fg);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.25s ease, background 0.25s ease;
}
.cs-hero__link:hover {
    border-color: transparent;
    background: rgba(14, 27, 51, 0.05);
}

/* ============================================================
   2. CS-MEDIA — full-width hero image
   ============================================================ */
.cs-media {
    background: #ffffff;
    padding: 0 clamp(24px, 6vw, 96px) clamp(56px, 7vw, 88px);
}

.cs-media__frame {
    max-width: 1100px;
    margin: 0 auto;
    /* Capped aspect-ratio instead of natural height — the raw photo runs
       quite tall at full width, so this keeps the section from towering
       over the rest of the page. */
    aspect-ratio: 16 / 9;
    border-radius: 24px;
    overflow: hidden;
    /* Initial state — wipes open top-to-bottom via js/case-study.js, same
       clip-path mechanic as .about__image-mask / .print-cta__visual. */
    clip-path: inset(0% 0 100% 0);
    will-change: clip-path;
}

.cs-media__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================================
   3. CS-OVERVIEW — challenge / approach / result narrative
   ============================================================ */
.cs-overview {
    background: #ffffff;
    padding: 0 clamp(24px, 6vw, 96px) clamp(64px, 8vw, 96px);
}

.cs-overview__inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.cs-overview__eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 10px;
}

.cs-overview__text {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--color-muted);
}

/* ============================================================
   3. CS-WORK — skills/services breakdown
   ============================================================ */
.cs-work {
    position: relative;
    background: #faf8f4;
    padding: clamp(64px, 8vw, 100px) clamp(24px, 6vw, 96px);
}

.cs-work__intro {
    max-width: 720px;
    margin: 0 auto clamp(40px, 5vw, 56px);
}

.cs-work__eyebrow {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 14px;
}

.cs-work__heading {
    margin: 0 0 16px;
    font-family: "Karla", sans-serif;
    font-size: clamp(28px, 3.6vw, 42px);
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--color-fg);
}

.cs-work__paragraph {
    margin: 0;
    font-size: 15px;
    line-height: 1.75;
    color: var(--color-muted);
}

.cs-work__list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cs-work__item {
    margin: 0;
    font-size: 15px;
    line-height: 1.75;
    color: var(--color-muted);
}
.cs-work__item strong {
    color: var(--color-fg);
}

/* ============================================================
   4. CS-GALLERY
   ============================================================ */
.cs-gallery {
    background: #ffffff;
    padding: clamp(64px, 8vw, 100px) clamp(24px, 6vw, 96px);
}

/* Collage/masonry layout — a CSS multi-column flow instead of a uniform
   grid, so each photo keeps its own natural aspect ratio and the row
   heights vary organically instead of every tile being force-cropped to
   the same shape. */
.cs-gallery__grid {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 1200px;
    columns: 3 280px;
    column-gap: clamp(16px, 2.2vw, 24px);
}

.cs-gallery__item {
    display: block;
    break-inside: avoid;
    margin-bottom: clamp(16px, 2.2vw, 24px);
    border-radius: 16px;
    overflow: hidden;
}

.cs-gallery__item:nth-child(3n+2) { margin-top: 32px; }

.cs-gallery__item img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   5. CS-TESTIMONIAL — single centered quote (reuses .testimonials__card)
   ============================================================ */
.cs-testimonial {
    background: #faf8f4;
    padding: clamp(64px, 8vw, 100px) clamp(24px, 6vw, 96px);
}

.cs-testimonial__inner {
    max-width: 720px;
    margin: 0 auto;
}

.cs-testimonial__card.testimonials__card {
    padding: clamp(36px, 5vw, 52px);
    text-align: left;
}
.cs-testimonial__card .testimonials__quote {
    font-size: clamp(16px, 1.8vw, 19px);
    line-height: 1.8;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767.98px) {
    .cs-hero {
        flex-direction: column;
    }
    .cs-hero__inner {
        flex: none;
        max-width: 100%;
    }
    .cs-hero__visual {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    /* Move the collage image (.cs-media) below the challenge/approach/
       result copy (.cs-overview) on mobile only — on desktop the image
       leads, but on small screens readers want the text first. */
    .cs-page {
        display: flex;
        flex-direction: column;
    }
    .cs-page > #cs-hero { order: 1; }
    .cs-page > #cs-overview { order: 2; }
    .cs-page > #cs-media { order: 3; }
    .cs-page > #cs-work { order: 4; }
    .cs-page > #cs-gallery { order: 5; }
    .cs-page > #cs-testimonial { order: 6; }
}

@media (max-width: 991.98px) {
    .cs-gallery__grid {
        columns: 2 240px;
    }
    .cs-gallery__item:nth-child(3n+2) {
        margin-top: 0;
    }
}

@media (max-width: 575.98px) {
    .cs-hero__meta {
        grid-template-columns: 1fr 1fr;
    }
    .cs-gallery__grid {
        columns: 1;
    }
}
