/* ════════════════════════════════════════════════════════════════════════
   MODULE: Tabs / FAQ Tabs — PRO redesign   (round 62)
   ════════════════════════════════════════════════════════════════════════
   Replaces the legacy .module-tabs-nav / .module-tabs-btn styling from
   sections.css with a more modern, polished version.

   This file is loaded AFTER sections.css so its rules override.

   Two main improvements:

   1) Desktop — modern look
      • Inactive tabs: muted gray (was gold — gold everywhere felt loud)
      • Active tab:    navy text + thicker gold underline + subtle lift
      • Hover state:   text fades to navy + ghost underline previews active
      • Smooth animated underline using ::after pseudo-element

   2) Mobile — single horizontal scroll row (was: 6 tabs wrapping into
      3+ chaotic rows)
      • flex-wrap: nowrap forces single row
      • overflow-x: auto + scroll-snap for natural touch swipe
      • Edge gradient fades on the right hint that more tabs exist
      • Active tab gets scroll-margin so it doesn't end at the edge
      • Tap targets stay 44px tall for accessibility

   Compatible with both [tabs] and [faq-tabs] modules — both reuse the
   same `.module-tabs-nav` / `.module-tabs-btn` markup.
   ════════════════════════════════════════════════════════════════════════ */


/* ── Wrapper to host the gradient edge fades on mobile ──
   Achieved by making the nav itself the scroll container and
   adding ::before / ::after via the parent module section.
   We do this by wrapping the nav with a positioned parent. */

/* Reset the legacy mobile rule that wrapped tabs onto multiple rows */
.module-tabs-nav,
.module-faq-tabs .module-tabs-nav {
    flex-wrap: nowrap !important;          /* Single row, ALWAYS */
    overflow-x: auto !important;
    overflow-y: hidden;
    scroll-snap-type: x proximity;          /* Soft snap — feels natural */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 32px;
    padding: 0;
    gap: 4px;                                /* small gap between pills */
    /* Padding-bottom holds the underline so the focus ring doesn't
       clip against the bottom border. */
    padding-bottom: 0;
    position: relative;
}
.module-tabs-nav::-webkit-scrollbar {
    display: none;
}

/* The button itself — a cleaner, more polished look */
.module-tabs-btn {
    flex-shrink: 0;
    background: transparent;
    border: 0;
    border-radius: 8px 8px 0 0;
    padding: 14px 20px 13px;
    margin-bottom: -1px;                     /* overlap nav border */
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;                          /* muted gray for inactive */
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease;
    white-space: nowrap;
    position: relative;
    scroll-snap-align: start;
    scroll-margin-left: 12px;                /* leave breathing room when snapped */
}

/* Animated underline — a pseudo-element so we can transition it */
.module-tabs-btn::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;                            /* sit on the nav border */
    height: 3px;
    background: var(--gold, #E8A317);
    border-radius: 2px 2px 0 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.module-tabs-btn:hover {
    color: #475569;                          /* nudge toward navy on hover */
    background: rgba(232, 163, 23, 0.04);
}
.module-tabs-btn:hover::after {
    transform: scaleX(0.4);                  /* tease the underline */
    background: rgba(232, 163, 23, 0.4);
}

.module-tabs-btn.is-active {
    color: var(--navy, #0B1D3A);             /* clear active text */
    background: rgba(232, 163, 23, 0.06);    /* subtle gold tint */
}
.module-tabs-btn.is-active::after {
    transform: scaleX(1);                    /* full underline */
    background: var(--gold, #E8A317);
    height: 3px;
}

.module-tabs-btn:focus-visible {
    outline: 2px solid var(--gold, #E8A317);
    outline-offset: 2px;
    border-radius: 8px 8px 0 0;
}


/* ── Edge gradient hints — only shown on mobile/narrow screens ──
   We want a subtle "there's more" cue on the right when tabs scroll.
   We attach it to the nav's parent (typically .module-tabs or
   .module-faq-tabs) using a ::before/::after overlay.

   Using ::after on the nav itself is tricky because it's the scroll
   container — the pseudo would scroll with the content. Instead,
   wrap-style cue: linear-gradient masks via background. */

@media (max-width: 768px) {
    .module-tabs-nav {
        margin: 0 -16px 24px;                /* extend to viewport edges */
        padding: 0 16px;
        /* A right-edge gradient fade hint that more tabs exist.
           Background-attachment local keeps the gradient from
           scrolling with the content. */
        background:
            linear-gradient(to right, transparent calc(100% - 28px), rgba(255, 255, 255, 0.95) 100%) right top / 100% 100% no-repeat local,
            transparent;
    }
    .module-tabs-btn {
        padding: 12px 14px 11px;
        font-size: 0.74rem;
        letter-spacing: 0.06em;
        min-height: 44px;                    /* iOS HIG min tap target */
    }
    .module-tabs-btn::after {
        left: 10px;
        right: 10px;
        height: 3px;
    }
}

/* Very narrow phones — even tighter */
@media (max-width: 380px) {
    .module-tabs-btn {
        padding: 12px 12px 11px;
        font-size: 0.72rem;
    }
}


/* ════════════════════════════════════════════════════════════════════════
   FAQ ITEMS — small polish to match the new tab look
   ════════════════════════════════════════════════════════════════════════
   The .module-faq-boxed items inside each tab panel get a slightly
   softer card shadow + smoother accordion animation. */

.module-faq-boxed .module-faq-item {
    transition: box-shadow 0.18s ease, background 0.18s ease;
}
.module-faq-boxed .module-faq-item:hover {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.module-faq-boxed .module-faq-item.is-open {
    box-shadow: 0 4px 14px rgba(232, 163, 23, 0.12);
}

/* Smoother accordion open/close — only animates the answer height */
.module-faq-boxed .module-faq-item .module-faq-a {
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.18s ease;
}


/* ════════════════════════════════════════════════════════════════════════
   FAQ heading "Häufige gestellte Fragen" — nicer treatment on mobile
   ════════════════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
    .module-tabs-title,
    .module-faq-tabs .module-tabs-title {
        font-size: 1.6rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1.5rem !important;
    }
}
