/* 
=========================================
IOA ORGANIZATION STYLE (GOLD STANDARD S-TIER)
=========================================
*/

.ioa-organization-2025-v2 { 
    /* Core palette - Default State preserved */
    --color-title: #2E3A61;
    --color-text: #374151;
    --color-accent: #0AA7FF;
    --color-bg: #f8fafc;
    
    /* Spacing & Layout Defaults */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    
    font-family: 'Inter', sans-serif; 
    line-height: 1.7; 
    background-color: var(--color-bg);
    position: relative;
    width: 100%;
}

.ioa-organization-2025-v2 *,
.ioa-organization-2025-v2 *::before,
.ioa-organization-2025-v2 *::after { 
    box-sizing: border-box; 
}

/* Container */
.ioa-container { 
    margin: 0 auto; 
    width: 100%; 
    max-width: 1280px;
    padding: var(--space-lg);
}

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

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

/* Editor Visuals - Visible only in Elementor Editor */
.is-editor-mode .ioa-teleport-slot {
    min-height: 40px;
    border: 1px dashed rgba(10, 167, 255, 0.4);
    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: #0c4a6e;
    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); }
}

/* =========================================
   GRID & CARDS SYSTEM
   ========================================= */
.ioa-org-grid {
    display: grid;
    grid-template-columns: repeat(var(--ioa-card-columns, 3), 1fr);
    gap: var(--ioa-card-gap, 2rem);
    width: 100%;
}

/* Masonry Support */
.ioa-org-grid.masonry {
    display: block;
    column-count: var(--ioa-card-columns, 3);
    column-gap: var(--ioa-card-gap, 2rem);
}

.ioa-org-grid.masonry .ioa-org-card {
    margin-bottom: var(--ioa-card-gap, 2rem);
    break-inside: avoid;
}

/* Card Styling */
.ioa-org-card { 
    position: relative; 
    overflow: hidden; 
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.ioa-org-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Accent Strip */
.ioa-org-card::before { 
    content: ""; 
    position: absolute; 
    top: 0; 
    left: 0; 
    height: 100%; 
    width: 4px; /* Default, overridden by controls */
    background: linear-gradient(to bottom, #2E3A61, #0AA7FF);
    opacity: 0.9; 
    z-index: 1;
    transition: width 0.3s ease;
}

.ioa-org-card .ioa-card-content { 
    margin-bottom: 0; 
    position: relative;
    z-index: 2;
    color: var(--color-text);
    width: 100%;
}

/* Typography Defaults for Content */
.ioa-org-card .ioa-card-content p {
    margin-bottom: 1em;
}
.ioa-org-card .ioa-card-content p:last-child {
    margin-bottom: 0;
}

/* Superscript/Subscript Support */
.ioa-org-card sup {
    vertical-align: super;
    font-size: smaller;
}
.ioa-org-card sub {
    vertical-align: sub;
    font-size: smaller;
}

/* =========================================
   CHART SECTION
   ========================================= */
.ioa-chart-section { 
    margin-top: 5rem; 
    width: 100%;
}

.ioa-chart-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    margin-bottom: 2rem; 
    padding-bottom: 1rem; 
    border-bottom: 1px solid #e5e7eb;
}

.ioa-chart-title-wrapper h2 { 
    margin: 0; 
    color: var(--color-title);
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    line-height: 1.2;
}

.ioa-chart-meta { 
    text-transform: uppercase; 
    color: #0563C1;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding-bottom: 4px; /* Alignment adjustment */
}

/* Chart Container */
.ioa-chart-container { 
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 100%;
    overflow-x: auto; /* Handle overflow on small screens */
}

.ioa-org-chart { 
    width: 100%; 
    height: auto; 
    min-width: 800px; /* Ensure chart doesn't squish */
    display: block; 
    margin: 0 auto; 
}

/* SVG Interactive Elements */
.ioa-org-box { 
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.05)); 
    transition: all 0.3s ease;
    cursor: pointer;
}

.ioa-org-box:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15)); 
    stroke-width: 2px;
}

.ioa-org-line { 
    fill: none; 
    stroke: #d1d5db;
    stroke-width: 1;
    transition: stroke 0.3s ease;
}

.ea3g-org-title { 
    text-anchor: middle; 
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    fill: #111827;
}

/* ForeignObject Typography for SVG Nodes */
.ioa-fo-wrapper { 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    height: 100%; 
    text-align: center; /* Default, overridden by JS/CSS controls */
    line-height: 1.3; 
    padding: 4px;
    width: 100%;
}

.ioa-fo-title { 
    word-break: break-word; 
    display: block; 
    font-weight: 600;
    color: #111827;
    font-size: 14px;
    width: 100%;
}

.ioa-fo-subtitle { 
    word-break: break-word; 
    margin-top: 2px; 
    display: block;
    color: #374151;
    font-size: 12px;
    width: 100%;
}

.ioa-fo-subtitle.bold { 
    font-weight: 700; 
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 1100px) { 
    .ioa-org-grid:not(.masonry) { 
        grid-template-columns: repeat(2, 1fr); 
    } 
    .ioa-chart-header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 1rem;
    } 
    .ioa-chart-meta { 
        margin-top: 0; 
    } 
}

@media (max-width: 768px) { 
    .ioa-container {
        padding: var(--space-sm);
    }
    .ioa-org-grid:not(.masonry) { 
        grid-template-columns: 1fr; 
    } 
    .ioa-chart-section { 
        margin-top: 3rem; 
    }
    .ioa-org-card {
        padding: 1.5rem;
    }
}