/* General Reset for Plugin Scope */
.th-slider-wrapper {
    position: relative;
    width: 100%;
    max-width: 1920px;
    aspect-ratio: 1920 / 700;
    margin: 0 auto;
    margin-bottom: 8vw; /* Space below so overlapping thumbs don't hide content */
    background: #000;
    overflow: visible; /* Changed to visible for overlapping thumbs */
    font-family: inherit;
    color: #fff;
    /* Scales font size exactly relative to container width */
    font-size: clamp(6px, 0.8vw, 16px);
}

.th-slider-wrapper * {
    box-sizing: border-box;
}

/* Backgrounds */
.th-backgrounds {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden; /* Keep backgrounds strictly inside */
}

.th-bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    visibility: hidden;
}

.th-bg-slide.active {
    visibility: visible;
}

/* Blinds Transition Container */
.th-blinds-container {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
}

.th-blind-col {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.th-blind-inner {
    position: absolute;
    top: 0;
    height: 100%;
    width: 500%; /* 5 columns */
    background-size: cover;
    background-position: center;
}

.th-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.1) 100%);
    z-index: 3;
    pointer-events: none;
}

/* Content Container Grid */
.th-slider-content {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    padding: 3% 5%;
    pointer-events: none;
}

/* Text Area */
.th-text-area {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 50%;
    pointer-events: auto;
}

.th-title {
    line-height: 1.1;
    margin: 0 0 0.5em 0;
    font-weight: 400;
    transition: opacity 0.5s;
}

.th-desc {
    line-height: 1.6;
    margin: 0 0 2em 0;
    transition: opacity 0.5s;
}

.th-title.fade-out, .th-desc.fade-out {
    opacity: 0;
}

.th-btn-group {
    pointer-events: auto;
}

.th-primary-btn {
    display: inline-block;
    padding: 0.8em 2em;
    background: #D4AF37;
    color: #000;
    text-decoration: none;
    font-size: 1.1em;
    border-radius: 0.5em;
    font-weight: bold;
}

/* Thumbnails (Overlapping Bottom Edge) */
.th-thumbnails-area {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    display: flex;
    align-items: flex-end;
    pointer-events: auto;
    transform: translateY(50%); /* Moves them down by exactly half their height */
    z-index: 10;
}

.th-thumb-container {
    display: flex;
    gap: 1.5em;
}

.th-thumb {
    width: 14em;
    height: 14em;
    border-radius: 1em;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 0.15em solid transparent;
    box-shadow: 0 0.5em 1.5em rgba(0,0,0,0.5);
    transition: border-color 0.3s ease;
}
.th-thumb:hover { border-color: #D4AF37; }

/* Stats (Glassmorphism Effect) */
.th-stats-area {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    pointer-events: auto;
}

.th-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5em;
    text-align: left;
}

.th-stat-item {
    background: rgba(255, 255, 255, 0.05); /* Very light white */
    backdrop-filter: blur(12px); /* Glass effect */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1em;
    padding: 1.5em;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.th-stat-val {
    font-size: 3em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 0.2em;
    line-height: 1;
}

.th-stat-label {
    font-family: sans-serif;
    font-size: 0.9em;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Mobile Specific Override */
@media (max-width: 768px) {
    .th-slider-wrapper {
        margin-bottom: 10px;
    }
    .th-slider-content {
        padding: 10px 15px; /* Tighter padding */
    }
    .th-thumbnails-area {
        transform: translateY(0); /* Bring inside the image */
    }
    .th-thumb-container {
        gap: 5px;
    }
    .th-thumb {
        width: 40px !important;
        height: 40px !important;
        border-radius: 4px !important;
        border-width: 1px !important;
    }
    
    .th-stats-area {
        transform: translateY(0);
    }
    .th-stats-grid {
        gap: 5px;
    }
    .th-stat-item {
        padding: 4px;
        border-radius: 4px;
        min-width: 40px;
        min-height: 35px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    .th-stat-val {
        font-size: 11px;
        margin-bottom: 1px;
    }
    .th-stat-label {
        font-size: 6px;
        letter-spacing: 0;
        line-height: 1.1;
    }
    
    /* Make button smaller so it doesn't push things down */
    .th-primary-btn {
        padding: 5px 12px;
        font-size: 10px;
        border-radius: 3px;
    }
    .th-desc {
        margin: 0 0 10px 0;
    }
}
