/*
 * teaching-content.css — Te Kete Ako content page system
 * Extension layer on top of main.css. Loaded directly by content pages only.
 * Never import into main.css. Shell pages (app/, auth/) never load this.
 *
 * Subject accents mirror js/unit-plans-hero.js subjectColors (light-mode palette).
 * v=2
 */

/* ── 1. Subject accent tokens ──────────────────────────────────────────────── */

:root {
    --tc-accent: #6B4C9A;
    --tc-accent-soft: color-mix(in srgb, var(--tc-accent) 8%, transparent);
    --tc-accent-mid:  color-mix(in srgb, var(--tc-accent) 20%, transparent);
}

[data-subject] {
    --tc-accent-soft: color-mix(in srgb, var(--tc-accent) 8%, transparent);
    --tc-accent-mid:  color-mix(in srgb, var(--tc-accent) 20%, transparent);
}

[data-subject="social-studies"],
[data-subject="social"],
[data-subject="history"]             { --tc-accent: #6B4C9A; } /* waiporoporo — purple */

[data-subject="science"],
[data-subject="kaitiakitanga"]       { --tc-accent: #1E5741; } /* pōhatu — dark forest green */

[data-subject="mathematics"],
[data-subject="maths"],
[data-subject="math"]                { --tc-accent: #E67E22; } /* kākāriki kura — orange */

[data-subject="health"],
[data-subject="health-pe"],
[data-subject="pe"]                  { --tc-accent: #E84A5F; } /* mā kura — red */

[data-subject="english"],
[data-subject="literacy"]            { --tc-accent: #5B8DBE; } /* kikorangi — steel blue */

[data-subject="technology"],
[data-subject="digital"],
[data-subject="digital-technology"]  { --tc-accent: #8B6F47; } /* parauri — brown */

[data-subject="arts"]                { --tc-accent: #D35D6E; } /* whero ātea — rose */

[data-subject="te-reo"],
[data-subject="te-ao-maori"],
[data-subject="te-ao-māori"]         { --tc-accent: #40B5AD; } /* kōwhai awa — azure teal */

[data-subject="cross"],
[data-subject="cross-curricular"],
[data-subject="general"],
[data-subject="stem"],
[data-subject="hauora"]              { --tc-accent: #40B5AD; } /* teal fallback */


/* ── 2. Content layout containers ─────────────────────────────────────────── */

.tc-content {
    max-width: var(--content-width, 1200px);
    margin: 0 auto;
    padding: var(--space-xl, 2rem) var(--space-lg, 1.5rem);
}

/* Authored peer-resource lifecycle: visible only on promoted teaching variants. */
.variant-pathway-panel {
    margin: 1rem 0 2rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid color-mix(in srgb, var(--color-secondary, #5b4b8a) 28%, transparent);
    border-inline-start: 0.35rem solid var(--color-secondary, #5b4b8a);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--color-secondary, #5b4b8a) 7%, white);
}

.variant-pathway-panel h2,
.variant-pathway-panel h3 {
    margin-top: 0;
}

.variant-pathway-label {
    display: inline-block;
    margin-bottom: 0.55rem;
    color: var(--color-secondary-dark, #403364);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.variant-dimensions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.65rem 1rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
}

.variant-dimensions li {
    margin: 0;
}

.variant-peer-link {
    font-weight: 750;
}

.tc-content-narrow {
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-xl, 2rem) var(--space-lg, 1.5rem);
}

.tc-handout-body .tc-content {
    max-width: 800px;
    padding: var(--space-xl, 2rem) var(--space-2xl, 3rem);
}


/* ── 3. Landscape heroes ───────────────────────────────────────────────────── */

/* Unit overview — full height hero */
.tc-hero {
    position: relative;
    height: 40vh;
    min-height: 280px;
    max-height: 460px;
    overflow: hidden;
    background: var(--color-primary, #1a1a2e);
}

/*
 * Two usage patterns for tc-hero-landscape:
 *  (a) standalone / combined class (section.unit-hero.tc-hero-landscape,
 *      div.lesson-header.tc-hero-landscape) — position: relative so it
 *      takes up space in normal flow and ::before fills it.
 *  (b) inner child of .tc-hero (unit-index pages: tc-hero > tc-hero-landscape)
 *      — position: absolute; inset: 0 so it fills the outer container.
 */
.tc-hero-landscape {
    position: relative;
    overflow: hidden;
}
.tc-hero > .tc-hero-landscape {
    position: absolute;
    inset: 0;
}

.tc-hero-landscape::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center 60%;
    background-image: var(--tc-hero-photo, none);
    opacity: 0.45;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.tc-hero-overlay {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: var(--space-xl, 2rem) var(--space-2xl, 3rem);
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.72) 0%,
        rgba(0,0,0,0.28) 55%,
        transparent 100%
    );
}

.tc-hero-glass {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-lg, 1.5rem) var(--space-xl, 2rem);
    max-width: 640px;
}

.tc-hero-badges {
    display: flex;
    gap: var(--space-sm, 0.5rem);
    margin-bottom: var(--space-md, 1rem);
    flex-wrap: wrap;
}

.tc-badge {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: var(--radius-sm, 4px);
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.tc-badge-subject {
    background: var(--tc-accent);
    border-color: var(--tc-accent);
}

.tc-title-mi {
    display: block;
    font-family: var(--font-special, 'Outfit', sans-serif);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.tc-title-en {
    display: block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    font-weight: 400;
    color: rgba(255,255,255,0.82);
    margin-top: 4px;
}

/* Lesson — 80px accent strip */
.tc-lesson-strip {
    height: 80px;
    background-image: var(--tc-hero-photo, none);
    background-size: cover;
    background-position: center 40%;
    opacity: 0.35;
    filter: saturate(0.6);
    position: relative;
}

.tc-lesson-strip::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--tc-accent) 0%, transparent 40%);
    opacity: 0.45;
}

/* Handout — very faint body wash on screen, invisible on print */
.tc-handout-body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: var(--tc-hero-photo, none);
    background-size: cover;
    background-position: center;
    opacity: 0.035;
    filter: saturate(0) blur(4px);
    pointer-events: none;
}


/* ── 4. Section cards ──────────────────────────────────────────────────────── */

.tc-section {
    background: white;
    border: 1px solid var(--color-border, #e2e8f0);
    border-left: 4px solid var(--tc-accent);
    border-radius: 0 var(--radius-lg, 12px) var(--radius-lg, 12px) 0;
    padding: var(--space-lg, 1.5rem) var(--space-xl, 2rem);
    margin-bottom: var(--space-lg, 1.5rem);
}

/* Teacher notes — collapsible on screen, always visible on print */
.tc-section-teacher {
    border-left-color: var(--tc-accent-mid);
    background: var(--tc-accent-soft);
}

.tc-section-teacher[data-collapsed="true"] .tc-section-body {
    display: none;
}

.tc-section-teacher .tc-collapse-toggle {
    cursor: pointer;
    color: var(--tc-accent);
    font-size: 0.8rem;
    font-weight: 600;
    background: none;
    border: none;
    padding: 0;
    margin-top: var(--space-sm, 0.5rem);
}

.tc-section-teacher .tc-collapse-toggle:hover {
    text-decoration: underline;
}

/* NZC section — slightly heavier border */
.tc-section[data-section="nzc-alignment"] {
    border-left-width: 6px;
}


/* ── 5. Bilingual section headings ─────────────────────────────────────────── */

.tc-section-heading {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-lg, 1.5rem);
    padding-bottom: var(--space-sm, 0.5rem);
    border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.tc-mi {
    font-family: var(--font-special, 'Outfit', sans-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tc-accent);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.tc-en {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}


/* ── 6. Content typography ─────────────────────────────────────────────────── */

/* Learning objectives */
.tc-objectives-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm, 0.5rem);
}

.tc-objectives-list li {
    padding-left: var(--space-lg, 1.5rem);
    position: relative;
    line-height: 1.6;
    font-size: 0.95rem;
}

.tc-objectives-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tc-accent);
}

/* NZC verbatim quote */
.tc-nzc-quote {
    border-left: 3px solid var(--tc-accent);
    background: var(--tc-accent-soft);
    padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
    margin: var(--space-md, 1rem) 0;
    border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
    font-family: var(--font-special, 'Merriweather', serif);
    font-style: italic;
    font-size: 0.93rem;
    line-height: 1.65;
}

.tc-nzc-quote p { margin: 0 0 var(--space-xs, 0.25rem); }

.tc-nzc-quote cite {
    display: block;
    font-style: normal;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: var(--space-sm, 0.5rem);
}

/* Unverified NZC — visible amber warning for editors */
.tc-nzc-quote[data-verified="false"] {
    border-left-color: #b45309;
    background: #fffbeb;
}

.tc-nzc-quote[data-verified="false"]::after {
    content: '⚠ Unverified — do not publish';
    display: block;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 700;
    color: #b45309;
    margin-top: var(--space-sm, 0.5rem);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Resource list */
.tc-resource-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm, 0.5rem);
}

.tc-resource-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 0.5rem);
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    background: var(--color-base-50, #f8fafc);
    border: 1px solid var(--color-border-light, #f1f5f9);
    border-radius: var(--radius-md, 8px);
    font-size: 0.9rem;
}

.tc-resource-item a {
    color: var(--tc-accent);
    font-weight: 600;
    text-decoration: none;
    flex: 1;
}

.tc-resource-item a:hover { text-decoration: underline; }

.tc-resource-type {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #94a3b8);
    background: white;
    border: 1px solid var(--color-border, #e2e8f0);
    padding: 2px 8px;
    border-radius: var(--radius-sm, 4px);
}

/* Unit map table */
.tc-unit-map-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.tc-unit-map-table th {
    background: var(--tc-accent-soft);
    color: var(--tc-accent);
    text-align: left;
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--tc-accent-mid);
}

.tc-unit-map-table td {
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    border-bottom: 1px solid var(--color-border-light, #f1f5f9);
    vertical-align: top;
    line-height: 1.5;
}

.tc-unit-map-table tr:last-child td { border-bottom: none; }
.tc-unit-map-table tr:hover td { background: var(--tc-accent-soft); }


/* ── 7. Teaching sequence phases ───────────────────────────────────────────── */

.tc-teaching-sequence {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tc-sequence-phase {
    padding: var(--space-lg, 1.5rem) var(--space-xl, 2rem);
    position: relative;
}

.tc-sequence-phase + .tc-sequence-phase {
    border-top: 1px solid var(--color-border-light, #f1f5f9);
}

.tc-phase-label {
    display: flex;
    align-items: baseline;
    gap: var(--space-md, 1rem);
    margin-bottom: var(--space-md, 1rem);
}

.tc-phase-mi {
    font-family: var(--font-special, 'Outfit', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--tc-accent);
}

.tc-phase-en {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tc-phase-hook    { border-left: 3px solid #f59e0b; }
.tc-phase-explore { border-left: 3px solid var(--tc-accent); }
.tc-phase-connect { border-left: 3px solid #40B5AD; }

/* Print checklist */
.tc-print-checklist {
    list-style: none;
    padding: 0;
    margin: var(--space-md, 1rem) 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tc-print-checklist li {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 0.5rem);
    font-size: 0.88rem;
    padding: 4px 0;
}

.tc-print-checklist li::before {
    content: '□';
    font-size: 1rem;
    color: var(--tc-accent);
    flex-shrink: 0;
}

.tc-print-checklist li[data-copies]::after {
    content: attr(data-copies);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: var(--tc-accent);
    padding: 1px 6px;
    border-radius: var(--radius-sm, 4px);
    margin-left: auto;
}

/* Differentiation grid */
.tc-diff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md, 1rem);
}

.tc-diff-extend,
.tc-diff-support {
    padding: var(--space-md, 1rem);
    border-radius: var(--radius-md, 8px);
    font-size: 0.9rem;
}

.tc-diff-extend  { background: #ecfdf5; border: 1px solid #a7f3d0; }
.tc-diff-support { background: #eff6ff; border: 1px solid #bfdbfe; }

.tc-diff-extend  strong { color: #065f46; }
.tc-diff-support strong { color: #1d4ed8; }

.tc-diff-extend  strong,
.tc-diff-support strong {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-sm, 0.5rem);
}


/* ── 8. Handout layout ─────────────────────────────────────────────────────── */

.tc-handout-header {
    border-bottom: 3px solid var(--tc-accent);
    padding-bottom: var(--space-lg, 1.5rem);
    margin-bottom: var(--space-xl, 2rem);
}

.tc-handout-breadcrumb {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tc-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm, 0.5rem);
}

.tc-handout-title {
    font-family: var(--font-special, 'Merriweather', serif);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--color-text-primary, #0f172a);
    line-height: 1.3;
    margin: 0 0 var(--space-sm, 0.5rem);
}

.tc-handout-meta {
    display: flex;
    gap: var(--space-md, 1rem);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-wrap: wrap;
}

.tc-handout-meta span::before  { content: '· '; color: var(--tc-accent); }
.tc-handout-meta span:first-child::before { content: ''; }

.tc-handout-instructions {
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: var(--space-xl, 2rem);
    padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
    background: var(--tc-accent-soft);
    border-radius: var(--radius-md, 8px);
}

.tc-handout-activity {
    min-height: 200px;
    margin-bottom: var(--space-xl, 2rem);
}

/* Writing lines */
.tc-writing-lines {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tc-writing-lines > * + * {
    border-top: 1px solid var(--color-border, #e2e8f0);
    min-height: 2.5rem;
    padding: var(--space-xs, 0.25rem) 0;
}

.tc-reflection-prompt {
    font-family: var(--font-special, 'Merriweather', serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--tc-accent);
    border-top: 2px solid var(--tc-accent-mid);
    padding-top: var(--space-lg, 1.5rem);
    margin-top: var(--space-xl, 2rem);
    line-height: 1.6;
}

.tc-handout-footer {
    margin-top: var(--space-2xl, 3rem);
    padding-top: var(--space-md, 1rem);
    border-top: 1px solid var(--color-border-light, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--color-text-muted, #94a3b8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* ── 9. Print styles ───────────────────────────────────────────────────────── */

@media print {
    .tc-hero,
    .tc-lesson-strip,
    .tc-handout-body::before { display: none !important; }

    body { background: white !important; }

    .tc-section {
        border: 1px solid #ccc;
        border-left: 3px solid #333;
        box-shadow: none;
        break-inside: avoid;
        page-break-inside: avoid;
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
    }

    .tc-section-teacher[data-collapsed="true"] .tc-section-body {
        display: block !important;
    }

    .tc-section-teacher .tc-collapse-toggle { display: none; }

    .tc-collapse-toggle,
    .action-btn,
    [data-action] { display: none !important; }

    .tc-nzc-quote[data-verified="false"]::after {
        color: black;
        border: 1px solid #999;
        padding: 2px 6px;
    }

    .tc-unit-map-table { break-inside: avoid; }

    .tc-phase-hook,
    .tc-phase-explore,
    .tc-phase-connect { border-left: 3px solid #333; }
}


/* ── 10. Print stamp (hidden on screen, visible on print) ──────────────────── */

.tc-print-stamp { display: none; }

@media print {
    .tc-print-stamp {
        display: block;
        position: fixed;
        bottom: 1.5cm;
        right: 1.5cm;
        text-align: center;
        opacity: 0.22;
        font-family: var(--font-body, 'Inter', sans-serif);
        font-size: 0.65rem;
        color: #555;
        line-height: 1.4;
    }

    .tc-print-stamp img {
        display: block;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        margin: 0 auto 4px;
        object-fit: cover;
    }

    .tc-print-stamp .stamp-name {
        font-weight: 700;
        color: #333;
    }
}


/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .tc-hero             { height: 32vh; min-height: 220px; }
    .tc-hero-glass       { padding: var(--space-md, 1rem); }
    .tc-content          { padding: var(--space-lg, 1.5rem) var(--space-md, 1rem); }
    .tc-section          { padding: var(--space-md, 1rem) var(--space-lg, 1.5rem); }
    .tc-diff-grid        { grid-template-columns: 1fr; }
    .tc-unit-map-table   { font-size: 0.8rem; }
    .tc-unit-map-table th,
    .tc-unit-map-table td { padding: var(--space-xs, 0.25rem) var(--space-sm, 0.5rem); }
    .tc-hero-overlay     { padding: var(--space-lg, 1.5rem); }
}
