/*
 * CrossAIHub · Living Atlas · World Map · v1.0
 * ---------------------------------------------
 * Standalone stylesheet for /atlas/map/.
 * Palette + typography inherited from CrossAIHub House Bible.
 *
 * Peace be to this house.
 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #FDFBF5;
  color: #2B2418;
  font-family: 'Cormorant Garamond', Georgia, serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.atlas-map__skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.atlas-map__skip:focus {
  left: 8px;
  top: 8px;
  background: #6B1F2E;
  color: #FDFBF5;
  padding: 8px 12px;
  z-index: 100;
  font-family: 'Inter', system-ui, sans-serif;
  text-decoration: none;
  border-radius: 4px;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */

.atlas-map__header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #E7DFC7;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.atlas-map__wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #6B1F2E;
  width: fit-content;
}
.atlas-map__wordmark-cross { width: 28px; height: 28px; }
.atlas-map__wordmark-text { display: flex; flex-direction: column; line-height: 1.1; }
.atlas-map__wordmark-name { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.15rem; font-weight: 500; }
.atlas-map__wordmark-tag { font-family: 'Inter', system-ui, sans-serif; font-size: 0.7rem; color: #3C2E1B; letter-spacing: 0.04em; }

.atlas-map__breadcrumb {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  color: #3C2E1B;
}
.atlas-map__breadcrumb a {
  color: #6B1F2E;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.atlas-map__breadcrumb a:hover,
.atlas-map__breadcrumb a:focus-visible { border-bottom-color: #B48748; }

/* ─── Main + hero ─────────────────────────────────────────────────────────── */

.atlas-map__main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.atlas-map__hero {
  text-align: center;
  padding: 2rem 0 2rem;
  border-bottom: 1px solid #E7DFC7;
  margin-bottom: 2rem;
}

.atlas-map__kicker {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #B48748;
  margin: 0 0 0.75rem;
}

.atlas-map__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 500;
  color: #6B1F2E;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.atlas-map__lede {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-style: italic;
  color: #3C2E1B;
  margin: 0 auto;
  max-width: 640px;
}

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

.atlas-map__surface {
  position: relative;
  margin-bottom: 3rem;
}

.atlas-map__canvas {
  position: relative;
  width: 100%;
  border: 1px solid #E7DFC7;
  border-radius: 12px;
  overflow: hidden;
  background: #F1E5C7;
  box-shadow: 0 2px 12px rgba(43, 36, 24, 0.06);
}

#atlas-map-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 300px;
}

/* ─── Markers ─────────────────────────────────────────────────────────────── */

.atlas-map__marker {
  cursor: pointer;
  outline: none;
}

.atlas-map__marker-ring {
  fill: none;
  stroke: #B48748;
  stroke-width: 1.5;
  opacity: 0.65;
  transform-origin: center;
  transform-box: fill-box;
  animation: atlas-map-pulse 2.4s ease-in-out infinite;
}

@keyframes atlas-map-pulse {
  0%   { transform: scale(1);   opacity: 0.65; }
  50%  { transform: scale(1.3); opacity: 0.15; }
  100% { transform: scale(1);   opacity: 0.65; }
}

.atlas-map__marker-dot {
  fill: #6B1F2E;
  stroke: #FDFBF5;
  stroke-width: 1.5;
  transition: fill 200ms ease;
}

.atlas-map__marker:hover .atlas-map__marker-dot,
.atlas-map__marker:focus .atlas-map__marker-dot {
  fill: #B48748;
}

.atlas-map__marker:focus-visible .atlas-map__marker-dot {
  stroke-width: 3;
}

.atlas-map__marker-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 11px;
  font-weight: 500;
  fill: #3C2E1B;
  pointer-events: none;
  opacity: 0.85;
}

/* Hide labels on very small screens (touch tap opens card without needing label) */
@media (max-width: 640px) {
  .atlas-map__marker-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-map__marker-ring {
    animation: none;
    opacity: 0.65;
  }
}

/* ─── Summary card ────────────────────────────────────────────────────────── */

.atlas-map__card {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 380px;
  max-width: calc(100% - 2rem);
  max-height: calc(100% - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
  background: #FDFBF5;
  border: 1px solid #B48748;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(43, 36, 24, 0.15);
  z-index: 10;
}

.atlas-map__card[hidden] { display: none; }

.atlas-map__card-kicker {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #B48748;
  margin: 0 0 0.5rem;
}

.atlas-map__card-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #6B1F2E;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.atlas-map__card-biblical-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: #3C2E1B;
  margin: 0 0 1rem;
}

.atlas-map__card-verse {
  margin: 1rem 0 0.25rem;
  padding: 0 0.5rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: #2B2418;
  border-left: 2px solid #B48748;
  padding-left: 1rem;
}

.atlas-map__card-cite {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #B48748;
  margin: 0 0 1rem;
  padding-left: 1rem;
  letter-spacing: 0.03em;
}

.atlas-map__card-summary {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  color: #2B2418;
  margin: 0 0 1rem;
  line-height: 1.55;
}

.atlas-map__card-chips {
  margin: 1rem 0;
}

.atlas-map__card-chip-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.atlas-map__card-chip-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3C2E1B;
}

.atlas-map__card-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.atlas-map__card-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid;
  border-radius: 999px;
  transition: background 180ms ease;
}

.atlas-map__card-chip--person {
  color: #FDFBF5;
  background: #6B1F2E;
  border-color: #6B1F2E;
}
.atlas-map__card-chip--person:hover { background: #571825; }

.atlas-map__card-chip--event {
  color: #FDFBF5;
  background: #B48748;
  border-color: #B48748;
}
.atlas-map__card-chip--event:hover { background: #9F753C; }

.atlas-map__card-reflection {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid #B48748;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #2B2418;
  background: #F6EFDC;
  border-radius: 0 6px 6px 0;
}

.atlas-map__card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.atlas-map__card-action {
  padding: 0.5rem 1rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid;
  cursor: pointer;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.atlas-map__card-action--primary {
  color: #FDFBF5;
  background: #6B1F2E;
  border-color: #6B1F2E;
}
.atlas-map__card-action--primary:hover,
.atlas-map__card-action--primary:focus-visible {
  background: #571825;
}

.atlas-map__card-action--secondary {
  color: #6B1F2E;
  background: transparent;
  border-color: #6B1F2E;
}
.atlas-map__card-action--secondary:hover,
.atlas-map__card-action--secondary:focus-visible {
  background: #6B1F2E;
  color: #FDFBF5;
}

/* Mobile card: full-width slide-up */
@media (max-width: 640px) {
  .atlas-map__card {
    position: fixed;
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: 70vh;
    border-radius: 12px 12px 0 0;
    z-index: 100;
  }
}

/* ─── Fallback list ───────────────────────────────────────────────────────── */

.atlas-map__fallback {
  margin-top: 2rem;
  padding: 2rem 1.5rem;
  background: #F6EFDC;
  border: 1px solid #E7DFC7;
  border-radius: 12px;
}

.atlas-map__fallback-note {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  color: #3C2E1B;
  font-style: italic;
  margin: 0 0 1.5rem;
}

.atlas-map__fallback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.atlas-map__fallback-region h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #6B1F2E;
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #B48748;
}

.atlas-map__fallback-region ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.atlas-map__fallback-region li {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.35rem 0;
  border-bottom: 1px solid #E7DFC7;
}

.atlas-map__fallback-region li:last-child {
  border-bottom: none;
}

.atlas-map__fallback-region a {
  color: #6B1F2E;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.atlas-map__fallback-region a:hover,
.atlas-map__fallback-region a:focus-visible {
  border-bottom-color: #B48748;
}

/* ─── Pathways ────────────────────────────────────────────────────────────── */

.atlas-map__pathways {
  margin-top: 3rem;
  padding: 2rem;
  background: #F6EFDC;
  border: 1px solid #E7DFC7;
  border-radius: 12px;
  text-align: center;
}

.atlas-map__pathways-kicker {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #B48748;
  margin: 0 0 0.5rem;
}

.atlas-map__pathways-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #6B1F2E;
  margin: 0 0 1.5rem;
}

.atlas-map__pathways-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.atlas-map__pathway {
  padding: 0.6rem 1.25rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6B1F2E;
  background: #FDFBF5;
  border: 1px solid #6B1F2E;
  border-radius: 999px;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.atlas-map__pathway:hover,
.atlas-map__pathway:focus-visible {
  background: #6B1F2E;
  color: #FDFBF5;
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */

.atlas-map__footer {
  border-top: 1px solid #E7DFC7;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #F6EFDC;
  margin-top: 3rem;
}

.atlas-map__footer-blessing {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-style: italic;
  color: #6B1F2E;
  margin: 0 0 0.5rem;
}

.atlas-map__footer-note {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  color: #3C2E1B;
  margin: 0 0 0.75rem;
  letter-spacing: 0.04em;
}

.atlas-map__footer-nav {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  margin: 0;
}

.atlas-map__footer-nav a {
  color: #6B1F2E;
  text-decoration: none;
}
.atlas-map__footer-nav a:hover,
.atlas-map__footer-nav a:focus-visible {
  border-bottom: 1px solid #B48748;
}

/* ─── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .atlas-map__title { font-size: 1.75rem; }
  .atlas-map__lede { font-size: 1rem; }
  .atlas-map__hero { padding: 1rem 0 1.5rem; }
  .atlas-map__main { padding: 1.5rem 1rem; }
  .atlas-map__pathways { padding: 1.5rem 1rem; }
}

/* ─── Print ───────────────────────────────────────────────────────────────── */

@media print {
  #atlas-map-svg,
  .atlas-map__card,
  .atlas-map__pathways {
    display: none;
  }
}
