/* =========================
   JEAZ TABS - LINE STYLE
========================= */

.jeaz-tabs {
    --tabs-text: #111827;
    --tabs-muted: #4e4e4e;
    --tabs-line: rgba(17, 24, 39, 0.12);
    --tabs-bg: #f5f6f7;
    --tabs-active: #0011d3;
    --tabs-active-soft: rgba(109, 93, 252, 0.18);
    --tabs-focus: rgba(109, 93, 252, 0.22);

    color: var(--tabs-text);
}

/* =========================
   NAV
========================= */

.jeaz-tabs__nav {
    display: flex;
    gap: 24px;
    position: sticky;
    background-color: var(--tabs-bg);
    backdrop-filter: blur(12px);
    top: 73px;

    margin-bottom: 8px;
    padding-top: 8px;

    overflow-x: auto;
    overflow-y: hidden;

    width: 100%;

    justify-content: flex-start;

    scrollbar-width: none;
    z-index: 1;
}


@media (min-width: 500px) {
    .jeaz-tabs__nav {
        justify-content: center;
    }
}

/* =========================
   BUTTON
========================= */

.jeaz-tabs__button {
    appearance: none;
    border: 0;
    background: transparent;
    font-size: inherit;

    position: relative;

    cursor: pointer;

    min-height: 32px;
    padding: 0 0 14px;

    color: var(--tabs-muted);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.03em;

    transition:
        color .25s ease,
        opacity .25s ease;
}

.jeaz-tabs__button:hover {
    color: var(--tabs-text);
}

.jeaz-tabs__button::after {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;

    height: 2px;
    background: linear-gradient(
        90deg,
        var(--tabs-active),
        color-mix(in srgb, var(--tabs-active) 72%, #ffffff)
    );

    transform: scaleX(0);
    transform-origin: center;

    opacity: 0;

    transition:
        transform .28s ease,
        opacity .28s ease;
}

.jeaz-tabs__button.is-active {
    color: var(--tabs-active);
    font-weight: 700;
}

.jeaz-tabs__button.is-active::after {
    transform: scaleX(1);
    opacity: 1;
}

/* =========================
   CONTENT
========================= */

.jeaz-tab-item {
    display: none;
    animation: jeazTabsFade .28s ease;
}

.jeaz-tab-item.is-active {
    display: block;
}

.jeaz-tab-item__content > *:first-child {
    margin-top: 0;
}

.jeaz-tab-item__content > *:last-child {
    margin-bottom: 0;
}

/* =========================
   ANIMATION
========================= */

@keyframes jeazTabsFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   FOCUS ACCESSIBILITY
========================= */

.jeaz-tabs__button:focus-visible {
    outline: none;
    color: var(--tabs-active);
}

.jeaz-tabs__button:focus-visible::before {
    content: "";

    position: absolute;
    inset: -8px -12px 6px;

    border-radius: 14px;
    background: var(--tabs-focus);
    z-index: -1;
}

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

@media (max-width: 600px) {
    .jeaz-tabs__nav {
        gap: 24px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .jeaz-tabs__nav::-webkit-scrollbar {
        display: none;
    }

    .jeaz-tabs__button {
        flex: 0 0 auto;
    }
}

/* =========================
   DARK MODE AUTOMATICO
========================= */

@media (prefers-color-scheme: dark) {
    .jeaz-tabs {
        --tabs-text: #f8fafc;
        --tabs-muted: #d1d1d1;
        --tabs-line: rgba(248, 250, 252, 0.14);
            --tabs-bg: rgba(15,23,42,.82);
        --tabs-active: #fff;
        --tabs-active-soft: rgba(155, 140, 255, 0.22);
        --tabs-focus: rgba(155, 140, 255, 0.20);
    }

    .jeaz-tabs__button::after {
        background: linear-gradient(
            90deg,
            var(--tabs-active),
            color-mix(in srgb, var(--tabs-active) 70%, #ffffff)
        );
    }
}