/* ============================================================
   Gallery Stack — frontend CSS (v1.5.36+).
   Replaces the inline 2-col grid that lived in gallery-stack.php.

   Layout strategy:
     - Desktop (>=1025px): CSS-column masonry. 2 columns, free
       image heights, marketing uploads whatever sizes/aspects
       they like and the columns flow naturally.
     - Tablet (769-1024px): same masonry, tighter gap.
     - Mobile (<=768px): horizontal scroll-snap slider with arrow
       buttons + dot indicator. Same swipe pattern as the
       Routine Builder cards.

   Each image is a <button class="wlpp-story-grid-item"> so
   keyboard + screen-reader users can open the lightbox the same
   way mouse users do. The PhotoSwipe init is in gallery-stack.js.
   ============================================================ */

.wlpp-story-grid-wrap {
    position: relative;
    margin: 30px 0;
}


/* ============================================================
   GRID — desktop masonry via CSS columns
   ============================================================ */
.wlpp-story-grid {
    column-count: 2;
    column-gap: 16px;
}

.wlpp-story-grid-item {
    /* Reset native button defaults so the wrapper looks like a
       clean tile, not a system button. */
    display: block;
    width: 100%;
    margin: 0 0 16px 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;

    /* Avoid splitting an image across two columns. */
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}

.wlpp-story-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.wlpp-story-grid-item:focus-visible {
    outline: 3px solid #851625;
    outline-offset: 2px;
}

.wlpp-story-grid-img {
    width: 100%;
    height: auto;
    display: block;
}


/* ============================================================
   ARROWS + DOTS — hidden on desktop (masonry has no concept of
   "next" — there's no scroll). Mobile-only via media query.
   ============================================================ */
.wlpp-story-grid-arrow,
.wlpp-story-grid-dots {
    display: none;
}


/* ============================================================
   TABLET (769-1024px) — slightly tighter masonry.
   ============================================================ */
@media (max-width: 1024px) and (min-width: 769px) {
    .wlpp-story-grid {
        column-gap: 12px;
    }
    .wlpp-story-grid-item {
        margin-bottom: 12px;
    }
}


/* ============================================================
   MOBILE (<=768px) — horizontal scroll-snap slider.
   ============================================================ */
@media (max-width: 768px) {

    /* Slider: switch off masonry, become a flex row with native
       scroll-snap (same pattern as routine-builder.css). */
    .wlpp-story-grid {
        column-count: initial;
        display: flex;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }
    .wlpp-story-grid::-webkit-scrollbar {
        display: none;
    }

    .wlpp-story-grid-item {
        flex: 0 0 88%;
        max-width: 88%;
        margin: 0;
        scroll-snap-align: start;
    }
    .wlpp-story-grid-item:hover {
        transform: none;
        box-shadow: none;
    }

    /* Arrows: visible, sit just outside the slider edge, semi-
       transparent burgundy circles. Hidden when at the start or
       end (JS toggles .is-disabled). */
    .wlpp-story-grid-arrow {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 0;
        background: rgba(255, 255, 255, 0.92);
        color: #1f1f1f;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
        cursor: pointer;
        padding: 0;
        z-index: 2;
        transition: opacity 0.2s, transform 0.15s;
    }
    .wlpp-story-grid-arrow-prev { left: -4px; }
    .wlpp-story-grid-arrow-next { right: -4px; }
    .wlpp-story-grid-arrow:disabled,
    .wlpp-story-grid-arrow.is-disabled {
        opacity: 0.35;
        pointer-events: none;
    }

    /* Dots — one per image, current = burgundy + scaled. */
    .wlpp-story-grid-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 14px;
        padding: 0;
        list-style: none;
    }
    .wlpp-story-grid-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #d6d2cd;
        border: 0;
        padding: 0;
        cursor: pointer;
        transition: background-color 0.2s, transform 0.2s;
    }
    .wlpp-story-grid-dot.is-active {
        background: #851625;
        transform: scale(1.3);
    }
}


/* ============================================================
   PHOTOSWIPE CONTAINER — minor tweak so its close/arrow icons
   pick up brand colour. Otherwise WC's default skin is reused
   as-is.
   ============================================================ */
.pswp__button--close,
.pswp__button--arrow--left,
.pswp__button--arrow--right {
    /* Keep WC defaults; no override needed for now. */
}
