/* ── Kings Corner – Speaker Carousel Widget ──────────────────────────────── */

.kc-speaker-carousel {
    position: relative;
    background-color: var(--kc-sc-bg, #0d1b6b);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    overflow: hidden;
    color: #fff;
    padding: 52px 48px 140px;
    /* extra bottom padding for dots + strip */
    min-height: 420px;
    display: flex;
    flex-direction: var(--kc-sc-flex-direction, row);
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: var(--kc-sc-justify-content, flex-start);
}

/* ── Speaker Count Defaults (CSS Variables) ──────────────────────────────── */

.kc-sc-count-1 {
    --kc-sc-photos-width: 40%;
    --kc-sc-photo-width: 100%;
    --kc-sc-photo-margin: 0;
}

.kc-sc-count-2 {
    --kc-sc-photos-width: 50%;
    --kc-sc-photo-width: 60%;
    --kc-sc-photo-margin: -10%;
}

.kc-sc-count-3 {
    --kc-sc-photos-width: 58%;
    --kc-sc-photo-width: 40%;
    --kc-sc-photo-margin: -9%;
}

.kc-sc-count-4 {
    --kc-sc-photos-width: 62%;
    --kc-sc-photo-width: 34%;
    --kc-sc-photo-margin: -11%;
}

.kc-sc-count-5 {
    --kc-sc-photos-width: 66%;
    --kc-sc-photo-width: 29%;
    --kc-sc-photo-margin: -12%;
}

/* ── Photos (absolute, right side, always visible) ───────────────────────── */

.kc-sc-photos {
    position: relative;
    width: var(--kc-sc-photos-width, 50%);
    display: flex;
    align-items: flex-end;
    z-index: 4;
    flex: 0 0 var(--kc-sc-photos-width, 50%);
}

.kc-sc-photo {
    position: relative;
    width: var(--kc-sc-photo-width, 40%);
    flex-shrink: 0;
    z-index: 1;
    transition: transform 0.4s ease;
    align-self: flex-end;
    cursor: pointer;
}

.kc-sc-photo:not(:first-child) {
    margin-left: var(--kc-sc-photo-margin, -9%);
}

/* Progressive z-index: rightmost photo in front */
.kc-sc-photo:nth-child(1) {
    z-index: 1;
}

.kc-sc-photo:nth-child(2) {
    z-index: 2;
}

.kc-sc-photo:nth-child(3) {
    z-index: 3;
}

.kc-sc-photo:nth-child(4) {
    z-index: 4;
}

.kc-sc-photo:nth-child(5) {
    z-index: 5;
}

.kc-sc-photo img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: top center;
    /* Dimmed + desaturated for inactive */
    filter: brightness(0.35) saturate(0.2);
    transition: filter 0.4s ease;
    /* mix-blend-mode helps blend white/light backgrounds into the dark widget bg */
    mix-blend-mode: luminosity;
}

/* Active photo: full brightness, no grayscale, normal blend */
.kc-sc-photo.is-active {
    z-index: 10 !important;
    transform: scale(1.03);
    transform-origin: bottom center;
}

.kc-sc-photo.is-active img {
    filter: brightness(0.92) saturate(0.85);
    mix-blend-mode: normal;
}

/* ── Content (left column) ───────────────────────────────────────────────── */

.kc-sc-content {
    position: relative;
    z-index: 5;
    width: var(--kc-sc-content-width, 50%);
    flex: 0 0 var(--kc-sc-content-width, 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: 15px;
}

/* Intro paragraph */
.kc-sc-intro {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
    margin: 0 0 20px;
    max-width: 650px;
}

.kc-sc-intro strong {
    color: #fff;
    font-weight: 700;
}

/* ── Name slides ─────────────────────────────────────────────────────────── */

.kc-sc-slides-wrap {
    position: relative;
    margin-bottom: 24px;
}

.kc-sc-slide {
    display: none;
    animation: kcScFadeIn 0.38s ease;
}

.kc-sc-slide.active {
    display: block;
}

@keyframes kcScFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Stats Strip Ticker Logic ────────────────────────────── */

@keyframes kcScTicker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Duplicated items hidden by default */
.kc-sc-stats-dup {
    display: none;
    flex-shrink: 0;
}

/*
 * Ticker animations are only applied when the device-specific class is present.
 * kc-ticker-d (Desktop), kc-ticker-t (Tablet), kc-ticker-m (Mobile)
 */
/*
 * Ticker animations are only applied when the device-specific class is present.
 * kc-ticker-d (Desktop), kc-ticker-t (Tablet), kc-ticker-m (Mobile)
 */
@media (min-width: 1025px) {
    .kc-ticker-d .kc-sc-stats-dup {
        display: flex !important;
    }

    .kc-ticker-d .kc-sc-stats-track {
        animation: kcScTicker var(--kc-sc-ticker-speed, 20s) linear infinite;
        gap: 0;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .kc-ticker-t .kc-sc-stats-dup {
        display: flex !important;
    }

    .kc-ticker-t .kc-sc-stats-track {
        animation: kcScTicker var(--kc-sc-ticker-speed, 20s) linear infinite;
        gap: 0;
    }
}

@media (max-width: 768px) {
    .kc-ticker-m .kc-sc-stats-dup {
        display: flex !important;
    }

    .kc-ticker-m .kc-sc-stats-track {
        animation: kcScTicker var(--kc-sc-ticker-speed, 20s) linear infinite;
        gap: 0;
    }
}


/* Speaker name */
.kc-sc-name {
    font-size: clamp(2.2rem, 4.5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    color: #fff;
    letter-spacing: -0.01em;
}

/* First name — independently styleable via Elementor typography */
.kc-sc-fn {
    color: #fff;
}

/* Last name — accent color, independently styleable */
.kc-sc-ln {
    color: var(--kc-sc-accent, #00c4a0);
}

/* ── Stacked description cards ───────────────────────────────────────────── */

/*
 * Escalera effect: 3 cards stacked diagonally.
 * Back cards (--1, --2) are absolutely positioned matching the front card size,
 * then translated top-left to peek out behind the front card.
 * Front card (.kc-sc-desc-box) sits in normal flow at z-index 2.
 */

.kc-sc-desc-stack {
    position: relative;
    /* Margin to ensure back cards translated top-left are not clipped */
    margin-top: 4px;
    padding-top: calc(var(--kc-sc-desc-offset, 12px) * 2);
    padding-left: calc(var(--kc-sc-desc-offset, 12px) * 2);
}

/* Shared glass style for all desc cards */
.kc-sc-desc-back,
.kc-sc-desc-box {
    border-radius: var(--kc-sc-desc-radius, 6px);
    border: 1px solid var(--kc-sc-desc-border, rgba(255, 255, 255, 0.18));
    backdrop-filter: blur(var(--kc-sc-desc-blur, 14px)) brightness(var(--kc-sc-desc-brightness, 1));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 0 28px var(--kc-sc-desc-glow, rgba(255, 255, 255, 0.05));
}

/* Decorative back cards: same size as front card, shifted top-left */
.kc-sc-desc-back {
    position: absolute;
    /* Cover the front card area (which starts after the padding) */
    top: calc(var(--kc-sc-desc-offset, 25px) * 2);
    left: calc(var(--kc-sc-desc-offset, 25px) * 2);
    right: 0;
    bottom: 0;
    background: var(--kc-sc-desc-bg-back, rgba(255, 255, 255, 0.04));
    pointer-events: none;
}

/* Back card --2: furthest behind (most top-left) */
.kc-sc-desc-back--2 {
    transform: translate(calc(var(--kc-sc-desc-offset, 25px) * -10), 0);
    z-index: 0;
    opacity: 0.7;
}

/* Back card --1: middle (slightly top-left of front) */
.kc-sc-desc-back--1 {
    transform: translate(calc(var(--kc-sc-desc-offset, 25px) * -5), 0);
    z-index: 1;
    opacity: 0.85;
}

/* Front card */
.kc-sc-desc-box {
    position: relative;
    z-index: 2;
    background: var(--kc-sc-desc-bg, rgba(255, 255, 255, 0.08));
    max-width: var(--kc-sc-desc-width, 420px);
    padding: 20px 24px;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.65;
}

.kc-sc-desc-box strong,
.kc-sc-desc-box b {
    color: #fff;
    font-weight: 700;
}

/* Desc slides within the front card */
.kc-sc-desc-slide {
    display: none;
    animation: kcScFadeIn 0.38s ease;
}

.kc-sc-desc-slide.active {
    display: block;
}

/* ── Navigation dots (absolute, bottom-right) ────────────────────────────── */

.kc-sc-dots {
    position: absolute;
    bottom: 100px;
    right: 48px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 20;
}

.kc-sc-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s, transform 0.3s;
}

.kc-sc-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.kc-sc-dot.active {
    background: var(--kc-sc-accent, #00c4a0);
    transform: scale(1.15);
}

/* ── Stats Strip (bottom, teal bar) ────────────────────────── */

.kc-sc-stats-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--kc-sc-strip-bg, #00b48f);
    padding: 8px 0;
    z-index: 30;
    min-height: 60px;
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: all 0.3s ease;
    /* Respect order from PHP variable if available */
    order: var(--kc-sc-strip-order, 2);
}

/* If NO ticker is active on this device, allow columns and wrapping */
.kc-speaker-carousel:not(.kc-ticker-d):not(.kc-ticker-t):not(.kc-ticker-m):not(.is-ticker) .kc-sc-stats-strip,
.kc-speaker-carousel:not(.kc-ticker-d):not(.kc-ticker-t):not(.kc-ticker-m):not(.is-ticker) .kc-sc-stats-grid,
.kc-speaker-carousel:not(.kc-ticker-d):not(.kc-ticker-t):not(.kc-ticker-m):not(.is-ticker) .kc-sc-stats-track {
    width: 100%;
    overflow: visible;
    height: auto;
    flex-wrap: wrap;
}

.kc-speaker-carousel:not(.kc-ticker-d):not(.kc-ticker-t):not(.kc-ticker-m):not(.is-ticker) .kc-sc-stats-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    gap: 20px;
    padding-right: 0;
}

.kc-sc-stats-slide {
    display: none;
    width: 100%;
    animation: kcScFadeIn 0.4s ease;
}

.kc-sc-stats-slide.active {
    display: block;
}

.kc-sc-stats-grid {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    align-items: center;
    overflow: hidden;
}

.kc-sc-stats-track {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
}

/* Force nowrap when ticker is active for ANY device */
.kc-ticker-d .kc-sc-stats-track,
.kc-ticker-t .kc-sc-stats-track,
.kc-ticker-m .kc-sc-stats-track {
    flex-wrap: nowrap !important;
}

.kc-sc-stats-group {
    display: flex;
    flex-wrap: nowrap;
    flex-shrink: 0;
    padding-right: var(--kc-sc-stats-gap, 40px);
}

/* No global is-ticker animation to avoid conflicts */
.kc-sc-stats-dup {
    display: none !important;
    flex-shrink: 0;
}




.kc-sc-stat-col {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kc-sc-stat-top {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
}

.kc-sc-stat-bot {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.2;
    text-transform: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (min-width: 768px) and (max-width: 1024px) {
    .kc-speaker-carousel {
        padding: 60px 24px 100px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        height: auto;
        min-height: unset;
    }

    /* Hierarchy Fix: Intro -> Name -> Photos -> Strip -> Bio */
    .kc-sc-content {
        display: contents !important;
    }

    .kc-sc-intro {
        order: 1;
        width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }

    .kc-sc-slides-wrap {
        order: 2;
        width: 100%;
        text-align: center;
        margin-bottom: 30px;
    }

    .kc-sc-photos {
        width: 100% !important;
        flex: 0 0 auto !important;
        height: auto;
        min-height: 250px;
        position: relative;
        justify-content: center;
        order: 3;
    }

    .kc-sc-stats-strip {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        order: 4;
        margin-bottom: 30px;
        width: 100% !important;
        left: auto;
        right: auto;
    }

    .kc-sc-desc-stack {
        order: 5;
        width: 100%;
        margin: 0 auto;
        padding: 20px 0;
    }

    .kc-sc-desc-box {
        max-width: 100% !important;
        margin: 0 auto;
    }

    .kc-sc-dots {
        position: relative;
        right: auto;
        bottom: auto;
        margin: 20px auto 0;
        justify-content: center;
        order: 6;
    }

    .kc-sc-name {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    /* Fixed Tablet Grid: 2 columns (2x2) */
    .kc-speaker-carousel:not(.kc-ticker-t) .kc-sc-stats-group {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px !important;
        width: 100% !important;
    }

    .kc-speaker-carousel:not(.kc-ticker-t) .kc-sc-stats-dup {
        display: none !important;
    }

    .kc-speaker-carousel:not(.kc-ticker-t) .kc-sc-stat-col {
        text-align: center;
    }
}

@media (max-width: 767px) {
    .kc-speaker-carousel {
        padding: 24px 16px 40px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    /* Hierarchy Fix: Intro -> Name -> Photos -> Strip -> Bio */
    .kc-sc-content {
        display: contents !important;
    }

    .kc-sc-intro {
        order: 1;
        width: 100%;
        margin-bottom: 12px;
        padding: 10px;
    }

    .kc-sc-slides-wrap {
        order: 2;
        width: 100%;
        margin-bottom: 20px;
    }

    .kc-sc-photos {
        width: 100% !important;
        flex: 0 0 auto !important;
        height: auto;
        margin: 0 0 25px;
        padding: 0 0 5px;
        display: flex;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        order: 3;
    }

    .kc-sc-photos::-webkit-scrollbar {
        display: none;
    }

    .kc-sc-photo {
        width: var(--kc-sc-photo-width, 70%);
        min-width: var(--kc-sc-photo-width, 70%);
        margin-left: 0;
        scroll-snap-align: center;
        transition: transform 0.3s ease;
    }

    .kc-sc-photo:not(:first-child) {
        margin-left: var(--kc-sc-photo-margin, 0);
    }

    .kc-sc-photo img {
        filter: brightness(0.6) saturate(0.5);
        mix-blend-mode: normal;
        border-radius: 12px;
    }

    .kc-sc-photo.is-active {
        transform: scale(1.02);
    }

    .kc-sc-photo.is-active img {
        filter: brightness(0.95) saturate(0.9);
    }

    .kc-sc-desc-stack {
        order: 5;
        width: 100%;
        padding: 0;
        margin-top: 0;
    }

    .kc-sc-desc-back {
        display: none;
    }

    .kc-sc-desc-box {
        max-width: 100% !important;
        padding: 14px 16px;
    }

    .kc-sc-dots {
        display: none;
    }

    .kc-sc-stats-strip {
        position: relative !important;
        padding: 15px 0;
        height: auto !important;
        min-height: auto !important;
        margin: 0 0 25px;
        order: 4;
        overflow: visible !important;
    }

    .kc-sc-stats-grid {
        gap: 30px;
    }

    .kc-sc-stat-top {
        font-size: 1.15rem;
    }

    .kc-sc-stat-bot {
        font-size: 0.65rem;
    }

    .kc-speaker-carousel:not(.kc-ticker-m) .kc-sc-stats-grid {
        display: block !important;
        padding: 15px 12px;
    }

    .kc-speaker-carousel:not(.kc-ticker-m) .kc-sc-stats-group {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        width: 100% !important;
        padding-right: 0 !important;
    }

    .kc-speaker-carousel:not(.kc-ticker-m) .kc-sc-stats-dup {
        display: none !important;
    }

    .kc-speaker-carousel:not(.kc-ticker-m) .kc-sc-stat-col {
        text-align: center;
        width: 100% !important;
        padding: 5px 0;
    }
}