/* ==========================================================================
   Downloads — printable document chrome for /downloads/*.html
   Layered on css/styles.css. All values reference the main token system.
   No side-stripes, no system fonts, no off-palette callouts.
   ========================================================================== */

body.download-doc {
    background: var(--paper);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.65;
}

/* Sticky brand header on every download */
.download-header {
    background: var(--paper-elevated);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) var(--space-6);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.download-header a {
    color: var(--ink);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color var(--duration-fast) var(--ease-out);
}

.download-header a:hover { color: var(--accent-warm); }

.download-actions { display: flex; gap: var(--space-3); }

.download-btn {
    padding: var(--space-2) var(--space-4);
    border-radius: 8px;
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    background: var(--paper-elevated);
    color: var(--ink);
    font-family: inherit;
    transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.download-btn:hover {
    background: var(--paper);
    border-color: var(--ink-secondary);
}

.download-btn--primary {
    background: var(--ink);
    color: var(--paper-elevated);
    border-color: var(--ink);
}

.download-btn--primary:hover {
    background: var(--ink-secondary);
    border-color: var(--ink-secondary);
}

/* Document container — feels like a printed page on screen */
.document-container {
    max-width: calc(816px + var(--space-gutter) * 2);
    margin: var(--space-12) auto var(--space-20);
    padding: 0 var(--space-gutter);
}

.document-container--wide { max-width: calc(900px + var(--space-gutter) * 2); }

.document {
    background: var(--paper-elevated);
    box-shadow: var(--shadow-md);
    border-radius: 6px;
    padding: clamp(2rem, 6vw, 3.75rem);
}

.document--page { min-height: 1056px; }

/* Document typography — Fraunces display + Plus Jakarta body */
.document h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: var(--space-2);
}

.document .subtitle {
    font-size: var(--text-lg);
    color: var(--ink-secondary);
    margin-bottom: var(--space-10);
}

.document h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-2xl);
    font-weight: 600;
    letter-spacing: -0.015em;
    margin: var(--space-10) 0 var(--space-4);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
}

.document h2:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.document h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-secondary);
    margin: var(--space-6) 0 var(--space-3);
}

.document h4 {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.document p { margin-bottom: var(--space-4); font-size: var(--text-base); }

.document ul,
.document ol { margin: 0 0 var(--space-4) var(--space-6); font-size: var(--text-base); }

.document li { margin-bottom: var(--space-2); }

.document strong { font-weight: 600; color: var(--ink); }

.document a { color: var(--accent-warm); }

.document table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-4) 0 var(--space-6);
    font-size: var(--text-sm);
}

.document th,
.document td {
    padding: var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.document th {
    background: var(--paper);
    font-weight: 600;
    border-bottom-color: var(--border-strong);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: var(--text-xs);
    color: var(--ink-secondary);
}

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

/* Boxed h2 variant — for files that visually break sections (interview-questions,
   questions-to-ask, industry-contacts). No top border in this variant. */
.document h2.h2-boxed {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xl);
}

/* Horizontal-rule h2 variant — for networking-email-templates */
.document h2.h2-rule {
    border-top: none;
    padding-top: 0;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-strong);
}

/* ==========================================================================
   Callouts — full hairline border + tinted background. NO side-stripes.
   ========================================================================== */
.callout {
    border: 1px solid var(--border-strong);
    background: var(--paper);
    border-radius: 12px;
    padding: var(--space-5);
    margin: var(--space-5) 0;
    font-size: var(--text-sm);
    line-height: 1.6;
}

.callout strong:first-child { color: var(--ink); }

.callout--tip {
    background: var(--accent-warm-soft);
    border-color: rgba(191, 72, 0, 0.18);
}

.callout--tip strong { color: var(--accent-warm); }

.callout--warn {
    background: rgba(29, 29, 31, 0.04);
    border-color: var(--border-strong);
}

/* ==========================================================================
   Examples — leading typographic glyph (✓ / ✗) instead of side-stripe
   ========================================================================== */
.example {
    background: var(--paper);
    border: 1px solid var(--border);
    padding: var(--space-4) var(--space-5);
    border-radius: 8px;
    margin: var(--space-4) 0;
    font-size: var(--text-sm);
    line-height: 1.6;
}

.example-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--ink-tertiary);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.example--good,
.example--bad {
    position: relative;
    padding-left: calc(var(--space-5) + 1.5rem);
}

.example--good::before,
.example--bad::before {
    position: absolute;
    left: var(--space-5);
    top: var(--space-4);
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: var(--text-xl);
    line-height: 1;
    color: var(--ink);
}

.example--good::before { content: '✓'; }
.example--bad::before { content: '✗'; color: var(--ink-secondary); }

.example--good .example-label { color: var(--ink); }
.example--bad .example-label { color: var(--ink-secondary); }
.example--bad { color: var(--ink-secondary); }

/* ==========================================================================
   Inline atoms
   ========================================================================== */
.placeholder {
    background: var(--accent-warm-soft);
    color: var(--accent-warm);
    padding: 0 var(--space-2);
    border-radius: 4px;
    font-style: italic;
    font-weight: 500;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-4) 0;
}

.keyword {
    background: var(--paper);
    border: 1px solid var(--border-strong);
    color: var(--ink-secondary);
    padding: var(--space-1) var(--space-3);
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 500;
}

/* ==========================================================================
   Pattern: stats grid (cscs-pathway, pt-cert)
   ========================================================================== */
.doc-stats {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-6);
    margin: var(--space-6) 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-5);
}

.doc-stat { text-align: center; }
.doc-stat-value {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-3xl);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.1;
    display: block;
    margin-bottom: var(--space-1);
}
.doc-stat-label {
    font-size: var(--text-xs);
    color: var(--ink-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ==========================================================================
   Pattern: timeline (cscs-pathway) — left-edge dots, NO side-stripe
   ========================================================================== */
.doc-timeline { margin: var(--space-8) 0; }

.doc-timeline-item {
    position: relative;
    padding: var(--space-4) 0 var(--space-4) var(--space-8);
    border-bottom: 1px solid var(--border);
}

.doc-timeline-item:last-child { border-bottom: none; }

.doc-timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: var(--space-5);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ink);
}

.doc-timeline-week {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    color: var(--ink);
    display: inline-block;
    min-width: 100px;
    margin-right: var(--space-3);
}

/* ==========================================================================
   Pattern: org cards & event list (industry-contacts)
   ========================================================================== */
.org-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-5);
    margin: var(--space-4) 0;
    background: var(--paper-elevated);
}

.org-name {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
    letter-spacing: -0.01em;
}

.org-desc {
    font-size: var(--text-sm);
    color: var(--ink-secondary);
    margin-bottom: var(--space-3);
}

.org-link {
    color: var(--accent-warm);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
}

.org-link:hover { text-decoration: underline; }

.event-list { margin: var(--space-4) 0; }

.event {
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--paper);
    margin: var(--space-3) 0;
}

.event-name { font-weight: 600; margin-bottom: var(--space-1); }
.event-details { font-size: var(--text-sm); color: var(--ink-secondary); }

/* ==========================================================================
   Pattern: certification card (pt-certification, group-fitness)
   ========================================================================== */
.doc-cert-card {
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: var(--space-6);
    margin: var(--space-6) 0;
    background: var(--paper-elevated);
}

.doc-cert-name {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
    letter-spacing: -0.01em;
}

.doc-cert-org {
    font-size: var(--text-sm);
    color: var(--ink-secondary);
    margin-bottom: var(--space-4);
}

.doc-cert-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.doc-cert-stats .doc-stat {
    background: var(--paper);
    padding: var(--space-3);
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Pros/cons — both neutral, no green/orange tint */
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.pros, .cons {
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--paper);
}

.pros h4, .cons h4 {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-tertiary);
    margin-bottom: var(--space-2);
}

.pros ul, .cons ul {
    margin-left: var(--space-5);
    font-size: var(--text-sm);
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .pros-cons { grid-template-columns: 1fr; }
}

/* Recommendation card — replaces purple gradient with brand ink */
.recommendation {
    background: var(--ink);
    color: var(--paper-elevated);
    padding: var(--space-6);
    border-radius: 12px;
    margin: var(--space-8) 0;
}

.recommendation h3 {
    color: var(--paper-elevated);
    margin-top: 0;
    margin-bottom: var(--space-3);
}

.recommendation p { color: rgba(251, 251, 253, 0.85); }

/* ==========================================================================
   Pattern: question lists (interview-questions, questions-to-ask)
   ========================================================================== */
.question-list { list-style: none; margin: 0; padding: 0; }

.question-list li {
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--text-base);
}

.question-list li:last-child { border-bottom: none; }

.why {
    font-size: var(--text-sm);
    color: var(--ink-secondary);
    margin-top: var(--space-2);
    font-style: italic;
}

.question {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border);
}

.question:last-child { border-bottom: none; }

.question-text {
    font-weight: 600;
    font-size: var(--text-base);
    margin-bottom: var(--space-2);
}

.question-tip { font-size: var(--text-sm); color: var(--ink-secondary); }

.sample-answer {
    background: var(--paper);
    border: 1px solid var(--border);
    padding: var(--space-4);
    border-radius: 8px;
    margin-top: var(--space-3);
    font-size: var(--text-sm);
}

.sample-answer strong { color: var(--ink); }

/* ==========================================================================
   Pattern: STAR worksheet (star-method-worksheet)
   ========================================================================== */
.star-grid { display: grid; gap: var(--space-5); margin: var(--space-8) 0; }

.star-card {
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: var(--space-6);
    background: var(--paper-elevated);
}

.star-letter {
    display: inline-flex;
    width: 48px;
    height: 48px;
    background: var(--ink);
    color: var(--paper-elevated);
    border-radius: 50%;
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-2xl);
    font-weight: 600;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3);
    line-height: 1;
}

.star-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.star-description {
    font-size: var(--text-sm);
    color: var(--ink-secondary);
    margin-bottom: var(--space-4);
}

.star-prompt {
    font-size: var(--text-sm);
    font-style: italic;
    color: var(--ink);
    margin-bottom: var(--space-3);
}

.write-area {
    min-height: 100px;
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
    padding: var(--space-4);
    font-size: var(--text-sm);
    color: var(--ink-tertiary);
}

.example-box {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-6);
    margin: var(--space-8) 0;
}

.example-box h3 { margin-bottom: var(--space-4); color: var(--ink); }

.example-item { margin-bottom: var(--space-4); }
.example-item strong { display: block; margin-bottom: var(--space-1); }
.example-item:last-child { margin-bottom: 0; }

.worksheet-section {
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: var(--space-6);
    margin: var(--space-8) 0;
    page-break-inside: avoid;
}

.worksheet-section h3 {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

/* ==========================================================================
   Pattern: email/letter templates (networking-email-templates, cover-letter-template)
   ========================================================================== */
.template {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-6);
    margin: var(--space-5) 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: var(--text-sm);
    line-height: 1.85;
}

.template-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--ink-tertiary);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.letter-header { margin-bottom: var(--space-8); }
.sender-info, .recipient-info { margin-bottom: var(--space-6); }
.date { margin-bottom: var(--space-6); color: var(--ink-secondary); }
.salutation { margin-bottom: var(--space-4); }
.letter-body p { margin-bottom: var(--space-4); }
.closing { margin-top: var(--space-6); }
.signature { margin-top: var(--space-10); font-weight: 600; }

.instructions {
    background: var(--accent-warm-soft);
    border: 1px solid rgba(191, 72, 0, 0.18);
    border-radius: 12px;
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
}

.instructions h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: var(--text-xs);
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: var(--accent-warm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.instructions ul { margin-left: var(--space-5); margin-bottom: 0; }
.instructions p { margin-bottom: var(--space-2); }
.instructions p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Pattern: resume template (resume-template.html) — keeps document layout
   Scoped under `.document` to override generic .document h1/h2 styling.
   ========================================================================== */
.document .resume-header {
    text-align: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 2px solid var(--ink);
}

.document .resume-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-2);
    padding-top: 0;
    border-top: none;
    line-height: 1.15;
}

.document .resume-contact { font-size: var(--text-sm); color: var(--ink-secondary); }
.document .resume-contact span { margin: 0 var(--space-2); }

.document .resume-section { margin-bottom: var(--space-6); }

.document .resume-section-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink);
    border-top: none;
    border-bottom: 1px solid var(--border-strong);
    padding-top: 0;
    padding-bottom: var(--space-2);
    margin: 0 0 var(--space-3);
}

.document .resume-entry { margin-bottom: var(--space-4); }

.document .resume-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
    margin-bottom: var(--space-1);
    flex-wrap: wrap;
}

.document .resume-entry-title { font-weight: 600; font-size: var(--text-base); }

.document .resume-entry-date { font-size: var(--text-sm); color: var(--ink-tertiary); }

.document .resume-entry-subtitle {
    font-size: var(--text-sm);
    color: var(--ink-secondary);
    font-style: italic;
    margin-bottom: var(--space-2);
}

.document .resume-entry ul { margin-left: var(--space-5); font-size: var(--text-sm); margin-bottom: 0; }

.document .resume-skills { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: 0; }

.document .resume-skill {
    background: var(--paper);
    border: 1px solid var(--border);
    padding: var(--space-1) var(--space-3);
    border-radius: 4px;
    font-size: var(--text-sm);
}

/* ==========================================================================
   Pattern: checklist (linkedin-optimization-guide) — neutral, no off-palette
   ========================================================================== */
.doc-checklist {
    background: var(--paper);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: var(--space-5);
    margin: var(--space-6) 0;
}

.doc-checklist h4 {
    margin-bottom: var(--space-3);
    color: var(--ink);
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-base);
}

.doc-checklist ul { margin-left: var(--space-5); margin-bottom: 0; }

/* Numbered h2 (linkedin) — replace LinkedIn-blue circle with brand ink */
.document h2 .number {
    display: inline-flex;
    background: var(--ink);
    color: var(--paper-elevated);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    margin-right: var(--space-3);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    flex-shrink: 0;
}

/* ==========================================================================
   Pattern: specialty grid (group-fitness-guide)
   ========================================================================== */
.specialty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin: var(--space-5) 0;
}

.specialty-card {
    background: var(--paper);
    border: 1px solid var(--border);
    padding: var(--space-4);
    border-radius: 8px;
    text-align: center;
}

.specialty-card h4 { font-size: var(--text-sm); margin-bottom: var(--space-2); }
.specialty-card p { font-size: var(--text-xs); color: var(--ink-secondary); margin: 0; }

/* ==========================================================================
   Print rules — universal for all download docs
   ========================================================================== */
@media print {
    .download-header,
    .instructions { display: none !important; }
    body.download-doc { background: white; }
    .document-container,
    .document-container--wide {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }
    .document {
        box-shadow: none;
        border-radius: 0;
        padding: 40px;
    }
    .worksheet-section,
    .star-card,
    .doc-cert-card { break-inside: avoid; }
    a { color: inherit; text-decoration: underline; }
    h2 { break-after: avoid; }
}
