/* ============================================
   Case study — detail (/case-studies/<slug>/) a přehled (/case-studies/), scoped pod .cs
   Karty a zástupné rámečky jsou ve style.css (sdílené s homepage)
   ============================================ */

.cs {
    background: var(--white);
    color: var(--black);
}

.cs p {
    color: var(--black);
}

/* Nadpisy Novecento s háčky potřebují trochu víc místa nad řádkem */
.cs h1 {
    font-size: clamp(3rem, 7vw, 6.5rem);
    line-height: 1.02;
}

.cs-perex {
    font-weight: 700;
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    line-height: 1.5;
    margin-top: 1.5rem;
    max-width: 34em;
}

/* ---- Hlavička článku ---- */
.cs-hero {
    padding: 9rem 0 var(--section-gap);
}

.cs-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 4rem;
    align-items: end;
}

.cs-meta {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 1.5rem 3rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--black);
}

.cs-meta dt {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.cs-meta dd {
    font-weight: 700;
}

.cs-meta-tags {
    grid-column: 1 / -1;
}

.cs-meta-tags dd {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cs-cover {
    aspect-ratio: 4 / 5;
    border-radius: 39px;
    border: 2px solid var(--black);
    overflow: hidden;
}

.cs-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Tělo článku: text v úzkém sloupci, fotky široké ---- */
.cs-body {
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
}

.cs-body > * {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.cs-body > .cs-mid {
    max-width: 1000px;
}

.cs-body > .cs-wide {
    max-width: none;
}

.cs-body p,
.cs-body li {
    font-size: 1.125rem;
    line-height: 1.75;
}

.cs-body p {
    margin-top: 1.25rem;
}

.cs-body ul,
.cs-body ol:not(.cs-timeline) {
    margin-top: 1.25rem;
    padding-left: 1.25rem;
}

.cs-body a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cs-h2 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 0.96;
    margin-top: 7rem;
}

.cs-body > .cs-h2:first-child {
    margin-top: 0;
}

.cs-num {
    display: block;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    margin-bottom: 0.75rem;
}

.cs-body h3 {
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    line-height: 1;
    margin-top: 4rem;
}

/* Velká fotka */
.cs-figure {
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.cs-figure img,
.cs-figure .cs-video-frame,
.cs-figure .cs-ph {
    display: block;
    width: 100%;
    border-radius: 39px;
    border: 2px solid var(--black);
}

.cs-figure .cs-ph {
    aspect-ratio: 16 / 9;
}

/* Velké video: rámeček drží rozměr, video se do něj jen vejde (Safari jinak video roztáhne) */
.cs-figure .cs-video-frame {
    border: 0;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--white);
}

.cs-figure .cs-video-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cs figcaption {
    max-width: 680px;
    margin: 0.85rem auto 0;
    font-size: 0.9rem;
    color: var(--grey-dark);
}

/* Galerie */
.cs-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 3rem;
}

.cs-gallery--1 {
    grid-template-columns: 1fr;
}

.cs-gallery--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cs-gallery img,
.cs-gallery .cs-ph {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 32px;
    border: 2px solid var(--black);
}

.cs-gallery figcaption {
    margin: 0.6rem 0 0;
}

/* Barevná paleta — barva je obsah, ne dekorace */
.cs-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-top: 2.5rem;
}

.cs-swatch {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cs-swatch-color {
    aspect-ratio: 1;
    border-radius: 32px;
    border: 2px solid var(--black);
    margin-bottom: 0.75rem;
}

.cs-swatch b {
    font-family: "novecento-sans-condensed", sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    text-transform: uppercase;
    line-height: 1.05;
}

.cs-swatch code {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
}

.cs-swatch small,
.cs-font small {
    font-size: 0.9rem;
    color: var(--grey-dark);
    line-height: 1.5;
}

/* Písma */
.cs-fonts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 2.5rem;
}

.cs-font {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cs-font-img {
    aspect-ratio: 16 / 9;
    border-radius: 32px;
    border: 2px solid var(--black);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.cs-font-img:empty {
    display: none;
}

.cs-font-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cs-font b {
    font-weight: 800;
    font-size: 1.1rem;
}

/* Časová osa */
.cs-timeline {
    list-style: none;
    margin-top: 2.5rem;
    border-left: 2px solid var(--black);
}

.cs-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 1.5rem;
    padding: 0 0 2.5rem 2rem;
}

.cs-timeline li:last-child {
    padding-bottom: 0;
}

.cs-timeline li::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 0.45rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--black);
}

.cs-year {
    font-family: "novecento-sans-condensed", sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 1;
    text-transform: uppercase;
}

.cs-timeline b {
    font-weight: 800;
    font-size: 1.15rem;
}

.cs-timeline p {
    margin-top: 0.35rem;
}

.cs-timeline div > p:first-child {
    margin-top: -0.2rem;
}

.cs-body > .cs-timeline + p {
    margin-top: 2.5rem;
}

/* ---- Citát klienta ---- */
.cs-quote {
    padding: var(--section-gap) 0;
    text-align: center;
}

/* Mezera článek → citát o 50px menší */
.cs-body + .cs-quote {
    padding-top: calc(var(--section-gap) - 50px);
}

.cs-quote blockquote {
    max-width: 1000px;
    margin: 0 auto;
}

.cs-quote blockquote p {
    font-family: "novecento-sans-condensed", sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    line-height: 1.02;
    text-transform: uppercase;
}

.cs-quote cite {
    display: block;
    margin-top: 1.5rem;
    font-style: normal;
    font-weight: 700;
    font-size: 1.05rem;
}

/* ---- CTA ---- */
.cs-cta-wrap {
    padding: var(--section-gap) 0;
}

.cs-cta {
    background: var(--black);
    color: var(--white);
    border-radius: 39px;
    padding: clamp(2.5rem, 6vw, 5rem);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
}

.cs-cta h2 {
    max-width: 14em;
    line-height: 1;
}

/* Foto Marka (z Kontaktu) vpravo: přesahuje box nahoru, dole končí na jeho hraně (jako O mně) */
.cs-cta {
    --cta-photo-w: clamp(220px, 24vw, 360px);
    --cta-photo-right: clamp(2rem, 6vw, 6rem);
    position: relative;
    padding-right: calc(var(--cta-photo-w) + var(--cta-photo-right) * 2);
}

.cs-cta-wrap {
    padding-top: calc(var(--section-gap) + clamp(80px, 9vw, 170px));
}

.cs-cta-photo {
    position: absolute;
    right: var(--cta-photo-right);
    bottom: 0;
    width: var(--cta-photo-w);
    height: auto;
    pointer-events: none;
}

@media (max-width: 768px) {
    .cs-cta-wrap {
        padding-top: var(--section-gap);
    }

    .cs-cta {
        padding-right: clamp(2.5rem, 6vw, 5rem);
        padding-bottom: 0;
    }

    .cs-cta-photo {
        position: static;
        align-self: center;
        width: min(70%, 280px);
    }
}

/* ---- Další case study / zpět ---- */
.cs-next {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    flex-wrap: wrap;
    padding-top: 3rem;
    padding-bottom: var(--section-gap);
}

.cs-back {
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.cs-back:hover,
.cs-next-link:hover {
    opacity: 0.6;
}

.cs-next-link {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    transition: opacity var(--transition);
}

.cs-next-link .section-label {
    margin-bottom: 0.5rem;
}

.cs-next-title {
    font-family: "novecento-sans-condensed", sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
    text-transform: uppercase;
}

/* ---- Přehled /case-studies/ ---- */
.cs-index {
    padding: 9rem 0 var(--section-gap);
}

.cs-index .cs-grid {
    margin-top: 3.5rem;
}

/* ---- Mobil ---- */
@media (max-width: 768px) {
    .cs-hero,
    .cs-index {
        padding-top: 7.5rem;
    }

    .cs-hero-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .cs-cover,
    .cs-figure img,
    .cs-figure .cs-video-frame,
    .cs-figure .cs-ph,
    .cs-cta {
        border-radius: 28px;
    }

    .cs-body p,
    .cs-body li {
        font-size: 1.05rem;
    }

    .cs-h2 {
        margin-top: 5rem;
    }

    .cs-body h3 {
        margin-top: 3rem;
    }

    .cs-gallery,
    .cs-gallery--3 {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .cs-gallery img,
    .cs-gallery .cs-ph,
    .cs-swatch-color,
    .cs-font-img {
        border-radius: 22px;
    }

    .cs-palette {
        grid-template-columns: 1fr 1fr;
    }

    .cs-timeline li {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        padding-left: 1.5rem;
    }

    .cs-next {
        flex-direction: column-reverse;
        align-items: flex-start;
    }

    .cs-next-link {
        align-items: flex-start;
        text-align: left;
    }
}

/* ---- Text + vertikální video (jako Proces na homepage) ---- */
.cs-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4rem;
    align-items: center;
    margin-top: 4rem;
}

.cs-split-text > h3:first-child {
    margin-top: 0;
}

.cs-split-video {
    width: clamp(260px, 22vw, 360px);
    aspect-ratio: 9 / 16;
    border-radius: 39px;
    border: 2px solid var(--black);
    overflow: hidden;
    background: var(--black);
}

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

@media (max-width: 768px) {
    .cs-split {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 3rem;
    }

    .cs-split-video {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        border-radius: 28px;
    }
}

/* ---- Tip v textu (> v Markdownu) ---- */
/* Sketchy tip — černý blok, bílé písmo, plovoucí mozek vpravo nahoře */
.cs-body .cs-tip {
    position: relative;
    margin-top: 2.5rem;
    padding: 1.75rem 2rem 2rem;
    background: var(--black);
    color: var(--white);
    border-radius: 32px;
}

.cs-body .cs-tip p {
    margin-top: 0;
    color: var(--white);
}

.cs-body .cs-tip p + p {
    margin-top: 0.75rem;
}

.cs-body .cs-tip .cs-tip-title {
    margin-bottom: 0.6rem;
    text-align: center;
    font-family: 'novecento-sans-condensed', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    line-height: 1.04;
    text-transform: uppercase;
}

.cs-tip-brain {
    position: absolute;
    top: -38px;
    right: 24px;
    width: 96px;
    animation: csTipFloat 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes csTipFloat {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50%      { transform: translateY(-10px) rotate(-2deg); }
}

@media (prefers-reduced-motion: reduce) {
    .cs-tip-brain {
        animation: none;
    }
}
