/* ============================================================================
 * spell-page.css — wiki-density layout for /spell/:id
 * Reference: Wowhead Classic spell page, PoE wiki gem page.
 * Goal: scannable in two seconds. No display fonts, no decoration.
 * ========================================================================== */

/* School accent — used as a thin border on the icon and link colour. */
:root {
    --school-default:  #d6dade;
    --school-physical: #d6dade;
    --school-holy:     #ffe680;
    --school-fire:     #ff7444;
    --school-nature:   #4dff8d;
    --school-frost:    #92dffe;
    --school-shadow:   #b080ff;
    --school-arcane:   #ff80f3;
}
.spell-page--physical { --school: var(--school-physical); }
.spell-page--holy     { --school: var(--school-holy); }
.spell-page--fire     { --school: var(--school-fire); }
.spell-page--nature   { --school: var(--school-nature); }
.spell-page--frost    { --school: var(--school-frost); }
.spell-page--shadow   { --school: var(--school-shadow); }
.spell-page--arcane   { --school: var(--school-arcane); }

.spell-page {
    --school: var(--school-default);
    max-width: 720px;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Header ──────────────────────────────────────────────────── */
.spell-page__head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.5rem;
    padding-block-end: 0.5rem;
    border-block-end: 1px solid var(--border-subtle);
}
.spell-page__icon {
    width: 36px; height: 36px;
    border: 1px solid var(--school);
    border-radius: 2px;
    flex-shrink: 0;
    background: var(--bg-tooltip, #050505);
}
.spell-page__head-text {
    display: flex; align-items: baseline; gap: 0.5rem;
    min-width: 0;
}
.spell-page__name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fg-primary);
    line-height: 1.15;
}
.spell-page__rank {
    color: var(--fg-muted);
    font-size: 0.85rem;
    font-weight: 400;
}
/* "Ranks" infobox row — list of sibling-rank links for talented spells. */
.spell-page__ranks a { white-space: nowrap; }
.spell-page__rank-current {
    color: var(--fg-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* ── Infobox table: tight, label : value rows. Wowhead-Classic feel ── */
.spell-info {
    border-collapse: collapse;
    margin: 0 0 0.85rem;
    width: max-content;        /* hugs content; doesn't span full width */
    min-width: 320px;
}
.spell-info tbody tr:nth-child(even) td,
.spell-info tbody tr:nth-child(even) th {
    background: var(--bg-panel-alt, #20242b);
}
.spell-info th {
    text-align: start;
    font-weight: 500;
    color: var(--fg-muted);
    padding: 3px 14px 3px 8px;
    white-space: nowrap;
    width: 1%;          /* shrink-to-fit */
}
.spell-info td {
    padding: 3px 14px 3px 0;
    color: var(--fg-primary);
}
.spell-info td.numeric {
    font-variant-numeric: tabular-nums;
}
.spell-info td.muted { color: var(--fg-faint, #8b8f97); }

/* ── Description ─────────────────────────────────────────────── */
.spell-page__desc {
    margin: 0 0 0.5rem;
    max-width: 60ch;
    color: var(--fg-primary);
}
.spell-page__aura-desc {
    margin: 0 0 0.85rem;
    max-width: 60ch;
    color: var(--fg-muted);
    font-style: italic;
}

/* ── Sections (Effects / Attributes / Crosslinks) ────────────── */
.spell-page__section {
    margin-block-start: 0.75rem;
    padding-block-start: 0.5rem;
    border-block-start: 1px solid var(--border-subtle);
}
.spell-page__section h2 {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
}
.spell-page__section h3 {
    margin: 0 0 0.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg-primary);
}

/* ── Effects: numbered, value sits right after the name ─────── */
.spell-page__effects {
    list-style: decimal;
    padding-inline-start: 1.4rem;
    margin: 0;
}
.effect-row {
    margin-block-end: 0.15rem;
    padding-block: 1px;
    line-height: 1.4;
}
.effect-row::marker {
    color: var(--fg-faint);
    font-variant-numeric: tabular-nums;
}
.effect-row__head {
    display: inline;
}
.effect-row__name { color: var(--fg-primary); }
.effect-row__value {
    margin-inline-start: 0.5rem;
    color: var(--school);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.effect-row__aux {
    margin: 0 0 0 1.25rem;
    color: var(--fg-faint);
    font-size: 0.85rem;
}
.effect-row__aux > span + span::before {
    content: ' · '; color: var(--fg-disabled, #5d6068);
}
.effect-row__aux .numeric { font-variant-numeric: tabular-nums; }
.effect-row__aux a { color: var(--school); }

/* ── Key/value tables (Attributes) ──────────────────────────── */
.spell-page__kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 1px 14px;
    margin: 0;
    font-size: 0.85rem;
}
.spell-page__kv dt { color: var(--fg-muted); }
.spell-page__kv dd { margin: 0; color: var(--fg-primary); }
.spell-page__kv code {
    font-size: 0.85rem;
    color: var(--fg-muted);
}

/* ── Crosslinks ─────────────────────────────────────────────── */
.spell-page__crosslinks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.spell-page__crosslinks ul { list-style: none; padding: 0; margin: 0; }
.spell-page__crosslinks li { font-size: 0.85rem; }
.spell-page__crosslinks a { color: var(--school); }

@media (max-width: 600px) {
    .spell-info { width: 100%; min-width: 0; }
    .spell-page__crosslinks { grid-template-columns: 1fr; }
}


/* --- Subsection h2 (Reagents / Flags / Procs from items / …) ---
 * Match the wiki-density h2 already used by `.spell-page__section`. */
.spell-page__section > h2 {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
}


/* --- Reagents list --- */
.spell-page__reagent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.85rem;
}
.spell-page__reagent-list li {
    padding-block: 1px;
}
.spell-page__reagent-list a { color: var(--school); }


/* --- Flags pill list (small inline labels) --- */
.spell-page__flags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.spell-page__flags li {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-panel, #1b1f25);
    color: var(--fg-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.5;
}


/* --- Procs from items / Cast by NPCs lists --- */
.spell-page__procs-from-items > ul,
.spell-page__cast-by-npcs > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 1.5rem;
    font-size: 0.85rem;
}
.spell-page__procs-from-items > ul > li,
.spell-page__cast-by-npcs > ul > li {
    padding-block: 1px;
    break-inside: avoid;
}
.spell-page__procs-from-items .more,
.spell-page__cast-by-npcs .more,
.spell-page__crosslinks .more {
    color: var(--fg-faint);
    font-style: italic;
}
.proc-trigger {
    color: var(--fg-faint);
    font-size: 0.78rem;
}

@media (max-width: 720px) {
    .spell-page__procs-from-items > ul,
    .spell-page__cast-by-npcs > ul {
        columns: 1;
    }
}
