@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;700&family=Lora:ital,wght@0,400;0,600;1,400&family=Gloria+Hallelujah&display=swap');

:root {
    /* Palette Beatrix Potter (Organic & Earthy) */
    --bg-page: #FDF5E6;
    /* Warm Cream - Creme Quente */
    --bg-card: #FFFFFF;

    /* Brand Colors */
    --primary: #2A5A3F;
    /* Forest Green - Mata Viva */
    --primary-light: #D1FAE5;
    --accent-gold: #BFA265;
    /* Old Gold - Nobreza */
    --text-primary: #1C1917;
    /* Stone 900 */
    --text-secondary: #44403C;
    /* Stone 700 */
    --text-tertiary: #A8A29E;
    /* Stone 400 */

    /* Guardians (Vibrant yet Natural) */
    --g-melquior: #D97706;
    --g-celeste: #EA580C;
    --g-bernardo: #78350F;
    --g-noe: #4338CA;
    --g-iris: #DB2777;

    /* Typography */
    --font-heading: 'Lora', serif;
    --font-body: 'Outfit', sans-serif;
    /* Toca Boca Style: Clean & Round */
    --font-hand: 'Gloria Hallelujah', cursive;
    /* Toque Humano */

    /* UI Toca Boca (Round & Friendly) */
    --radius-sm: 12px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 50px -12px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg-page);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* SIDEBAR REFINADA */
.sidebar {
    width: 280px;
    background: #FFFCF5;
    /* Lighter Cream */
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: 2.5rem 2rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.02);
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-section {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.nav-link:hover {
    background: #FFFFFF;
    color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-soft);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

/* MAIN CONTENT - Left Anchor Strategy */
.main-content {
    margin-left: 280px;
    padding: 4rem 5rem;
    /* Reverted to Centered Style */
    width: 100%;
    max-width: 1600px;
}

header {
    margin-bottom: 5rem;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: #E0E7FF;
    color: #3730A3;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #292524;
    letter-spacing: -0.02em;
}

.subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 650px;
    line-height: 1.6;
}

/* STATS (Pill Style) */
.stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 4rem;
}

.stat-card {
    background: #FFFFFF;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.stat-val {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-heading);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* CARDS - TOCA BOCA STYLE (Rounder, Friendlier) */
.section-header {
    margin-bottom: 2.5rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 2px dashed rgba(0, 0, 0, 0.05);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-primary);
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    /* 32px - Bem Redondo */
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy Spring */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* Decorative Top Bar */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: #E5E7EB;
}

.card.melquior::before {
    background: var(--g-melquior);
}

.card.celeste::before {
    background: var(--g-celeste);
}

.card.bernardo::before {
    background: var(--g-bernardo);
}

.card.noe::before {
    background: var(--g-noe);
}

.card.iris::before {
    background: var(--g-iris);
}

.card-body {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-id {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--accent-gold);
    background: #FEF9C3;
    padding: 0.4rem 0.8rem;
    border-radius: 99px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.guardian-icon-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s;
}

.card:hover .guardian-icon-img {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.25;
    color: var(--text-primary);
}

.card-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: normal;
    margin-bottom: 2rem;
    flex-grow: 1;
    opacity: 0.9;
}

.card-footer {
    padding: 1.5rem 2rem;
    background: #FAFAF9;
    border-top: 1px solid rgba(0, 0, 0, 0.02);
    text-align: right;
}

.btn-arr {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.2);
}

.btn-arr:hover {
    background: #065F46;
    padding-right: 2rem;
}


/* BLOG PLACEHOLDER */
.blog-empty {
    background: #F9FAFB;
    border: 2px dashed #E5E7EB;
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
}

.blog-empty h3 {
    color: #374151;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.blog-empty p {
    color: #6B7280;
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        /* Drastically reduced Mobile Padding (Was 2rem) */
    }
}

/* LESSON PAGE SPECIFIC (Premium Visuals) */
.lesson-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 4rem 2rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    position: relative;
}

/* Home Button - Fixed Position on Desktop */
.home-btn {
    position: fixed;
    top: 2rem;
    left: 2rem;
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0.6;
    transition: all 0.2s;
    z-index: 100;
    filter: grayscale(1);
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem;
    border-radius: 50%;
    backdrop-filter: blur(4px);
}

.home-btn:hover {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === CARD COMPONENTS (Global "Block" Look) === */
.scene-card,
.instruction-box {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    /* Subtle separation */
    border: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
    padding: 2.5rem;
    /* Spacious desktop padding */
    position: relative;
    overflow: hidden;
    /* For the ::before gradient */
}

/* === PREMIUM COMPONENTS REFATORADOS === */

/* 1. Instruction Box (Amarelo - Bastidores) */
.instruction-box {
    background: #FEF9C3;
    /* Amarelo Suave */
    border-left: 4px solid #F59E0B;
    /* Ouro */
    border-radius: 0 16px 16px 0;
    font-family: var(--font-body);
    color: #4B5563;
}

.instruction-box strong {
    color: #92400E;
    /* Texto destaque em tom terra/âmbar */
}

/* Fix: Rotaciona o ícone de mão para apontar para o texto à direita */
.instruction-box .ph-hand-pointing {
    transform: rotate(90deg);
}

/* 2. Narrative/Sensory Text (Palco - Imersão) */
.narrative-text {
    font-family: var(--font-heading);
    /* Lora */
    font-size: 1.15rem;
    line-height: 1.8;
    color: #374151;
    /* Cinza escuro para leitura */
    margin: 2rem 0;
    padding: 0 1rem;
    position: relative;
}

.narrative-text::before {
    content: '🍃';
    /* Decorative Icon default */
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* 3. Scene Card Premium */
.scene-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.06);
    /* Sombra Premium */
    border: 1px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 3rem;
    padding: 3rem;
    /* Espaçamento desktop generoso */
    position: relative;
    overflow: hidden;
}

/* Portador Header Correction */
.portador-block .script-header {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
}

.portador-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Top Navigation Support */
.lesson-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

.nav-back-link {
    text-decoration: none;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.nav-back-link:hover {
    color: var(--primary);
}

/* RESPONSIVE SYSTEM (Tri-State) */
/* 1. TABLET (768px - 1024px) */
@media (max-width: 1024px) {
    .main-content {
        padding: 2rem;
    }

    .lesson-container {
        padding: 2rem;
        width: 95%;
        /* More width utilize */
    }

    .sidebar {
        display: none;
        /* Hide sidebar on tablet too if drawer exists */
    }

    .mobile-toggle {
        display: flex;
        /* Ensure toggle is visible */
    }

    .scene-card,
    .instruction-box {
        padding: 1.5rem;
    }
}

/* HEADER & TYPOGRAPHY RESTORATION */
.scene-header {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    color: #111827;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.scene-icon {
    font-size: 1.5rem;
}

.lesson-container .scene-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FCD34D 0%, #F59E0B 100%);
    opacity: 0.8;
}

/* 2. MOBILE (< 768px) */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
        /* Edge to edge main wrapper */
    }

    .lesson-container {
        padding: 4rem 0 1rem 0;
        /* Expanded top padding for Home Button (two fingers) */
        width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    /* FIX: Home Button becomes Absolute to not float over text */
    .home-btn {
        position: absolute;
        top: 1rem;
        left: 1rem;
    }

    /* FIX: "Red Text" - Ensure content has breathing room */
    .script-persona-block,
    .lesson-hero,
    .card-body,
    p,
    li,
    h2,
    h3 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Keep Cards "Boxy" on Mobile, just smaller padding */
    .scene-card,
    .instruction-box {
        padding: 1.5rem !important;
        border-radius: 12px;
        /* Slightly smaller radius for mobile */
        margin-bottom: 1.5rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
        /* Restore subtle shadow */
    }

    /* Revert padding kill for internal elements of cards/boxes */
    .scene-card p,
    .instruction-box p {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    /* Portador Block: Stack Icon and Text */
    .portador-block .script-content {
        flex-direction: column;
    }

    .portador-icon {
        margin-bottom: 0.5rem;
    }

    /* Navigation Stack */
    .lesson-nav {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }

    .nav-btn {
        text-align: center;
        align-items: center;
    }
}

/* Hero Section */
.lesson-hero {
    text-align: center;
    margin-bottom: 5rem;
    position: relative;
    padding: 4rem 2rem;
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.lesson-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--primary);
    opacity: 0.5;
}

.lesson-meta-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
    background: #F5F5F4;
    padding: 0.5rem 1rem;
    border-radius: 99px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.hero-quote {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-style: italic;
    max-width: 700px;
    margin: 0 auto 3rem auto;
    line-height: 1.6;
}

.hero-guardian {
    width: 120px;
    height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
    transition: transform 0.5s ease;
}

.hero-guardian:hover {
    transform: scale(1.05) rotate(3deg);
}

/* Script/Persona Block (Roleplay) - Refined for "Word Wrap" Effect */
.script-persona-block {
    display: block;
    /* Removed Flex to allow wrapping */
    margin: 3rem 0;
    background: #FFFFFF;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border-left: 6px solid var(--primary);
    overflow: hidden;
    /* Clearfix for float */
}

.script-avatar {
    float: left;
    /* The "Word" effect */
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #F3F4F6;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
    /* Space below image before text wraps */
}

/* New: Icon-based Avatar for Portador */
.script-avatar-icon {
    float: left;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #F3F4F6;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    /* Icon Size */
    color: var(--accent-gold);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.script-content {
    display: block;
    /* Standard block to allow text wrap */
}

.script-header {
    margin-bottom: 0.5rem;
    /* Removed flex to let it flow naturally */
}

.script-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    /* Stay on same line */
    margin-right: 0.75rem;
}

.script-tone {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-style: italic;
    display: inline;
    /* Ensure it flows after name */
}

.script-text {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Standard Content Styles */
h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-top: 4rem;
    margin-bottom: 2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

h2::after {
    content: '';
    flex-grow: 1;
    height: 2px;
    background: #E5E7EB;
    opacity: 0.5;
}

/* Recursion / Nested Sections */
.nested-section {
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.nested-section h3,
.nested-section h4 {
    color: var(--text-secondary);
    margin-top: 1.5rem;
    font-size: 1.2rem;
}

/* Mobile Optimizations (Toca Boca: Usability first) */
@media (max-width: 768px) {
    .lesson-container {
        padding: 1rem 0;
        /* ZERO side padding on container */
    }

    .nested-section {
        margin-left: 0;
        /* Drastically reduced indent */
        padding-left: 0.75rem;
        border-left: 3px solid rgba(0, 0, 0, 0.1);
        /* Thicker line for visibility */
    }

    .hero-title {
        font-size: 2.25rem;
    }

    /* Smaller Hero Title */
    .lesson-nav {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Stacked Navigation */
    .nav-btn {
        text-align: center !important;
        align-items: center !important;
    }

    /* MAXIMIZING CONTENT WIDTH (User Request: Remove Red Spaces) */
    .script-persona-block,
    .instruction-box,
    .lesson-hero,
    .card-body,
    .stat-card {
        padding: 0.75rem !important;
        /* ULTRA MINIMAL (12px) */
    }

    /* Reduce side margins of paragraphs to gain even more space if any exist */
    p,
    li {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .section-header {
        flex-direction: column;
        /* Stack header items */
        align-items: flex-start;
        gap: 0.5rem;
    }

    .script-persona-block {
        margin: 1.5rem 0;
        /* Reduce vertical margin too */
        border-radius: var(--radius-sm);
        /* Smaller radius to save corner space */
    }

    .script-avatar {
        margin-right: 1rem;
        /* Tighter avatar spacing */
    }
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4B5563;
    text-align: justify;
}

li {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #4B5563;
    text-align: justify;
}

.instruction-box {
    background: #FEF3C7;
    color: #92400E;
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 1rem;
    margin: 2rem 0;
    border: 1px solid #FCD34D;
    display: flex;
    gap: 1rem;
    text-align: justify;
    align-items: flex-start;
    /* Ensure items don't stretch */
}

/* Fix Icon Size in Instruction Box */
.instruction-box i {
    font-size: 1.5rem;
    width: auto;
    /* Prevent 80px stretch bug */
    flex-shrink: 0;
}

/* Opt-in text wrap for long instruction boxes */
.instruction-box--wrap {
    display: block;
    overflow: hidden;
}

.instruction-box--wrap > i:first-child {
    float: left;
    display: block;
    font-size: 1.5rem !important;
    line-height: 1;
    margin-top: 0.2rem !important;
    margin-right: 1.25rem !important;
    margin-bottom: 0.5rem !important;
}

.instruction-box--wrap ol,
.instruction-box--wrap ul {
    display: block;
    list-style-position: inside;
    margin: 0.75rem 0 0 0 !important;
    padding-left: 0 !important;
}

.instruction-box--wrap li {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Navigation */
.lesson-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E7EB;
}

.lesson-header-nav .nav-mini-link {
    text-decoration: none;
    color: #6B7280;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.lesson-header-nav .nav-mini-link:hover {
    color: var(--primary);
}

.lesson-nav {
    margin-top: 6rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.nav-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.nav-btn.disabled {
    visibility: hidden;
}

.nav-btn.prev {
    align-items: flex-start;
    text-align: left;
}

.nav-btn.next {
    align-items: flex-end;
    text-align: right;
    background: #FEFCE8;
    border-color: #FEF08A;
}

.nav-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.nav-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.nav-btn:hover .nav-title {
    color: #065F46;
}

/* === NOVAS CLASSES - Migração 16/01/2026 === */

/* === CORES POR AUTOR (Para a Família) === */
.bruner-box {
    background: #DBEAFE;
    border-left: 4px solid #3B82F6;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1rem;
}

.cm-box {
    background: #EDE9FE;
    border-left: 4px solid #8B5CF6;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1rem;
}

.tgtb-box {
    background: #FEF3C7;
    border-left: 4px solid #F59E0B;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1rem;
}

.espiritual-box {
    background: #DCFCE7;
    border-left: 4px solid #22C55E;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1rem;
}

.graca-box {
    background: #F9FAFB;
    border-left: 4px solid #9CA3AF;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1rem;
}

.sementes-box {
    background: #ECFDF5;
    border-left: 4px solid #10B981;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1rem;
}

/* === PORTADOR DA TOCHA === */
.portador-icon {
    font-size: 2.5rem;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    line-height: 1;
    /* Fix vertical alignment */
}

.portador-block {
    border-left-color: #F59E0B !important;
    background: #FFFBEB;
}

.portador-block .script-header {
    display: flex;
    /* Force flex to align Icon + Title */
    align-items: center;
    margin-bottom: 0.5rem;
}

/* === LOCAL CARD === */
.local-card {
    text-align: center;
    margin: 1.5rem 0;
}

.local-card img {
    max-width: 480px;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border: 4px solid white;
    transform: rotate(-1deg);
}

.local-label {
    font-size: 0.9rem;
    color: #9CA3AF;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    /* Enforce centering */
}

.ritual-bastidores-box {
    background: #FFF7ED;
    border-left-color: #D97706;
}

.ritual-bastidores-box div,
.ritual-bastidores-box p {
    color: #7C2D12;
}

.ritual-portador-block {
    margin-top: 1.5rem;
}

.ritual-local-card {
    margin-top: 1.75rem;
}

.ritual-local-card .local-label {
    color: #B45309;
}

.journey-scene {
    background:
        radial-gradient(circle at top right, rgba(253, 230, 138, 0.22), transparent 34%),
        linear-gradient(180deg, #FFFDF8 0%, #FFFFFF 100%);
    border-color: rgba(180, 83, 9, 0.08);
}

.journey-scene::before {
    background: linear-gradient(90deg, #F59E0B 0%, #FCD34D 48%, #FB923C 100%);
    height: 5px;
}

.journey-scene::after {
    content: '';
    position: absolute;
    right: -42px;
    bottom: -56px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.12) 0%, rgba(251, 191, 36, 0) 72%);
    pointer-events: none;
}

.journey-scene--reveal {
    background:
        radial-gradient(circle at top left, rgba(253, 230, 138, 0.28), transparent 38%),
        linear-gradient(180deg, #FFF9EE 0%, #FFFFFF 100%);
}

.journey-scene .scene-header {
    color: #7C2D12;
}

.journey-reveal-card {
    margin-top: 0;
    margin-bottom: 2rem;
}

.journey-reveal-card .local-label {
    color: #92400E;
    letter-spacing: 0.12em;
}

.journey-reveal-card .card-visual-asset {
    box-shadow: 0 14px 28px rgba(146, 64, 14, 0.16);
}

.journey-instruction-box {
    background: #FFF7ED;
    border-left-color: #C2410C;
}

.journey-instruction-box strong {
    color: #9A3412;
}

.journey-instruction-box p + p {
    margin-top: 0.5rem;
}

.journey-instruction-box--safety {
    background: #FEF2F2;
    border-left-color: #DC2626;
}

.journey-instruction-box--safety strong {
    color: #991B1B;
}

.journey-script {
    background: rgba(255, 255, 255, 0.94);
    border-left-color: #D97706;
    box-shadow: 0 10px 24px rgba(146, 64, 14, 0.08);
}

.journey-script .script-avatar {
    border-color: #FDE68A;
    background: #FFFFFF;
}

.journey-script .script-header {
    display: block;
}

.journey-script .script-tone {
    display: block;
    margin-top: 0.35rem;
    color: #92400E;
}

.journey-script .script-text p + p {
    margin-top: 0.85rem;
}

.bridge-highlight-box {
    background: #EEF2FF;
    border-left-color: #4F46E5;
}

.bridge-highlight-box strong {
    color: #3730A3;
}

.heart-questions-box {
    background: #FFF7ED;
    border-left: 4px solid #C2410C;
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1rem;
    color: #7C2D12;
}

.heart-questions-box p + ul {
    margin-top: 0.5rem;
}

.heart-questions-box li + li {
    margin-top: 0.5rem;
}

.connection-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

/* === ADDED DURING MIGRATION CLEANUP === */
.materials-box {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.prep-focus-tag {
    text-align: center;
    margin-bottom: 1.25rem;
    color: #6B7280;
    font-size: 0.95rem;
    font-style: italic;
}

.prep-bridge-box {
    background: #FFFBEB;
    border-left: 4px solid #D97706;
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin: 0 0 1.5rem 0;
    color: #92400E;
}

.prep-heart-box {
    background: #FFF7ED;
    border-left-color: #F59E0B;
}

.prep-copy {
    margin-top: 1.5rem;
}

.prep-section + .prep-section,
.prep-copy > .strategy-box,
.prep-copy > .graca-box {
    margin-top: 1.5rem;
}

.prep-section-title {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
}

.prep-section-title i {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.prep-copy p {
    color: var(--text-secondary);
}

.prep-copy ul {
    margin: 0.5rem 0 0 1.5rem;
    color: var(--text-secondary);
}

.prep-copy li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.strategy-box {
    background: #ECFDF5;
    border-left: 4px solid #10B981;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1rem;
}

.strategy-box p + p {
    margin-top: 0.75rem;
}

.daily-seeds-box {
    background: #F0FDF4;
    border-left-color: #166534;
}

.daily-seeds-box p + p {
    margin-top: 0.75rem;
}

.connection-link-card {
    display: block;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid rgba(79, 70, 229, 0.18);
    background: linear-gradient(135deg, #EEF2FF 0%, #F8FAFC 100%);
    color: #312E81;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.connection-link-card:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 70, 229, 0.32);
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.12);
}

.connection-link-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4F46E5;
}

.connection-link-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
}

.formation-intro-box {
    background: #FFF7ED;
    border-left-color: #F59E0B;
}

.formation-stack > * + * {
    margin-top: 1.5rem;
}

.spiral-box {
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    border-left: 4px solid #4F46E5;
    border-radius: 8px;
    padding: 1rem;
}

.sensory-box {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #92400E;
    border-left: 4px solid #F59E0B;
}

/* === PHASE 6: COMPONENTES DE NARRATIVA (CLEAN UI) === */
/* 1. NAVEGAÇÃO SEMÂNTICA (Grid) */
.lesson-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-col {
    display: flex;
    align-items: center;
}

.nav-col.prev {
    justify-content: flex-start;
}

.nav-col.logo {
    justify-content: center;
}

.nav-col.next {
    justify-content: flex-end;
}

.nav-logo-img {
    height: 32px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.nav-logo-img:hover {
    opacity: 1;
}

/* 2. ESTÉTICA TÁTIL (Organic Cards) */
.card-visual-asset {
    width: 140px;
    /* Default size, often overridden inline or via specific classes if needed, keeping 140px as base */
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 4px solid white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Modificadores de Rotação */
.rotate-left {
    transform: rotate(-2deg);
}

.rotate-right {
    transform: rotate(2deg);
}

.rotate-slight {
    transform: rotate(-1deg);
}

.rotate-90 {
    transform: rotate(90deg);
}

/* Interatividade */
.hover-float:hover {
    transform: translateY(-4px) scale(1.05) rotate(0deg);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

/* 3. LISTASLIMPAS (Tipografia) */
.materials-box ul,
.instruction-box ol {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

.materials-box li,
.instruction-box li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 4. UTILITÁRIOS */
.no-italic {
    font-style: normal !important;
}

@media (max-width: 768px) {
    .lesson-nav-grid {
        grid-template-columns: 1fr 1fr;
        /* Logo hides or moves on mobile */
        gap: 1rem;
    }

    .nav-col.logo {
        display: none;
    }

    /* Hide center logo on tight mobile, or adjust if prefer */
}

/* === PHASE 8: ICON SYSTEM (Phosphor Duotone + Beatrix Potter) === */
:root {
    --potter-forest: #2A5A3F;
    --potter-gold: #BFA265;
    --potter-terra: #A0522D;
    --potter-carmim: #960018;
    --potter-indigo: #4B0082;
    --potter-stone: #78716C;
}

/* Base Icon Style */
i.ph-duotone {
    vertical-align: middle;
    display: inline-block;
}

/* Duotone Classes */
.duotone-gold {
    color: var(--potter-gold);
    --ph-duotone-accent-color: var(--potter-terra);
}

.duotone-forest {
    color: var(--potter-forest);
    --ph-duotone-accent-color: #8FBC8F;
}

.duotone-magic {
    color: var(--potter-indigo);
    --ph-duotone-accent-color: #9370DB;
}

.duotone-terra {
    color: var(--potter-terra);
    --ph-duotone-accent-color: var(--potter-gold);
}

.duotone-heart {
    color: var(--potter-carmim);
    --ph-duotone-accent-color: #FFB6C1;
}

.duotone-neutral {
    color: var(--potter-stone);
    --ph-duotone-accent-color: #E7E5E4;
}

.duotone-indigo {
    color: var(--potter-indigo);
    --ph-duotone-accent-color: #E0E7FF;
}

.duotone-sky {
    color: #0284C7;
    --ph-duotone-accent-color: #DBEAFE;
}

/* === CARD CONTAINER CENTERING (Fix user feedback) === */
.card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    margin: 1.5rem 0.5rem;
    /* Little margin for safety */
}

/* === DUOTONE CARMIM (Portador/Zeal) === */
.duotone-carmim {
    color: #960018;
    /* Carmim */
    --ph-duotone-accent-color: #FFB6C1;
    /* Light Pink */
}

/* === INTELLIGENT PORTADOR STYLING === */
/* Garante que o ícone do portador seja sempre Carmim e Centralizado */
.portador-block .script-avatar-icon {
    border-color: #FEE2E2;
    /* Red-100 */
    color: #960018;
    /* Force Carmim Text */
}

.portador-block .script-avatar-icon i {
    /* Force specific icon colors if needed, but duotone class handles it. */
    /* This ensures layout is perfect */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === ACTING CUES (Refatoração L001 Review) === */
.acting-cue {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--accent-gold);
    /* Dourado como prometido no Standard */
    font-style: italic;
    margin-bottom: 0.75rem;
    display: block;
}
