/*==============================================
   KIMST home hero slider
   Self-contained (kh-hero prefix) - replaces the legacy
   .main-slider / owl "banner-carousel" styling.
   Relies on .kh-container from header.css.
===============================================*/

.kh-hero {
    --kh-g900: #073d20;
    --kh-g800: #0a4f29;
    --kh-g700: #0b6a34;
    --kh-g300: #8fe0b0;
    --kh-red: #d02010;
    --kh-red-700: #a8180c;
    --kh-ink: #14231a;
    --kh-ease: cubic-bezier(.22, 1, .36, 1);
    --kh-delay: 5000ms; /* fallback only: hero.js sets the real value from data-delay on the section */

    position: relative;
    overflow: hidden;
    color: #fff;
    font-family: var(--kh-font-ui);
    background:
        radial-gradient(900px 520px at 88% -10%, rgba(16, 133, 67, .55), transparent 62%),
        linear-gradient(135deg, var(--kh-g900) 0%, var(--kh-g800) 58%, var(--kh-g700) 100%);
}

.kh-hero *,
.kh-hero *::before,
.kh-hero *::after {
    box-sizing: border-box;
}

/* Decoration: dotted texture + a large ring */
.kh-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1.5px, transparent 1.6px);
    background-size: 28px 28px;
    -webkit-mask-image: linear-gradient(100deg, #000 0%, transparent 62%);
    mask-image: linear-gradient(100deg, #000 0%, transparent 62%);
    pointer-events: none;
}

.kh-hero::after {
    content: "";
    position: absolute;
    left: -180px;
    bottom: -260px;
    width: 560px;
    height: 560px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    box-shadow: 0 0 0 60px rgba(255, 255, 255, .025), 0 0 0 120px rgba(255, 255, 255, .02);
    pointer-events: none;
}

.kh-hero :focus-visible {
    outline: 2px solid var(--kh-g300);
    outline-offset: 3px;
}

/*---------- Track: slides share one grid cell so the section never changes height ----------*/

.kh-hero__track {
    position: relative;
    z-index: 1;
    display: grid;
    touch-action: pan-y;
}

.kh-hero__slide {
    grid-area: 1 / 1;
    display: flex;
    align-items: center;
    padding: 48px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .7s ease, visibility 0s linear .7s;
}

.kh-hero__slide.is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.kh-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 64px;
    min-height: clamp(400px, 50vh, 470px);
}

.kh-hero__slide--notice .kh-hero__inner {
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
}

/*---------- Copy ----------*/

.kh-hero__copy {
    max-width: 580px;
}

.kh-hero .kh-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.kh-hero__eyebrow i {
    color: var(--kh-g300);
    font-size: 15px;
}

.kh-hero h2.kh-hero__title {
    margin: 22px 0 18px;
    color: #fff;
    font-family: var(--kh-font-ui);
    font-size: clamp(34px, 4.3vw, 58px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.01em;
}

/* The notice headline is longer than the others; keep it to two lines */
.kh-hero .kh-hero__slide--notice h2.kh-hero__title {
    font-size: clamp(32px, 3.7vw, 50px);
}

.kh-hero__title em {
    display: inline;
    color: var(--kh-g300);
    font-style: normal;
}

.kh-hero p.kh-hero__lead {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, .86);
    font-family: var(--kh-font-body);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.65;
}

.kh-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.kh-hero__meta li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.kh-hero__meta i {
    color: var(--kh-g300);
}

.kh-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.kh-hero a.kh-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.kh-hero a.kh-hero__btn i {
    font-size: 15px;
    transition: transform .25s var(--kh-ease);
}

.kh-hero a.kh-hero__btn--primary {
    background: var(--kh-red);
    color: #fff;
    box-shadow: 0 12px 28px rgba(208, 32, 16, .35);
}

.kh-hero a.kh-hero__btn--primary:hover {
    background: var(--kh-red-700);
    color: #fff;
    transform: translateY(-2px);
}

.kh-hero a.kh-hero__btn--primary:hover i {
    transform: translateX(4px);
}

.kh-hero a.kh-hero__btn--ghost {
    border-color: rgba(255, 255, 255, .55);
    background: transparent;
    color: #fff;
}

.kh-hero a.kh-hero__btn--ghost:hover {
    border-color: #fff;
    background: #fff;
    color: var(--kh-g800);
    transform: translateY(-2px);
}

/*---------- Visual card ----------*/

.kh-hero__card {
    position: relative;
    margin: 0;
    justify-self: end;
    width: 100%;
    max-width: 560px;
}

/* Offset outline behind the photo */
.kh-hero__card::before {
    content: "";
    position: absolute;
    inset: 18px -18px -18px 18px;
    border: 2px solid rgba(143, 224, 176, .4);
    border-radius: 30px;
}

.kh-hero__card img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--ratio, 4 / 3);
    object-fit: cover;
    object-position: var(--pos, 50% 50%);
    border-radius: 28px;
    background: #0a4f29;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .38);
    transition: none;
}

.kh-hero__card--poster {
    max-width: none;
}

.kh-hero__card--poster img {
    background: #fff;
    object-fit: contain;
}

.kh-hero__chip {
    position: absolute;
    left: -28px;
    bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px 12px 14px;
    border-radius: 16px;
    background: #fff;
    color: var(--kh-ink);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
}

.kh-hero__chip i {
    color: #108543;
    font-size: 30px;
    line-height: 1;
}

.kh-hero__chip b,
.kh-hero__chip small {
    display: block;
}

.kh-hero__chip b {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.kh-hero__chip small {
    margin-top: 2px;
    color: #5b6b61;
    font-size: 13px;
    line-height: 1.2;
}

/*---------- Entrance animation (only the active slide animates) ----------*/

.kh-hero .kh-anim {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .5s ease, transform .6s var(--kh-ease);
}

.kh-hero__card {
    opacity: 0;
    transform: translateX(36px) scale(.97);
    transition: opacity .6s ease, transform .8s var(--kh-ease);
}

.kh-hero__slide.is-active .kh-anim,
.kh-hero__slide.is-active .kh-hero__card {
    opacity: 1;
    transform: none;
}

.kh-hero__slide.is-active .kh-anim:nth-child(1) { transition-delay: .15s; }
.kh-hero__slide.is-active .kh-anim:nth-child(2) { transition-delay: .25s; }
.kh-hero__slide.is-active .kh-anim:nth-child(3) { transition-delay: .35s; }
.kh-hero__slide.is-active .kh-anim:nth-child(4) { transition-delay: .45s; }
.kh-hero__slide.is-active .kh-anim:nth-child(5) { transition-delay: .55s; }
.kh-hero__slide.is-active .kh-hero__card { transition-delay: .2s; }

/*---------- Progress rail ----------*/

.kh-hero__rail {
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, .14);
    background: rgba(3, 30, 16, .35);
}

.kh-hero__rail-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 68px;
}

.kh-hero__pager {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
}

/* Each dot is a generous tap target wrapping a slim progress bar */
.kh-hero__dot {
    position: relative;
    flex: 0 1 72px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.kh-hero__dot::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    margin-top: -2px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .28);
    transition: background .2s ease;
}

.kh-hero__dot:hover::before {
    background: rgba(255, 255, 255, .5);
}

.kh-hero__fill {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    margin-top: -2px;
    border-radius: 4px;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left center;
}

.kh-hero__dot.is-active .kh-hero__fill {
    animation: khHeroFill var(--kh-delay) linear forwards;
}

@keyframes khHeroFill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* Temporary pause (hover / focus / off-screen) freezes the bar; stopped (user pause or reduced motion) shows it full */
.kh-hero.is-paused .kh-hero__fill {
    animation-play-state: paused;
}

.kh-hero.is-stopped .kh-hero__dot.is-active .kh-hero__fill {
    animation: none;
    transform: scaleX(1);
}

.kh-hero__count {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: rgba(255, 255, 255, .7);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .06em;
}

.kh-hero__count b {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.kh-hero__ctrls {
    display: flex;
    gap: 8px;
}

.kh-hero__ctrl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.kh-hero__ctrl:hover {
    border-color: #fff;
    background: #fff;
    color: var(--kh-g800);
}

.kh-hero__ctrl:active {
    transform: scale(.94);
}

#khHeroPause {
    font-size: 15px;
}

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

@media (max-width: 1199.98px) {
    .kh-hero__inner,
    .kh-hero__slide--notice .kh-hero__inner {
        gap: 44px;
    }

    .kh-hero__chip {
        left: -14px;
    }
}

@media (max-width: 991.98px) {
    .kh-hero__slide {
        align-items: flex-start;
        padding: 32px 0 40px;
    }

    .kh-hero__inner,
    .kh-hero__slide--notice .kh-hero__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
        min-height: 0;
    }

    /* Image first, copy underneath */
    .kh-hero__card,
    .kh-hero__card--poster {
        order: -1;
        justify-self: stretch;
        max-width: 640px;
        margin: 0 auto;
    }

    .kh-hero__card::before {
        inset: 12px -10px -12px 10px;
        border-radius: 24px;
    }

    .kh-hero__card img {
        aspect-ratio: var(--ratio, 16 / 10);
        border-radius: 22px;
    }

    .kh-hero__chip {
        left: 12px;
        bottom: 12px;
        padding: 9px 14px 9px 11px;
    }

    .kh-hero__chip i {
        font-size: 24px;
    }

    .kh-hero__copy {
        max-width: 640px;
        margin: 0 auto;
        width: 100%;
    }

    .kh-hero p.kh-hero__lead {
        font-size: 17px;
    }
}

@media (max-width: 575.98px) {
    .kh-hero__slide {
        padding: 24px 0 32px;
    }

    .kh-hero__inner {
        gap: 26px;
    }

    .kh-hero__chip {
        gap: 9px;
        padding: 8px 12px 8px 9px;
        border-radius: 12px;
    }

    .kh-hero__chip i {
        font-size: 20px;
    }

    .kh-hero__chip b {
        font-size: 13px;
    }

    .kh-hero__chip small {
        font-size: 12px;
    }

    .kh-hero h2.kh-hero__title {
        margin: 18px 0 12px;
    }

    .kh-hero p.kh-hero__lead {
        display: -webkit-box;
        -webkit-line-clamp: 4;
        line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 16px;
        line-height: 1.6;
    }

    .kh-hero__actions {
        gap: 10px;
        margin-top: 24px;
    }

    .kh-hero a.kh-hero__btn {
        flex: 1 1 auto;
        padding: 13px 20px;
        font-size: 15px;
    }

    .kh-hero__rail-inner {
        gap: 14px;
        min-height: 60px;
    }

    .kh-hero__count {
        display: none;
    }

    .kh-hero__dot {
        flex-basis: 48px;
    }

    .kh-hero__ctrl {
        width: 38px;
        height: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kh-hero .kh-anim,
    .kh-hero__card {
        transform: none;
        transition: opacity .2s ease;
        transition-delay: 0s !important;
    }

    .kh-hero__slide {
        transition-duration: .01ms;
    }
}
