/* =============================================================
   Accordion Image Block v4.3 — Frontend Styles
   Fixes: fixed height (no resize on click), uniform image size,
   better padding, smooth animations
============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Epilogue:wght@700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
.aib-section {
    --aib-accent:     #C8001A;
    --aib-bg-surface: #F0F1F4;
    --aib-bg-right:   #0b0b0b;
    --aib-white:      #ffffff;
    --aib-text:       #141414;
    --aib-sub:        #6b6b6b;
    --aib-line:       rgba(0,0,0,0.08);
    /* Fixed height — widget NEVER resizes on tab switch */
    --aib-height:     620px;
}

/* ── Outer reset ── */
.aib-section *,
.aib-section *::before,
.aib-section *::after { box-sizing: border-box; }

/* ── Wrapper — FIXED HEIGHT, never changes ── */
.aib-section {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--aib-bg-surface);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.04),
        0 8px 24px rgba(0,0,0,0.07),
        0 32px 80px rgba(0,0,0,0.09);
    /* KEY FIX: fixed height — no layout shift ever */
    height: var(--aib-height);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* =============================================================
   LEFT — Accordion Column
============================================================= */
.aib-acc-col {
    padding: 56px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--aib-line);
    background: var(--aib-white);
    /* Fixed height: scroll internally if needed */
    height: var(--aib-height);
    overflow: hidden;
}

/* Eyebrow */
.aib-eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: capitalize;
    color: var(--aib-accent);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.aib-eyebrow::before {
    content: '';
    width: 20px;
    height: 2px;
    background: var(--aib-accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Main section title */
.aib-sec-title {
    font-family: 'Epilogue', sans-serif;
    font-size: clamp(22px, 2.2vw, 30px);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -0.01em;
    margin: 0 0 36px;
    padding: 0;
    border: none;
    background: none;
    text-transform: capitalize;
    flex-shrink: 0;
}

/* Accordion list */
.aib-acc-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Item */
.aib-item {
    border-top: 1px solid var(--aib-line);
    flex-shrink: 0;
}
.aib-item:last-child { border-bottom: 1px solid var(--aib-line); }

/* Trigger button */
.aib-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 0;
    background: none !important;
    background-color: transparent !important;
    border: none;
    box-shadow: none;
    cursor: pointer;
    text-align: left;
    gap: 16px;
    font-family: inherit;
    transition: none;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}
.aib-trigger:hover,
.aib-trigger:focus,
.aib-trigger:active {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none;
    outline: none;
}
.aib-trigger:focus-visible {
    outline: 2px solid var(--aib-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.aib-trigger-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

/* Item number */
.aib-num {
    font-family: 'Epilogue', sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: #0d0d0d;
    letter-spacing: 0.06em;
    transition: color 0.3s ease;
    min-width: 22px;
    flex-shrink: 0;
    line-height: 1;
}

/* Accordion label */
.aib-label {
    font-size: 15px;
    font-weight: 600;
    color: #444;
    transition: color 0.3s ease, font-size 0.3s ease, font-weight 0.25s ease;
    line-height: 1.35;
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

/* Plus icon */
.aib-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.14);
    flex-shrink: 0;
    position: relative;
    background: transparent !important;
    transition: border-color 0.3s ease, transform 0.35s ease;
}
.aib-icon::before,
.aib-icon::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    background: #bbb;
    border-radius: 2px;
    transition: background 0.3s ease, transform 0.35s ease;
}
.aib-icon::before { width: 10px; height: 1.5px; transform: translate(-50%,-50%); }
.aib-icon::after  { width: 1.5px; height: 10px; transform: translate(-50%,-50%); }

/* ── Accordion Body ──
   KEY FIX: max-height animation keeps layout stable.
   Uses a generous max-height so text never gets clipped. */
.aib-body {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.35s ease;
    padding-left: 36px;
}

.aib-body-text {
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.72;
    color: var(--aib-sub);
    margin: 0;
    padding: 4px 0 20px;
    border: none;
    background: none;
    text-transform: none;
}

/* ── OPEN STATE ── */
.aib-item.aib-open .aib-num {
    color: var(--aib-accent);
}

.aib-item.aib-open .aib-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--aib-accent);
    font-family: 'Epilogue', sans-serif;
    letter-spacing: -0.01em;
    text-transform: capitalize;
}

.aib-item.aib-open .aib-icon {
    background: transparent !important;
    border-color: var(--aib-accent);
    transform: rotate(45deg);
}
.aib-item.aib-open .aib-icon::before,
.aib-item.aib-open .aib-icon::after {
    background: var(--aib-accent);
}

/* Body expands when open — generous max-height to fit any text */
.aib-item.aib-open .aib-body {
    max-height: 200px;
    opacity: 1;
}


/* =============================================================
   RIGHT — Visual / Dark Panel
   KEY FIX: fixed height, panels absolutely positioned
============================================================= */
.aib-vis-col {
    position: relative;
    background: var(--aib-bg-right);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: var(--aib-height);
}

/* Subtle dot-grid texture */
.aib-dot-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

/* Accent corner */
.aib-corner {
    position: absolute;
    top: 0; right: 0;
    width: 0; height: 0;
    border-top: 64px solid rgba(200,0,26,0.12);
    border-left: 64px solid transparent;
    z-index: 1;
    pointer-events: none;
}

/* Panel — absolutely stacked, only active shows.
   KEY FIX: absolute inset means NO height contribution → no resize */
.aib-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    /* Animation: fade + slight upward slide */
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity   0.45s ease,
        transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
    /* Padding for image + card + dots */
    padding: 28px 28px 52px;
    gap: 0;
}
.aib-panel.aib-panel-on {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* ── Image area — fills most of the panel ──
   KEY FIX: explicit fixed height so image NEVER changes panel height */
.aib-img-area {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    /* Extra padding around image for breathing room */
    margin-bottom: 0;
}

/* KEY FIX: image is always exactly 100% of its container */
.aib-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border: none;
    border-radius: 14px 14px 0 0;
    /* Smooth image transition within panel */
    transition: transform 0.6s ease;
}
.aib-panel.aib-panel-on .aib-img {
    transform: scale(1);
}
.aib-panel:not(.aib-panel-on) .aib-img {
    transform: scale(1.04);
}

/* Empty state */
.aib-img-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    border-radius: 14px 14px 0 0;
}

/* ── Overlay card on image ── */
.aib-img-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 62%;
    background: var(--aib-white);
    border-radius: 0 16px 0 0;
    padding: 18px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 4px -4px 20px rgba(0,0,0,0.12);
    /* Slide in with panel */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}
.aib-panel:not(.aib-panel-on) .aib-img-overlay {
    transform: translateX(-12px);
    opacity: 0;
}
.aib-panel.aib-panel-on .aib-img-overlay {
    transform: translateX(0);
    opacity: 1;
    transition-delay: 0.15s;
}

.aib-overlay-title {
    display: block;
    font-family: 'Epilogue', sans-serif;
    font-size: 14px;
    font-weight: 900;
    color: var(--aib-text);
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-transform: capitalize;
}

.aib-overlay-desc {
    font-size: 12px;
    font-weight: 400;
    color: #666;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    text-transform: none;
}

.aib-overlay-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--aib-accent);
    text-decoration: none;
    transition: gap 0.2s ease;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}
.aib-overlay-link:hover { gap: 13px; }
.aib-overlay-link svg { flex-shrink: 0; }

/* ── Info card — fixed height at bottom ── */
.aib-card {
    flex-shrink: 0;
    background: linear-gradient(
        135deg,
        var(--aib-accent) 0%,
        color-mix(in srgb, var(--aib-accent) 60%, #6a0dad) 55%,
        #6a0dad 100%
    );
    border-radius: 0 0 14px 14px;
    padding: 20px 22px 22px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0 20px;
    align-items: center;
    /* KEY FIX: fixed min-height so card is always same size */
    min-height: 108px;
    /* Animate card up with panel */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}
.aib-panel:not(.aib-panel-on) .aib-card {
    transform: translateY(10px);
    opacity: 0;
}
.aib-panel.aib-panel-on .aib-card {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.1s;
}

.aib-card-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    line-height: 1.4;
    letter-spacing: 0.01em;
    text-align: center;
    text-transform: capitalize;
    border-right: 1px solid rgba(255,255,255,0.20);
    padding-right: 20px;
}

.aib-card-desc {
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.65;
    color: rgba(255,255,255,0.85);
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    text-transform: none;
}

/* ── TinyMCE / HTML content styling ── */
.aib-body-text p,
.aib-overlay-desc p,
.aib-card-desc p {
    margin: 0 0 8px;
    padding: 0;
}
.aib-body-text p:last-child,
.aib-overlay-desc p:last-child,
.aib-card-desc p:last-child { margin-bottom: 0; }

.aib-body-text a    { color: var(--aib-accent); text-decoration: underline; }
.aib-card-desc a    { color: rgba(255,255,255,0.9); text-decoration: underline; }
.aib-body-text ul,
.aib-body-text ol   { margin: 0 0 8px 18px; padding: 0; }
.aib-body-text li   { margin-bottom: 4px; }
.aib-body-text strong { font-weight: 700; }
.aib-body-text em   { font-style: italic; }

/* ── Progress bar ── */
.aib-prog {
    position: absolute;
    bottom: 14px;
    left: 18px; right: 18px;
    z-index: 3;
    display: flex;
    gap: 5px;
}

.aib-prog-dot {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    border: none;
    background: rgba(255,255,255,0.12);
    cursor: pointer;
    padding: 0;
    transition: background 0.35s ease;
    -webkit-appearance: none;
    appearance: none;
}
.aib-prog-dot.aib-prog-on { background: var(--aib-accent); }
.aib-prog-dot:focus-visible {
    outline: 2px solid var(--aib-accent);
    outline-offset: 3px;
}

/* =============================================================
   RESPONSIVE
============================================================= */

@media (max-width: 1024px) {
    .aib-section { --aib-height: 580px; }
}

@media (max-width: 900px) {
    .aib-section      { --aib-height: 560px; }
    .aib-acc-col      { padding: 36px 30px; }
    .aib-panel        { padding: 18px 18px 46px; }
    .aib-img-overlay  { width: 70%; padding: 14px 16px 16px; }
    .aib-overlay-title { font-size: 12px; }
    .aib-card         { min-height: 96px; padding: 16px 18px 18px; }
    .aib-prog         { left: 14px; right: 14px; }
}

@media (max-width: 660px) {
    .aib-section {
        grid-template-columns: 1fr;
        border-radius: 18px;
        height: auto;
    }
    .aib-acc-col {
        order: 1;
        border-right: none;
        border-bottom: 1px solid var(--aib-line);
        padding: 32px 24px;
        justify-content: flex-start;
        height: auto;
        overflow: visible;
    }
    .aib-vis-col {
        order: 2;
        height: 420px;
        border-radius: 0 0 18px 18px;
    }
    .aib-item.aib-open .aib-label { font-size: 18px; }
    .aib-sec-title  { font-size: 20px; margin-bottom: 28px; }
    .aib-panel      { padding: 10px 10px 44px; }
    .aib-card       { grid-template-columns: 1fr; gap: 10px; min-height: auto; }
    .aib-card-title { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.20); padding-right: 0; padding-bottom: 10px; text-align: left; }
    .aib-img-overlay { width: 80%; }
    .aib-prog       { left: 10px; right: 10px; }
}

@media (max-width: 400px) {
    .aib-acc-col    { padding: 24px 18px; }
    .aib-trigger    { padding: 14px 0; }
    .aib-label      { font-size: 13px; }
    .aib-item.aib-open .aib-label { font-size: 16px; }
    .aib-img-overlay { width: 88%; }
}
