/* ═══════════════════════════════════════════════════════════
   COMPONENTS.CSS
   Reusable UI components across the platform
   - Notebook styles
   - Exercise cards
   - Quotes and highlights
   - Tags and timelines
   - Scholarly article components
   - Exercise sheets
   - Landscape folios
   
   All components are designed to be:
   - Reusable across pages
   - Fully responsive
   - Visually consistent with academic aesthetic
   ═══════════════════════════════════════════════════════════ */

/* Notebook style (lined paper) */
.notebook {
    position: relative;
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
    background: 
        repeating-linear-gradient(
            to bottom,
            #ffffff,
            #ffffff 27px,
            rgba(175, 190, 210, 0.2) 28px
        );
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-gentle);
}

.notebook::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50px;
    width: 1px;
    background: rgba(200, 120, 120, 0.2);
}

/* Exercise card */
.exercise-card {
    position: relative;
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: var(--shadow-gentle);
}

.exercise-card::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 14px;
    height: 14px;
    background: var(--color-accent);
    border-radius: 50%;
}

/* Quote */
.quote {
    position: relative;
    margin: var(--space-xl) 0;
    padding: var(--space-lg) var(--space-xl);
    font-family: var(--font-serif);
    font-size: 1.5rem;
    background: rgba(107, 142, 168, 0.05);
    border-left: 4px solid var(--color-accent);
    border-radius: 6px;
}

.quote::before {
    content: "“";
    position: absolute;
    top: -20px;
    left: 15px;
    font-size: 4rem;
    color: rgba(107, 142, 168, 0.15);
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid var(--color-border);
    border-radius: 50px;
    margin-right: 0.5rem;
}

.tag--brevet {
    background: rgba(155, 176, 169, 0.15);
    border-color: rgba(155, 176, 169, 0.4);
}

.tag--important {
    background: rgba(212, 180, 153, 0.15);
    border-color: rgba(212, 180, 153, 0.4);
}

/* Timeline */
.timeline {
    display: flex;
    justify-content: space-between;
    margin: var(--space-xl) 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 2px;
    background: var(--color-border-light);
}

.timeline-step {
    position: relative;
    z-index: 1;
    background: var(--color-surface);
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 50px;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* Chapter divider */
.divider {
    text-align: center;
    margin: var(--space-xl) 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--color-border-light);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
}

/* Paper landscape */
.paper-landscape {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    padding: var(--space-xl);
    box-shadow: var(--shadow-gentle);
}

/* ═══════════════════════════════════════════════════════════
   SCHOLARLY ARTICLE (A4 Format)
   Centered academic paper with proper typography
   ═══════════════════════════════════════════════════════════ */

.article-section {
    padding: var(--space-xl) var(--space-md);
}

.scholarly-article {
    background: white;
    padding: 4rem 3.5rem;
    margin: 0 auto;
    max-width: var(--container-medium);  /* Centered with max-width */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--color-border-light);
}

.article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.article-title {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: var(--color-text-primary);
}

.article-meta {
    font-family: var(--font-body);
    font-size: 1rem;
    font-style: italic;
    color: var(--color-text-tertiary);
}

.article-body {
    max-width: 65ch;
}

.article-heading {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.article-paragraph {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    color: var(--color-text-secondary);
    text-align: justify;
}

/* Pull quote */
.pull-quote {
    margin: 2.5rem 0 2.5rem 2rem;
    padding-left: 2rem;
    border-left: 3px solid var(--color-accent);
    position: relative;
}

.pull-quote-mark {
    position: absolute;
    left: -0.5rem;
    top: -0.5rem;
    font-family: var(--font-serif);
    font-size: 4rem;
    color: var(--color-accent);
    opacity: 0.2;
    line-height: 1;
}

.pull-quote-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--color-text-primary);
}

/* Highlighted passage (soft marker effect) */
.highlight-passage {
    background: linear-gradient(to bottom, 
        rgba(255, 255, 200, 0) 0%,
        rgba(255, 255, 200, 0.3) 20%,
        rgba(255, 255, 200, 0.3) 80%,
        rgba(255, 255, 200, 0) 100%);
    padding: 0.5rem 0;
    margin: 1.5rem 0;
}

.highlight-passage .article-paragraph {
    margin-bottom: 0;
}

/* Inline figure */
.inline-figure {
    margin: 1.5rem 0;
}

.inline-figure--right {
    float: right;
    margin: 0.5rem 0 1.5rem 2rem;
    max-width: 250px;
}

.inline-image {
    width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.inline-figure figcaption {
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
    margin-top: 0.5rem;
    text-align: center;
}

/* Thought break */
.thought-break {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 3rem auto;
    width: 30%;
    opacity: 0.5;
}

/* Simple timeline, centered so content is not left-heavy */
.simple-timeline {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    align-items: center;
    margin: 2.5rem 0;
    padding: 1.5rem 0;
    position: relative;
}

.simple-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--color-border);
    z-index: 0;
}

.timeline-event {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
}

.timeline-marker {
    width: 14px;
    height: 14px;
    background: white;
    border: 3px solid var(--color-accent);
    border-radius: 50%;
}

.timeline-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    white-space: normal;
    text-align: center;
    max-width: 12em;
}

/* Section that contains timeline: center all text so it's not left-aligned */
.section-container:has(.simple-timeline) {
    text-align: center;
}

.section-container:has(.simple-timeline) .text-body {
    text-align: center;
}

/* Article tags */
.article-tags {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border-light);
}

.article-tag {
    position: relative;
    padding: 0.4rem 1rem;
    color: var(--color-text-secondary);
    border: 2px solid var(--color-accent);
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════
   EXERCISE SHEET (Torn notebook page)
   ═══════════════════════════════════════════════════════════ */

.exercise-sheet {
    position: relative;
    background: white;
    padding: 2.5rem 2rem 2rem 3rem;
    margin: 2rem auto;
    max-width: 750px;  /* Wider by default */
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--color-border);
}

/* Torn corner effect */
.torn-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 40px 40px 0;
    border-color: transparent #f5f7fa transparent transparent;
    filter: drop-shadow(-1px 1px 2px rgba(0, 0, 0, 0.1));
}

/* Spiral binding holes */
.spiral-holes {
    position: absolute;
    left: 1rem;
    top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.spiral-hole {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--color-border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.exercise-content {
    margin-left: 0.5rem;
}

.exercise-title {
    font-size: 1.5rem;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
}

.exercise-prompt {
    background: rgba(107, 142, 168, 0.05);
    padding: 1.25rem;
    border-left: 4px solid var(--color-accent);
    margin-bottom: 1.5rem;
}

.exercise-question {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.exercise-answer-area {
    position: relative;
    padding: 2rem 0;
    min-height: 180px;
}

.answer-lines {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.answer-line {
    display: block;
    height: 1px;
    background: var(--color-border);
    opacity: 0.4;
}

.exercise-hint {
    position: absolute;
    top: 0.5rem;
    left: 0;
    color: var(--color-text-tertiary);
    font-size: 0.95rem;
}

.exercise-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--color-border);
    color: var(--color-text-tertiary);
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════
   LANDSCAPE FOLIO (Photographs on desk)
   ═══════════════════════════════════════════════════════════ */

.landscape-section {
    background: rgba(245, 247, 250, 0.5);
    padding: var(--space-xl) var(--space-md);
}

.landscape-folio {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
}

.landscape-panel {
    position: relative;
    transition: transform 0.3s ease;
}

.landscape-panel:hover {
    transform: translateY(-4px);
}

.landscape-panel--rotate-right {
    transform: rotate(1.5deg);
}

.landscape-panel--rotate-left {
    transform: rotate(-1.5deg);
}

.landscape-panel--rotate-right:hover {
    transform: rotate(0deg) translateY(-4px);
}

.landscape-panel--rotate-left:hover {
    transform: rotate(0deg) translateY(-4px);
}

.photo-frame {
    background: white;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--color-border-light);
}

.landscape-photo {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--color-border-light);
}

.photo-caption {
    margin-top: 1rem;
    text-align: center;
    font-size: 1rem;
    color: var(--color-text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE BEHAVIOR
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .scholarly-article {
        padding: 2.5rem 1.5rem;
    }
    
    .article-title {
        font-size: 1.75rem;
    }
    
    .article-paragraph {
        font-size: 1rem;
        text-align: left;
    }
    
    .pull-quote {
        margin-left: 0;
        padding-left: 1.5rem;
    }
    
    .inline-figure--right {
        float: none;
        margin: 1.5rem 0;
        max-width: 100%;
    }
    
    .simple-timeline {
        flex-direction: column;
        gap: 2rem;
    }
    
    .simple-timeline::before {
        top: 5%;
        bottom: 5%;
        left: 50%;
        right: auto;
        width: 2px;
        height: auto;
    }
    
    .timeline-event {
        flex-direction: row;
        gap: 1rem;
        width: 100%;
        justify-content: center;
    }
    
    .timeline-label {
        max-width: none;
    }
    
    .article-tags {
        flex-wrap: wrap;
    }
    
    .exercise-sheet {
        padding: 2rem 1.5rem 1.5rem 2.5rem;
    }
    
    .spiral-holes {
        left: 0.5rem;
        gap: 2rem;
    }
    
    .spiral-hole {
        width: 12px;
        height: 12px;
    }
    
    .landscape-folio {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .landscape-panel--rotate-right,
    .landscape-panel--rotate-left {
        transform: none;
    }
    
    .landscape-photo {
        height: 220px;
    }
}

/* ═══════════════════════════════════════════════════════════
   BEAUTIFUL NEW ENHANCEMENTS
   Additional components and effects
   ═══════════════════════════════════════════════════════════ */

/* Chalkboard component (perfect for math/formulas) */
.chalkboard {
    background: linear-gradient(135deg, #2d3e3f 0%, #1a2425 100%);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 
        inset 0 0 100px rgba(0, 0, 0, 0.3),
        0 8px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    margin: var(--space-xl) 0;
}

.chalkboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

.chalkboard-content {
    position: relative;
    z-index: 1;
    color: #f0f0e8;
    font-family: var(--font-body);
    font-size: 1.3rem;
    line-height: 1.8;
}

.chalkboard-title {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chalkboard-formula {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    color: #a8d5e2;
    text-align: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin: 1.5rem 0;
}

/* Research citation block */
.citation-block {
    background: rgba(107, 142, 168, 0.05);
    border-left: 4px solid var(--color-accent);
    padding: 1.5rem;
    margin: var(--space-lg) 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.citation-author {
    font-weight: 600;
    color: var(--color-text-primary);
}

.citation-source {
    font-style: italic;
    color: var(--color-text-tertiary);
}

/* Footnote reference */
.footnote-ref {
    display: inline-block;
    font-size: 0.75em;
    vertical-align: super;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    margin: 0 0.1em;
}

.footnote-ref:hover {
    text-decoration: underline;
}

/* Definition box (like a dictionary entry) */
.definition-box {
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 1.75rem;
    margin: var(--space-lg) 0;
    box-shadow: var(--shadow-gentle);
}

.definition-term {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.definition-pronunciation {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text-tertiary);
    font-style: italic;
    margin-bottom: 1rem;
}

.definition-meaning {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

/* Flash card component */
.flash-card {
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 2.5rem;
    margin: var(--space-lg) 0;
    box-shadow: var(--shadow-gentle);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.flash-card:hover {
    transform: translateY(-4px) rotateX(2deg);
    box-shadow: var(--shadow-hover);
}

.flash-card-front {
    text-align: center;
}

.flash-card-question {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.flash-card-hint {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--color-text-tertiary);
}

/* Progress indicator (for multi-step content) */
.progress-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: var(--space-lg) 0;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-border);
    transition: all 0.3s ease;
}

.progress-dot--active {
    background: var(--color-accent);
    transform: scale(1.3);
}

.progress-dot--completed {
    background: var(--color-accent);
    opacity: 0.5;
}

/* Info box (callout) */
.info-box {
    background: linear-gradient(135deg, 
        rgba(107, 142, 168, 0.08) 0%,
        rgba(107, 142, 168, 0.04) 100%);
    border-left: 4px solid var(--color-accent);
    border-radius: 0 8px 8px 0;
    padding: 1.5rem;
    margin: var(--space-lg) 0;
    position: relative;
}

.info-box::before {
    content: 'ℹ';
    position: absolute;
    top: 1rem;
    left: -2rem;
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-box-content {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

/* Warning box variant */
.warning-box {
    background: linear-gradient(135deg, 
        rgba(212, 180, 153, 0.12) 0%,
        rgba(212, 180, 153, 0.06) 100%);
    border-left: 4px solid #D4B499;
}

.warning-box::before {
    content: '⚠';
    background: #D4B499;
}

/* Success box variant */
.success-box {
    background: linear-gradient(135deg, 
        rgba(155, 176, 169, 0.12) 0%,
        rgba(155, 176, 169, 0.06) 100%);
    border-left: 4px solid #9BB0A9;
}

.success-box::before {
    content: '✓';
    background: #9BB0A9;
}

/* Responsive for new components */
@media (max-width: 768px) {
    .chalkboard {
        padding: 1.5rem;
    }
    
    .chalkboard-title {
        font-size: 1.5rem;
    }
    
    .chalkboard-formula {
        font-size: 1.2rem;
    }
    
    .flash-card {
        padding: 1.5rem;
    }
    
    .info-box::before,
    .warning-box::before,
    .success-box::before {
        position: relative;
        left: 0;
        top: 0;
        margin-bottom: 1rem;
    }
}