/* ==========================================================================
   QoboWEB case studies: showcase, gallery, pager and lightbox
   Plain CSS (not compiled by Tailwind). Linked from case-study templates and
   the Work index so it is present after Barba head updates.
   ========================================================================== */

.cs-wrap {
    --cs-radius: 24px;
    --cs-line: var(--color-line-1, rgba(0, 0, 0, .12));
    --cs-muted: var(--color-content-1, rgba(0, 0, 0, .55));
    --cs-card: var(--color-card-1, #f1f0ec);
}

/* ---- Overview strip --------------------------------------------------- */
.cs-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--cs-line);
    border-bottom: 1px solid var(--cs-line);
}
.cs-facts > div {
    padding: 18px 16px 18px 0;
    min-width: 0;
}
.cs-facts > div + div { border-left: 1px solid var(--cs-line); padding-left: 16px; }
.cs-facts > div:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--cs-line); }
.cs-facts > div:nth-child(4) { border-top: 1px solid var(--cs-line); }
.cs-facts dt {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cs-muted);
    margin-bottom: 8px;
}
.cs-facts dd { font-size: 15px; line-height: 1.35; font-weight: 500; overflow-wrap: anywhere; }
.cs-facts a { text-decoration: underline; text-underline-offset: 3px; }
.cs-facts a:hover { text-decoration-thickness: 2px; }
@media (min-width: 48rem) {
    .cs-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .cs-facts > div { padding: 22px 20px; }
    .cs-facts > div:first-child { padding-left: 0; }
    .cs-facts > div:nth-child(3) { border-left: 1px solid var(--cs-line); padding-left: 20px; border-top: 0; }
    .cs-facts > div:nth-child(4) { border-top: 0; }
}

/* ---- Zoomable media --------------------------------------------------- */
.case-hyundai .ch-zoom,
.ch-zoom {
    position: relative;
    display: block;
    border-radius: var(--cs-radius, 24px);
    overflow: hidden;
    background: var(--cs-card, #f1f0ec);
    cursor: zoom-in;
    isolation: isolate;
}
.ch-zoom img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform .9s cubic-bezier(.19, 1, .22, 1);
}
.ch-zoom:hover img { transform: scale(1.012); }
.ch-zoom:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.ch-zoom__hint {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(20, 20, 20, .78);
    color: #f4f3ef;
    font-size: 12px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: .02em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
}
.ch-zoom__hint svg { width: 12px; height: 12px; }
.ch-zoom:hover .ch-zoom__hint,
.ch-zoom:focus-visible .ch-zoom__hint { opacity: 1; transform: none; }
@media (hover: none) {
    .ch-zoom__hint { opacity: 1; transform: none; }
}

/* Browser chrome for full-page screenshots: shown full length, never cropped */
.ch-browser { background: var(--cs-card, #f1f0ec); }
.ch-browser::before {
    content: "";
    display: block;
    height: 30px;
    background:
        radial-gradient(circle at 16px 15px, rgba(0, 0, 0, .18) 0 4px, transparent 4.5px),
        radial-gradient(circle at 30px 15px, rgba(0, 0, 0, .18) 0 4px, transparent 4.5px),
        radial-gradient(circle at 44px 15px, rgba(0, 0, 0, .18) 0 4px, transparent 4.5px),
        var(--cs-card, #f1f0ec);
    border-bottom: 1px solid var(--cs-line, rgba(0, 0, 0, .12));
}

/* ---- Layouts ---------------------------------------------------------- */
.cs-showcase { display: grid; gap: 40px 24px; }
.cs-showcase .ch-figure:first-child { grid-column: 1 / -1; }
@media (min-width: 48rem) {
    .cs-showcase { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cs-showcase.-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cs-showcase.-pair .ch-figure:first-child { grid-column: auto; }
    .cs-showcase.-pair .ch-figure:nth-child(2) { margin-top: 96px; }
}

.cs-index-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}
.cs-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--cs-line, rgba(0, 0, 0, .12));
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
    font-weight: 500;
}

.case-hyundai .ch-tall .ch-zoom { max-width: 460px; margin-inline: auto; }
.case-hyundai .ch-tall .ch-caption { margin-inline: auto; max-width: 460px; }

/* ---- Previous / next pager ------------------------------------------- */
.cs-pager {
    display: grid;
    gap: 4px;
    grid-template-columns: 1fr;
}
@media (min-width: 48rem) {
    .cs-pager { grid-template-columns: 1fr auto 1fr; align-items: stretch; }
}
.cs-pager__link {
    position: relative;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border-radius: 24px;
    background: var(--cs-card, #f1f0ec);
    transition: background-color .3s ease;
}
.cs-pager__link.-next { grid-template-columns: 1fr 96px; text-align: right; }
.cs-pager__link.-next .cs-pager__thumb { order: 2; }
.cs-pager__thumb {
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0, 0, 0, .08);
}
.cs-pager__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.19, 1, .22, 1); }
.cs-pager__link:hover .cs-pager__thumb img { transform: scale(1.06); }
.cs-pager__label {
    display: block;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cs-muted, rgba(0, 0, 0, .55));
    margin-bottom: 8px;
}
.cs-pager__title { display: block; font-size: clamp(20px, 2vw, 28px); line-height: 1.1; letter-spacing: -.02em; font-weight: 500; }
.cs-pager__all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 28px;
    border-radius: 24px;
    border: 1px solid var(--cs-line, rgba(0, 0, 0, .12));
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.cs-pager__all::before {
    content: "";
    width: 14px;
    height: 14px;
    background:
        linear-gradient(currentColor, currentColor) 0 0 / 6px 6px no-repeat,
        linear-gradient(currentColor, currentColor) 100% 0 / 6px 6px no-repeat,
        linear-gradient(currentColor, currentColor) 0 100% / 6px 6px no-repeat,
        linear-gradient(currentColor, currentColor) 100% 100% / 6px 6px no-repeat;
}
.cs-pager a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---- Work index: full-bleed showcase card image fit ------------------- */
.qobo-work-card img { object-position: center top; }

/* ---- Lightbox --------------------------------------------------------- */
.qlb {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: rgba(17, 17, 17, .95);
    color: #f4f3ef;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility 0s linear .35s;
    font-family: inherit;
}
.qlb.is-open { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.qlb__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px clamp(16px, 3vw, 32px);
    font-size: 13px;
    font-weight: 500;
}
.qlb__count { font-variant-numeric: tabular-nums; color: rgba(244, 243, 239, .65); }
.qlb__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(244, 243, 239, .22);
    color: inherit;
    background: rgba(244, 243, 239, .04);
    font: inherit;
    cursor: pointer;
    transition: background-color .25s ease, border-color .25s ease;
}
.qlb__btn:hover { background: rgba(244, 243, 239, .12); border-color: rgba(244, 243, 239, .45); }
.qlb__btn:focus-visible { outline: 2px solid #f4f3ef; outline-offset: 3px; }
.qlb__btn[hidden] { display: none; }
.qlb__btn svg { width: 16px; height: 16px; }
.qlb__stage {
    position: relative;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(8px, 6vw, 96px);
    overflow: hidden;
}
.qlb__stage.is-tall {
    align-items: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 24px;
}
.qlb__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
    opacity: 0;
    transform: scale(.985);
    transition: opacity .35s ease, transform .5s cubic-bezier(.19, 1, .22, 1);
}
.qlb__img.is-ready { opacity: 1; transform: none; }
.qlb__stage.is-tall .qlb__img { max-height: none; width: min(960px, 100%); }
.qlb__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}
.qlb__nav.-prev { left: clamp(8px, 2vw, 24px); }
.qlb__nav.-next { right: clamp(8px, 2vw, 24px); }
.qlb__stage.is-tall ~ .qlb__nav { position: fixed; }
.qlb__foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 3vw, 32px) 20px;
    font-size: 14px;
    line-height: 1.45;
}
.qlb__caption { max-width: 70ch; }
.qlb__tip { color: rgba(244, 243, 239, .5); font-size: 12px; white-space: nowrap; }
@media (max-width: 47.99rem) {
    .qlb__tip { display: none; }
    .qlb__nav { top: auto; bottom: 64px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .qlb, .qlb__img, .ch-zoom img, .ch-zoom__hint, .cs-pager__thumb img { transition: none; }
}
html.qlb-locked, html.qlb-locked body { overflow: hidden; }

/* ---- Image-free studies: typographic panels, cards, text pager --------- */
.cs-typepanel {
    --cs-tone: #24262b;
    position: relative;
    display: grid;
    align-content: space-between;
    gap: 48px;
    min-height: clamp(320px, 52vw, 640px);
    padding: clamp(24px, 4vw, 56px);
    border-radius: 20px;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(244, 243, 239, .10) 0%, rgba(244, 243, 239, 0) 60%),
        var(--cs-tone);
    color: #f4f3ef;
    overflow: hidden;
}
@media (min-width: 48rem) { .cs-typepanel { border-radius: 32px; } }
.cs-typepanel__index, .cs-typepanel__tags {
    font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500;
    color: rgba(244, 243, 239, .62);
}
.cs-typepanel__line {
    max-width: 20ch;
    font-size: clamp(30px, 5.4vw, 84px);
    line-height: 1.02;
    letter-spacing: -.035em;
    font-weight: 500;
}
.cs-typecard {
    --cs-tone: #24262b;
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(110% 80% at 85% 10%, rgba(244, 243, 239, .12) 0%, rgba(244, 243, 239, 0) 55%),
        var(--cs-tone);
    transition: transform .9s cubic-bezier(.19, 1, .22, 1);
}
.cs-typecard__mark {
    font-size: clamp(120px, 22vw, 300px);
    line-height: .8;
    letter-spacing: -.06em;
    font-weight: 500;
    color: rgba(244, 243, 239, .1);
    user-select: none;
}
a:hover ~ div .cs-typecard { transform: scale(1.03); }
.cs-pager__link.-text, .cs-pager__link.-next.-text { grid-template-columns: 1fr; padding: 22px 24px; min-height: 96px; }
.cs-nextline {
    display: block;
    padding-top: 28px;
    border-top: 1px solid var(--cs-line);
}
.cs-nextline__label { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-muted); }
.cs-nextline__title {
    display: block; margin-top: 18px;
    font-size: clamp(52px, 11vw, 160px); line-height: .92; letter-spacing: -.045em; font-weight: 500;
    transition: transform .6s cubic-bezier(.19, 1, .22, 1);
}
.cs-nextline__line { display: block; margin-top: 18px; max-width: 40ch; font-size: 16px; line-height: 1.45; color: var(--cs-muted); }
.cs-nextline:hover .cs-nextline__title { transform: translateX(12px); }
.cs-nextline:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }
@media (prefers-reduced-motion: reduce) { .cs-typecard, .cs-nextline__title { transition: none; } }
