/* ================================================================
   Simple Sequence Scroll — Front-end Styles
================================================================ */

.sss-section { position: relative; width: 100%; }

.sss-sticky {
    position: sticky;
    top: 0; width: 100%; height: 100vh;
    overflow: hidden; background: #000;
}

.sss-canvas { display: none; }

/* Progress bar */
.sss-progress {
    position: absolute; bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: rgba(255,255,255,0.12); z-index: 10;
}
.sss-progress-bar { height: 100%; width: 0%; background: #fff; will-change: width; }

/* Loader */
.sss-loader {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px;
    background: #000; z-index: 20; transition: opacity 0.5s ease;
}
.sss-loader--done { opacity: 0; pointer-events: none; }
.sss-loader-track {
    width: min(280px, 55%); height: 2px;
    background: rgba(255,255,255,0.12); border-radius: 2px; overflow: hidden;
}
.sss-loader-fill {
    height: 100%; width: 0%; background: #fff;
    border-radius: 2px; transition: width 0.12s linear;
}
.sss-loader-label {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.7rem; letter-spacing: 0.1em;
    text-transform: uppercase; color: rgba(255,255,255,0.35);
}

/* ================================================================
   COLOUR OVERLAY — sits between frames and text overlays
   background set inline by PHP (gradient or solid colour)
================================================================ */
.sss-color-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;           /* above background image, below text overlays (z:5) */
    pointer-events: none;
}

/* ================================================================
   OVERLAYS
   .sss-overlays fills the sticky viewport completely.
   Each .sss-overlay is position:absolute with top/left % set by JS.
================================================================ */
.sss-overlays {
    position: absolute;
    inset: 0;               /* full sticky area — overlays reference this */
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.sss-overlay {
    /* position, top, left, transform set by JS */
    position: absolute;
    opacity: 0;
    will-change: opacity;
    pointer-events: none;
}

/* Font sizes — defaults only.
   Overridden per-breakpoint by px values from Settings → Simple Sequence Scroll.
   The admin page outputs a <style> block in wp_head with !important rules. */
.sss-overlay--size-small  .sss-overlay-text { font-size: 18px; }
.sss-overlay--size-medium .sss-overlay-text { font-size: 28px; }
.sss-overlay--size-large  .sss-overlay-text { font-size: 44px; }
.sss-overlay--size-xl     .sss-overlay-text { font-size: 72px; }

.sss-overlay-inner {
    display: flex; flex-direction: column;
    align-items: center; gap: 20px;
}

.sss-overlay-text {
    font-family: inherit; /* inherits active theme font — no override */
    font-weight: 400; line-height: 1.15;
    text-shadow: 0 2px 32px rgba(0,0,0,0.6), 0 0 80px rgba(0,0,0,0.3);
    will-change: transform, opacity;
    white-space: nowrap; /* prevents wrapping on desktop */
}

/* On mobile: allow wrapping, constrain width */
@media (max-width: 767px) {
    .sss-overlay-text {
        white-space: normal;
        word-break: break-word;
    }
    .sss-overlay {
        max-width: 80vw !important;
    }
}

/* Word/letter/typewriter spans */
.sss-word {
    display: inline-block;
    margin-right: 0.28em;
    will-change: transform, opacity;
}
.sss-space {
    display: inline-block;
    width: 0.28em;
}
.sss-letter {
    display: inline-block;
    will-change: transform, opacity;
}
.sss-tw-cursor {
    display: inline-block;
    margin-left: 2px;
    animation: sss-blink 0.7s step-end infinite;
}
@keyframes sss-blink { 50% { opacity: 0; } }

/* ================================================================
   CTA BUTTON
================================================================ */
.sss-cta {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.95rem; font-weight: 500; letter-spacing: 0.02em;
    text-decoration: none; padding: 12px 28px; border-radius: 4px;
    cursor: pointer; opacity: 0; will-change: opacity, transform;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.sss-cta--solid   { background: #fff; color: #000; border: 2px solid #fff; }
.sss-cta--solid:hover { background: transparent; color: #fff; }
.sss-cta--outline { background: transparent; color: #fff; border: 2px solid #fff; }
.sss-cta--outline:hover { background: #fff; color: #000; }
.sss-cta--ghost   { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); backdrop-filter: blur(8px); }
.sss-cta--ghost:hover { background: rgba(255,255,255,0.28); }

/* ================================================================
   MODAL
================================================================ */
.sss-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.sss-modal--open { opacity: 1; pointer-events: auto; }
.sss-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
}
.sss-modal-box {
    position: relative; background: #fff; border-radius: 12px;
    padding: 48px; max-width: 520px; width: 90%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.3);
    transform: translateY(16px);
    transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
.sss-modal--open .sss-modal-box { transform: translateY(0); }
.sss-modal-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; font-size: 1.1rem; cursor: pointer; color: #999;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background 0.15s, color 0.15s;
}
.sss-modal-close:hover { background: #f0f0f0; color: #333; }
.sss-modal-content { font-family: Georgia, serif; font-size: 1.1rem; line-height: 1.6; color: #222; }

/* Empty state */
.sss-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px;
    height: 200px; background: #f5f5f5;
    border: 2px dashed #ddd; border-radius: 4px;
    color: #aaa; font-family: sans-serif; font-size: 0.875rem;
}
.sss-empty p { margin: 0; }

/* ----------------------------------------------------------------
   Disable on mobile — show a static 16:9 placeholder instead
---------------------------------------------------------------- */
@media (max-width: 767px) {
    .sss-section--no-mobile {
        height: auto !important;
    }
    .sss-section--no-mobile .sss-sticky {
        position: relative;
        height: min( 56.25vw, 100vw );  /* 16:9 ratio */
        background-color: #000;
        background-size: cover;
        background-position: center;
    }
    .sss-section--no-mobile .sss-loader,
    .sss-section--no-mobile .sss-overlays,
    .sss-section--no-mobile .sss-progress,
    .sss-section--no-mobile .sss-color-overlay {
        display: none;
    }
    /* Show a subtle "view on desktop" hint */
    .sss-section--no-mobile .sss-sticky::after {
        content: 'Best viewed on desktop';
        position: absolute;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        font-family: -apple-system, BlinkMacSystemFont, sans-serif;
        font-size: 0.7rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: rgba(255,255,255,0.4);
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sss-section  { height: auto !important; }
    .sss-sticky   { position: relative; height: min(56.25vw, 90vh); }
    .sss-loader, .sss-overlays { display: none; }
}
