/**
 * VSTT Hero Slider Styles
 * * @package VSTT_Hero_Slider
 * @version 1.4.1
 */

/* ------------------------------------------------------------------------- *
 * 1. Utilities & Accessibility
 * ------------------------------------------------------------------------- */

/* Standard WordPress Screen Reader Class */
.u-screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* ------------------------------------------------------------------------- *
 * 2. Hero Wrapper & Backgrounds
 * ------------------------------------------------------------------------- */

.gkc-hero-slider-wrapper {
    /* Variables */
    --gkc-slider-accent: #0052ff; /* Fallback */
    --gkc-slider-bg: #111;
    --gkc-slider-text: #fff;
    --gkc-slider-overlay-z: 1;
    --gkc-slider-content-z: 2;

    /* Layout & Box Model */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100vh;
    padding: 2.5rem;
    box-sizing: border-box;
    border-radius: 8px;
    overflow: hidden;

    /* Visuals */
    background-color: #333;
    color: var(--gkc-slider-text);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    /* Background Logic */
    background-size: cover;
    background-position: center;
    transition: background-image 0.4s ease-in-out;

    /* Stacking Context (Prevents Z-Index wars with Theme) */
    isolation: isolate;
}

.gkc-hero-slider-wrapper[data-bg-type="dynamic"] {
    background-color: var(--gkc-slider-bg);
}

/* Static Background Layer (Image or Video) */
.gkc-hero-bg-static {
    position: absolute;
    inset: 0;
    z-index: var(--gkc-slider-overlay-z);
    background-size: cover;
    background-position: center;
    pointer-events: none; /* Let clicks pass through to slider if needed */
}

.gkc-hero-bg-static video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Layering */
.gkc-hero-content,
.gkc-hero-slider {
    position: relative;
    z-index: var(--gkc-slider-content-z);
}

.gkc-hero-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-bottom: 1.5rem; /* Spacing on mobile */
}

/* Tablet/Desktop Layout */
@media (min-width: 768px) {
    .gkc-hero-slider-wrapper {
        padding: 4rem;
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .gkc-hero-content {
        justify-content: flex-end;
        margin-bottom: 0;
        max-width: 50%; /* Prevent content from pushing slider too far */
    }
}

/* ------------------------------------------------------------------------- *
 * 3. Typography & CTA
 * ------------------------------------------------------------------------- */

.gkc-hero-h2 {
    font-size: clamp(2.25rem, 6vw, 4rem);
    line-height: 1.1;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    max-width: 14ch;
    color: #fff;
    min-height: 2.2em; /* Prevents layout jump during load */
    transition: opacity 0.3s ease-in-out;
}

@media (min-width: 768px) {
    .gkc-hero-h2 {
        line-height: 0.95;
    }
}

.gkc-hero-h2.gkc-fading {
    opacity: 0;
}

/* CTA Button */
.c-button.c-hero-alpha_cta {
    background: #fff;
    color: #000;
    border: 0;
    padding: 0;
    cursor: pointer;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.c-button.c-hero-alpha_cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Accessibility Focus State */
.c-button.c-hero-alpha_cta:focus-visible {
    outline: 3px solid var(--gkc-slider-accent);
    outline-offset: 2px;
}

.c-button_inner {
    display: block;
    padding: 0.75rem 1.5rem;
}

.c-button_label {
    font-size: 1rem;
    font-weight: 600;
}

/* ------------------------------------------------------------------------- *
 * 4. Slider Component
 * ------------------------------------------------------------------------- */

.gkc-hero-slider {
    background: #fff;
    color: #000;
    border-radius: 4px;
    width: 100%;
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

@media (min-width: 768px) {
    .gkc-hero-slider {
        width: auto;
        min-width: 400px;
        max-width: 450px;
        flex-shrink: 0;
    }
}

.gkc-slider-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
}

.gkc-slider-container {
    position: relative;
    overflow: hidden;
    min-height: 5.5em; /* Reserve space for content */
    flex: 1;
}

/* Slides */
.gkc-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(10px);
    position: absolute;
    inset: 0;
    width: 100%;
}

.gkc-slide.is-active {
    display: block;
    opacity: 1;
    transform: translateX(0);
    position: relative;
}

/* SEO Image Hiding (Strict) */
.gkc-slide-bg-element {
    display: none !important;
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.gkc-slide-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: #000;
    line-height: 1.2;
}

/* Bottom Row */
.gkc-slider-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 1rem;
}

.gkc-slide-readmore-link {
    color: #000;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.125rem;
    transition: color 0.2s ease;
}

.gkc-slide-readmore-link:focus-visible {
    outline: 2px solid var(--gkc-slider-accent);
    outline-offset: 4px;
    border-radius: 2px;
}

.gkc-slide-readmore {
    display: inline-block;
    padding-bottom: 2px;
    border-bottom: 2px solid var(--gkc-slider-accent);
}

.gkc-slide-readmore-link:hover .gkc-slide-readmore {
    color: var(--gkc-slider-accent);
}

.gkc-slider-pagination-wrapper {
    margin: 0;
    padding: 0;
}

.gkc-slider-pagination {
    font-size: 0.875rem;
    font-family: monospace; /* Tabular nums preferrably, but monospace works */
    color: #aaa;
    font-weight: 600;
}

/* ------------------------------------------------------------------------- *
 * 5. Navigation Arrows
 * ------------------------------------------------------------------------- */

.gkc-slider-nav-arrows {
    display: flex;
    flex-direction: column;
    width: 64px;
    flex-shrink: 0;
    border-inline-start: 1px solid #eee; /* Logical Property for RTL */
}

.gkc-slider-arrow {
    flex: 1;
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background-color 0.2s ease, color 0.2s ease;
    appearance: none; /* Reset UA styles */
    -webkit-appearance: none;
}

.gkc-slider-arrow:hover {
    background-color: #f0f0f0;
    color: #000;
}

.gkc-slider-arrow:focus-visible {
    background-color: #f9f9f9;
    outline: 2px solid var(--gkc-slider-accent);
    outline-offset: -2px; /* Pull outline inside */
    z-index: 10;
}

.gkc-slider-arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.gkc-slider-arrow.gkc-next {
    border-bottom: 1px solid #eee;
}

.gkc-slider-arrow svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
}

/* ------------------------------------------------------------------------- *
 * 6. Progress Bar (Autoplay)
 * ------------------------------------------------------------------------- */

.gkc-slider-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    z-index: 5;
    pointer-events: none;
}

.gkc-slider-progress-bar {
    height: 100%;
    background-color: var(--gkc-slider-accent);
    width: 0%;
    transform-origin: left;
}

.gkc-slider-progress-bar.is-playing {
    /* Animation duration injected via JS */
    animation-name: gkc-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes gkc-progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ------------------------------------------------------------------------- *
 * 7. Loader & Animations
 * ------------------------------------------------------------------------- */

/* Initial Load State: Hide inactive slides to prevent FOUC/Layout shifts */
.gkc-hero-slider-wrapper.gkc-is-loading .gkc-slide:not(.is-active) {
    display: none !important;
}

.gkc-hero-slider-wrapper.gkc-is-loading .gkc-slide.is-active {
    display: block !important;
    opacity: 1 !important;
    position: relative !important;
    transform: none !important;
}

/* Gentle Fade In for entire wrapper */
.gkc-hero-slider-wrapper {
    opacity: 0;
    animation: gkcFadeIn 0.5s ease forwards;
}

@keyframes gkcFadeIn {
    to { opacity: 1; }
}

/* ------------------------------------------------------------------------- *
 * 8. Media Queries & Accessibility Prefs
 * ------------------------------------------------------------------------- */

/* Mobile Adjustments */
@media (max-width: 767px) {
    .gkc-hero-slider-wrapper {
        padding: 1.5rem;
    }

    .gkc-slider-content-wrapper {
        padding: 1rem;
    }

    .gkc-slide-title {
        font-size: 1.25rem;
        min-height: 0;
    }

    .gkc-slider-container {
        min-height: 4em;
    }

    .gkc-slider-nav-arrows {
        width: 50px;
    }

    .gkc-slider-arrow {
        min-height: 44px; /* A11y: Minimum touch target size */
    }

    .gkc-slider-arrow svg {
        width: 20px;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .gkc-hero-slider-wrapper,
    .gkc-hero-h2,
    .gkc-slide,
    .c-button.c-hero-alpha_cta {
        transition: none !important;
        animation: none !important;
    }

    .gkc-slider-progress-bar.is-playing {
        animation: none !important;
        width: 0 !important; /* Hide progress bar if no animation */
    }
}