/* Sections shared by How it works and the content pages (stories, story, help): section headers,
   the story cards (slider on desktop, list on phone), video beside text, and the steps. */
/* ============================================================================
   SHARED STYLES
   ============================================================================ */
.section-header {
    text-align: center;
    font-size: var(--fs-h2);
    color: var(--cs-ink);
    margin-bottom: 40px;
    font-weight: 800;
}

/* ============================================================================
   SECTION 1: CONVERSATION TOPICS
   ============================================================================ */
.topics-section {
    min-height: auto;
    padding: 60px 20px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-margin-top: 130px;
}

.topics-slider-wrapper {
    position: relative;
    padding: 0 60px;
    max-width: 1320px;
    margin: 0 auto;
}

.topics-slider {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 20px 4px;
    -webkit-overflow-scrolling: touch;
}

/* keep the section content inside the screen width (flex items otherwise grow to their content) */
.topics-section > .container,
.examples-section > .container {
    width: 100%;
    min-width: 0;
}

.topic-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
    display: block;
}

.topics-slider::-webkit-scrollbar {
    height: 8px;
}

.topics-slider::-webkit-scrollbar-track {
    background: var(--cs-edge);
}

.topics-slider::-webkit-scrollbar-thumb {
    background: var(--cs-muted);
    border-radius: 4px;
}

.topic-card {
    flex: 0 0 calc((100% - 72px) / 4); /* 4 cards per row on desktop */
    min-width: 0;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    scroll-snap-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.topic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

.topic-title {
    font-size: var(--fs-body);
    font-weight: 600;
    margin-bottom: 12px;
}

.topic-description {
    color: var(--cs-muted);
    font-size: var(--fs-body);
    margin-bottom: 0;
}

.popular-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--cs-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: var(--fs-caption);
    font-weight: 600;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid var(--cs-line);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    font-size: 24px;
    color: var(--cs-ink);
}

.slider-arrow:hover {
    background: var(--cs-edge);
    border-color: var(--cs-muted);
}

.slider-arrow.left {
    left: 10px;
}

.slider-arrow.right {
    right: 10px;
}

/* ============================================================================
   SECTION 2: EXAMPLES
   ============================================================================ */
.examples-section {
    min-height: auto;
    padding: 60px 20px 80px;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-margin-top: 130px;
}

.gallery-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    max-width: 1200px;
    margin: 0 auto;
    gap: 56px;
    padding: 0 40px;
    align-items: start;
}

.video-player-section {
    min-width: 0;
}

.main-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 8;
    margin: 0 auto;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.main-video-wrapper video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.video-side {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
}

.video-title-display {
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.video-title-display h2 {
    font-size: var(--fs-h2);
    color: var(--cs-ink);
    margin: 0 0 12px 0;
    font-weight: 800;
}

.video-description {
    font-size: var(--fs-body);
    color: var(--cs-muted);
    line-height: 1.6;
    margin: 0;
}

/* Thumbnails that pick the video: play icon on each, red outline on the one playing */
.video-selector-section {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-content: start;
}

.video-thumb-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.video-button {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    padding: 0;
    background: transparent;
    border: 3px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.video-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.85;
}

.video-button .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--cs-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-small);
    padding-left: 3px;
    box-sizing: border-box;
}

.video-button:hover {
    border-color: var(--cs-line);
}

.video-button.active {
    border-color: var(--cs-primary);
}

.video-button.active img {
    opacity: 1;
}

.video-thumb-label {
    font-size: var(--fs-caption);
    color: var(--cs-ink);
    line-height: 1.3;
}

.video-button.active + .video-thumb-label {
    color: var(--cs-primary);
    font-weight: 600;
}

.video-examples-intro {
    max-width: 1000px;
    margin: 64px auto 0;
    background: white;
    padding: 32px;
    border-radius: 12px;
    border-left: 4px solid var(--cs-primary);
}

.video-examples-intro h3 {
    font-size: var(--fs-h3);
    font-weight: 800;
    color: var(--cs-ink);
    margin-bottom: 16px;
}

.video-examples-intro p {
    font-size: var(--fs-body);
    color: var(--cs-muted);
    margin-bottom: 16px;
}

.examples-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.examples-list li {
    padding: 8px 0;
    font-size: var(--fs-body);
    color: var(--cs-ink);
    line-height: 1.6;
}

.examples-list strong {
    color: var(--cs-primary);
    font-weight: 600;
}

/* How It Works Section - From Homepage */
.how-it-works-intro {
    padding: 80px 32px;
    background: white;
    margin: 64px auto 0;
    max-width: 1200px;
}


.how-it-works-intro h3 {
    font-size: var(--fs-h1);
    font-weight: 800;
    color: var(--cs-ink);
    text-align: center;
    margin-bottom: 60px;
    line-height: 1.2;
}

.steps-grid-examples {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.step-example {
    text-align: center;
}

.step-visual-example {
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    position: relative;
    aspect-ratio: 9/16;
    max-width: 350px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    height: 550px;
}

.step-visual-example img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.step-title-example {
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--cs-ink);
    margin-bottom: 12px;
    line-height: 1.3;
}

.step-description-example {
    font-size: var(--fs-body);
    color: var(--cs-muted);
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    /* Topics Section Mobile */
    .topics-section {
        min-height: auto;
        padding: 30px 0 40px 0;
        scroll-margin-top: 130px;
    }

    .section-header {
        font-size: var(--fs-h2);
        margin-bottom: 24px;
        padding: 0 16px;
    }
    
    .topics-slider-wrapper {
        padding: 0;
        position: relative;
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }
    
    .slider-arrow {
        width: 36px;
        height: 36px;
        font-size: 18px;
        z-index: 20;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .slider-arrow.left {
        left: 8px;
    }
    
    .slider-arrow.right {
        right: 8px;
    }
    
    .topics-slider {
        padding: 20px 52px;
        gap: 16px;
        overflow-x: auto;
        scroll-behavior: smooth;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .topics-slider::-webkit-scrollbar {
        display: none;
    }
    
    .topic-card {
        flex: 0 0 calc((100% - 16px) / 2);
        padding: 20px;
    }

    .topic-title {
        font-size: var(--fs-body);
        margin-bottom: 8px;
    }
    
    .topic-description {
        font-size: var(--fs-small);
        line-height: 1.5;
    }
    
    .popular-badge {
        font-size: var(--fs-caption);
        padding: 3px 10px;
    }
    
    /* Examples Section Mobile: video, thumbnails right under it, then title + description */
    .examples-section {
        min-height: auto;
        padding: 40px 16px;
        scroll-margin-top: 130px;
    }

    .gallery-layout {
        grid-template-columns: minmax(0, 1fr);
        padding: 0;
        gap: 18px;
        max-width: 100%;
    }

    .main-video-wrapper {
        width: 240px;
        max-width: 100%;
    }

    .video-side {
        gap: 18px;
    }

    .video-selector-section {
        order: -1;
        gap: 8px;
    }

    .video-thumb-label {
        display: none;
    }

    .video-button .play-icon {
        width: 30px;
        height: 30px;
        font-size: var(--fs-caption);
    }

    .video-title-display {
        padding: 16px;
    }

    .video-title-display h2 {
        font-size: var(--fs-h2);
    }

    .video-description {
        font-size: var(--fs-small);
    }

    .video-examples-intro {
        padding: 20px;
        margin-top: 32px;
    }

    .video-examples-intro h3 {
        font-size: var(--fs-h3);
    }

    .video-examples-intro p {
        font-size: var(--fs-small);
    }

    .examples-list li {
        font-size: var(--fs-small);
    }

    /* Steps Mobile: small square image beside the text */
    .how-it-works-intro {
        padding: 60px 4px;
        margin-top: 32px;
    }

    .how-it-works-intro h3 {
        font-size: var(--fs-h1);
        margin-bottom: 32px;
    }

    .steps-grid-examples {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .step-example {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 18px;
        align-items: center;
        text-align: left;
    }

    .step-visual-example {
        grid-row: 1 / span 2;
        width: 96px;
        height: 96px;
        aspect-ratio: 1 / 1;
        border-radius: 14px;
        margin: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .step-visual-example img {
        object-fit: cover;
        object-position: top;
    }

    .step-title-example {
        font-size: var(--fs-body);
        margin-bottom: 4px;
        align-self: end;
    }

    .step-description-example {
        font-size: var(--fs-small);
        margin: 0;
        max-width: none;
        align-self: start;
    }

    
}

@media (min-width: 769px) and (max-width: 1100px) {
    .topic-card {
        flex-basis: calc((100% - 48px) / 3);
    }

    .steps-grid-examples {
        gap: 24px;
    }

    .gallery-layout {
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 32px;
        padding: 0;
    }

    .video-selector-section {
        gap: 10px;
    }

    .step-visual-example {
        height: 420px;
    }
}

/* Phone: topics as a one-column list, small square thumbnail beside title + description */
@media (max-width: 640px) {
    .topics-slider-wrapper {
        padding: 0;
        overflow: visible;
    }

    .slider-arrow {
        display: none;
    }

    .topics-slider {
        flex-direction: column;
        gap: 12px;
        overflow: visible;
        padding: 0;
        scroll-snap-type: none;
    }

    .topic-card {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 10px;
    }

    .topic-card:hover {
        transform: none;
    }

    .topic-img {
        width: 64px;
        height: 64px;
        flex: 0 0 auto;
        margin: 0;
        border-radius: 10px;
    }

    .topic-text {
        min-width: 0;
    }

    .topic-title {
        font-size: var(--fs-body);
        margin-bottom: 2px;
    }

    .topic-description {
        font-size: var(--fs-small);
        line-height: 1.4;
    }
}

/* Stories page: the same cards in rows instead of a slider (phone keeps the one-column list) */
.topics-slider-wrapper.is-grid { padding: 0; }
.topics-slider.is-grid { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; }
.topics-all { text-align: center; margin: 24px 0 0; }
.topics-all a { font-weight: 600; color: inherit; }

/* ============================================================================
   CTA SECTION
   ============================================================================ */
.cta-section {
    text-align: center;
    padding: 60px 20px;
    background: white;
}

.cta-section h2 {
    font-size: var(--fs-h2);
    margin-bottom: 16px;
    color: var(--cs-ink);
}

.cta-button {
    display: inline-block;
    padding: 16px 32px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: var(--cs-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 35, 63, 0.3);
}

.cta-secondary-text {
    margin-top: 12px;
    color: var(--cs-muted);
    font-size: var(--fs-small);
}

@media (max-width: 768px) {
    /* CTA Section Mobile */
    .cta-section {
        padding: 40px 16px;
    }
    
    .cta-section h2 {
        font-size: var(--fs-h2);
    }
    
    .cta-button {
        padding: 14px 28px;
        font-size: var(--fs-body);
    }
}

/* ============================================================================
   2026 style (E4 Jade & cherry): colours, type, cards, buttons. Layout unchanged.
   ============================================================================ */
.section-header, .how-it-works-intro h3 {
    font-family: var(--cs-font-display); font-weight: 800; font-variation-settings: 'SOFT' 100; color: var(--cs-ink);
}
.topic-card {
    border-radius: var(--cs-radius-card); box-shadow: var(--cs-shadow); background: var(--cs-card);
}
.topic-card:hover { box-shadow: 0 2px 4px rgba(16, 36, 31, .08), 0 12px 24px rgba(16, 36, 31, .10); }
.topic-img { border-radius: 14px; background: var(--cs-secondary); }
.topic-title { font-family: var(--cs-font-body); font-weight: 600; color: var(--cs-ink); }
.topic-description { color: var(--cs-muted); }
.topics-all a { color: var(--cs-primary); }
.slider-arrow { border: 1.5px solid var(--cs-ink); color: var(--cs-ink); background: #fff; }
.slider-arrow:hover { background: #fff; border-color: var(--cs-primary); color: var(--cs-primary); }
.topics-slider::-webkit-scrollbar-track { background: var(--cs-edge); }
.topics-slider::-webkit-scrollbar-thumb { background: var(--cs-line); }

.main-video-wrapper { background: var(--cs-ink); border: 9px solid var(--cs-ink); border-radius: 40px; box-shadow: 0 18px 40px rgba(16, 36, 31, .18); }
.main-video-wrapper video { border-radius: 31px; }
.video-title-display { background: var(--cs-card); border-radius: var(--cs-radius-card); box-shadow: var(--cs-shadow); }
.video-title-display h2 { font-family: var(--cs-font-display); font-weight: 800; }
.video-button { background: var(--cs-line); border: 0; outline: 3px solid transparent; outline-offset: 2px; }
.video-button:hover { border-color: transparent; outline-color: var(--cs-line); }
.video-button.active { border-color: transparent; outline-color: var(--cs-primary); }
.video-button .play-icon { background: #fff; color: var(--cs-primary); }
.video-examples-intro { background: var(--cs-card); border-left: 0; border-radius: var(--cs-radius-card); box-shadow: var(--cs-shadow); }

.how-it-works-intro { background: transparent; }
.step-example { background: var(--cs-secondary); border-radius: var(--cs-radius-card); padding: 18px; }
.step-visual-example { background: var(--cs-card); box-shadow: none; }
.step-title-example { font-family: var(--cs-font-body); font-weight: 600; color: var(--cs-ink); }
.step-description-example { color: var(--cs-muted); }

/* Closing call-to-action: a jade block with the cherry pill button */
.cta-section {
    background: var(--cs-secondary); border-radius: 28px; max-width: 1160px; margin: 24px auto 72px; padding: 48px 24px;
}
.cta-section h2 { font-family: var(--cs-font-display); font-weight: 800; color: var(--cs-ink); }
.cta-button, .cta-button:visited {
    background: var(--cs-primary-grad); color: #fff; border: 0; border-radius: 999px; font-family: var(--cs-font-body); font-weight: 600;
}
.cta-button:hover { background: var(--cs-primary-grad-hover); color: #fff; transform: none; box-shadow: none; }
.cta-secondary-text { color: var(--cs-muted); }
@media (max-width: 768px) {
    .cta-section { margin: 16px 20px 56px; padding: 36px 22px; }
    .cta-section h2 { font-size: var(--fs-h2); line-height: 1.1; }
    .cta-section .cta-button { display: block; padding: 17px 24px; }
    .main-video-wrapper { border-width: 9px; }
}
@media (max-width: 640px) {
    .topic-card { border-radius: 18px; padding: 8px 14px 8px 8px; }
    .topic-img { width: 64px; height: 64px; border-radius: 12px; }
}
