/* ============================================================
   HEIRS DOSSIER — heirs.css
   The five heirs of Ederia, as dossiers in the court's encyclopedia.

   Shape and colour follow BRANDING.md: square, 1px gold hairlines,
   gold for structure, crimson for the current thing, parchment for
   speech. Each heir's own colour appears only on their own elements —
   the nameplate rule, the portrait frame, the tab that selects them.
   ============================================================ */

/* ── Tab Navigation ──────────────────────────────────────── */
.heir-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.heir-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 96px;
    padding: 12px 10px;
    background: var(--court-raised);
    border: 1px solid var(--court-line);
    border-radius: 0;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.heir-tab:hover {
    background: var(--court-hover);
    border-color: var(--court-border);
    transform: translateY(-2px);
}

.heir-tab.active {
    background: var(--court-hover);
    border-color: var(--heir-color, var(--royal-gold));
}

/* Per-heir accents. Identity, not decoration — see BRANDING.md. */
.heir-tab[data-heir="edwinn"]  { --heir-color: #5b8cff; }
.heir-tab[data-heir="via"]     { --heir-color: #e662a0; }
.heir-tab[data-heir="marik"]   { --heir-color: #41b87f; }
.heir-tab[data-heir="xanthe"]  { --heir-color: #c47c6a; }
.heir-tab[data-heir="cailynn"] { --heir-color: #9a67d2; }

/* The arched niche the hub's heir cards use, at thumbnail size. */
.tab-portrait {
    width: 52px;
    height: 62px;
    object-fit: cover;
    object-position: top;
    border: 1px solid var(--court-border);
    border-bottom: 0;
    border-radius: 50% 50% 0 0 / 30% 30% 0 0;
    background: var(--royal-black);
    transition: border-color .18s ease;
}

.heir-tab.active .tab-portrait { border-color: var(--heir-color); }

.tab-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--court-secondary);
}

.heir-tab.active .tab-name { color: var(--heir-color); }

/* ── Dossier Panel ───────────────────────────────────────── */
.dossier-stage { position: relative; }

.heir-dossier {
    display: none;
    grid-template-columns: 300px 1fr;
    gap: 0;
    background: var(--court-raised);
    border: 1px solid var(--court-border);
    border-top: 2px solid var(--heir-color, var(--royal-gold));
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    animation: dossierFadeIn .24s ease;
}

.heir-dossier.active { display: grid; }

@keyframes dossierFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Portrait Column ─────────────────────────────────────── */
/* Sticky so the portrait stays with you down a long dossier; align-self:start
   keeps the hairline from trailing past the plate into empty panel. */
.dossier-portrait-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: start;
    position: sticky;
    top: 16px;
    padding: 30px 26px;
    background: var(--court-surface);
    border-right: 1px solid var(--court-line);
}

.dossier-frame {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--royal-black);
    border: 1px solid var(--heir-color, var(--royal-gold));
    border-bottom: 0;
    border-radius: 50% 50% 0 0 / 18% 18% 0 0;
    box-shadow: inset 0 0 0 5px var(--royal-black);
}

.dossier-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* ── Nameplate ───────────────────────────────────────────── */
.dossier-nameplate {
    width: 100%;
    text-align: center;
    padding-top: 20px;
}

.nameplate-rule {
    height: 1px;
    background: var(--court-line);
    margin-bottom: 14px;
}

.nameplate-rule + .nameplate-name { margin-top: 0; }

.dossier-nameplate .nameplate-rule:last-child {
    margin: 0;
    background: var(--heir-color, var(--royal-gold));
    opacity: .7;
}

.nameplate-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--royal-gold-light);
    letter-spacing: 0;
    margin: 0 0 6px;
    line-height: 1.3;
}

.nameplate-epithet {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-size: 17px;
    color: var(--heir-color, var(--royal-gold));
    margin: 0 0 14px;
}

/* The way out to the character's stats on the main site, under the
   nameplate. Shown by js/heirs.js once the character is found. */
.nameplate-sheet { margin: -6px 0 14px; }

.nameplate-kin + .nameplate-sheet { margin-top: -8px; }

.nameplate-sheet a {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--court-secondary);
    border-bottom: 1px solid var(--court-line);
    padding-bottom: 2px;
    transition: color .18s ease, border-color .18s ease;
}

.nameplate-sheet a i { margin-right: 6px; }

.nameplate-sheet-where { color: var(--court-secondary); opacity: .75; }

.nameplate-sheet a:hover,
.nameplate-sheet a:focus-visible {
    color: var(--heir-color, var(--royal-gold));
    border-bottom-color: var(--heir-color, var(--royal-gold));
}

/* ── Content Column ──────────────────────────────────────── */
/* The page scrolls, not the panel: a dossier reads as one document. */
.dossier-content-col { padding: 30px 34px 34px; }

/* ── Stamp ───────────────────────────────────────────────── */
.dossier-stamp {
    float: right;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--heir-color, var(--royal-gold));
    background: var(--royal-black);
    border: 1px solid var(--heir-color, var(--royal-gold));
    box-shadow: none;
    margin: 0 0 18px 24px;
    opacity: .85;
}

/* ── Dossier Text ────────────────────────────────────────── */
.dossier-text {
    color: var(--parchment);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 19px;
    line-height: 1.75;
}

.dossier-text p { margin: 0 0 16px; }

.dossier-intro {
    font-size: 20px;
    line-height: 1.75;
    margin-bottom: 22px;
}

/* The journey: one run of prose per act, under the act's name from the
   chronicle. Set like a section title but quieter and without the rule, so
   an act reads as a subdivision of the section rather than a section. It is
   a <p role="heading">, not an <h4>: court-chrome.css paints every bare
   h1-h4 gold-light with letter-spacing 0 under !important, which would turn
   this into a nameplate. Scoped under .dossier-text to outrank its p rule. */
.dossier-text .dossier-act {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--court-secondary);
    line-height: 1.4;
    margin: 22px 0 10px;
}

/* Where the journey comes from and how far it runs. */
.dossier-journey-note {
    font-size: 16px;
    font-style: italic;
    color: var(--court-secondary);
}

.dossier-journey-note a {
    color: var(--royal-gold);
    text-decoration: none;
    border-bottom: 1px solid var(--court-line);
}

.dossier-journey-note a:hover { border-bottom-color: var(--royal-gold); }

/* Gold, not the heir's colour: a section heading is structure. */
.dossier-section-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--royal-gold);
    border-bottom: 1px solid var(--court-line);
    padding-bottom: 8px;
    margin: 28px 0 14px;
    clear: both;
}

/* Past the reader's spoiler shield (js/court-shield.js). */
.dossier-text .spoiled { display: none; }

.dossier-text .spoiler-row {
    margin: 10px 0 18px;
    font-size: 15px;
}

.dossier-closing {
    font-style: italic;
    color: var(--court-secondary);
    border-left: 2px solid var(--royal-gold);
    padding-left: 18px;
    margin-top: 26px;
}

/* ── Prev / Next Controls ────────────────────────────────── */
.dossier-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 26px;
}

.dossier-prev,
.dossier-next {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--court-raised);
    border: 1px solid var(--court-border);
    border-radius: 2px;
    color: var(--royal-gold);
    font-size: 14px;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}

.dossier-prev:hover,
.dossier-next:hover {
    background: var(--court-hover);
    border-color: var(--royal-gold);
}

.dossier-prev:disabled,
.dossier-next:disabled {
    opacity: .3;
    cursor: default;
}

/* ── Dots ────────────────────────────────────────────────── */
/* Diamonds, echoing the section marks on the hub. */
.dossier-dots {
    display: flex;
    gap: 12px;
    align-items: center;
}

.dot {
    width: 7px;
    height: 7px;
    background: transparent;
    border: 1px solid var(--court-border);
    transform: rotate(45deg);
    transition: background .18s ease, border-color .18s ease;
    cursor: pointer;
}

.dot.active {
    background: var(--royal-gold);
    border-color: var(--royal-gold);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
    .heir-dossier.active { grid-template-columns: 1fr; }

    .dossier-portrait-col {
        position: static;
        padding: 24px;
        border-right: none;
        border-bottom: 1px solid var(--court-line);
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
    }

    .dossier-frame {
        width: 140px;
        min-width: 140px;
    }

    .dossier-nameplate {
        padding-top: 0;
        text-align: left;
        align-self: center;
    }

    .dossier-content-col { padding: 24px; }
}

@media (max-width: 560px) {
    /* Five in a row rather than four and a stray: the tabs are the page's
       index, and a wrapped one reads as a different kind of thing. */
    .heir-tabs {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
    }

    .heir-tab {
        min-width: 0;
        padding: 9px 4px;
        gap: 8px;
    }

    .tab-portrait { width: 40px; height: 48px; }

    .tab-name { font-size: 10px; }

    .dossier-portrait-col {
        flex-direction: column;
        align-items: center;
    }

    .dossier-frame { width: 160px; }

    .dossier-nameplate { text-align: center; }

    .dossier-text { font-size: 18px; }

    .dossier-intro { font-size: 19px; }
}

/* ── The Arsenal ────────────────────────────────────────────
   The dossier's second tab (js/heirs.js, heir.arsenal): the items,
   companions and abilities the heir carries, gated piece by piece by the
   spoiler shield. Recorded in BRANDING.md under The Crimson Court. */

.dossier-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 20px;
    border-bottom: 1px solid var(--court-line);
}

.dossier-tab {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 10px 14px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--court-secondary);
    cursor: pointer;
    transition: color .18s ease, border-color .18s ease;
}

.dossier-tab i { margin-right: 6px; }

.dossier-tab:hover,
.dossier-tab:focus-visible { color: var(--parchment); }

.dossier-tab.active {
    color: var(--heir-color);
    border-bottom-color: var(--heir-color);
}

.dossier-arsenal {
    color: var(--parchment);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 17px;
    line-height: 1.65;
}

.dossier-arsenal .dossier-section-title:first-child { margin-top: 4px; }

.dossier-arsenal .spoiler-row {
    margin: 10px 0 18px;
    font-size: 15px;
}

.arsenal-piece {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 22px;
    padding: 20px 0;
    border-bottom: 1px solid var(--court-line);
    transition: box-shadow .3s ease;
}

.arsenal-list .arsenal-piece:last-child { border-bottom: 0; }

/* The frame is the portrait frame's smaller cousin: the heir's colour on
   the ring, the kind's icon behind the art, so a piece with no art yet
   still has a face. The image sits over the icon and removes itself if it
   fails to load. */
.arsenal-art {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--court-border);
    background: var(--court-raised);
    box-shadow: 0 0 0 3px var(--court-surface), 0 0 0 4px var(--heir-color), 0 0 22px var(--heir-glow);
    color: inherit;
    font: inherit;
}

/* With art, the frame is a button that opens it full size. */
.arsenal-art.has-art {
    cursor: zoom-in;
    transition: box-shadow .18s ease;
}

.arsenal-art.has-art:hover,
.arsenal-art.has-art:focus-visible {
    box-shadow: 0 0 0 3px var(--court-surface), 0 0 0 4px var(--royal-gold-light), 0 0 30px var(--heir-glow);
    outline: none;
}

.arsenal-art i {
    font-size: 40px;
    color: var(--court-secondary);
    opacity: .7;
}

/* The whole picture, never a crop: a bident or a greatsword is tall, and
   the frame's raised surface shows around it. */
.arsenal-art img {
    position: absolute;
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    object-fit: contain;
    background: var(--court-raised);
}

.arsenal-kind {
    margin: 0 0 4px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--court-secondary);
}

/* A <p role="heading">, for the same reason .dossier-act is. */
.dossier-arsenal .arsenal-name {
    margin: 0 0 8px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--parchment);
    line-height: 1.3;
}

.arsenal-source {
    margin: 0 0 10px;
    font-style: italic;
    color: var(--court-secondary);
}

.arsenal-until {
    margin: 0 0 12px;
    font-style: italic;
    color: var(--crimson-light);
}

.arsenal-until i { margin-right: 6px; font-style: normal; }

.arsenal-piece.is-lost .arsenal-art {
    filter: grayscale(.85);
    opacity: .75;
    box-shadow: 0 0 0 3px var(--court-surface), 0 0 0 4px var(--court-border);
}

.arsenal-desc p { margin: 0 0 12px; }

.arsenal-desc p:last-child { margin-bottom: 0; }

.arsenal-powers {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.arsenal-powers li {
    padding: 6px 0 6px 14px;
    margin: 0 0 8px;
    border-left: 2px solid var(--court-line);
    line-height: 1.55;
}

.arsenal-powers li b {
    display: block;
    margin-bottom: 2px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--royal-gold);
}

/* A curse on a piece: the same row in crimson. */
.arsenal-powers li.is-curse { border-left-color: rgba(214, 51, 92, .45); }

.arsenal-powers li.is-curse b { color: var(--crimson-light); }

.arsenal-held {
    margin: 10px 0 0;
    font-size: 15px;
    font-style: italic;
    color: var(--court-secondary);
}

.arsenal-held i { margin-right: 6px; font-style: normal; }

/* The piece a link pointed at, marked the way a linked-to NPC card is. */
.arsenal-piece.arsenal-targeted { box-shadow: inset 4px 0 0 var(--heir-color); padding-left: 14px; }

@media (max-width: 640px) {
    .arsenal-piece { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .arsenal-art { width: 100%; max-width: 320px; height: auto; aspect-ratio: 1 / 1; margin: 0 auto; }
    .arsenal-art i { font-size: 34px; }
    .dossier-arsenal .arsenal-name { font-size: 17px; }
}
