/**
 * VSTT More Details - Master Luxury Edition
 * Layout: Vertical List -> Expands to Content + Image Split
 * Style: Minimalist, High-Contrast (Matches Service Extras)
 *
 * @package VSTT_Layouts
 */

.vstt-details-wrapper {
    /* Variables */
    --vstt-border-color: rgba(0, 0, 0, 0.1);
    --vstt-bg-active: #111111;   /* Luxury Black */
    --vstt-text-active: #ffffff; /* White text */
    --vstt-transition: all 0.35s ease-in-out;
    
    width: 100%;
    margin: 40px 0;
    font-family: inherit;
    color: var(--vstt-text-main, #333);
}

.vstt-details-wrapper * {
    box-sizing: border-box;
}

/* --- List Item Container --- */
.vstt-detail-item {
    border-top: 1px solid var(--vstt-border-color);
    transition: background-color 0.35s ease;
}

.vstt-detail-item:last-child {
    border-bottom: 1px solid var(--vstt-border-color);
}

/* --- Trigger Button --- */
.vstt-detail-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: inherit;
    transition: all 0.3s ease;
    outline: none;
}

.vstt-detail-trigger:hover {
    opacity: 0.7;
}

/* Accessibility: Keyboard Focus State */
.vstt-detail-trigger:focus-visible {
    outline: 2px solid var(--vstt-text-main, #333);
    outline-offset: -4px;
}

/* Typography - FORCE COLOR to fix Theme Overrides */
.vstt-detail-title {
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    color: inherit !important; /* Forces container color, overriding theme H3/Link colors */
}

/* Arrow Icon */
.vstt-icon-arrow {
    font-size: 1.3em;
    line-height: 1;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- ACTIVE STATE (Luxury Black) --- */

/* 1. Apply Black BG when parent has active class */
.vstt-detail-item.vstt-active-item {
    background-color: var(--vstt-bg-active) !important;
    color: var(--vstt-text-active) !important;
}

/* 2. Force text to White when active */
.vstt-detail-item.vstt-active-item .vstt-detail-trigger,
.vstt-detail-item.vstt-active-item .vstt-detail-title,
.vstt-detail-item.vstt-active-item .vstt-icon-arrow {
    color: var(--vstt-text-active) !important;
}

/* 3. Keyboard Focus in Active State */
.vstt-detail-item.vstt-active-item .vstt-detail-trigger:focus-visible {
    outline-color: #fff;
}

/* 4. Rotate Arrow */
.vstt-detail-trigger[aria-expanded="true"] .vstt-icon-arrow {
    transform: rotate(180deg);
}

/* --- The Panel --- */
.vstt-detail-panel {
    display: none; /* Default hidden */
    padding: 0 30px 40px 30px;
}

/* CRITICAL FIX: If PHP says it's expanded, SHOW IT immediately via CSS to prevent FOUC */
.vstt-detail-trigger[aria-expanded="true"] + .vstt-detail-panel {
    display: block;
}

/* Active Panel Styling */
.vstt-detail-item.vstt-active-item .vstt-detail-panel {
    color: var(--vstt-text-active);
}

/* --- Grid Layout --- */
.vstt-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50% 50% split */
    gap: 50px;
    align-items: start;
    padding-top: 20px;
}

/* Left Side: Content */
.vstt-panel-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vstt-panel-heading {
    margin: 0;
    font-size: 1.8em;
    line-height: 1.2;
    font-weight: 400;
    color: inherit !important; /* Inherit white from parent */
}

.vstt-panel-body {
    line-height: 1.7;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.85) !important; /* Force white text */
}

/* WYSIWYG List Fixes */
.vstt-panel-body ul, 
.vstt-panel-body ol {
    margin-left: 20px;
    color: inherit !important;
}

/* Button */
.vstt-btn-details {
    display: inline-block;
    align-self: flex-start;
    padding: 12px 35px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff !important;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.vstt-btn-details:hover {
    background: #fff;
    color: #000 !important;
    border-color: #fff;
}

/* Right Side: Image */
.vstt-panel-image {
    width: 100%;
    aspect-ratio: 4/3;
    position: relative;
    overflow: hidden;
}

.vstt-img-responsive {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.vstt-detail-item:hover .vstt-img-responsive {
    transform: scale(1.02);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 900px) {
    .vstt-panel-grid {
        grid-template-columns: 1fr; /* Stack vertically */
        gap: 30px;
    }

    .vstt-detail-trigger {
        padding: 20px;
    }
    
    .vstt-detail-panel {
        padding: 0 20px 30px 20px;
    }

    .vstt-panel-image {
        order: -1; /* Image above text on mobile */
        aspect-ratio: 16/9;
        max-height: 300px;
    }
    
    .vstt-panel-heading {
        font-size: 1.5em;
    }
}