/* /atlas: where each faith is attested, by year. Reading-page shell from
   pages.css; the map takes the app's own map colors, and each faith its own
   color from atlas.json (set as --c on its dots, chips and list rows). */

.atlas { max-width: 72rem; margin: 0 auto; padding: 22px 16px 70px; }
.atlas h1 { font: 600 30px/1.2 var(--serif); margin: 10px 0 12px; color: var(--read); }
.atlas h2 {
  font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint);
  margin: 34px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
}
.atlas p { line-height: 1.65; color: var(--read-2); max-width: 46rem; }
.atlas .lede { font-size: 16.5px; }
.atlas a { color: var(--accent); }

/* faith toggles */
.atlas-faiths { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.atlas-faiths button {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-dim); font-size: 13.5px; cursor: pointer;
}
.atlas-faiths button .sw { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--c); }
.atlas-faiths button[aria-pressed="true"] { color: var(--read); border-color: var(--c); }
.atlas-faiths button[aria-pressed="true"] .sw { background: var(--c); }
.atlas-faiths button .rng { color: var(--text-faint); font-size: 12px; }
.atlas-faiths button:hover { border-color: var(--c); }

.atlas-stage {
  position: relative; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--map-sea);
}
#atlas-map {
  position: relative; display: block; width: 100%; height: min(64vh, 580px); min-height: 300px;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
/* The globe is painted on a canvas under the dots; the flat land is hidden. */
#atlas-globe { position: absolute; inset: 0; width: 100%; height: 100%; }
#atlas-globe[hidden] { display: none; }
.atlas-stage:has(#atlas-globe:not([hidden])) { background: var(--bg); }
#atlas-map.globe .land, #atlas-map.globe .grid { display: none; }
#atlas-map .back, #atlas-map .ring.hide, #atlas-map .territory.hide { display: none; }
#atlas-map .territory { pointer-events: none; }
/* On the globe the territory is painted into the sphere itself. */
#atlas-map.globe .territory { display: none; }
/* Over the areas the dots are only markers: no edge, a little transparent. */
#atlas-map.areas-on .pt:not(.on) .dot { stroke: none; opacity: .85; }
#atlas-map.areas-on .pt:not(.on) .dot.ev-tradition { fill: var(--c); opacity: .6; }
/* Over the areas the region rings are redundant: the area already says "around here". */
#atlas-map.areas-on .ring { display: none; }

.atlas-style { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 13px; color: var(--text-dim); }
.atlas-style button {
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-dim); font-size: 13px; cursor: pointer;
}
.atlas-style button[aria-pressed="true"] { color: var(--read); border-color: var(--accent); }
.atlas-zoom button[aria-pressed="true"] { border-color: var(--accent); }
#atlas-map.dragging { cursor: grabbing; }
#atlas-map .land { fill: var(--map-land); stroke: var(--map-coast); stroke-width: .6; vector-effect: non-scaling-stroke; }
#atlas-map .grid { stroke: var(--map-grid); stroke-width: .5; vector-effect: non-scaling-stroke; fill: none; }

#atlas-map .pt { cursor: pointer; }
#atlas-map.ready .pt { transition: opacity .3s; }
#atlas-map .pt.later, #atlas-map .pt.off { opacity: 0; pointer-events: none; }
/* A dark edge on every dot: the faith colors are pale, and on the light
   themes' pale sea an edge in the sea color left them nearly invisible. */
#atlas-map .dot { fill: var(--c); stroke: rgba(0, 0, 0, .6); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
#atlas-map .dot.ev-tradition { fill: var(--map-sea); stroke: var(--c); stroke-width: 2; }
#atlas-map .ring { fill: none; stroke: var(--c); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: .7; vector-effect: non-scaling-stroke; }
#atlas-map .pt.fresh .dot { stroke: var(--read); stroke-width: 1.6; }
#atlas-map .pt.on .dot { stroke: var(--read); stroke-width: 3; }
/* Size and outline are set in user units by atlas.js, so they hold at every zoom. */
#atlas-map .pt text {
  display: none; font-weight: 600; font-family: var(--sans, system-ui); fill: var(--read);
  paint-order: stroke; stroke: var(--map-sea); stroke-linejoin: round; pointer-events: none;
}
/* Names: the chosen place always; new places once zoomed in far enough to read them. */
#atlas-map .pt.on text, #atlas-map.near .pt.fresh text { display: inline; }

.atlas-zoom { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; }
.atlas-zoom button {
  width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 17px; cursor: pointer;
}
.atlas-zoom button:hover { border-color: var(--accent); }
.atlas-hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; font-size: 13px; color: var(--text); pointer-events: none;
}

.atlas-card {
  position: absolute; right: 10px; top: 10px; width: min(340px, calc(100% - 20px));
  max-height: calc(100% - 20px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--c);
  border-radius: 10px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.3);
}
.atlas-card h3 { margin: 0 26px 2px 0; font: 600 18px var(--serif); color: var(--read); }
.atlas-card .faith { font-size: 12.5px; font-weight: 600; color: var(--c); }
.atlas-card .meta { font-size: 12.5px; color: var(--text-faint); margin-bottom: 8px; }
.atlas-card p { margin: 6px 0; font-size: 14px; }
.atlas-card blockquote {
  margin: 8px 0; padding-left: 10px; border-left: 2px solid var(--c);
  font: 14.5px/1.55 var(--serif); color: var(--read);
}
.atlas-card .src { font-size: 13px; color: var(--text-dim); }
.atlas-card .x {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; background: none;
  color: var(--text-dim); font-size: 20px; cursor: pointer;
}
.atlas-card .also { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--text-faint); }
.atlas-card .also button {
  border: 0; background: none; padding: 0 6px 0 0; color: var(--c); font-size: 12.5px; cursor: pointer; text-decoration: underline;
}

.atlas-time { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; }
.atlas-time input { flex: 1; min-width: 0; accent-color: var(--accent); }
.atlas-time output { min-width: 14ch; font: 600 15px var(--serif); color: var(--read); text-align: right; }
.atlas-play {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-size: 14px;
}
.atlas-play:hover { background: var(--accent-deep); }

.atlas-key { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; color: var(--text-dim); }
.atlas-key li { display: inline-flex; align-items: center; gap: 6px; }
.atlas-key svg { overflow: visible; }
.key-dot { fill: var(--text-dim); }
.key-ring { fill: none; stroke: var(--text-dim); stroke-width: 2; }
.key-region { fill: none; stroke: var(--text-dim); stroke-width: 1.2; stroke-dasharray: 3 3; }
.atlas .atlas-help { font-size: 13px; color: var(--text-faint); margin: 6px 0 0; }

.atlas-list { list-style: none; padding: 0; margin: 0; columns: 2 22rem; column-gap: 32px; }
.atlas-list li {
  break-inside: avoid; padding: 7px 0 7px 12px; border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid var(--c); margin-bottom: 2px; font-size: 14px; color: var(--read-2);
}
.atlas-list li[hidden] { display: none; }
.atlas-list .yr { display: inline-block; min-width: 4.8em; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.atlas-list button {
  border: 0; background: none; padding: 0; color: var(--read); font: 600 14px var(--sans, system-ui); cursor: pointer;
}
.atlas-list button:hover { color: var(--accent); }
.atlas-list .src { display: block; margin-left: 4.8em; font-size: 12.5px; color: var(--text-faint); }
.atlas-list li.later { opacity: .45; }

@media (max-width: 640px) {
  .atlas h1 { font-size: 24px; }
  #atlas-map { height: 400px; }
  .atlas-card { top: auto; bottom: 10px; max-height: 60%; }
  .atlas-time output { min-width: 11ch; font-size: 14px; }
}
