/*
 * IOA Events Section Widget Styles (S-Tier Edition)
 */

/* Scoped container for the IOA Events section */
.ioa-events-2025-v3 {
    /* Design System Variables */
    --color-title-1: #2E3A61;
    --color-title-2: #0AA7FF;
    --color-surface: #ffffff;
    --color-background: #E2E8F0; /* The authoritative Light Slate Grey */
    --color-text-primary: #111827;
    --color-text-secondary: #374151;
    --color-text-on-dark: #ffffff;
    
    /* Teleporter Consistency */
    --color-primary: #0AA7FF; 

    /* Shadows */
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.08);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing Scale */
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 2.5rem;
    --space-3xl: 3.5rem;
    --space-4xl: 5rem;

    /* Border Radius */
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    --radius-card: 16px;

    font-family: 'Inter', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
}

/* Scoped Reset */
.ioa-events-2025-v3 *,
.ioa-events-2025-v3 *::before,
.ioa-events-2025-v3 *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- Support for Superscript and Subscript --- */
/* Fixes line-height issues when using sup/sub in text areas */
.ioa-events-2025-v3 sup,
.ioa-events-2025-v3 sub {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.ioa-events-2025-v3 sup {
    top: -0.5em;
}

.ioa-events-2025-v3 sub {
    bottom: -0.25em;
}

/* =========================================
   TELEPORT SLOTS (Gold Standard Feature)
   ========================================= */
.ioa-teleport-slot {
    min-height: 0;
    transition: all 0.3s ease;
    margin-bottom: 0;
    width: 100%;
    display: block;
}

.ioa-teleport-slot.has-content {
    margin-bottom: 1.5rem;
    animation: ioa-fade-in 0.5s ease;
}

/* Editor Visuals - Visible only in Elementor Editor (.is-editor-mode added via PHP) */
.is-editor-mode .ioa-teleport-slot {
    min-height: 40px;
    border: 1px dashed rgba(10, 167, 255, 0.3); /* Using Brand Blue */
    background: rgba(10, 167, 255, 0.05);
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.is-editor-mode .ioa-teleport-slot::before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

@keyframes ioa-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* --- Layout & Header (Normal Mode) --- */
.ioa-events-2025-v3:not(.ioa-compact-mode) .ioa-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4xl) var(--space-xl);
    position: relative;
}

.ioa-events-2025-v3:not(.ioa-compact-mode) .ioa-header {
    margin-bottom: var(--space-3xl);
    /* Text align is now handled by Elementor controls */
}

/* 
   REMOVED hardcoded font-size: 42px. 
   Now inherits from HTML Tag (H2, H3...) or Elementor Typography settings 
*/
.ioa-events-2025-v3:not(.ioa-compact-mode) .ioa-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--color-title-1);
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.ioa-events-2025-v3:not(.ioa-compact-mode) .ioa-subtitle {
    font-size: 18px;
    color: var(--color-text-secondary);
    max-width: 700px;
    margin: 0 auto; /* Keeps it centered if block, text-align handled by control */
    line-height: 1.7;
}

/* --- Main Content Grid (Normal Mode) --- */
.ioa-events-2025-v3:not(.ioa-compact-mode) .ioa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

/* Logic for image position control */
.elementor-widget-ioa_events_section.ioa-events-image-pos-left .ioa-grid {
    direction: rtl; /* Reverses the order of grid items */
}
.elementor-widget-ioa_events_section.ioa-events-image-pos-left .ioa-grid > * {
    direction: ltr; /* Resets text direction for content inside */
}

.ioa-events-2025-v3:not(.ioa-compact-mode) .ioa-text-content {
    /* Text align is now handled by Elementor controls */
}

.ioa-events-2025-v3:not(.ioa-compact-mode) .ioa-description {
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: var(--space-2xl);
    color: var(--color-text-secondary);
}
.ioa-events-2025-v3 .ioa-description p:last-child {
    margin-bottom: 0;
}

.ioa-events-2025-v3:not(.ioa-compact-mode) .ioa-event-list {
    list-style: none;
    margin-bottom: var(--space-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.ioa-events-2025-v3:not(.ioa-compact-mode) .ioa-event-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    font-size: 16px;
    line-height: 1.6;
}

.ioa-events-2025-v3 .ioa-event-icon-wrapper {
    flex-shrink: 0;
    margin-top: 3px;
}

.ioa-events-2025-v3 .ioa-event-icon {
    width: 22px;
    height: 22px;
    fill: var(--color-title-2);
}

/* --- Image Visual --- */
.ioa-events-2025-v3 .ioa-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    object-fit: cover;
}

.ioa-events-2025-v3 .ioa-visual-wrapper:hover .ioa-image {
    transform: scale(1.03) translateY(-4px);
}

/* --- Button Wrapper --- */
.ioa-events-2025-v3 .ioa-btn-wrapper {
    display: flex;
    width: 100%;
    /* justify-content handled by controls */
}

/* --- Button (Base) --- */
.ioa-events-2025-v3 .ioa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    /* Padding/Radius defaults here but overridable by controls */
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    background: var(--color-title-1);
    color: var(--color-text-on-dark);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

.ioa-events-2025-v3 .ioa-btn:hover {
    transform: translateY(-3px);
    background: #1e293b;
    box-shadow: var(--shadow-xl);
}

/* --- Responsive Design (Mobile) --- */
@media (max-width: 900px) {
    .ioa-events-2025-v3 .ioa-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
        direction: ltr !important; /* Reset direction for mobile stacking */
    }

    .ioa-events-2025-v3 .ioa-text-content {
       order: 2;
    }

    .ioa-events-2025-v3 .ioa-visual-wrapper {
        order: 1;
    }
}

@media (max-width: 768px) {
    .ioa-events-2025-v3 .ioa-container {
        padding: var(--space-3xl) var(--space-lg);
    }
    /* Font size removed to allow control via typography settings, 
       but you can keep media queries if you want defaults */
}

/* =========================================
   COMPACT / PILLAR MODE
   ========================================= */

.ioa-events-2025-v3.ioa-compact-mode {
    height: 100%;
    display: flex;
    flex-direction: column;
    
    /* Pillar Styling: No rounded corners on container, grey background preserved */
    background-color: var(--color-background);
    border-radius: 0;
    box-shadow: none; 
    border: none;
}

.ioa-events-2025-v3.ioa-compact-mode .ioa-container {
    /* 1. Flexbox Column Layout */
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;

    /* 2. Standardized Padding */
    padding: 40px !important; 
    
    /* 3. Text Alignment Left (Default, can be overridden) */
    text-align: left;
}

/* 4. Header Section (Title/Subtitle) */
.ioa-events-2025-v3.ioa-compact-mode .ioa-header {
    text-align: left; /* Default */
    margin-bottom: 20px;
    /* Subtle separation for the pillar header */
    border-bottom: 2px solid rgba(0,0,0,0.05);
    padding-bottom: 15px;
}

.ioa-events-2025-v3.ioa-compact-mode .ioa-title {
    font-family: 'Poppins', sans-serif;
    /* Removed fixed 26px to allow H-tag inheritance */
    color: var(--color-title-1);
    line-height: 1.25;
    margin-bottom: 10px;
    margin-top: 0;
}

.ioa-events-2025-v3.ioa-compact-mode .ioa-subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--color-text-secondary);
}

/* 5. Main Content Area */
.ioa-events-2025-v3.ioa-compact-mode .ioa-text-content {
    width: 100%;
    margin-bottom: 0; 
}

/* Remove Grid behavior, enforce Vertical Stack */
.ioa-events-2025-v3.ioa-compact-mode .ioa-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 0;
    direction: ltr !important;
    /* Crucial: Grow to fill vertical space so button hits bottom */
    flex-grow: 1; 
}

/* 6. List Styling in Compact */
.ioa-events-2025-v3.ioa-compact-mode .ioa-description {
    font-size: 15px;
    margin-bottom: 15px;
}

.ioa-events-2025-v3.ioa-compact-mode .ioa-event-list {
    list-style: none; /* Fixed: Removes bullets */
    padding: 0;       /* Fixed: Removes default indent */
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ioa-events-2025-v3.ioa-compact-mode .ioa-event-item {
    display: flex;           /* Fixed: Flex layout for side-by-side alignment */
    align-items: flex-start; /* Fixed: Aligns checkmark with the first line of text */
    gap: 10px;               /* Fixed: Adds space between checkmark and text */
    font-size: 14px;
    line-height: 1.5;
}

/* 7. Image / Visual (Banner style in compact) */
.ioa-events-2025-v3.ioa-compact-mode .ioa-visual-wrapper {
    margin-bottom: 25px;
}

.ioa-events-2025-v3.ioa-compact-mode .ioa-image {
    /* KEY CHANGE: Fixed height ensures it doesn't push the section too tall */
    height: 220px; 
    width: 100%;
    object-fit: cover; /* Ensures image isn't squashed */
    border-radius: 4px;
}

/* 8. Footer Button Wrapper - Anchored Bottom */
.ioa-events-2025-v3.ioa-compact-mode .ioa-btn-wrapper {
    margin-top: auto; /* Pushes button to bottom of container */
    width: 100%;
    /* Justify content handled by controls, default defaults to left/stretch via controls */
}