/* ===========================================
   Lesson Layout - Mobilens Rejse
   Matches hjemmearbejde1.html styling
   =========================================== */

:root {
    /* Base colors */
    --color-cream: #faf6f1;
    --color-coffee: #2d1810;
    --color-coffee-light: #5c3d2e;
    --color-copper: #b87333;
    --color-copper-light: #d4956a;
    --color-terracotta: #c1666b;
    --color-sage: #4a7c59;
    --color-gold: #c9a227;
    --color-text: #1a1a1a;
    --color-text-muted: #5a5a5a;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Source Sans 3', system-ui, sans-serif;
    
    /* Content type colors - Copper/Gold for Tasks */
    --content-task-bg: linear-gradient(135deg, rgba(184, 115, 51, 0.08) 0%, rgba(201, 162, 39, 0.05) 100%);
    --content-task-border: var(--color-copper);
    --content-task-accent: var(--color-gold);
    
    /* Green (Sage) for Concepts */
    --content-concept-bg: linear-gradient(135deg, rgba(74, 124, 89, 0.1) 0%, rgba(74, 124, 89, 0.05) 100%);
    --content-concept-border: var(--color-sage);
    --content-concept-text: #2d5a3a;
    
    /* Blue for Facts/Info */
    --content-info-bg: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
    --content-info-border: #2563eb;
    --content-info-text: #1e40af;
    
    /* Red for Warnings */
    --content-warning-bg: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(248, 113, 113, 0.05) 100%);
    --content-warning-border: #ef4444;
    --content-warning-text: #b91c1c;
    
    /* Gray for Sources */
    --content-source-bg: #f8fafc;
    --content-source-border: #94a3b8;
    --content-source-text: #64748b;
}

/* Base Body Styling */
body {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--color-text);
    background: var(--color-cream);
    margin: 0;
    padding: 0;
}

/* Consistent font size for all text */
p,
li,
td,
.expandable__content,
.box--reading,
.box--task {
    font-size: 1.05rem;
    line-height: 1.75;
}

/* Main Content Area */
.main-content,
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.container--wide {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Content Sections */
.content-section {
    margin-bottom: 4rem;
    animation: fadeInUp 0.6s ease-out both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Headings */
.content-section h2,
.box--reading h2,
.expandable__content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-coffee);
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.content-section h3,
.box--reading h3,
.expandable__content h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-coffee-light);
    margin: 2rem 0 1rem;
}

.content-section h4,
.box--reading h4,
.expandable__content h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-coffee);
    margin: 1.5rem 0 0.75rem;
}

/* Paragraphs and Lists */
.content-section p,
.box--reading p,
.expandable__content p {
    margin-bottom: 1.25rem;
    color: var(--color-text);
    line-height: 1.8;
}

.content-section ul,
.content-section ol,
.box--reading ul,
.box--reading ol,
.expandable__content ul,
.expandable__content ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

.content-section li,
.box--reading li,
.expandable__content li {
    margin-bottom: 0.6rem;
    line-height: 1.7;
}

.content-section strong,
.box--reading strong,
.expandable__content strong {
    color: var(--color-coffee);
    font-weight: 600;
}

/* Reading Box - Redesigned */
.box--reading {
    background: white;
    border-radius: 1.25rem;
    padding: 2rem 2.5rem;
    margin: 2rem 0;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 8px 24px rgba(0, 0, 0, 0.04);
    border-left: none;
    position: relative;
}

.box--reading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-copper), var(--color-gold));
    border-radius: 1.25rem 1.25rem 0 0;
}

/* Task Box - Base styling (works for all task boxes) */
.box--task {
    background: white;
    border: 2px solid var(--color-copper, #b87333);
    border-radius: 1.25rem;
    padding: 1.75rem;
    margin: 2.5rem 0;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 10px 30px rgba(184, 115, 51, 0.12);
    position: relative;
}

/* Task boxes WITH header get special styling */
.box--task:has(.box--task__header) {
    padding: 0;
    border: none;
    overflow: hidden;
}

.box--task:has(.box--task__header)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: 1.25rem;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--color-copper, #b87333), var(--color-gold, #c9a227)) border-box;
    pointer-events: none;
    z-index: 0;
}

.box--task:has(.box--task__header) > * {
    position: relative;
    z-index: 1;
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(*)) {
    .box--task {
        padding: 0;
        border: none;
        overflow: hidden;
    }
    
    .box--task::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border: 2px solid transparent;
        border-radius: 1.25rem;
        background: linear-gradient(white, white) padding-box,
                    linear-gradient(135deg, var(--color-copper, #b87333), var(--color-gold, #c9a227)) border-box;
        pointer-events: none;
        z-index: 0;
    }
    
    .box--task > * {
        position: relative;
        z-index: 1;
    }
}

/* Task Header */
.box--task__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--color-copper, #b87333) 0%, var(--color-gold, #c9a227) 100%);
    color: white;
    margin: 0;
}

.box--task__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

/* Small dot before task number */
.box--task__number::before {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    margin-right: 0.5rem;
    opacity: 0.7;
}

/* Task Body Content - for boxes WITH header */
.box--task:has(.box--task__header) > *:not(.box--task__header) {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

.box--task:has(.box--task__header) > h3:first-of-type,
.box--task:has(.box--task__header) > .box--task__header + h3 {
    margin-top: 1.5rem;
}

.box--task:has(.box--task__header) > *:last-child {
    padding-bottom: 1.75rem;
    margin-bottom: 0;
}

/* Fallback content padding for browsers without :has() */
@supports not selector(:has(*)) {
    .box--task > *:not(.box--task__header) {
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }
    
    .box--task > .box--task__header + h3 {
        margin-top: 1.5rem;
    }
    
    .box--task > *:last-child {
        padding-bottom: 1.75rem;
        margin-bottom: 0;
    }
}

/* Task box typography */
.box--task h3 {
    color: var(--color-coffee, #2d1810);
    font-size: 1.25rem;
    margin: 1rem 0 0.75rem;
}

.box--task h4 {
    color: var(--color-copper, #b87333);
    font-size: 1rem;
    margin: 1.25rem 0 0.5rem;
}

.box--task p {
    color: var(--color-text, #1a1a1a);
    margin-bottom: 1rem;
}

.box--task ul,
.box--task ol {
    margin: 0.5rem 0 1rem;
    padding-left: 1.5rem;
}

.box--task li {
    margin-bottom: 0.4rem;
}

/* Task Steps styling */
.task-steps {
    background: rgba(184, 115, 51, 0.04);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin: 1rem 1.75rem 1.75rem;
}

.task-steps h4 {
    margin-top: 0;
    padding-top: 0;
}

.task-steps h4:not(:first-child) {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(184, 115, 51, 0.15);
}

.task-steps ol,
.task-steps ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.task-steps li {
    margin-bottom: 0.4rem;
}

/* Notes variant - special styling */
.box--task--notes,
.box--task[data-task-type="notes"] {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.03),
        0 10px 30px rgba(201, 162, 39, 0.15);
}

.box--task--notes::before,
.box--task[data-task-type="notes"]::before {
    background: linear-gradient(#fffbeb, #fffbeb) padding-box,
                linear-gradient(135deg, var(--color-gold), #f59e0b) border-box;
}

.box--task--notes .box--task__header,
.box--task[data-task-type="notes"] .box--task__header {
    background: linear-gradient(135deg, var(--color-gold) 0%, #f59e0b 100%);
}

/* Expandable Sections - Redesigned */
.expandable {
    background: white;
    border-radius: 1rem;
    margin: 2rem 0;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 8px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.expandable__header {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-coffee);
    transition: background 0.2s;
}

.expandable__header:hover {
    background: rgba(184, 115, 51, 0.05);
}

.expandable--blue .expandable__header {
    border-left: 4px solid var(--color-copper);
}

.expandable--green .expandable__header {
    border-left: 4px solid var(--color-sage);
}

.expandable--gray .expandable__header {
    border-left: 4px solid #94a3b8;
}

.expandable__content {
    padding: 0 1.5rem 1.5rem;
}

/* Remove nested box styling when inside expandables */
.expandable__content > .box--reading {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

.expandable__content > .box--reading::before {
    display: none;
}

/* Task boxes inside expandables should stand out */
.expandable__content .box--task {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    border-radius: 0;
}

.expandable__content .box--task::before {
    border-radius: 0;
}

.expandable__icon {
    width: 20px;
    height: 20px;
    color: var(--color-copper);
    transition: transform 0.3s;
    flex-shrink: 0;
}

.expandable--open .expandable__icon {
    transform: rotate(180deg);
}

/* Expandable title styling */
.expandable__title {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.expandable__header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Type indicators for expandables */
.expandable--blue .expandable__header-content::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-copper);
    border-radius: 50%;
}

.expandable--green .expandable__header-content::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-sage);
    border-radius: 50%;
}

.expandable--gray .expandable__header-content::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
}

/* Pull Quote */
.pull-quote {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-coffee);
    padding: 1.5rem 0;
    margin: 2.5rem 0;
    border-top: 3px solid var(--color-copper);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    line-height: 1.5;
}

.pull-quote em {
    color: var(--color-copper);
    font-style: normal;
}

/* Highlight Box */
.highlight-box,
.info-box {
    background: linear-gradient(135deg, rgba(74, 124, 89, 0.1) 0%, rgba(74, 124, 89, 0.05) 100%);
    border-left: 4px solid var(--color-sage);
    padding: 1.5rem 2rem;
    border-radius: 0 1rem 1rem 0;
    margin: 2rem 0;
}

.highlight-box h4,
.info-box h4 {
    color: var(--color-sage);
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Example Box */
.example-box,
.resource-box {
    background: white;
    border-radius: 1.25rem;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.02),
        0 12px 40px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.example-box::before,
.resource-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-copper), var(--color-gold));
}

.example-box h4,
.resource-box h4 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-coffee);
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.data-table th {
    background: var(--color-coffee);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(184, 115, 51, 0.03);
}

/* Figures */
figure {
    margin: 2rem 0;
}

figure img {
    width: 100%;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: center;
    font-style: italic;
}

/* Text and Figure Row Layout */
.text-figure-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    margin: 2rem 0;
}

.text-figure-row--figure-left {
    grid-template-columns: 1fr 1fr;
}

.text-figure-row--figure-left .text-figure-row__figure {
    order: -1;
}

.text-figure-row__text {
    line-height: 1.75;
}

.text-figure-row__figure {
    margin: 0;
}

.text-figure-row__figure img {
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: auto;
}

.figure-zoomable img {
    cursor: zoom-in;
    transition: transform 0.2s, box-shadow 0.2s;
}

.figure-zoomable img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .text-figure-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .text-figure-row--figure-left .text-figure-row__figure {
        order: 0;
    }
}

/* ===========================================
   Consistent Color Coding System
   =========================================== */

/* Concept Cards - Green theme */
.concept-card {
    background: var(--content-concept-bg);
    border-left: 4px solid var(--content-concept-border);
    padding: 1.25rem 1.5rem;
    border-radius: 0 0.75rem 0.75rem 0;
    margin-bottom: 1rem;
}

.concept-card__term {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--content-concept-text);
    margin-bottom: 0.5rem;
}

.concept-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text);
}

.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Info Box - Blue theme */
.info-box,
.fact-box {
    background: var(--content-info-bg);
    border-left: 4px solid var(--content-info-border);
    padding: 1.5rem 2rem;
    border-radius: 0 1rem 1rem 0;
    margin: 2rem 0;
}

.info-box h4,
.fact-box h4 {
    color: var(--content-info-text);
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
}

/* Warning Box - Red theme */
.warning-box,
.conflict-box {
    background: var(--content-warning-bg);
    border-left: 4px solid var(--content-warning-border);
    padding: 1.5rem 2rem;
    border-radius: 0 1rem 1rem 0;
    margin: 2rem 0;
}

.warning-box h4,
.conflict-box h4 {
    color: var(--content-warning-text);
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
}

/* Warning indicator via border emphasis */
.warning-box,
.conflict-box {
    border-left-width: 6px;
}

/* Metal Cards - special styling for metal information */
.metal-card {
    background: white;
    border-left: 4px solid var(--color-copper);
    padding: 1.5rem 2rem;
    border-radius: 0 1rem 1rem 0;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.metal-card h3 {
    color: var(--color-coffee);
    margin-top: 0;
    font-family: var(--font-display);
}

/* Notes Box - Yellow/Gold theme for student notes */
.notes-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px dashed var(--color-gold);
    border-radius: 1rem;
    padding: 1.75rem 2rem;
    margin: 2rem 0;
    position: relative;
}

.notes-box__label {
    position: absolute;
    top: -0.75rem;
    left: 1.5rem;
    background: var(--color-gold);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notes-box h3 {
    margin-top: 0.5rem;
    color: var(--color-coffee);
}

/* Summary Box - Copper theme */
.summary-box {
    background: linear-gradient(135deg, rgba(184, 115, 51, 0.06) 0%, rgba(201, 162, 39, 0.04) 100%);
    border: 2px solid var(--color-copper);
    border-radius: 1rem;
    padding: 2rem;
    margin: 3rem 0 2rem;
    position: relative;
}

.summary-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-copper), var(--color-gold));
    border-radius: 1rem 1rem 0 0;
}

.summary-box h2 {
    font-family: var(--font-display);
    color: var(--color-copper);
    margin-top: 0;
    font-size: 1.5rem;
}

/* Next Lesson Card */
.next-lesson-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 10px 30px rgba(184, 115, 51, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.next-lesson-card:hover {
    border-color: var(--color-copper);
    transform: translateY(-2px);
}

.next-lesson-card__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin: 0 0 0.25rem;
}

.next-lesson-card__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--color-coffee);
}

.next-lesson-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--color-copper), var(--color-gold));
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

.next-lesson-card__link:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(184, 115, 51, 0.3);
}

@media (max-width: 600px) {
    .next-lesson-card {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Task List Styling */
.task-list {
    background: rgba(184, 115, 51, 0.04);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem 1.25rem 2.5rem;
    margin: 1rem 0;
}

.task-list li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.task-list li::marker {
    color: var(--color-copper);
    font-weight: 600;
}

/* Quote Highlight - stylized blockquote */
.quote-highlight {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--color-coffee);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-left: 4px solid var(--color-copper);
    background: linear-gradient(90deg, rgba(184, 115, 51, 0.06) 0%, transparent 100%);
    border-radius: 0 0.5rem 0.5rem 0;
}

/* Term Highlighting - Sage green for definitions */
.term {
    background: linear-gradient(120deg, rgba(74, 124, 89, 0.15) 0%, rgba(74, 124, 89, 0.08) 100%);
    padding: 0.1em 0.4em;
    border-radius: 0.25em;
    font-weight: 500;
    color: var(--content-concept-text);
    cursor: help;
    border-bottom: 1px dashed var(--color-sage);
}

/* External Links */
.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-copper);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(184, 115, 51, 0.1);
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.external-link:hover {
    background: rgba(184, 115, 51, 0.2);
    transform: translateX(4px);
}

/* Goals Box */
.lesson-goals {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-left: 4px solid var(--color-sage);
}

.lesson-goals h4 {
    color: var(--color-sage);
    margin-top: 0;
    font-family: var(--font-display);
}

/* Source Box - Redesigned */
.box--source {
    background: #f8fafc;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-left: 4px solid #94a3b8;
}

.box--source h2 {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 1rem;
    font-family: var(--font-display);
}

.box--source ul {
    margin: 0;
    padding-left: 1.25rem;
}

.box--source li {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.box--source a {
    color: #475569;
}

.box--source a:hover {
    color: var(--color-copper);
}

/* Improved Content Section spacing */
.content-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.6s ease-out both;
}

.content-section:last-of-type {
    border-bottom: none;
    margin-bottom: 2rem;
}

/* Lesson Navigation - Redesigned */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(184, 115, 51, 0.15);
}

.lesson-nav-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    flex: 1;
    max-width: 45%;
}

.lesson-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(184, 115, 51, 0.15);
}

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

.lesson-nav-btn--next {
    justify-content: flex-end;
    text-align: right;
    margin-left: auto;
}

.lesson-nav-btn__arrow {
    font-size: 1.5rem;
    color: var(--color-copper);
}

.lesson-nav-btn__text {
    display: flex;
    flex-direction: column;
}

.lesson-nav-btn__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

.lesson-nav-btn__title {
    font-weight: 600;
    color: var(--color-coffee);
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .lesson-navigation {
        flex-direction: column;
    }
    
    .lesson-nav-btn {
        max-width: 100%;
    }
    
    .lesson-nav-btn--next {
        justify-content: flex-start;
        text-align: left;
    }
}

/* Navigation Footer */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 4rem;
}

.lesson-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-coffee);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.lesson-nav a:hover {
    background: rgba(184, 115, 51, 0.1);
    color: var(--color-copper);
}

/* ===========================================
   Page Table of Contents (Sticky Sidebar)
   =========================================== */

.page-toc {
    position: fixed;
    right: 20px;
    top: 100px;
    width: 240px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 1rem;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 10px 30px rgba(0, 0, 0, 0.08);
    z-index: 100;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

.page-toc__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--color-coffee) 0%, var(--color-coffee-light) 100%);
    color: white;
}

.page-toc__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
}

.page-toc__toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    position: relative;
}

.page-toc__toggle::before {
    content: '';
    width: 12px;
    height: 2px;
    background: white;
    position: absolute;
    transform: rotate(45deg);
}

.page-toc__toggle::after {
    content: '';
    width: 12px;
    height: 2px;
    background: white;
    position: absolute;
    transform: rotate(-45deg);
}

.page-toc--collapsed .page-toc__toggle::before {
    transform: none;
    top: 10px;
    box-shadow: 0 4px 0 white, 0 8px 0 white;
}

.page-toc--collapsed .page-toc__toggle::after {
    display: none;
}

.page-toc__toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.page-toc__list {
    list-style: none;
    margin: 0;
    padding: 0.75rem 0;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.page-toc__item {
    padding: 0;
    margin: 0;
}

.page-toc__item a {
    display: block;
    padding: 0.5rem 1.25rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.4;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.page-toc__item a:hover {
    background: rgba(184, 115, 51, 0.05);
    color: var(--color-coffee);
}

.page-toc__item--active a {
    border-left-color: var(--color-copper);
    background: rgba(184, 115, 51, 0.08);
    color: var(--color-coffee);
    font-weight: 600;
}

/* Task items have special styling */
.page-toc__item--task a {
    color: var(--color-copper);
    font-weight: 500;
}

.page-toc__item--task a::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--color-copper);
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Collapsed state */
.page-toc--collapsed {
    width: 50px;
}

.page-toc--collapsed .page-toc__title,
.page-toc--collapsed .page-toc__list {
    display: none;
}

.page-toc--collapsed .page-toc__header {
    justify-content: center;
}

/* ===========================================
   Reading Progress Bar
   =========================================== */

.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    z-index: 9999;
}

.reading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--color-copper), var(--color-gold));
    width: 0%;
    transition: width 0.15s ease-out;
    box-shadow: 0 1px 3px rgba(184, 115, 51, 0.3);
    position: relative;
}

.reading-progress__text {
    position: absolute;
    right: 0;
    top: 8px;
    background: var(--color-coffee);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.reading-progress__text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hide scroll-progress if reading-progress exists (avoid duplicate) */
.reading-progress-container ~ .scroll-progress {
    display: none;
}

/* ===========================================
   Mobile Adjustments
   =========================================== */

@media (max-width: 1200px) {
    .page-toc {
        right: 10px;
        width: 200px;
    }
}

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

@media (max-width: 768px) {

    .main-content,
    main {
        padding: 2rem 1rem 3rem;
    }

    .box--reading,
    .example-box,
    .resource-box {
        padding: 1.5rem;
        border-radius: 1rem;
    }
    
    .box--task {
        margin: 2rem -1rem;
        border-radius: 0;
    }
    
    .box--task::before {
        border-radius: 0;
    }

    .content-section h2,
    .box--reading h2 {
        font-size: 1.6rem;
    }

    .expandable__header {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }
}