/* Maps & Places room — ported from the original build, re-skinned for the
   RISV2 dark marble + glass system. The coordinate plot (projection box,
   --plot-scale counter-scaling, dot/label geometry) is untouched; only the
   panels around it changed skin. */

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.maps-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: start;
    padding: clamp(48px, 6vw, 86px) clamp(20px, 6vw, 90px);
    background: transparent;
}
.maps-intro h2 { margin: 0; font: 400 clamp(2.6rem, 4.6vw, 4.6rem)/.95 var(--serif); color: #f4efe2; }
.maps-intro > div > p:last-child { font: 1.02rem/1.68 var(--serif); color: var(--muted); max-width: 60ch; }
.maps-honesty {
    padding: 22px 24px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--study-gold);
    border-radius: 0 var(--radius) var(--radius) 0;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.maps-honesty .authority-label { margin-top: 0; }
.maps-honesty p:last-child { margin: 0; font-size: .85rem; line-height: 1.62; color: var(--muted); }

/* ---- the coordinate plot ---- */
.place-plot-section {
    padding: clamp(30px, 4vw, 54px) clamp(16px, 5vw, 90px) clamp(40px, 5vw, 70px);
    background: radial-gradient(circle at 50% 20%, rgba(47, 143, 107, .1), transparent 60%);
}
.place-plot {
    position: relative;
    --plot-scale: 1;
    max-width: 1250px; margin: 0 auto;
    border: 1px solid rgba(201, 164, 92, .3);
    border-radius: var(--radius);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 40%, rgba(201, 164, 92, .10), transparent 62%),
        #0e1512;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}
.place-plot svg { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
.place-plot.is-dragging svg { cursor: grabbing; }

/* The drawn backdrop, pinned corner to corner with the projected box. It sits
   under everything and is deliberately quiet so the dots stay the subject. */
.plot-backdrop { opacity: .82; }

/* The degree grid. Its stroke width is counter-scaled in study-maps.js, along
   with the dot radii and label sizes - see the note on resize() there. */
.plot-grid line { stroke: rgba(233, 213, 154, .13); }

.plot-point { cursor: pointer; }
.plot-hit { fill: transparent; }
.plot-dot { fill: #e6c46b; stroke: #0e1512; stroke-width: 1.5; transition: fill .18s ease; }
.plot-point text {
    fill: rgba(255, 247, 222, .82);
    font-family: var(--serif); font-weight: 700;
    /* A dark halo behind each name so it stays readable over the backdrop. */
    paint-order: stroke;
    stroke: rgba(6, 12, 9, .72);
    pointer-events: none;
    transition: fill .18s ease;
}
.plot-point:hover .plot-dot,
.plot-point:focus-visible .plot-dot { fill: #fff3cf; }
.plot-point:hover text,
.plot-point:focus-visible text { fill: #fff; }

/* ---- zoom controls ---- */
.plot-zoom {
    position: absolute; z-index: 2; right: 12px; top: 12px;
    display: flex; flex-direction: column; gap: 6px;
}
.plot-zoom button {
    min-width: 38px; height: 38px; padding: 0 10px;
    border: 1px solid rgba(201, 164, 92, .55); border-radius: 8px;
    background: rgba(10, 15, 13, .82); color: var(--gold-pale);
    font: 900 1rem var(--serif); cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.plot-zoom button:last-child { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; }
.plot-zoom button:hover { background: var(--gold); color: #141109; border-color: var(--gold); }

.plot-hint {
    position: absolute; z-index: 2; left: 14px; bottom: 10px; margin: 0;
    font-size: .68rem; color: rgba(255, 247, 222, .5);
    pointer-events: none;
}
@media (max-width: 620px) { .plot-hint { display: none; } }
.plot-point:hover text,
.plot-point:focus-visible text { fill: #fff; }
.plot-point:focus-visible { outline: none; }
.plot-point.is-disputed .plot-dot { fill: transparent; stroke: #e6c46b; stroke-width: 2; stroke-dasharray: 3 2.5; }
.plot-note {
    max-width: 1250px; margin: 16px auto 0;
    font-size: .8rem; line-height: 1.6;
    color: rgba(255, 255, 255, .55);
}

/* ---- place cards ---- */
.places-section { padding: clamp(48px, 6vw, 86px) clamp(20px, 6vw, 90px); background: transparent; }
.places-section > header { max-width: 1450px; margin: 0 auto 22px; }
.places-section h2 { margin: 0; font: 400 clamp(2.2rem, 3.6vw, 3.4rem) var(--serif); color: #f4efe2; }
.places-section .authority-label { margin-top: 0; }

.region-filters { max-width: 1450px; margin: 0 auto 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.region-filters button {
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass); color: var(--gold-pale);
    padding: 8px 14px; font-weight: 850; font-size: .71rem; cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.region-filters button.active, .region-filters button:hover {
    background: linear-gradient(135deg, #d8b878, var(--gold) 55%, #a8843e);
    color: #141109; border-color: transparent;
}
.place-filters { max-width:1450px;margin:0 auto 14px;display:grid;grid-template-columns:minmax(170px,.7fr) minmax(260px,1.4fr) minmax(220px,1fr);gap:12px;padding:18px;background:rgba(255,255,255,.055);border:1px solid rgba(230,196,107,.22); }
.place-filters label { display:grid;gap:7px; }
.place-filters label > span { font-size:.68rem;font-weight:800;letter-spacing:.13em;text-transform:uppercase;color:#e6c46b; }
.place-filters select,.place-filters input { width:100%;min-height:46px;padding:10px 12px;border:1px solid rgba(255,255,255,.22);border-radius:4px;background:#12261e;color:#f8f1df;font:inherit; }
.place-results { max-width:1450px;margin:0 auto 20px;color:#b9c4bd; }
.place-detail-link { color:inherit;text-decoration:none; }
.place-record-link { display:block;margin-top:14px;color:#e6c46b;font-weight:800;text-decoration:none; }
.plot-point.is-selected .plot-dot { fill:#fff3cf;stroke:#102019;stroke-width:3; }
.plot-point.is-selected text { font-weight:900;fill:#fff3cf; }

.place-grid {
    max-width: 1450px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px;
}
.place-card {
    display: flex; flex-direction: column;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden; transition: border-color .2s, transform .2s;
}
.place-card.is-focused { border-color: var(--study-gold); transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }

/* The lettered plate sits underneath. When a photograph exists it covers the
   plate; when the file is missing the <img> removes itself and the plate shows,
   so a pending image never renders as a broken icon. */
.place-figure { position: relative; height: 152px; background: linear-gradient(150deg, #16442f, #0a2a20); }
.place-plate {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font: 400 2.6rem var(--serif); letter-spacing: .1em;
    color: rgba(233, 213, 154, .5);
}
.place-figure img {
    position: relative; z-index: 1;
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.place-body { display: flex; flex-direction: column; gap: 7px; padding: 18px 20px 20px; flex: 1; }
.place-body h3 { margin: 0; font: 400 1.42rem var(--serif); color: #f4efe2; }
.place-flag {
    display: inline-block; margin-left: 8px; padding: 3px 7px;
    border: 1px solid rgba(201, 164, 92, .45);
    border-radius: 999px;
    font: 800 .55rem var(--sans, system-ui); letter-spacing: .1em;
    text-transform: uppercase; color: var(--gold); vertical-align: middle;
}
.place-modern { margin: 0; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-pale); font-weight: 800; }
.place-body > p:not(.place-modern) { margin: 0; font-size: .84rem; line-height: 1.58; color: var(--muted); }
.place-refs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 10px; }
.place-refs button {
    border: 1px solid rgba(201, 164, 92, .4); border-radius: 999px;
    background: transparent; color: var(--gold);
    padding: 6px 10px; font-weight: 800; font-size: .69rem; cursor: pointer;
}
.place-refs button:hover { background: var(--study-gold); color: #141109; }
.place-map-link { font-size: .72rem; font-weight: 800; color: var(--muted); text-decoration: underline; }
.place-map-link:hover { color: var(--gold-pale); }

/* ---- the ministries of Jesus and Paul ---- */
.ministry-section { padding: clamp(48px, 6vw, 86px) clamp(20px, 6vw, 90px); background: transparent; }
.ministry-section.is-paul { background: rgba(255, 255, 255, .02); }
.ministry-section > header { max-width: 1450px; margin: 0 auto 24px; }
.ministry-section .authority-label { margin-top: 0; }
.ministry-section h2 { margin: 0 0 10px; font: 400 clamp(2.2rem, 3.6vw, 3.4rem) var(--serif); color: #f4efe2; }
.ministry-section > header p { margin: 0 0 8px; font-size: .95rem; line-height: 1.62; color: var(--muted); max-width: 78ch; }
.ministry-note { font-size: .82rem !important; color: var(--muted) !important; border-left: 3px solid var(--study-gold); padding-left: 14px; }
.ministry-note b { color: var(--gold-pale); }

.stop-list {
    max-width: 1450px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px;
}
.stop-card {
    display: flex; gap: 14px; padding: 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.stop-index {
    flex: none; width: 30px; height: 30px;
    display: grid; place-items: center;
    border: 1px solid rgba(201, 164, 92, .5); border-radius: 50%;
    font: 800 .78rem var(--sans, system-ui); color: var(--gold);
}
.stop-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.stop-body h4 { margin: 0; font: 400 1.28rem var(--serif); color: #f4efe2; }
.stop-body > p { margin: 0; font-size: .84rem; line-height: 1.56; color: var(--muted); }

.stop-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.stop-people li {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 5px 0; border-top: 1px solid var(--glass-border);
    font-size: .8rem; color: var(--ink);
}
.stop-people li:first-child { border-top: 0; }
.stop-people span { font-weight: 700; }
.stop-people button {
    border: 1px solid rgba(201, 164, 92, .35); border-radius: 999px;
    background: transparent; color: var(--gold);
    padding: 3px 7px; font-weight: 800; font-size: .63rem; cursor: pointer;
}
.stop-people button:hover { background: var(--study-gold); color: #141109; }

.journey { max-width: 1450px; margin: 0 auto 30px; }
.journey-head {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px;
    padding-bottom: 10px; margin-bottom: 14px;
    border-bottom: 2px solid rgba(201, 164, 92, .35);
}
.journey-head h3 { margin: 0; font: 400 1.75rem var(--serif); color: #f4efe2; }
.journey-head .place-refs { margin-top: 0; padding-top: 0; }

/* ---- archaeology ---- */
.archaeology-section { padding: clamp(48px, 6vw, 86px) clamp(20px, 6vw, 90px); background: transparent; }
.archaeology-section > header { max-width: 1450px; margin: 0 auto 26px; }
.archaeology-section h2 { margin: 0 0 10px; font: 400 clamp(2.2rem, 3.6vw, 3.4rem) var(--serif); color: #f4efe2; }
.archaeology-section .authority-label { margin-top: 0; }
.archaeology-section > header p { margin: 0 0 8px; font-size: .92rem; line-height: 1.62; color: var(--muted); max-width: 78ch; }
.archaeology-caveat { font-size: .82rem !important; color: var(--muted) !important; border-left: 3px solid var(--study-gold); padding-left: 14px; }

.find-grid {
    max-width: 1450px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px;
}
.find-card {
    display: flex; flex-direction: column; gap: 9px; padding: 24px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.find-card h3 { margin: 0; font: 400 1.4rem var(--serif); color: #f4efe2; }
.find-meta { display: grid; gap: 4px; margin: 0; }
.find-meta > div { display: flex; gap: 8px; font-size: .74rem; }
.find-meta dt { font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); min-width: 62px; }
.find-meta dd { margin: 0; color: var(--muted); }
.find-card p { margin: 0; font-size: .84rem; line-height: 1.58; color: var(--muted); }
.find-shows { padding-top: 8px; border-top: 1px solid var(--glass-border); }
.find-shows b { color: var(--gold-pale); }

/* ---- unified map explorer ---- */
.map-explorer-head {
    max-width: 1450px; margin: 0 auto 18px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(430px, .9fr);
    gap: clamp(24px, 4vw, 58px); align-items: end;
}
.map-explorer-head .authority-label { margin-top: 0; }
.map-explorer-head h2 { margin: 0 0 9px; font: 400 clamp(2rem, 3.2vw, 3.35rem)/1 var(--serif); color: #f4efe2; }
.map-explorer-head > div > p:last-child { max-width: 62ch; margin: 0; color: var(--muted); line-height: 1.6; }
.map-toolbar {
    display: grid; grid-template-columns: 1.2fr .9fr; gap: 10px;
    padding: 14px; border: 1px solid rgba(230,196,107,.24); border-radius: 14px;
    background: rgba(8, 27, 20, .7); box-shadow: 0 12px 34px rgba(0,0,0,.22);
}
.map-toolbar label { display: grid; gap: 6px; }
.map-toolbar label > span { font-size: .64rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; color: #e6c46b; }
.map-toolbar input,.map-toolbar select {
    width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
    background: #10271f; color: #f8f1df; font: inherit;
}
.map-toolbar input:focus,.map-toolbar select:focus { outline: 2px solid #e6c46b; outline-offset: 2px; }
.map-presets {
    max-width: 1450px; margin: 0 auto 12px; display: flex; gap: 7px; flex-wrap: wrap;
}
.map-presets button {
    min-height: 40px; padding: 8px 15px; border: 1px solid rgba(230,196,107,.26); border-radius: 999px;
    background: rgba(11,30,23,.68); color: #e8e2d3; font: 800 .72rem var(--sans,system-ui); cursor: pointer;
}
.map-presets button:hover,.map-presets button.active {
    border-color: transparent; background: linear-gradient(135deg,#e3c77f,#cba556); color: #142019;
}
.map-explorer {
    max-width: 1450px; margin: 0 auto; display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(295px, 345px); gap: 14px; align-items: stretch;
}
.map-explorer .place-plot { max-width: none; margin: 0; border-radius: 18px; border-color: rgba(230,196,107,.38); }
.map-explorer .plot-backdrop { opacity: .94; }
.map-explorer .plot-grid line { stroke: rgba(20,44,36,.14); }
.map-explorer .plot-point text {
    fill: #fff7df; font-family: var(--sans,system-ui); font-weight: 850; letter-spacing: .01em;
    stroke: rgba(7,21,16,.9); stroke-linejoin: round; paint-order: stroke fill;
}
.map-explorer .plot-dot { fill: #f0ca68; stroke: #102019; stroke-width: 2; }
.map-explorer .plot-point.is-selected .plot-hit { fill: rgba(255,240,179,.22); stroke: rgba(255,247,214,.85); stroke-width: 2; }
.map-explorer .plot-point.is-selected .plot-dot { fill: #fff8dc; stroke: #102019; stroke-width: 3; }
.map-explorer .plot-point.is-selected text { fill: #fff8dc; }
.map-explorer .plot-point.is-disputed .plot-dot { fill: rgba(12,36,27,.72); stroke: #f0ca68; stroke-width: 2.5; }
.map-explorer .plot-zoom {
    right: 14px; top: 14px; flex-direction: row; gap: 0; overflow: hidden;
    border: 1px solid rgba(230,196,107,.52); border-radius: 10px; background: rgba(8,20,15,.88);
    box-shadow: 0 7px 22px rgba(0,0,0,.25);
}
.map-explorer .plot-zoom button,.map-explorer .plot-zoom span {
    display: grid; place-items: center; min-width: 44px; height: 44px; border: 0; border-right: 1px solid rgba(230,196,107,.24); border-radius: 0;
    background: transparent; color: #fff1c8; font: 850 .78rem var(--sans,system-ui);
}
.map-explorer .plot-zoom button { cursor: pointer; }
.map-explorer .plot-zoom button:first-child,.map-explorer .plot-zoom button:nth-child(3) { font-size: 1.15rem; }
.map-explorer .plot-zoom button:last-child { border-right: 0; text-transform: uppercase; letter-spacing: .08em; font-size: .61rem; }
.map-explorer .plot-zoom button:hover { background: #d6b25f; color: #122019; }
.plot-legend {
    position: absolute; z-index: 2; left: 14px; top: 14px; display: flex; gap: 13px;
    padding: 8px 10px; border-radius: 9px; background: rgba(8,20,15,.76); color: #f3ead3;
    font: 750 .66rem var(--sans,system-ui); backdrop-filter: blur(5px);
}
.plot-legend span { display: flex; align-items: center; gap: 6px; }
.plot-legend i { width: 9px; height: 9px; border: 2px solid #102019; border-radius: 50%; background: #f0ca68; }
.plot-legend i.is-disputed { background: #173329; border-color: #f0ca68; }
.map-explorer .plot-hint {
    left: auto; right: 14px; bottom: 12px; padding: 6px 9px; border-radius: 7px;
    background: rgba(8,20,15,.7); color: rgba(255,247,222,.82); font-size: .66rem;
}
.map-explorer .plot-hint span:last-child { display: none; }
.map-place-preview {
    min-height: 100%; padding: clamp(24px,3vw,36px); border: 1px solid rgba(230,196,107,.3); border-radius: 18px;
    background: linear-gradient(155deg,rgba(35,66,51,.82),rgba(9,29,22,.96));
    box-shadow: 0 18px 50px rgba(0,0,0,.28); color: #d5dcd5;
    display: flex; flex-direction: column; justify-content: center;
}
.map-place-preview h3 { margin: 7px 0 5px; font: 400 clamp(1.8rem,2.4vw,2.55rem)/1.04 var(--serif); color: #fff8e8; }
.map-place-preview h3 .place-flag { display: table; margin: 10px 0 0; }
.map-preview-kicker { color: #e7c66f; font-size: .64rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.map-preview-modern { margin: 0 0 18px !important; color: #e7c66f !important; font-size: .72rem !important; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.map-place-preview > p { margin: 0; font-size: .9rem; line-height: 1.65; }
.map-preview-refs { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0; }
.map-preview-refs button {
    padding: 7px 10px; border: 1px solid rgba(230,196,107,.42); border-radius: 999px;
    background: transparent; color: #efd27e; font: 800 .68rem var(--sans,system-ui); cursor: pointer;
}
.map-preview-refs button:hover { background: #d6b25f; color: #132019; }
.map-preview-action {
    display: flex; justify-content: space-between; align-items: center; margin-top: auto; min-height: 48px; padding: 12px 15px;
    border-radius: 10px; background: linear-gradient(135deg,#e5c875,#c69c43); color: #142019; font-weight: 900; text-decoration: none;
}
.map-preview-empty { text-align: center; max-width: 27ch; margin: auto; }
.map-preview-empty h3 { margin-top: 14px; }
.map-preview-empty p { margin: 0; line-height: 1.65; color: var(--muted); }
.map-preview-mark { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto; border: 1px solid rgba(230,196,107,.55); border-radius: 50%; color: #efd27e; font-size: 1.5rem; }

@media (max-width: 1100px) {
    .map-explorer-head { grid-template-columns: 1fr; }
    .map-explorer { grid-template-columns: 1fr; }
    .map-place-preview { min-height: 260px; }
}
@media (max-width: 650px) {
    .place-plot-section { padding-inline: 12px; }
    .map-toolbar { grid-template-columns: 1fr; }
    .map-presets { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .map-presets button { flex: 0 0 auto; min-height: 44px; }
    .plot-legend { left: 8px; top: 8px; flex-direction: column; gap: 4px; }
    .map-explorer .plot-zoom { right: 8px; top: 8px; }
    .map-explorer .plot-zoom span { display: none; }
    .map-explorer .plot-zoom button { min-width: 42px; height: 42px; }
    .map-explorer .plot-hint { right: 8px; bottom: 8px; }
    .map-explorer .plot-hint span:first-child { display: none; }
    .map-explorer .plot-hint span:last-child { display: inline; }
}

@media (max-width: 900px) {
    .maps-intro { grid-template-columns: 1fr; }
    .plot-point text { font-size: 17px; }
    .place-filters { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .place-card, .plot-dot, .plot-point text { transition: none; }
    .place-card.is-focused { transform: none; }
}
