/* =============================================================
   RE Work Section Block  –  remedy-edge-global/re-work-section
   ============================================================= */

/* ── Wrapper ────────────────────────────────────────────────── */
.block-editor-block-list__block.re-work-section {
    background-color: #0a1628;
}
.re-work-section {
    width: 100%;
    padding: 2rem 2rem 1rem 2rem;
    box-sizing: border-box;
    color: #ffffff;
}

/* ── Track ──────────────────────────────────────────────────── */
.re-ws__track {
    display: grid;
    grid-template-columns: 1fr;
    position: relative;
    max-width: 1224px; /* 960px */
    margin: 0 auto;
    overflow: hidden;
}

/* ── Individual card ────────────────────────────────────────── */
.re-ws__card {
    /* Stack all cards in the same grid cell */
    grid-row: 1;
    grid-column: 1;
    display: flex;
    flex-direction: column;
    /* Hidden off-screen to the right by default */
    opacity: 0;
    pointer-events: none;
    transform: translateX( 100% );
    transition: transform 0.5s cubic-bezier( 0.4, 0, 0.2, 1 ),
                opacity   0.4s ease;
    z-index: 0;
}

.re-ws__card.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX( 0 );
    z-index: 1;
}

/* ── 16:9 image container ───────────────────────────────────── */
.re-ws__card-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0;
    background-color: #111e33;
}

.re-ws__card-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* ── Card body (description + link) ────────────────────────── */
.re-ws__card-body {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 30px;
    width: 100%;
    margin-top: 10px;
    background-color: var(--reg-color-accent);
}

.re-ws__card-body-empty {
    height: 30px;
    width: 100%;
    margin-top: 10px;
    /* background-color: green; */
}

.re-ws__card-description, .re-ws__card-link {
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 0.25rem;
    text-align: center;
}

/* ── Work link ──────────────────────────────────────────────── */
.re-ws__card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 2px solid rgba( 255, 255, 255, 0.35 );
    padding-bottom: 0.1rem;
    transition: border-color 0.2s ease;
}

.re-ws__card-link:hover,
.re-ws__card-link:focus-visible {
    border-color: #ffffff;
    outline: none;
}

.re-ws__card-link-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.re-ws__card-link:hover .re-ws__card-link-arrow {
    transform: translateX( 4px );
}

/* ── Prev / Next arrows ────────────────────────────────────── */
.re-ws__arrow {
    top: 50%; /* calc( 50% - 24px );   vertically centred within the 16:9 image */
    transform: translateY( -50% );
    z-index: 2;
    position: absolute;
    /*
    display: block;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba( 10, 22, 40, 0.65 );
    border: 1px solid rgba( 255, 255, 255, 0.25 );
    color: #ffffff;
    cursor: pointer;
    opacity: 0.75;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    */
    appearance: none;
    padding: 0;
}
/*
.re-ws__arrow:hover,
.re-ws__arrow:focus-visible {
    background: rgba( 10, 22, 40, 0.9 );
    border-color: rgba( 255, 255, 255, 0.7 );
    opacity: 1;
    outline: none;
}
*/
.re-ws__arrow--prev { left:  0.75rem; }
.re-ws__arrow--next { right: 0.75rem; }

/* Hide arrows when only one card exists */
.re-ws__track:has( > .re-ws__card:only-of-type ) .re-ws__arrow {
    display: none;
}

/* Disable pointer events on arrows inside the block editor */
.block-editor-block-list__block .re-ws__arrow {
    pointer-events: none;
    opacity: 0.4;
}

/* ── Bullet navigation ──────────────────────────────────────── */
.re-ws__nav {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: -57px; /* -65px */
    max-width: 1224px; /* 960px */
    margin-left: auto;
    margin-right: auto;
    z-index: 3;
}

.re-ws__bullet {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    width: 14px;
    border-radius: 6px;
    transition: width 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.75);

    &.is-active {
        width: 30px;
    }   
}

.re-ws__bullet:focus-visible {
    outline: 2px solid rgba( 255, 255, 255, 1);
    outline-offset: 4px;
    border-radius: 6px;
}

.re-ws__bullet.is-active .re-ws__bullet-label,
.re-ws__bullet:hover .re-ws__bullet-label,
.re-ws__bullet:focus-visible .re-ws__bullet-label {
    color: var(--reg-color-accent);
}

/* ── Progress bar track ─────────────────────────────────────── */
.re-ws__bullet-progress {
    display: block;
    width: 100%;
    height: 12px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

/* ── Progress bar fill ──────────────────────────────────────── */
.re-ws__bullet-bar {
    display: block;
    height: 100%;
    width: 0;
    background: var(--reg-color-accent);
    border-radius: 2px;
}

/* Animate the fill when this bullet is active */
.re-ws__bullet.is-active .re-ws__bullet-bar {
    animation: re-ws-fill var( --re-ws-duration, 5s ) linear forwards;
}

/* Pause bar animation when the user hovers the section */
.re-work-section.is-paused .re-ws__bullet.is-active .re-ws__bullet-bar {
    animation-play-state: paused;
}

@keyframes re-ws-fill {
    from { width: 0%; }
    to   { width: 100%; }
}

/* ── Editor styles ──────────────────────────────────────────── */
.re-work-section.is-editor .re-ws__editor-controls {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba( 255, 255, 255, 0.05 );
    border: 1px solid rgba( 255, 255, 255, 0.15 );
    border-radius: 4px;
}

.re-ws__editor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.re-ws__editor-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: rgba( 255, 255, 255, 0.08 );
    border-radius: 4px;
}

.re-ws__editor-image {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.re-ws__editor-image-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.re-ws__editor-actions {
    margin-top: 1rem;
}

.re-ws__editor-empty {
    color: rgba( 255, 255, 255, 0.6 );
    font-style: italic;
    margin: 0;
}

/* ── Footer text ────────────────────────────────────────────── */
.re-ws__footer-text {
    max-width: 1224px; /* 960px */
    margin: calc( 1.5rem + 60px) auto 0;
    padding: 0 0.75rem;
    text-align: center;
    color: rgba( 255, 255, 255, 1);
    font-size: 1.5rem;
    font-weight: 600;
}

.re-ws__editor-footer {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba( 255, 255, 255, 0.05 );
    border: 1px solid rgba( 255, 255, 255, 0.15 );
    border-radius: 4px;
}

.re-ws__editor-footer-label {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba( 255, 255, 255, 0.5 );
}

.re-ws__editor-footer .re-ws__footer-text {
    margin: 0;
    min-height: 1.5em;
}

/* Disable progress bar animation inside the block editor */
.block-editor-block-list__block .re-ws__bullet-bar {
    animation: none !important;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media ( max-width: 768px ) {
    .re-work-section {
        padding: 1.5rem 0 0 0; /* 1.25rem */
    }

    .re-ws__card-body, .re-ws__card-body-empty {
        height: 40px;
    }

    .re-ws__nav {
        margin-top: -67px; /* -65px */
    }


    .re-ws__bullet-label {
        font-size: 0.75rem;
    }
}