/* Editor preview: show all panels stacked for easy editing */
.acf-tabs-container.is-editor-preview .acf-tab-item {
    display: block !important;
    position: relative !important; /* Ensures editor blocks don't overlap */
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 1 !important;
    margin-bottom: 20px;
    border: 1px dashed #ccc;
    padding: 15px;
}

/* Container */
.acf-tabs-container {
    margin-bottom: 2rem;
    --tab-highlight: #0a70c1;
}

/* Panels wrapper */
.tabs-panels {
    position: relative; /* REQUIRED for the NextGEN visibility hack */
    max-width: 1200px;
    margin: 20px auto 0;
}

/* ---- Nav wrapper ----
   Sits sticky above content. Hosts the overflow indicator
   via ::before / ::after so they aren't clipped by the
   overflow-x:auto on .tabs-nav itself.
--------------------------------------- */
.tabs-nav-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
}

/* Gradient fade — visible when tabs overflow right */
.tabs-nav-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(to left, #fff 0%, rgba(255,255,255,0.85) 40%, transparent 100%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* Arrow chevron */
.tabs-nav-wrapper::before {
    content: '›';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: #777;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.tabs-nav-wrapper.has-overflow::after,
.tabs-nav-wrapper.has-overflow::before {
    opacity: 1;
}

.tabs-nav-wrapper.has-overflow::before {
    animation: tabChevron 1.5s ease-in-out infinite;
}

@keyframes tabChevron {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50%       { transform: translateY(-50%) translateX(4px); }
}

/* ---- Nav scrolling bar ---- */
.tabs-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

/* ---- Tab buttons ---- */
.tabs-nav button {
    flex-shrink: 0;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    white-space: normal;
    word-break: break-word;
    max-width: 220px;
    min-width: 150px;
    min-height: 45px;
    line-height: 1.4;
    text-align: center;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.tabs-nav button:hover { color: #0a70c1; }

.tabs-nav button.active {
    color: #000;
    font-weight: 600;
    border-bottom-color: var(--tab-highlight);
}

/* ---- Tab panels ---- */
.acf-tab-item {
    /* Hide visually but keep dimensions for NextGEN Gallery to measure */
    position: absolute;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    width: 100%;
    top: 0;
    left: 0;
}

.acf-tab-item.active { 
    /* Bring back into the document flow when active */
    position: relative;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .tabs-nav button {
        min-width: 120px;
        max-width: none;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}