/* ==========================================================================
   Homepage Story strip + fullscreen viewer.

   Scoped entirely under .wptb-story-* / .wptb-story-viewer — does not touch
   any existing homepage section's classes. Loaded only on the index route.
   ========================================================================== */

/* A dedicated gold, not the site's --color-one (brand red) and not an
   Instagram-style multicolor gradient — a thin brushed-metal sheen instead
   of a flat fill, so it reads as premium rather than a colored border. */
:root {
    --story-gold-a: #a97e34;
    --story-gold-b: #f3dfa4;
    --story-gold-c: #8a651f;
    --story-header-h: 100px;
}

@media screen and (max-width: 1199.98px) {
    :root {
        --story-header-h: 81px;
    }
}

.wptb-story-strip {
    position: relative;
    width: 100%;
    padding-top: var(--story-header-h);
    background: transparent;
}

.wptb-story-strip__track {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 20px 12px;
    margin: 0;
    list-style: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wptb-story-strip__track::-webkit-scrollbar {
    display: none;
    height: 0;
}

/* RTL layout: keep scroll starting from the right, matching menu/reading direction */
.wptb-story-strip__track {
    direction: rtl;
}

.wptb-story-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 64px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    scroll-snap-align: start;
    -webkit-tap-highlight-color: transparent;
}

.wptb-story-item__ring {
    display: block;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, var(--story-gold-a) 0%, var(--story-gold-b) 45%, var(--story-gold-c) 100%);
    transition: transform 0.28s cubic-bezier(.25, .8, .25, 1), box-shadow 0.28s ease;
    box-shadow: 0 0 0 0 rgba(243, 223, 164, 0);
}

.wptb-story-item__ring-inner {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 2px;
    background: var(--color-dark-one, #151515);
    overflow: hidden;
}

.wptb-story-item__ring img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.wptb-story-item:hover .wptb-story-item__ring,
.wptb-story-item:focus-visible .wptb-story-item__ring {
    transform: scale(1.07);
    box-shadow: 0 4px 18px 0 rgba(169, 126, 52, 0.35);
}

.wptb-story-item:active .wptb-story-item__ring {
    transform: scale(0.94);
}

.wptb-story-item.wptb-story-item--seen .wptb-story-item__ring {
    background: linear-gradient(135deg, rgba(169, 126, 52, 0.35) 0%, rgba(243, 223, 164, 0.35) 45%, rgba(138, 101, 31, 0.35) 100%);
}

.wptb-story-item__title {
    display: block;
    width: 66px;
    font-family: var(--font-family-three, 'Sora', sans-serif), 'estedad-light', sans-serif;
    font-size: 11.5px;
    line-height: 1.3;
    text-align: center;
    color: rgba(255, 255, 255, 0.56);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media screen and (max-width: 575.98px) {
    .wptb-story-strip__track {
        gap: 14px;
        padding: 8px 14px 10px;
    }
    .wptb-story-item {
        width: 58px;
    }
    .wptb-story-item__ring {
        width: 52px;
        height: 52px;
    }
    .wptb-story-item__title {
        width: 60px;
        font-size: 11px;
    }
}

/* ==========================================================================
   Fullscreen Story viewer
   ========================================================================== */

.wptb-story-viewer {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: #000;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.wptb-story-viewer.is-open {
    display: block;
}

.wptb-story-viewer.is-visible {
    opacity: 1;
}

.wptb-story-viewer__stage {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    overflow: hidden;
    background: #000;
}

.wptb-story-viewer__slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.25, .8, .25, 1);
    pointer-events: none;
    background: #000;
}

.wptb-story-viewer__slide.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.wptb-story-viewer__slide img,
.wptb-story-viewer__slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wptb-story-viewer__progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    gap: 4px;
    padding: 10px 10px 0;
}

.wptb-story-viewer__bar {
    flex: 1;
    height: 2.5px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.28);
    overflow: hidden;
}

.wptb-story-viewer__bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--story-gold-b), var(--story-gold-a));
    border-radius: 2px;
}

.wptb-story-viewer__bar.is-complete .wptb-story-viewer__bar-fill {
    width: 100% !important;
}

.wptb-story-viewer__header {
    position: absolute;
    top: 20px;
    left: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wptb-story-viewer__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-family: var(--font-family-three, 'Sora', sans-serif), 'estedad-light', sans-serif;
    font-size: 13px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.wptb-story-viewer__meta-ring {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    padding: 1.5px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--story-gold-a), var(--story-gold-b), var(--story-gold-c));
}

.wptb-story-viewer__meta-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.wptb-story-viewer__close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 18px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.wptb-story-viewer__close:hover {
    background: rgba(0, 0, 0, 0.55);
    transform: scale(1.06);
}

.wptb-story-viewer__nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 32%;
    z-index: 2;
    cursor: pointer;
}

.wptb-story-viewer__nav--prev {
    right: 0;
}

.wptb-story-viewer__nav--next {
    left: 0;
}

.wptb-story-viewer__caption {
    position: absolute;
    bottom: 22px;
    left: 16px;
    right: 16px;
    z-index: 3;
    text-align: center;
    color: rgba(255, 255, 255, 0.82);
    font-family: var(--font-family-three, 'Sora', sans-serif), 'estedad-light', sans-serif;
    font-size: 12.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

.wptb-story-viewer.is-paused .wptb-story-viewer__progress {
    opacity: 0.55;
}

/* Related-post CTA — a small, precisely-bounded pill, never full-width/
   full-slide, sitting above the caption. z-index above both the nav tap
   zones (2) and progress/header (3) so it's always the topmost hit target
   in its own footprint, but its footprint is intentionally tiny so it never
   steals clicks meant for prev/next navigation elsewhere on the slide. */
.wptb-story-viewer__cta {
    position: absolute;
    bottom: 62px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 999px;
    background: rgba(12, 12, 12, 0.55);
    border: 1px solid rgba(243, 223, 164, 0.55);
    color: #f3dfa4;
    font-family: var(--font-family-three, 'Sora', sans-serif), 'estedad-light', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.wptb-story-viewer__cta:hover,
.wptb-story-viewer__cta:focus-visible {
    background: rgba(243, 223, 164, 0.12);
    box-shadow: 0 6px 22px rgba(169, 126, 52, 0.4);
    transform: translateX(-50%) scale(1.04);
    color: #f3dfa4;
}

.wptb-story-viewer__cta:active {
    transform: translateX(-50%) scale(0.97);
}

.wptb-story-viewer__cta::before {
    content: "\f135"; /* bootstrap-icons arrow-up-left, matches the site's existing CTA arrow language */
    font-family: bootstrap-icons !important;
    font-size: 11px;
}

@media screen and (max-width: 575.98px) {
    .wptb-story-viewer__stage {
        max-width: 100%;
    }
}
