/* =================================================================
   WPHI MODULE CHIPS + MODAL SLIDER
   index-slider.css — loaded on front page only
   ================================================================= */

/* ── Hint line above chip grid ───────────────────────────────── */
.wphi-chip-hint {
    text-align: center;
    font-size: 13px;
    /* color: var(--color-grey); */
    color: #000;
    font-weight: bold;
    letter-spacing: 0.04em;
    margin: 0 0 18px;
    text-transform: uppercase;
    font-family: var(--font-display);
}

/* ── Chip grid ───────────────────────────────────────────────── */
.wphi-chip-grid {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 5%;
    padding: 8px 0 32px;
}

/* ── Individual chip ─────────────────────────────────────────── */
.wphi-chip {
    flex: 0 0 20%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    flex-grow: 2;
    align-items: center;
    gap: 10px;
    background: var(--color-card-bg);
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 20px 12px 16px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 10px rgba(13,27,42,0.07);
    font-family: var(--font-body);
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
    margin: 15px 0;
}

.wphi-chip:hover,
.wphi-chip:focus-visible {
    transform: translateY(-3px);
    border-color: var(--color-teal);
  border-color: rgba(0, 0, 0, 0.80);
  box-shadow: 0 8px 28px rgba(0,0,0,0.20), 0 6px 22px rgba(0,0,0,0.50),  0 2px 12px rgba(0,0,0,0.70), inset 0 0 0 6px rgba(200, 200, 200, 0.4);
    outline: none;
}

.wphi-chip:active { transform: translateY(0); }

.wphi-chip-icon, .wphi-chip-icon-lg{
    object-fit: contain;
    display: block;
}

.wphi-chip-icon{
    width: 52px;
    height: 52px;
}

.wphi-chip-icon-lg{
    width: 72px;
    height: 72px;
}

.wphi-chip-name {
    font-family: var(--font-display);
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-teal-dark);
    line-height: 1.3;
}

/* =================================================================
   MODAL OVERLAY
   ================================================================= */

.wphi-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.wphi-modal:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

/* Keep display:flex even when [hidden] — opacity drives visibility */
.wphi-modal[hidden] {
    display: flex !important;
}

.wphi-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 16, 28, 0.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* =================================================================
   MODAL SHELL — two-column: TOC left | slide right
   ================================================================= */

.wphi-modal-shell {
    position: relative;
    z-index: 1;
    /* Wide enough for TOC + content */
    width: min(1200px, 94vw);
    height: min(92vh, 780px);
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: 1fr;
    background: var(--color-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,194,184,0.25);
    overflow: hidden;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.28s cubic-bezier(0.34,1.4,0.64,1);
    border: 2px solid #ccc;
}

.wphi-modal:not([hidden]) .wphi-modal-shell {
    transform: translateY(0) scale(1);
}

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

.wphi-modal-close {
    position: absolute;
    top: 12px;
    right: 22px;
    z-index: 30;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.25);
    background: var(--color-navy);
    color: var(--color-white);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, border-color 0.2s;
    line-height: 1;
    padding: 0;
}

.wphi-modal-close:hover {
    background: var(--color-red-dark);
    border-color: var(--color-red-dark);
    transform: scale(1.1);
}

.wphi-modal-close:active { transform: scale(0.95); }

/* =================================================================
   TOC SIDEBAR (left column)
   ================================================================= */

.wphi-modal-toc {
    grid-column: 1;
    grid-row: 1;
    background: var(--color-navy);
    border-right: 1px solid rgba(0,194,184,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Ensure TOC fills the full shell height */
    min-height: 0;
}

.wphi-modal-toc-heading {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-teal);
    padding: 16px 0;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0,194,184,0.12);
    margin: 0;
}

.modal-toc-top{
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
}

.wphi-modal-toc-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
    flex: 1 1 0;
    /* Stylised scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,194,184,0.35) transparent;
}

.wphi-modal-toc-list::-webkit-scrollbar {
    width: 4px;
}

.wphi-modal-toc-list::-webkit-scrollbar-track {
    background: transparent;
}

.wphi-modal-toc-list::-webkit-scrollbar-thumb {
    background: rgba(0,194,184,0.35);
    border-radius: 4px;
}

.wphi-modal-toc-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0,194,184,0.65);
}

.wphi-modal-toc-list li {
    padding: 0;
    margin: 0;
}

/* TOC item button */
.wphi-toc-item {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 9px 14px 9px 16px;
    background: transparent;
    border: none;
    border-left: 6px solid transparent;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-grey-light);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.35;
}

.wphi-toc-item:hover {
    background: rgba(0,194,184,0.08);
    color: var(--color-white);
    border-left-color: rgba(0,194,184,0.40);
}

.wphi-toc-item.is-active {
    background: rgba(0,194,184,0.14);
    color: var(--color-white);
    border-left-color: var(--color-amber);
    font-weight: 600;
}

.wphi-toc-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.wphi-toc-item.is-active .wphi-toc-icon,
.wphi-toc-item:hover .wphi-toc-icon {
    opacity: 1;
}

/* =================================================================
   SLIDE COLUMN (right column)
   ================================================================= */

.wphi-modal-slide-col {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Track wrapper clips the horizontal slide strip */
.wphi-modal-track-wrap {
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    /* box-shadow:
        0 2px 12px rgba(13, 27, 42, 0.06),
        inset 0 0 1px 6px rgba(200, 200, 200, 0.8);     */
}

/* Track: all slides side-by-side horizontally */
.wphi-modal-track {
    display: flex;
    height: 100%;
    transition: transform 0.38s cubic-bezier(0.4,0,0.2,1);
    will-change: transform;
    align-items: stretch;
}

/* Each slide scrolls vertically, styled scrollbar */
.wphi-modal-slide {
    flex: 0 0 100%;
    width: 100%;
    overflow-y: scroll;
    /* padding: 48px 28px 24px; */
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    /* Stylised scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(13,27,42,0.22) transparent;
}

.wphi-modal-slide::-webkit-scrollbar {
    width: 6px;
}

.wphi-modal-slide::-webkit-scrollbar-track {
    background: rgba(13,27,42,0.04);
    border-radius: 6px;
}

.wphi-modal-slide::-webkit-scrollbar-thumb {
    background: rgba(13,27,42,0.22);
    border-radius: 6px;
}

.wphi-modal-slide::-webkit-scrollbar-thumb:hover {
    background: rgba(0,194,184,0.50);
}

/* =================================================================
   ARTICLE CARD INSIDE SLIDE
   Restore the exact .features-flex article appearance.
   Only width is overridden (the stylesheet sets it to 40%).
   ================================================================= */

.wphi-modal-slide > article {
    /* Restore all .features-flex article properties */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;              /* override the 40% from .features-flex article */
    text-align: center;
    background: var(--color-card-bg);
    /* border: 2px solid var(--color-card-border); */
    outline-offset: -4px;
    border-radius: var(--radius-md);
    padding: 14px 22px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.wphi-modal-slide > article:hover {
    border-color: rgba(0, 0, 0, 0.80);
    /* box-shadow:
        0 8px 28px rgba(0,0,0,0.20),
        0 6px 22px rgba(0,0,0,0.50),
        0 2px 12px rgba(0,0,0,0.70),
        inset 0 0 0 6px rgba(200, 200, 200, 0.4); */
    /* suppress the translateY lift that would shift the slide */
    transform: none;
}

/* Counter bar at foot of slide column */
.wphi-modal-counter {
    text-align: center;
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--color-teal);
    padding: 8px 0 9px;
    flex-shrink: 0;
    border-top: 1px solid rgba(13,27,42,0.08);
    margin: 0;
}

/* =================================================================
   ARROW BUTTONS
   Siblings of .wphi-modal-shell — never inside the clipped shell.
   The modal is display:flex / align-items:center so they sit
   vertically centred beside the shell automatically.
   ================================================================= */

.wphi-modal-arrow {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(0,194,184,0.55);
    background: var(--color-navy);
    color: var(--color-teal);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    padding: 0;
    line-height: 1;
    z-index: 10;
    margin: 0 12px;
}

.wphi-modal-arrow:hover {
    background: rgba(0,194,184,0.2);
    border-color: var(--color-teal);
    transform: scale(1.08);
}

.wphi-modal-arrow:active { transform: scale(0.96); }

/* =================================================================
   RESPONSIVE — Tablet  ≤ 960px
   TOC collapses to a horizontal strip across the top of the shell.
   ================================================================= */

@media (max-width: 960px) {

    .wphi-chip-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .wphi-modal-arrow {
        width: 38px;
        height: 38px;
        font-size: 15px;
        margin: 0 6px;
    }

    .wphi-modal-shell {
        width: min(96vw, 700px);
        height: min(88vh, 700px);
        /* Stack: TOC strip on top, slide area below */
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    /* TOC becomes a horizontal scrolling strip */
    .wphi-modal-toc {
        grid-column: 1;
        grid-row: 1;
        border-right: none;
        border-bottom: 1px solid rgba(0,194,184,0.18);
        flex-direction: column;
        max-height: none;
    }

    .wphi-modal-toc-heading {
        padding: 10px 16px 8px;
    }

    .wphi-modal-toc-list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 4px 8px 8px;
        gap: 4px;
        /* Horizontal scrollbar */
        scrollbar-width: thin;
        scrollbar-color: rgba(0,194,184,0.35) transparent;
    }

    .wphi-modal-toc-list::-webkit-scrollbar { height: 4px; width: auto; }

    .wphi-modal-toc-list li { flex-shrink: 0; }

    .wphi-toc-item {
        flex-direction: column;
        align-items: center;
        gap: 5px;
        padding: 6px 10px;
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: var(--radius-sm);
        font-size: 11px;
        white-space: nowrap;
    }

    .wphi-toc-item.is-active {
        border-left-color: transparent;
        border-bottom-color: var(--color-teal);
    }

    .wphi-toc-icon {
        width: 20px;
        height: 20px;
    }

    .wphi-modal-slide-col {
        grid-column: 1;
        grid-row: 2;
    }

    .wphi-modal-slide {
        padding: 24px 20px 20px;
    }
}

/* =================================================================
   RESPONSIVE — Mobile  ≤ 600px
   TOC hidden. Bottom-sheet modal. Arrows float above the sheet.
   ================================================================= */

@media (max-width: 600px) {

    .wphi-chip-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .wphi-chip { padding: 16px 8px 12px; flex: 0 0 80%; }
    .wphi-chip.featured-chip{flex: 0 0 80%;}    
    .wphi-chip-icon { width: 40px; height: 40px; }
    .wphi-chip-name { font-size: 15px; }

    /* Full-screen bottom-sheet */
    .wphi-modal {
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-start;
    }

    .wphi-modal-shell {
        width: 100vw;
        height: 82dvh;
        max-height: 82dvh;
        border-radius: 0;
        transform: translateY(100%);
        transition: transform 0.32s cubic-bezier(0.34,1.1,0.64,1);
        /* Single column — TOC hidden */
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .wphi-modal:not([hidden]) .wphi-modal-shell {
        transform: translateY(0);
    }

    .wphi-modal-slide > article {border-radius: 0;}

    .feature-card-header h3{
        width: 100%;
        font-size: 24px;
        font-weight: bold;
        padding: 10px 0;
        white-space: normal;
    }

    /* Hide TOC entirely on mobile */
    .wphi-modal-toc { display: none; }

    .wphi-modal-slide-col {
        grid-column: 1;
        grid-row: 1;
    }

    /* Arrows sit above the sheet in the backdrop area */
    .wphi-modal-arrow {
        position: absolute;
        bottom: calc(4dvh + 10px);
        width: 60px;
        height: 60px;
        font-size: 14px;
        margin: 0 20px;
    }

    .wphi-modal-prev { left:  calc(20% - 52px); }
    .wphi-modal-next { right: calc(20% - 52px); }

    .wphi-modal-slide { padding: 48px 16px 16px; }

    .wphi-modal-slide::-webkit-scrollbar {
        width: 14px;
    }

    .wphi-modal-slide::-webkit-scrollbar-track {
        background: rgba(13,27,42,0.04);
        border-radius: 14px;
    }

    .wphi-modal-slide::-webkit-scrollbar-thumb {
        background: rgba(13,27,42,0.98);
        border-radius: 14px;
    }

    .wphi-modal-slide::-webkit-scrollbar-thumb:hover {
        background: rgba(0,194,184,0.50);
    }    
}
