/*
 * String Explorer guided string finder (/string-explorer).
 *
 * Ported faithfully from the legacy tool (ernieball/public/assets/css/
 * string-explorer.css): a teal field with the hand-drawn yellow "STRING
 * EXPLORER" wordmark on the left and the wizard on the right — wide yellow
 * option pills each paired with a separate yellow (i) info segment, and
 * orange/red BACK + START OVER controls.
 *
 * This page keeps its own teal/yellow/red identity (not the site pink). Page-
 * namespaced BEM (.string-explorer__*); the legacy brand colors live in the
 * page-local custom properties below.
 */

.string-explorer {
    /* Legacy palette. */
    /* WAVE, 2026-09-02: white copy on the old teal (#409283) was 3.7:1 and
       white on the old red (#f04c23) 3.6:1. Both darkened one step so white
       text clears 4.5:1 (4.9 / 5.2); StringExplorerContrastTest recomputes. */
    --se-teal: #337d6d;          /* main field                */
    --se-teal-deep: #1b6a5b;     /* description well          */
    --se-yellow: #fadc00;        /* option pills              */
    --se-red: #c8391a;           /* BACK / RESTART / Shop Now */
    --se-ink: #000000;
    --se-on-surface: #ffffff;

    padding: 2.5rem 0 3rem;
    background-color: var(--se-teal);
    color: var(--se-on-surface);
}

/* Page-scoped visibility utility. The wizard JS toggles `.hidden` to gate the
   option descriptions, the recommendation panel, and each video — legacy relied
   on Bootstrap's `.hidden`, which the rebuild no longer ships. */
.string-explorer .hidden {
    display: none !important;
}

/* -- Layout -------------------------------------------------------------- */

.string-explorer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

.string-explorer__brand {
    text-align: center;
}

.string-explorer__logo {
    display: block;
    width: 80%;
    max-width: 360px;
    height: auto;
    margin: 0 auto;
}

/* Recommendation pack shot: swapped in for the wordmark in the left column at a
   terminal node (top of the stack on mobile). Sized to mirror the wordmark so
   the left column keeps the same footprint across question steps and results. */
.string-explorer__product-image {
    margin: 0;
    text-align: center;
}

.string-explorer__product-shot {
    display: block;
    width: 80%;
    max-width: 360px;
    height: auto;
    margin: 0 auto;
}

/* The wordmark IS the h1 (it wraps the logo image; the alt is the heading
   text). It used to be an off-canvas text h1 beside the image — WAVE flagged
   the hidden heading (2026-09-01). The heading adds no box of its own. */
.string-explorer__title {
    margin: 0;
    padding: 0;
    line-height: 0;
    font-size: 0;
}

.string-explorer__content {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

/* -- Step header --------------------------------------------------------- */

.string-explorer__step-header {
    margin: 0.5rem 0 0;
    text-align: center;
    color: var(--se-on-surface);
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: uppercase;
}

.string-explorer__step-description {
    margin: 0.75rem auto 0;
    max-width: 46ch;
    text-align: center;
    color: #fff; /* full white — a 0.9 fade sat under 4.5:1 on the teal */
}

.string-explorer__noscript {
    display: block;
    margin: 1.5rem auto;
    text-align: center;
}

/* -- Option buttons ------------------------------------------------------ */

.string-explorer__finder {
    margin-top: 1.5rem;
}

.string-explorer__buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.string-explorer__loading,
.string-explorer__unavailable {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

.string-explorer__unavailable .btn {
    display: inline-block;
    margin-top: 0.75rem;
}

/* One row = the wide choice pill + a separate (i) info segment. */
.string-explorer__option {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.625rem;
    align-items: stretch;
}

.string-explorer__option-btn,
.string-explorer__info {
    min-height: 56px;
    background: var(--se-yellow);
    color: var(--se-ink);
    border: 1px solid var(--se-ink);
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

.string-explorer__option-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

/* An info-less row (no description) spans the full width. */
.string-explorer__option:not(:has(.string-explorer__info)) {
    grid-template-columns: 1fr;
}

.string-explorer__option-btn:hover,
.string-explorer__info:hover {
    background: #ffe83a;
}

.string-explorer__option-btn:active,
.string-explorer__info:active {
    transform: translateY(1px);
}

.string-explorer__option-btn:focus-visible,
.string-explorer__info:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.string-explorer__info {
    width: 64px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* The black circular (i), drawn in CSS so we carry no icon-font dependency. */
.string-explorer__info span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--se-ink);
    color: var(--se-yellow);
    border-radius: 50%;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1;
}

/* Description revealed by the (i) toggle (hidden by default via `.hidden`). */
.string-explorer__option-desc {
    grid-column: 1 / -1;
    width: 92%;
    margin: 0 auto;
    padding: 0.875rem 1.25rem;
    background: var(--se-teal-deep);
    border: 1px solid var(--se-yellow);
    border-radius: 30px;
    color: #fff;
    font-size: 0.9375rem;
    text-align: center;
}

/* -- Recommendation panel ------------------------------------------------ */

.string-explorer__result {
    margin-top: 1.5rem;
}

.string-explorer__recommend-header,
.string-explorer__videos-header {
    margin: 0 0 0.75rem;
    text-align: center;
    color: var(--se-on-surface);
    font-weight: 700;
    font-size: 1.375rem;
    text-transform: uppercase;
}

.string-explorer__hr {
    height: 1px;
    margin: 0 0 1.25rem;
    background: var(--se-ink);
    border: none;
}

.string-explorer__product-name {
    margin: 0 0 0.5rem;
    text-align: center;
    color: var(--se-on-surface);
    font-size: 1.5rem;
    font-weight: 700;
}

.string-explorer__product-description {
    margin: 0 0 1.25rem;
    text-align: center;
    color: #fff;
}

/* Shop Now + BACK/RESTART share the legacy orange/red fill. */
.string-explorer__buy,
.string-explorer__control {
    background: var(--se-red);
    color: #fff;
    border: 1px solid var(--se-ink);
    font-weight: 700;
}

.string-explorer__control {
    border-radius: 10px;
}

/* Shop Now — the primary recommendation CTA. A bold, padded pill with a subtle
   raised edge so it reads as the clear next action, distinct from the secondary
   Back / Start Over controls below it. */
.string-explorer__buy {
    display: block;
    max-width: 320px;
    margin: 0 auto;
    padding: 0.9375rem 2rem;
    text-align: center;
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 30px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
    transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.05s ease;
}

.string-explorer__buy:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.string-explorer__buy:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.string-explorer__buy:hover,
.string-explorer .string-explorer__control:hover:not(:disabled) {
    background: #d63e18;
    color: #fff;
    border-color: var(--se-ink);
    text-decoration: none;
}

/* -- Videos -------------------------------------------------------------- */

.string-explorer__videos {
    margin-top: 2.5rem;
}

.string-explorer__video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.string-explorer__video {
    margin: 0;
}

.string-explorer__video-frame {
    position: relative;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 25px;
}

/* 16:9 box (the rebuild does not ship Bootstrap's embed-responsive helpers). */
.string-explorer__video-frame.embed-responsive {
    aspect-ratio: 16 / 9;
}

.string-explorer__video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.string-explorer__video-title {
    margin: 0.75rem 0 0;
    text-align: center;
    color: var(--se-on-surface);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* -- Controls ------------------------------------------------------------ */

.string-explorer__controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.string-explorer__control {
    flex: 1;
    min-height: 48px;
    cursor: pointer;
}

.string-explorer__control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* -- Responsive ---------------------------------------------------------- */

@media (min-width: 768px) {
    .string-explorer {
        padding: 3.5rem 0 4.5rem;
    }

    .string-explorer__step-header {
        font-size: 1.75rem;
    }

    .string-explorer__product-name {
        font-size: 2rem;
    }
}

@media (min-width: 992px) {
    .string-explorer {
        padding: 5rem 0 6rem;
    }

    .string-explorer__grid {
        grid-template-columns: 5fr 7fr;
        gap: 3rem;
        align-items: center;
    }

    /* On a recommendation the right column is tall (CTA + controls + videos),
       so centering floats the pack shot halfway down. Snap both columns — and
       thus the pack image — to the top for the result view. */
    .string-explorer__grid:has(.string-explorer__content--result) {
        align-items: start;
    }

    .string-explorer__logo,
    .string-explorer__product-shot {
        width: 100%;
        max-width: 460px;
    }

    .string-explorer__step-header {
        font-size: 2rem;
    }

    .string-explorer__step-description {
        font-size: 1.125rem;
    }

    .string-explorer__option-btn {
        font-size: 1.25rem;
    }

    /* Two-up videos on wide screens. */
    .string-explorer__content--result .string-explorer__video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
