/*
 * Cultina Hover-Card — image front cross-fades to a brand-surface back on hover,
 * and the back-face text slides up + fades in (staggered) per the XD prototype.
 * Most values are driven by the widget's Style controls (typography, colours,
 * spacing, button, motion); this file holds the structure + the cross-fade and
 * motion mechanics. Motion is tuned via CSS custom properties the widget emits:
 *   --chc-fade       cross-fade duration       (default 450ms)
 *   --chc-move       text slide distance       (default 18px)
 *   --chc-move-dur   text slide/fade duration  (default 520ms)
 *   --chc-stagger    delay added per element   (default 70ms)
 */

.chc {
    --chc-fade: 450ms;
    --chc-move: 18px;
    --chc-move-dur: 520ms;
    --chc-stagger: 70ms;
    position: relative;
    display: block;
    width: 100%;
    height: 636px;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
@media (max-width: 1024px) { .chc { height: 460px; } }
@media (max-width: 767px)  { .chc { height: 380px; } }

/* Both faces fill the card; cross-fade via opacity. */
.chc__face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 56px 73px 44px;
    transition: opacity var(--chc-fade) ease;
}
@media (max-width: 1024px) { .chc__face { padding: 44px 40px 36px; } }
@media (max-width: 767px)  { .chc__face { padding: 36px 28px 28px; } }

.chc__front {
    justify-content: flex-end;
    background-size: cover;
    background-position: center center;
    opacity: 1;
}
.chc__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.28) 100%);
    pointer-events: none;
}
.chc__back {
    justify-content: space-between;
    background-color: #E8F5F9; /* overridden per instance via the control */
    opacity: 0;
}

.chc:hover .chc__front,
.chc:focus-visible .chc__front { opacity: 0; }
.chc:hover .chc__back,
.chc:focus-visible .chc__back { opacity: 1; }

/* ----- back-face text motion: slide up + fade, staggered by --chc-i ------ */
.chc__anim {
    opacity: 0;
    transform: translateY(var(--chc-move));
    transition:
        opacity var(--chc-move-dur) ease,
        transform var(--chc-move-dur) cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--chc-i, 0) * var(--chc-stagger));
}
.chc:hover .chc__anim,
.chc:focus-visible .chc__anim {
    opacity: 1;
    transform: translateY(0);
}

.chc:focus-visible {
    outline: none;
    box-shadow: var(--cultina-focus-ring, 0 0 0 3px rgba(194,0,106,0.5));
}

/* QA helper (?cardflip=1) — force the hover face for screenshots. */
body.cultina-cardflip .chc__front { opacity: 0; }
body.cultina-cardflip .chc__back  { opacity: 1; }
body.cultina-cardflip .chc__anim  { opacity: 1; transform: none; }

/* ----- text + button (Ubuntu; sizes per the XD type scale; overridable) -- */
.chc__bottom { position: relative; }

.chc__title {
    font-family: "Ubuntu", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    font-size: 44px;
    line-height: 1.14;
    color: #FFFFFF;
    margin: 0 0 20px;
}
.chc__title--dark { color: #313131; }
@media (max-width: 1024px) { .chc__title { font-size: 32px; } }
@media (max-width: 767px)  { .chc__title { font-size: 28px; } }

.chc__head {
    font-family: "Ubuntu", "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    font-size: 28px;
    line-height: 36px;
    color: #313131;
    margin: 0 0 22px;
}
@media (max-width: 767px) { .chc__head { font-size: 24px; line-height: 30px; } }

.chc__desc {
    font-family: "Ubuntu", "Helvetica Neue", Arial, sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 26px;
    color: #313131;
    margin: 0;
}

/* Pill button — white outline on the image front, dark outline on the back. */
.chc__btn {
    display: inline-block;
    font-family: "Ubuntu", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
    border-radius: 25px;
    padding: 14px 32px;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.chc__btn--dark {
    color: #313131;
    border-color: #313131;
}
/* The back button stays an outline button on card hover (per XD); it only fills
   when the button ITSELF is hovered — that fill is set by the widget's
   "Button-Hover-Füllung" control (selector .chc:hover .chc__btn:hover). */

@media (prefers-reduced-motion: reduce) {
    .chc__face,
    .chc__anim { transition: none; }
    .chc__anim { transform: none; }
}
