/**
 * Agency Custom Elementor Widgets — Side Nested Tabs
 * side-nested-tabs.css
 *
 * Panels use position:absolute within a position:relative wrap.
 * Wrap height is set explicitly by JS to match the active panel's scrollHeight.
 * This is the only approach that is 100% reliable across all themes:
 *   - No layout shift (height is always an explicit pixel value)
 *   - No content below the widget affected
 *   - No dependency on grid, flex, or display tricks
 */

/* ── Widget root ─────────────────────────────────────────────────────────── */
/* The outer border lives here so it is controlled by one Elementor selector.
   Keeping border off .acew-snt-tab-bar avoids overflow:hidden + border
   conflicts that cause inconsistent colour rendering inside editor iframes. */
.acew-snt-widget {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e1e8ef;
    overflow: hidden; /* clips inner content to the border-radius corners */
}

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.acew-snt-tab-bar {
    display: flex;
    border: none;
    border-radius: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.acew-snt-tab {
    flex: 1;
    padding: 15px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    color: #637a94;
    background-color: rgba(240, 244, 248, 0.5);
    cursor: pointer;
    transition: background-color 0.25s, color 0.25s;
    user-select: none;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    background-image: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    /* Hard-reset all sides so theme global button borders cannot bleed in.
       !important is intentional here — these sides are never user-configurable. */
    border-top: none !important;
    border-left: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    /* Right-side divider driven by Elementor custom properties.
       !important ensures theme rules cannot override our controlled values. */
    border-right-style: solid !important;
    border-right-width: var(--acew-tab-divider-width, 1px) !important;
    border-right-color: var(--acew-tab-divider-color, #e1e8ef) !important;
}

/* Last tab has no trailing divider */
.acew-snt-tab:last-child { border-right: none !important; }

/* No outer radius — flat edge-to-edge tab bar */
.acew-snt-tab:first-child,
.acew-snt-tab:last-child {
    border-radius: 0 !important;
}

.acew-snt-tab:hover:not(.active) {
    color: #0f172a;
    background-color: rgba(240, 244, 248, 0.9);
}

.acew-snt-tab.active {
    background-color: var(--acew-accent, #F15548);
    color: #ffffff;
    /* Pull active tab down 1px to cover the panel border-top */
    position: relative;
    z-index: 1;
    margin-bottom: -1px;
    padding-bottom: 16px;
}

.acew-snt-tab:focus-visible {
    outline: 2px solid var(--acew-accent, #F15548);
    outline-offset: -2px;
    position: relative;
    z-index: 1;
}

/* ── Panel wrap ──────────────────────────────────────────────────────────────
   position: relative  = positioning context for absolute panels
   height              = set in JS to match active panel's scrollHeight
   overflow: hidden    = hides inactive panels that extend below
   transition: height  = smooth resize when switching between panels of
                         different heights (e.g. one panel has more text)
──────────────────────────────────────────────────────────────────────────── */
.acew-snt-panel-wrap {
    position: relative;
    background-color: #ffffff;
    border: none; /* outer border lives on .acew-snt-widget */
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    box-sizing: border-box;
    /* height set by JS — transition makes height changes smooth */
    transition: height 0.2s ease;
}

.acew-snt-panel-wrap.acew-snt-shadow {
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

/* ── Individual panels ───────────────────────────────────────────────────── */
/* All panels are absolutely positioned within the wrap.                     */
/* Only the active panel's height contributes to the wrap (via JS).         */
.acew-snt-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 40px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.acew-snt-panel.active {
    opacity: 1;
    pointer-events: auto;
    /* position: relative makes active panel contribute to scrollHeight for JS */
    position: relative;
}

/* ── Decorative number ───────────────────────────────────────────────────── */
.acew-snt-num {
    display: block;
    font-family: inherit;
    font-size: 56px;
    font-weight: 400;
    color: var(--acew-accent, #F15548);
    opacity: 0.18;
    line-height: 1;
    margin-bottom: 16px;
}

/* ── Panel heading ───────────────────────────────────────────────────────── */
.acew-snt-panel-heading {
    font-family: inherit;
    font-size: clamp(1.1rem, 1.8vw, 1.375rem);
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
    margin: 0 0 16px 0;
    padding: 0;
}

/* ── Panel body ──────────────────────────────────────────────────────────── */
.acew-snt-panel-body {
    font-size: 17px;
    line-height: 1.75;
    color: #475b73;
}

.acew-snt-panel-body p { margin: 0 0 1em 0; }
.acew-snt-panel-body p:last-child { margin-bottom: 0; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .acew-snt-tab {
        font-size: 10px;
        padding: 12px 6px;
        letter-spacing: 0.04em;
    }

    .acew-snt-panel {
        padding: 24px;
    }

    .acew-snt-num {
        font-size: 40px;
    }
}

/* ── Reduce motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .acew-snt-panel-wrap { transition: none; }
    .acew-snt-tab        { transition: none; }
    .acew-snt-panel      { transition: none; }
}
