/*
 * VSTT AdsTabs Styles 
 * Version: 1.0.0
 * Note: Google Fonts (Outfit) are loaded via wp_enqueue_scripts in Core.php
 */

:root {
    --vstt-obsidian: #0C232A;
    --vstt-grey-text: #B0B0B0; 
    --vstt-border: #E5E7EB;
    --vstt-stone: #0C232A;
    --vstt-sun: #e30a17;
    --vstt-timing: 0.6s;
    --vstt-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. WRAPPER & RESET (Full Width Breakout) */
.vstt-wrapper {
    font-family: 'Outfit', sans-serif;
    position: relative;
    box-sizing: border-box;
    background: transparent;

    /* Logic to break out of parent containers to full viewport width */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    
    /* Prevent horizontal scroll on Windows */
    overflow-x: hidden; 
    padding: 0;
}

/* Isolation: strict box-sizing for plugin internals */
.vstt-wrapper *,
.vstt-wrapper *::before,
.vstt-wrapper *::after {
    box-sizing: border-box;
}

.vstt-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

/* 2. ITEM BORDER */
.vstt-item {
    border-bottom: 1px solid var(--vstt-border);
    border-top: 0;
    border-left: 0;
    border-right: 0;
    width: 100%;
    margin: 0;
    transition: border-color 0.3s ease;
}

.vstt-item.vstt-active {
    border-bottom: 1px solid var(--vstt-obsidian);
}

/* 3. TRIGGER BUTTON */
.vstt-trigger {
    width: 100%;
    max-width: 1200px; 
    margin: 0 auto;
    padding: 50px 20px 10px 20px; 
    display: flex;
    justify-content: space-between;
    align-items: flex-end; 
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    appearance: none; /* Remove native button styling */
}

/* Focus States (Accessibility) */
.vstt-trigger:focus {
    outline: none;
}

.vstt-trigger:focus-visible {
    outline: 2px solid var(--vstt-obsidian);
    outline-offset: 5px;
    border-radius: 4px;
}

/* 4. TYPOGRAPHY */
.vstt-title {
    font-family: 'Outfit', sans-serif;
    /* Fluid typography for better scaling */
    font-size: clamp(1.5rem, 3vw, 3rem); 
    font-weight: 700; 
    text-transform: capitalize; 
    color: var(--vstt-grey-text); 
    line-height: 1.1; 
    margin: 0;
    padding: 0 20px 0 0;
    flex: 1; 
    
    /* Break long words prevents overflow */
    word-break: break-word; 
    overflow-wrap: break-word;
    hyphens: auto;
    
    transition: color 0.4s ease;
}

.vstt-trigger:hover .vstt-title,
.vstt-trigger[aria-expanded="true"] .vstt-title {
    color: var(--vstt-obsidian);
}

/* 5. ICON SYSTEM */
.vstt-icon {
    position: relative;
    width: 40px; 
    height: 40px;
    flex-shrink: 0; 
    margin-left: auto; 
    margin-bottom: 5px; 
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.vstt-line {
    position: absolute;
    background-color: var(--vstt-obsidian);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.vstt-line-h { width: 100%; height: 2px; }
.vstt-line-v { width: 2px; height: 100%; }

/* Hover: Rotate to 45deg */
.vstt-trigger:hover .vstt-icon {
    transform: rotate(45deg);
}

/* Active: Reset rotation, hide vertical line */
.vstt-trigger[aria-expanded="true"] .vstt-icon {
    transform: rotate(0deg);
}
.vstt-trigger[aria-expanded="true"] .vstt-line-v {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0);
}

/* 6. CONTENT PANEL */
.vstt-content {
    /* JS controls height/opacity/hidden. CSS handles transition. */
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: height var(--vstt-timing) var(--vstt-ease), opacity 0.5s ease;
    background-color: transparent;
    will-change: height, opacity;
}

.vstt-item.vstt-active .vstt-content {
    opacity: 1;
    padding-bottom: 60px; 
}

.vstt-content-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0 20px;
    display: flex;
    flex-direction: column-reverse; /* Mobile: Text below image */
    gap: 30px;
    align-items: flex-start;
}

.vstt-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.vstt-desc {
    font-size: 1.25rem;
    color: var(--vstt-obsidian);
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 600;
    text-transform: uppercase;
    max-width: 650px;
}

.vstt-desc p {
    margin-bottom: 1em;
}
.vstt-desc p:last-child {
    margin-bottom: 0;
}

/* CTA Button */
.vstt-btn {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--vstt-stone);
    text-decoration: none;
    transition: color 0.3s ease;
    width: fit-content;
    margin-top: 10px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.vstt-btn:hover,
.vstt-btn:focus {
    color: var(--vstt-sun);
    outline: none;
}

.vstt-arrow {
    width: 30px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
}

.vstt-btn:hover .vstt-arrow {
    transform: translateX(10px);
}

/* Image Wrapper */
.vstt-right {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    background-color: #f0f0f1; /* Placeholder loading color */
}

.vstt-right img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s ease;
    margin: 0;
    max-width: 100%;
}

/* DESKTOP LAYOUT */
@media (min-width: 960px) {
    .vstt-content-inner {
        flex-direction: row;
        align-items: flex-start; 
        gap: 60px;
        padding-top: 40px; 
    }
    
    .vstt-desc {
        font-size: 1.5rem;
    }

    .vstt-right {
        width: 450px;
        height: 350px;
        flex-shrink: 0;
    }
}

/* REDUCED MOTION PREFERENCE */
@media (prefers-reduced-motion: reduce) {
    .vstt-content,
    .vstt-title,
    .vstt-icon,
    .vstt-line,
    .vstt-arrow,
    .vstt-right img {
        transition: none !important;
        animation: none !important;
    }
}

/* PRINT STYLES */
@media print {
    .vstt-wrapper {
        width: 100% !important;
        margin: 0 !important;
        position: static !important;
    }
    .vstt-trigger {
        page-break-after: avoid;
    }
    .vstt-content {
        height: auto !important;
        opacity: 1 !important;
        display: block !important;
    }
    .vstt-icon, .vstt-btn svg {
        display: none;
    }
}