/* ============================================================
   ABC Japan market Q&A — redesign (client-approved divergence).
   ADDITIVE stylesheet (never merged into app.min.css). Enqueued
   front-page only. Layout/spacing follow the approved prototype;
   type + colour are the theme's REAL tokens:
     gold   #997233   (brand CTA / play button / arrows)
     navy   #00182b   (ink)
     ground #f5f8fa   (site background)
     orange #ff9233   (heading initial — inherited via the live
                        `.japan_marker .splide__top h2:first-letter` rule)
     Canela (display) + Inter (body)  — the site's real webfonts.
   The heading is rendered by the theme's own selectors; nothing here
   restyles it, so it stays identical to live.
   ============================================================ */

/* Body scroll-lock while the overlay is open (position:fixed technique — robust
   on iOS; the JS stores/restores scroll offset via body.style.top). */
.qa2-scroll-lock {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

/* Centre the whole Q&A block (heading + rows) in the viewport at the prototype's
   ~1060px, with equal auto margins. Internal alignment stays as approved: the
   heading is left-aligned within the centred container, matching the rest of the
   site. Scoped to the front-page Q&A section (this stylesheet is front-page only).
   On viewports narrower than 1060px the auto margins collapse to 0, so mobile is
   unaffected — the section keeps the theme's own side padding. */
.japan_marker .japan_marker-container {
    max-width: 1060px;
    margin-inline: auto;
}

.qa2-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.qa2-item {
    margin: 0;
    padding: 0;
}

.qa2-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    background: #fff;
    border: 1px solid rgba(0, 24, 43, 0.14);
    border-radius: 18px;
    padding: 18px 20px 18px 24px;
    font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: #00182b;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.qa2-row:hover {
    border-color: rgba(153, 114, 51, 0.55);
    box-shadow: 0 10px 28px -18px rgba(0, 24, 43, 0.35);
    transform: translateY(-1px);
}

.qa2-row:focus-visible {
    outline: 3px solid #997233;
    outline-offset: 3px;
}

.qa2-q {
    font-size: clamp(1.02rem, 1.6vw, 1.16rem);
    font-weight: 500;
    line-height: 1.45;
}

.qa2-play {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #997233;
    display: grid;
    place-items: center;
    transition: background 0.16s ease, transform 0.16s ease;
}

.qa2-row:hover .qa2-play {
    background: #7c5b26;
    transform: scale(1.06);
}

.qa2-play svg {
    width: 14px;
    height: 16px;
    margin-left: 2px;
}

/* ---- overlay ---- */
.qa2-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 12, 22, 0.84);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.qa2-modal.is-open {
    display: flex;
    animation: qa2Fade 0.18s ease;
}

@keyframes qa2Fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.qa2-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1003;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.16s ease;
}

.qa2-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.qa2-close:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.qa2-close svg {
    width: 18px;
    height: 18px;
}

.qa2-stagewrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    max-width: min(92vw, 760px);
    animation: qa2Rise 0.2s ease;
}

@keyframes qa2Rise {
    from { transform: scale(0.975); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.qa2-title {
    font-family: Canela, Georgia, "Times New Roman", serif;
    font-weight: 400;
    color: #fff;
    text-align: center;
    font-size: clamp(1.15rem, 2.4vw, 1.6rem);
    line-height: 1.3;
    max-width: 34ch;
    padding: 0 54px; /* clear of the fixed X on narrow screens */
    margin: 0;
}

.qa2-stage {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
}

.qa2-video {
    width: min(88vw, 392px);
    aspect-ratio: 9 / 16;
    max-height: 72vh;
    object-fit: cover;
    object-position: center;
    background: #0b141c;
    border-radius: 16px;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.65);
    display: block;
}

.qa2-spin {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    animation: qa2Spin 0.8s linear infinite;
    pointer-events: none;
    display: none;
}

.qa2-stage.is-loading .qa2-spin {
    display: block;
}

@keyframes qa2Spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.qa2-error {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 78%;
    text-align: center;
    color: #fff;
    font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
    display: none;
}

.qa2-stage.is-error .qa2-error {
    display: block;
}

.qa2-stage.is-error .qa2-spin {
    display: none;
}

/* ---- arrows: gold circles matching the site's `.splide__arrow` ---- */
.qa2-arrow {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #997233;
    border: none;
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.16s ease, transform 0.16s ease;
}

.qa2-arrow:hover {
    background: #7c5b26;
    transform: scale(1.06);
}

.qa2-arrow:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.qa2-arrow svg {
    width: 20px;
    height: 20px;
}

.qa2-arrow--prev svg {
    transform: scaleX(-1);
}

.qa2-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.qa2-count {
    color: rgba(255, 255, 255, 0.72);
    font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
}

.qa2-arrow--bottom {
    display: none; /* bottom arrows are mobile-only */
}

@media (max-width: 760px) {
    .qa2-stage {
        gap: 0;
    }
    .qa2-arrow--side {
        display: none;
    }
    .qa2-arrow--bottom {
        display: grid;
    }
    .qa2-video {
        max-height: 66vh;
    }
    .qa2-row {
        padding: 16px 16px 16px 18px;
    }
    .qa2-play {
        width: 46px;
        height: 46px;
    }
    .qa2-arrow {
        width: 44px; /* 44px min touch target on mobile */
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qa2-modal.is-open,
    .qa2-stagewrap {
        animation: none;
    }
    .qa2-row,
    .qa2-play,
    .qa2-arrow,
    .qa2-close {
        transition: none;
    }
    .qa2-row:hover {
        transform: none;
    }
    .qa2-spin {
        animation-duration: 1.6s;
    }
}

/* ============================================================
   How-we-work timeline scroll progress (client-approved enhancement,
   companion to inc/enhancements/timeline-progress.js).
   The legacy IntersectionObserver line fill (`.active` -> ::before
   height:100%) is RETIRED — the fill is now a pure function of scroll
   position. Dots and numbering keep their `.active` behaviour exactly
   (only the line ::before is suppressed). The fill uses the same blue
   gradient the legacy fill used; scaleY compression gives it a soft
   leading edge. transition:none is REQUIRED: the theme has
   `.how_we_work-box *{transition:all .3s ease}` which would lag the
   1:1 scroll tether (and violate the no-easing rule, incl. under
   prefers-reduced-motion).
   ============================================================ */
.how_we_work-box .scrollbar-line::before {
    display: none !important; /* legacy jump-fill off; track stays */
}

.hww-fill {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1da1f2 1%, rgba(29, 161, 242, 0.1));
    transform: scaleY(0);
    transform-origin: top;
    transition: none !important;
    will-change: transform;
    pointer-events: none;
}
