/* Interactive feature pages (the map, the character wall). Site-agnostic —
 * colours come from the site's accent pair. */

.feature-intro { color: var(--text-dim); max-width: 70ch; margin: 0; }

.feature-disclaimer {
    margin-top: 28px;
    font-size: .8rem;
    color: var(--text-faint);
    max-width: 70ch;
}

/* ── Map ─────────────────────────────────────────────────────────── */

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 26px;
    align-items: start;
    margin-bottom: 40px;
}

/* Square on purpose: the placeholder SVG uses a 0 0 100 100 viewBox with
   preserveAspectRatio="none" so it stretches to exactly match the marker
   buttons, which are positioned in stage percentages. Square stage + square
   viewBox means that stretch is 1:1 and the coastline isn't distorted. */
.map-stage {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.map-image { width: 100%; height: 100%; object-fit: cover; }

.map-placeholder {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    /* "Water" base — deliberately darker/flatter than the landmass fill so
       the SVG shape reads as land sitting in it, not just more gradient. */
    background:
        repeating-linear-gradient(90deg, transparent 0 39px, var(--border-soft) 39px 40px),
        repeating-linear-gradient(0deg, transparent 0 39px, var(--border-soft) 39px 40px),
        radial-gradient(ellipse at 50% 50%, #dce8fa 0%, var(--bg-elev) 70%);
}
.map-landmass {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
/* Watermark sits in the bottom-left "sea" rather than centred, so it never
   competes with a marker label for the same pixels. */
.map-placeholder span {
    position: absolute;
    left: 6%;
    bottom: 5%;
    font-family: var(--font-display);
    font-size: clamp(1rem, 2.4vw, 1.5rem);
    font-weight: 700;
    letter-spacing: .34em;
    color: var(--text-faint);
    opacity: .3;
}

.map-marker {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    /* Translate by the dot's own width, not the whole button — the button is
       dot + label, so centring the button would push the dot off its actual
       coordinate by half the label's width. */
    transform: translate(-6.5px, -50%);
    white-space: nowrap;
    z-index: 2;
}
.map-marker.marker-flip {
    flex-direction: row-reverse;
    transform: translate(calc(-100% + 6.5px), -50%);
}
.map-marker:hover, .map-marker.active { z-index: 3; }

.marker-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
    transition: transform .2s var(--ease), box-shadow .3s;
}
.map-marker.active .marker-dot,
.map-marker:hover .marker-dot {
    transform: scale(1.35);
    box-shadow: 0 0 0 9px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* Labels are visible by default, not hover-only. A map that reads as loose
   dots until you mouse over each one isn't a map — and hover doesn't exist
   on touch at all. Hover/active just raises the contrast. */
/* Both states pair an opaque background with a foreground guaranteed to
   contrast against it, so a label is legible wherever it lands on the map.
   The earlier translucent dark pill inherited --text-dim on a light theme,
   which put dark text on a dark wash — unreadable over the whole peninsula. */
.marker-label {
    padding: .22em .6em;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: .74rem;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(16, 19, 26, .18);
    transition: color .2s, background .2s, border-color .2s;
}
.map-marker:hover .marker-label,
.map-marker.active .marker-label {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

/* Marker kinds get distinct colours so the map reads at a glance. */
.marker-city   .marker-dot, .marker-kind.marker-city   { background: var(--accent); }
.marker-town   .marker-dot, .marker-kind.marker-town   { background: var(--accent-alt); }
.marker-nature .marker-dot, .marker-kind.marker-nature { background: var(--ok); }
.marker-region .marker-dot, .marker-kind.marker-region { background: var(--warn); }

.map-side {
    max-height: 640px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.marker-list { list-style: none; margin: 0; padding: 0; }

.marker-entry {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    text-align: left;
    font-family: inherit;
    color: var(--text-dim);
    cursor: pointer;
    transition: background .18s;
}
.marker-entry:hover { background: var(--bg-elev); }
.marker-entry.active { background: var(--bg-elev); color: var(--text); }
.marker-entry b { display: block; color: var(--text); font-size: .94rem; }
.marker-entry small { display: block; font-size: .82rem; line-height: 1.45; margin-top: 3px; }

.marker-kind {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 50%;
}

/* ── Characters ──────────────────────────────────────────────────── */

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

.character-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color .22s, transform .22s var(--ease);
}
.character-card:hover { border-color: var(--accent); transform: translateY(-3px); }

.character-portrait { aspect-ratio: 3 / 4; background: var(--bg-elev); }
.character-portrait img { width: 100%; height: 100%; object-fit: cover; }
.character-portrait-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 40% 35%,
            color-mix(in srgb, var(--accent) 34%, transparent), transparent 62%),
        radial-gradient(circle at 70% 75%,
            color-mix(in srgb, var(--accent-alt) 26%, transparent), transparent 62%),
        var(--bg-elev);
}
.character-portrait-empty span {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.character-body { padding: 20px 22px 24px; }
.character-role {
    display: inline-block;
    margin-bottom: 8px;
    padding: .2em .7em;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}
.character-body h2 { font-size: 1.3rem; margin-bottom: .35em; }
.character-body p { color: var(--text-dim); font-size: .93rem; margin: 0; }

@media (max-width: 900px) {
    .map-layout { grid-template-columns: 1fr; }
    .map-side { max-height: none; }
    .marker-label { display: none; }
}

/* Link out to the trailer a character was revealed in — stands in for the
   portrait we have no licensed source for. */
.character-reveal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.character-reveal:hover { text-decoration: underline; }
