/* ==========================================================================
   CHRISBEK'S — Homepage hero (editorial campaign slider)
   Scoped to .cbk-hero so it never leaks into the rest of the theme.
   ========================================================================== */

.cbk-hero {
    --cbk-ivory: #F7F4EE;
    --cbk-panel: #EFE9DF;
    --cbk-ink: #171717;
    --cbk-ink-soft: #2E2B28;
    --cbk-accent: #FF6A00;       /* overridden with the admin primary colour in the partial */
    --cbk-accent-hover: #E25E00;
    --cbk-muted: #66615B;
    --cbk-line: #DDD8CF;
    --cbk-serif: "Cormorant Garamond", "Times New Roman", serif;
    --cbk-sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
    --cbk-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --cbk-text-in: 1.3s;
    --cbk-img-in: 1.5s;
    --cbk-interval: 6000ms;
    --cbk-dir: 1;

    position: relative;
    overflow: hidden;
    height: clamp(600px, 84vh, 920px);
    background: var(--cbk-ivory);
    color: var(--cbk-ink);
    font-family: var(--cbk-sans);
    -webkit-font-smoothing: antialiased;
}

/* Fine paper grain over the whole hero */
.cbk-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cbk-hero__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.cbk-hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: 45fr 55fr;
    height: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(24px, 5vw, 88px);
}

/* --- Left column -------------------------------------------------------- */

.cbk-hero__content {
    position: relative;
    z-index: 3;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 48px 0;
}

.cbk-hero .cbk-hero__statement {
    margin: 0;
    font-family: var(--cbk-serif);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--cbk-ink);
}

.cbk-hero__rule {
    display: block;
    width: 56px;
    height: 1px;
    margin: 22px 0 44px;
    background: var(--cbk-ink);
    opacity: 0.55;
}

/* All slide texts share one grid cell, so the column never jumps in height */
.cbk-hero__texts {
    display: grid;
    width: 100%;
}

.cbk-hero__text {
    grid-area: 1 / 1;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.cbk-hero__text.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.cbk-hero__text.is-leaving {
    visibility: visible;
    animation: cbk-text-out 0.9s var(--cbk-ease) both;
}

.cbk-hero__text.is-entering > * {
    animation: cbk-text-in var(--cbk-text-in) var(--cbk-ease) both;
}

.cbk-hero__text.is-entering > :nth-child(1) { animation-delay: 0.25s; }
.cbk-hero__text.is-entering > :nth-child(2) { animation-delay: 0.35s; }
.cbk-hero__text.is-entering > :nth-child(3) { animation-delay: 0.47s; }
.cbk-hero__text.is-entering > :nth-child(4) { animation-delay: 0.59s; }

.cbk-hero .cbk-hero__label {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    font-family: var(--cbk-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--cbk-muted);
}

.cbk-hero .cbk-hero__label::before {
    content: "";
    width: 28px;
    height: 1px;
    background: currentColor;
}

.cbk-hero .cbk-hero__title {
    margin: 20px 0 24px;
    font-family: var(--cbk-serif);
    font-size: clamp(2.6rem, 3.7vw, 4.25rem);
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -0.01em;
    color: var(--cbk-ink);
    text-transform: none;
    text-wrap: balance;
}

.cbk-hero .cbk-hero__desc {
    max-width: 30rem;
    margin: 0 0 40px;
    font-family: var(--cbk-sans);
    font-size: 15.5px;
    font-weight: 400;
    line-height: 1.75;
    color: var(--cbk-muted);
}

.cbk-hero .cbk-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 18px 30px;
    border-radius: 0;
    background: var(--cbk-accent);
    color: #fff;
    font-family: var(--cbk-sans);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.45s var(--cbk-ease);
}

.cbk-hero .cbk-hero__cta:hover,
.cbk-hero .cbk-hero__cta:focus-visible {
    background: var(--cbk-accent-hover);
    color: #fff;
    text-decoration: none;
}

.cbk-hero__arrow {
    display: inline-block;
    font-size: 14px;
    letter-spacing: 0;
    transition: transform 0.55s var(--cbk-ease);
}

.cbk-hero__cta:hover .cbk-hero__arrow,
.cbk-hero__cta:focus-visible .cbk-hero__arrow {
    transform: translateX(6px);
}

/* --- Slide navigation --------------------------------------------------- */

.cbk-hero__nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 64px;
}

.cbk-hero__count {
    min-width: 2ch;
    font-family: var(--cbk-sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--cbk-ink);
    font-variant-numeric: tabular-nums;
}

.cbk-hero__count--total {
    color: var(--cbk-muted);
}

.cbk-hero__track {
    position: relative;
    width: 120px;
    height: 1px;
    overflow: hidden;
    background: var(--cbk-line);
}

.cbk-hero__progress {
    position: absolute;
    inset: 0;
    background: var(--cbk-ink);
    transform: scaleX(0);
    transform-origin: left center;
}

.cbk-hero__progress.is-running {
    animation: cbk-progress var(--cbk-interval) linear forwards;
}

.cbk-hero__arrows {
    display: inline-flex;
    gap: 4px;
    margin-left: 20px;
}

.cbk-hero .cbk-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--cbk-ink);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.4s var(--cbk-ease), transform 0.4s var(--cbk-ease);
}

.cbk-hero .cbk-hero__btn:hover {
    opacity: 1;
}

.cbk-hero .cbk-hero__btn[data-cbk-prev]:hover { transform: translateX(-2px); }
.cbk-hero .cbk-hero__btn[data-cbk-next]:hover { transform: translateX(2px); }

.cbk-hero .cbk-hero__btn:focus-visible,
.cbk-hero .cbk-hero__cta:focus-visible {
    outline: 1px solid var(--cbk-ink);
    outline-offset: 4px;
}

.cbk-hero__btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.25;
}

/* --- Right column ------------------------------------------------------- */

.cbk-hero__visual {
    position: relative;
    z-index: 1;
}

/* Warm set wall behind the model, with a thin offset frame */
.cbk-hero__backdrop {
    position: absolute;
    right: 6%;
    bottom: 0;
    width: 68%;
    height: 80%;
    background: var(--cbk-panel);
}

.cbk-hero__backdrop::after {
    content: "";
    position: absolute;
    inset: -18px 18px 18px -18px;
    border: 1px solid var(--cbk-line);
}

.cbk-hero__figure {
    position: absolute;
    top: clamp(24px, 5vh, 56px);
    right: 0;
    bottom: -24px;  /* bleed below the hero so the drift never reveals the cut-out edge */
    left: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0;
    visibility: hidden;
    opacity: 0;
}

.cbk-hero__figure.is-active {
    z-index: 2;
    visibility: visible;
    opacity: 1;
}

.cbk-hero__figure.is-entering {
    animation: cbk-img-in var(--cbk-img-in) var(--cbk-ease) both;
}

.cbk-hero__figure.is-leaving {
    z-index: 1;
    visibility: visible;
    animation: cbk-img-out 1.2s var(--cbk-ease) both;
}

.cbk-hero__drift {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 100%;
    transform-origin: 50% 100%;
    will-change: transform;
}

/* The drift keeps running while a slide leaves, so the image never freezes mid-exit */
.cbk-hero__figure.is-active .cbk-hero__drift,
.cbk-hero__figure.is-leaving .cbk-hero__drift {
    animation: cbk-drift calc(var(--cbk-interval) + 1.5s) cubic-bezier(0.33, 0, 0.67, 1) forwards;
}

.cbk-hero .cbk-hero__drift img {
    display: block;
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: 50% 100%;
    filter: drop-shadow(0 26px 34px rgba(40, 30, 20, 0.10));
}

.cbk-hero__est {
    position: absolute;
    top: 50%;
    right: clamp(-48px, -2.5vw, -16px);
    z-index: 3;
    font-family: var(--cbk-sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--cbk-muted);
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: translateY(-50%) rotate(180deg);
}

/* Pausing freezes the timer, the progress line and the image drift together */
.cbk-hero.is-paused .cbk-hero__progress,
.cbk-hero.is-paused .cbk-hero__drift {
    animation-play-state: paused;
}

/* --- Keyframes ---------------------------------------------------------- */
/* --cbk-dir is 1 for "next" and -1 for "previous": text and image travel in opposite directions */

@keyframes cbk-text-in {
    from { opacity: 0; transform: translate3d(calc(var(--cbk-dir) * -40px), 0, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes cbk-text-out {
    from { opacity: 1; transform: translate3d(0, 0, 0); }
    to   { opacity: 0; transform: translate3d(calc(var(--cbk-dir) * 40px), 0, 0); }
}

@keyframes cbk-img-in {
    from { opacity: 0; transform: translate3d(calc(var(--cbk-dir) * 64px), 0, 0) scale(0.98); }
    to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes cbk-img-out {
    from { opacity: 1; transform: translate3d(0, 0, 0); }
    to   { opacity: 0; transform: translate3d(calc(var(--cbk-dir) * -48px), 0, 0); }
}

/* Barely-there life: 0.98 → 1.02 scale with a soft float and parallax drift */
@keyframes cbk-drift {
    0%   { transform: translate3d(0, 0, 0) scale(0.98); }
    50%  { transform: translate3d(calc(var(--cbk-dir) * -5px), -6px, 0) scale(1); }
    100% { transform: translate3d(calc(var(--cbk-dir) * -10px), -2px, 0) scale(1.02); }
}

@keyframes cbk-progress {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 1199.98px) {
    .cbk-hero__inner {
        grid-template-columns: 48fr 52fr;
    }

    .cbk-hero .cbk-hero__title {
        font-size: clamp(2.4rem, 3.9vw, 3.2rem);
    }

    .cbk-hero__est {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .cbk-hero {
        height: auto;
        min-height: 88vh;
        min-height: 88svh;
    }

    /* Statement → image → slide text → navigation */
    .cbk-hero__inner {
        display: flex;
        flex-direction: column;
        padding: 32px 20px 0;
    }

    .cbk-hero__content {
        display: contents;
    }

    .cbk-hero .cbk-hero__statement { order: 1; font-size: 11.5px; letter-spacing: 0.2em; text-wrap: balance; }
    .cbk-hero__rule               { order: 2; margin: 14px 0 18px; }
    .cbk-hero__visual             { order: 3; }
    .cbk-hero__texts              { order: 4; margin-top: 22px; }
    .cbk-hero__nav                { order: 5; margin: 22px 0 26px; }

    .cbk-hero__visual {
        height: clamp(280px, 40svh, 520px);
        overflow: hidden;
    }

    .cbk-hero__backdrop {
        right: 0;
        width: 100%;
        height: 78%;
    }

    .cbk-hero__backdrop::after {
        display: none;
    }

    .cbk-hero__figure {
        top: 0;
        bottom: -12px;
    }

    .cbk-hero .cbk-hero__title {
        margin: 16px 0 18px;
        font-size: clamp(2.15rem, 8.6vw, 3rem);
        line-height: 1.06;
    }

    .cbk-hero .cbk-hero__desc {
        margin-bottom: 24px;
        font-size: 14.5px;
        line-height: 1.7;
    }

    .cbk-hero .cbk-hero__cta {
        padding: 17px 26px;
    }

    .cbk-hero__track {
        flex: 1;
        width: auto;
        max-width: 160px;
    }

    .cbk-hero__arrows {
        margin-left: auto;
    }
}

/* Respect reduced-motion: keep the slideshow, drop the movement */
@media (prefers-reduced-motion: reduce) {
    .cbk-hero__text.is-entering > *,
    .cbk-hero__figure.is-entering {
        animation: cbk-fade-in 0.8s ease both;
    }

    .cbk-hero__text.is-leaving,
    .cbk-hero__figure.is-leaving {
        animation: cbk-fade-out 0.6s ease both;
    }

    .cbk-hero__figure.is-active .cbk-hero__drift,
    .cbk-hero__figure.is-leaving .cbk-hero__drift {
        animation: none;
    }

    @keyframes cbk-fade-in  { from { opacity: 0; } to { opacity: 1; } }
    @keyframes cbk-fade-out { from { opacity: 1; } to { opacity: 0; } }
}
