/*
 * BITSAFRIC EDUCATION
 * Money Adventures with Bitsafric
 * Shared storytelling stylesheet
 * Version: 1.0.0
 */

.edu-story {
    --story-bg: #080D12;
    --story-surface: #14232A;
    --story-panel: #1C3038;
    --story-green: #00E6A0;
    --story-gold: #F5C451;
    --story-blue: #60A5FA;
    --story-red: #FF8585;
    --story-text: #DCE7EC;
    --story-muted: #B1C0C8;
    --story-border: rgba(0, 230, 160, 0.22);

    margin: 30px 0;
    padding: 24px;
    border: 1px solid var(--story-border);
    border-radius: 16px;
    background: var(--story-surface);
    color: var(--story-text);
    scroll-margin-top: 110px;
    overflow-wrap: anywhere;
}

.edu-story *,
.edu-story *::before,
.edu-story *::after {
    box-sizing: border-box;
}

.edu-story .story-header {
    margin-bottom: 22px;
}

.edu-story .story-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--story-green);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.edu-story .story-episode {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--story-gold);
    font-size: 0.8rem;
    font-weight: 700;
}

.edu-story .story-header h3 {
    margin: 0 0 12px;
    color: #FFFFFF;
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.25;
}

.edu-story .story-intro {
    margin: 0;
    color: var(--story-muted);
    line-height: 1.7;
}

.edu-story .story-cover {
    margin: 18px auto;
    max-width: 760px;
}

.edu-story .story-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--story-border);
}

.edu-story .story-cover figcaption {
    margin-top: 8px;
    color: var(--story-muted);
    font-size: 0.8rem;
    text-align: center;
}

/* Comic panels */

.edu-story .story-comic {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.edu-story .story-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    background: var(--story-panel);
}

.edu-story .story-scene {
    display: block;
    margin-bottom: 16px;
    color: var(--story-muted);
    font-size: 0.82rem;
    font-style: italic;
    text-align: center;
}

.edu-story .story-dialogue {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 14px 0;
}

.edu-story .story-avatar {
    display: block;
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--story-bg);
}

.edu-story .story-bubble {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px 14px 14px 14px;
    background: var(--story-surface);
}

.edu-story .story-character {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
    font-weight: 800;
}

.edu-story .story-bubble p {
    margin: 0;
    color: var(--story-text);
    line-height: 1.65;
}

.edu-story .character-kato .story-character {
    color: var(--story-green);
}

.edu-story .character-amina .story-character {
    color: var(--story-gold);
}

.edu-story .character-brian .story-character {
    color: var(--story-blue);
}

.edu-story .character-sente .story-character {
    color: #C4B5FD;
}

.edu-story .character-kato .story-avatar {
    border: 2px solid var(--story-green);
}

.edu-story .character-amina .story-avatar {
    border: 2px solid var(--story-gold);
}

.edu-story .character-brian .story-avatar {
    border: 2px solid var(--story-blue);
}

.edu-story .character-sente .story-avatar {
    border: 2px solid #C4B5FD;
}

/* Financial storytelling */

.edu-story .story-narration {
    margin: 16px 0;
    color: var(--story-text);
    line-height: 1.75;
}

.edu-story .story-financial-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.edu-story .story-financial-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--story-border);
    border-radius: 10px;
    background: var(--story-bg);
}

.edu-story .story-financial-label {
    display: block;
    margin-bottom: 8px;
    color: var(--story-muted);
    font-size: 0.85rem;
}

.edu-story .story-financial-value {
    display: block;
    color: var(--story-green);
    font-size: clamp(1.15rem, 2.5vw, 1.65rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.edu-story .story-positive {
    color: var(--story-green);
}

.edu-story .story-negative {
    color: var(--story-red);
}

.edu-story .story-neutral {
    color: var(--story-text);
}

.edu-story .story-gold {
    color: var(--story-gold);
}

.edu-story .story-takeaway {
    margin: 20px 0;
    padding: 16px 18px;
    border: 1px solid var(--story-border);
    border-left: 4px solid var(--story-green);
    border-radius: 8px;
    background: rgba(0,230,160,0.05);
}

.edu-story .story-takeaway strong {
    display: block;
    margin-bottom: 8px;
    color: var(--story-green);
}

.edu-story .story-takeaway p {
    margin: 0;
    line-height: 1.65;
}

/* Interactive decision challenges */

.edu-story .story-challenge {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid rgba(245,196,81,0.25);
    border-radius: 12px;
    background: var(--story-bg);
}

.edu-story .story-challenge h4 {
    margin: 0 0 12px;
    color: var(--story-gold);
    font-size: 1.15rem;
}

.edu-story .story-question {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.edu-story .story-question legend {
    margin-bottom: 16px;
    color: var(--story-text);
    font-weight: 600;
    line-height: 1.6;
}

.edu-story .story-options {
    display: grid;
    gap: 10px;
}

.edu-story .story-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 48px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 9px;
    background: var(--story-surface);
    color: var(--story-text);
    cursor: pointer;
    line-height: 1.5;
}

.edu-story .story-option:hover {
    border-color: var(--story-green);
}

.edu-story .story-option input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: var(--story-green);
}

.edu-story .story-option:focus-within {
    outline: 2px solid var(--story-green);
    outline-offset: 3px;
}

.edu-story .story-option.is-correct {
    border-color: var(--story-green);
    background: rgba(0,230,160,0.08);
}

.edu-story .story-option.is-incorrect {
    border-color: var(--story-red);
    background: rgba(255,133,133,0.07);
}

.edu-story .story-feedback {
    margin-top: 14px;
    padding: 14px;
    border-radius: 8px;
    line-height: 1.6;
}

.edu-story .story-feedback.is-correct {
    color: var(--story-green);
    background: rgba(0,230,160,0.08);
    border: 1px solid var(--story-green);
}

.edu-story .story-feedback.is-incorrect {
    color: var(--story-red);
    background: rgba(255,133,133,0.07);
    border: 1px solid var(--story-red);
}

.edu-story .story-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.edu-story .story-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border: 1px solid var(--story-green);
    border-radius: 9px;
    background: var(--story-green);
    color: var(--story-bg);
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.edu-story .story-button-secondary {
    background: transparent;
    color: var(--story-green);
}

.edu-story .story-button:hover {
    filter: brightness(1.12);
}

.edu-story .story-button:focus-visible,
.edu-story a:focus-visible {
    outline: 3px solid var(--story-gold);
    outline-offset: 4px;
}

.edu-story .story-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.edu-story .story-note {
    margin: 16px 0 0;
    color: var(--story-muted);
    font-size: 0.8rem;
    line-height: 1.6;
}

.edu-story [hidden] {
    display: none !important;
}

/* Mobile storytelling */

@media (max-width: 600px) {

    .edu-story {
        margin: 22px 0;
        padding: 15px;
        border-radius: 12px;
    }

    .edu-story .story-panel {
        padding: 12px;
    }

    .edu-story .story-dialogue {
        gap: 9px;
    }

    .edu-story .story-avatar {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
    }

    .edu-story .story-bubble {
        padding: 11px;
    }

    .edu-story .story-financial-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .edu-story .story-challenge {
        padding: 14px;
    }

    .edu-story .story-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {

    .edu-story *,
    .edu-story *::before,
    .edu-story *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}