/* ============================================================
   THE ATTENTION ADVANTAGE — /attention-advantage/
   ------------------------------------------------------------
   Layered on css/style.css + css/tools.css + css/paths.css, the
   same way css/leaders.css is. Everything here paints from the
   semantic tokens, so the page follows the light/dark switcher;
   the print block at the bottom is the one place with literal
   colours, and it is excluded from the theme check by design
   (scripts/check-theme.mjs drops print rules) because a printed
   page has one theme and it is not the screen's.
   ============================================================ */

/* Footnote markers, the bibliography and the retired-claims panel live in
   css/attention-advantage-refs.css — shared with the stress test and the
   intensive's sales page. */

.aa-section { padding: 64px 0; }
.aa-section.alt { background: var(--surface-1); border-block: 1px solid var(--border-subtle); }

.aa-section-head { max-width: 72ch; margin-bottom: 34px; }
.aa-section-head h2 {
    margin: 0 0 12px;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: var(--fw-medium);
    letter-spacing: var(--tracking-tight);
}
.aa-section-head p { margin: 0; color: var(--text-secondary); line-height: 1.7; }

/* ---- Where it sits in the range ---- */
.aa-ladder { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.aa-rung {
    padding: 22px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg, 14px);
    background: var(--surface-2);
}

.aa-rung.is-this { border-color: var(--border-accent); background: var(--accent-subtle); }

.aa-rung-kicker {
    color: var(--text-tertiary);
    font: var(--fw-medium) 11px/1.5 var(--font-mono);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    /* Two lines' worth, reserved. The middle rung's kicker is the long one and
       wraps; without this its heading drops out of line with its neighbours. */
    min-height: 33px;   /* 2 x 11px x 1.5 — fallback for no `lh` support */
    min-height: 2lh;
}
.aa-rung.is-this .aa-rung-kicker { color: var(--text-accent); }

.aa-rung h3 { margin: 12px 0 6px; font-size: 1.05rem; font-weight: var(--fw-semibold); }
.aa-rung p { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.aa-rung a { color: var(--text-accent); }

/* ---- Mode switch: self-paced vs taught ---- */
.aa-modes {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    background: var(--surface-2);
    margin-bottom: 28px;
}

.aa-mode {
    padding: 9px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font: var(--fw-semibold) 14px/1 var(--font-sans);
    cursor: pointer;
}

.aa-mode[aria-selected="true"] { background: var(--accent); color: var(--text-on-accent); }
.aa-mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Module cards ---- */
.aa-modules { display: grid; gap: 18px; }

.aa-module {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg, 14px);
    background: var(--surface-2);
    overflow: hidden;
}

.aa-module.is-done { border-color: var(--border-accent); }

.aa-module-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    width: 100%;
    padding: 24px 26px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.aa-module-num {
    font: var(--fw-semibold) 13px/1 var(--font-mono);
    color: var(--text-accent);
    padding-top: 5px;
}

/* Both are spans inside the <button> that heads the card — a button may not
   contain block elements — so they need display:block, or the title and the
   question render as one run-on line. */
.aa-module-title { display: block; margin: 0 0 6px; font-size: 1.2rem; font-weight: var(--fw-semibold); }
.aa-module-q { display: block; margin: 0; color: var(--text-secondary); line-height: 1.6; }

.aa-module-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-tertiary);
    font-size: 12.5px;
    white-space: nowrap;
    padding-top: 4px;
}

.aa-tick {
    display: inline-grid;
    place-items: center;
    width: 22px; height: 22px;
    border: 1px solid var(--border-default);
    border-radius: 50%;
    font-size: 12px;
    color: transparent;
}

.is-done .aa-tick {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--text-on-accent);
}

.aa-module-body { padding: 0 26px 26px; border-top: 1px solid var(--border-subtle); }
.aa-module-body > * { margin-top: 24px; }

.aa-framing { color: var(--text-secondary); line-height: 1.75; max-width: 74ch; }

.aa-block-label {
    color: var(--text-tertiary);
    font: var(--fw-medium) 11px/1 var(--font-mono);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.aa-science { margin: 0; padding-left: 20px; color: var(--text-secondary); line-height: 1.7; }
.aa-science li { margin-bottom: 10px; max-width: 74ch; }
.aa-science li:last-child { margin-bottom: 0; }

.aa-steps { display: grid; gap: 10px; }

.aa-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md, 10px);
    background: var(--surface-3);
    text-decoration: none;
    color: inherit;
}

.aa-step:hover { border-color: var(--border-accent); }
.aa-step-title { display: block; font-weight: var(--fw-semibold); margin-bottom: 4px; }
.aa-step-why { color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; }
.aa-step-go { color: var(--text-accent); font-size: 13px; white-space: nowrap; }

/* ---- Exercise ---- */
.aa-exercise {
    padding: 22px;
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md, 10px);
    background: var(--accent-subtle);
}

.aa-exercise h4 { margin: 0 0 8px; font-size: 1rem; font-weight: var(--fw-semibold); }
.aa-exercise > p { margin: 0 0 18px; color: var(--text-secondary); line-height: 1.65; max-width: 74ch; }

.aa-prompt { display: grid; gap: 7px; margin-bottom: 16px; }
.aa-prompt:last-of-type { margin-bottom: 0; }
.aa-prompt label { font-size: 13.5px; font-weight: var(--fw-semibold); line-height: 1.5; }

.aa-prompt textarea,
.aa-prompt input {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm, 6px);
    background: var(--surface-1);
    color: var(--text-primary);
    font: inherit;
    line-height: 1.55;
    resize: vertical;
}

.aa-prompt input { max-width: 220px; }

.aa-prompt textarea:focus,
.aa-prompt input:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.aa-saved {
    margin-top: 14px;
    color: var(--text-tertiary);
    font-size: 12.5px;
    min-height: 1.2em;
}

.aa-takeaway {
    padding-left: 18px;
    border-left: 3px solid var(--border-accent);
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.6;
}

.aa-module-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Progress ---- */
.aa-progress-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 26px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg, 14px);
    background: var(--surface-2);
}

.aa-progress-panel h3 { margin: 0 0 8px; font-size: 1.1rem; font-weight: var(--fw-semibold); }
.aa-progress-panel p { margin: 0 0 14px; color: var(--text-secondary); line-height: 1.6; }

.aa-progress-track {
    height: 7px;
    border-radius: 999px;
    background: var(--surface-inset);
    overflow: hidden;
}

.aa-progress-fill { height: 100%; background: var(--accent); transition: width 0.25s ease; }
.aa-progress-label { margin-top: 10px; color: var(--text-tertiary); font-size: 13px; }

/* ---- Three-day timetable ---- */
.aa-days { display: grid; gap: 20px; }

.aa-day {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg, 14px);
    background: var(--surface-2);
    padding: 26px;
}

.aa-day-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.aa-day-num {
    font: var(--fw-semibold) 12px/1 var(--font-mono);
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-accent);
}
.aa-day-head h3 { margin: 0; font-size: 1.15rem; font-weight: var(--fw-semibold); }
.aa-day-pillar {
    padding: 4px 10px;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 12px;
}
.aa-day-summary { margin: 0 0 20px; color: var(--text-secondary); line-height: 1.7; max-width: 74ch; }

.aa-block { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-top: 1px solid var(--border-subtle); }
.aa-block-time { color: var(--text-tertiary); font: var(--fw-medium) 13px/1.5 var(--font-mono); }
.aa-block-name { display: block; font-weight: var(--fw-semibold); font-size: 14.5px; margin-bottom: 4px; }
.aa-block-note { color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }

/* ---- Blueprint ---- */
.aa-blueprint {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg, 14px);
    background: var(--surface-2);
    padding: 28px;
}

.aa-blueprint-empty { color: var(--text-secondary); line-height: 1.7; max-width: 70ch; }

.aa-bp-section { padding: 18px 0; border-top: 1px solid var(--border-subtle); }
.aa-bp-section:first-of-type { border-top: 0; padding-top: 0; }
.aa-bp-section h4 { margin: 0 0 12px; font-size: 0.95rem; font-weight: var(--fw-semibold); }
.aa-bp-line { margin: 0 0 12px; }
.aa-bp-line:last-child { margin-bottom: 0; }
.aa-bp-q { color: var(--text-tertiary); font-size: 12.5px; margin-bottom: 3px; }
.aa-bp-a { color: var(--text-primary); line-height: 1.6; white-space: pre-wrap; }

.aa-name-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; align-items: center; }
.aa-name-row label { color: var(--text-secondary); font-size: 13.5px; font-weight: var(--fw-semibold); }
.aa-name-row input {
    flex: 1 1 240px;
    padding: 11px 13px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm, 6px);
    background: var(--surface-1);
    color: var(--text-primary);
    font: inherit;
}

@media (max-width: 760px) {
    .aa-module-head { grid-template-columns: auto minmax(0, 1fr); }
    .aa-module-meta { grid-column: 2; padding-top: 0; }
    .aa-progress-panel { grid-template-columns: 1fr; }
    .aa-step { grid-template-columns: 1fr; }
    .aa-block { grid-template-columns: 1fr; gap: 4px; }
}

/* ------------------------------------------------------------------
   PRINT — the one-page operating guide, and nothing else.
   Literal colours are correct here: paper has one theme. The theme
   checker drops print rules for exactly this reason.
   ------------------------------------------------------------------ */
.aa-print { display: none; }

@media print {
    body > * { display: none !important; }
    body > .aa-print { display: block !important; }

    .aa-print {
        color: #111;
        background: #fff;
        font-family: Georgia, 'Times New Roman', serif;
        padding: 0;
    }

    .aa-print h1 { font-size: 22pt; margin: 0 0 4pt; }
    .aa-print .aa-print-sub { color: #555; font-size: 10pt; margin: 0 0 18pt; }
    .aa-print .aa-print-owner { font-size: 12pt; margin: 0 0 2pt; font-weight: bold; }

    .aa-print section {
        page-break-inside: avoid;
        border-top: 1pt solid #ccc;
        padding: 9pt 0;
    }

    .aa-print h2 { font-size: 11pt; margin: 0 0 6pt; text-transform: uppercase; letter-spacing: 0.08em; }
    .aa-print .aa-print-q { font-size: 8.5pt; color: #666; margin: 0 0 2pt; }
    .aa-print .aa-print-a { font-size: 10.5pt; margin: 0 0 8pt; white-space: pre-wrap; line-height: 1.45; }
    .aa-print footer { border-top: 1pt solid #ccc; margin-top: 10pt; padding-top: 7pt; font-size: 8.5pt; color: #666; }

    @page { margin: 16mm; }
}
