/* ============================================================
   ATLAS PAGE — shared subpage design layer
   Generalises the "Wisdom and Spirit" library aesthetic so every
   subpage reads as one publication. Loaded AFTER style.css
   (and after events-page-styles.css where that applies).
   Everything is scoped to .atlas-page.
   ============================================================ */

.atlas-page {
  --atlas-red: #990403;
  --atlas-red-bright: #c41e1c;
  --atlas-red-deep: #4a0000;
  --gold: #d4af37;
  --gold-soft: #e6cf92;
  --ink: #0f0303;
  --line: rgba(212, 175, 55, 0.18);
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f5eeec;
  --text-dim: #b8a5a1;
  --text-faint: #8a7873;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  margin: 0;
  padding: 0;
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-align: left;
}

/* Ambient light — a slow oxblood glow behind everything */
.atlas-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  width: auto;
  height: auto;
  transform: none;
  opacity: 1;
  background-image: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(153, 4, 3, 0.34) 0%, transparent 62%),
    radial-gradient(ellipse 60% 40% at 88% 12%, rgba(212, 175, 55, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 8% 78%, rgba(74, 0, 0, 0.42) 0%, transparent 62%);
}

/* Fine grain so the dark field never reads as flat */
.atlas-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px);
}

/* ---------- Top bar ---------- */

.atlas-page .topbar {
  background-color: rgba(15, 3, 3, 0.82);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  padding: 12px 26px;
}

.atlas-page .topbar h1 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--text);
}

.atlas-page .topbar .language-switcher .lang-link {
  color: var(--text-dim);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  padding: 3px 2px;
  transition: color 0.25s ease;
}

.atlas-page .topbar .language-switcher .lang-link.active,
.atlas-page .topbar .language-switcher .lang-link:hover {
  color: var(--gold);
}

.atlas-page .topbar .language-switcher span {
  color: rgba(255, 255, 255, 0.2);
}

/* ---------- Shell ---------- */

.atlas-page .page-shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px 110px;
  box-sizing: border-box;
  text-align: left;
  background: none;
}

/* A narrower measure for pages that are mostly prose */
.atlas-page .page-shell.shell-narrow {
  max-width: 940px;
}

/* ---------- Masthead ---------- */

.atlas-page .page-hero {
  padding: 104px 0 62px;
  text-align: center;
  animation: atlasRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  background: none;
  border: none;
  max-width: none;
  margin: 0;
}

.atlas-page .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 26px;
}

.atlas-page .hero-eyebrow::before,
.atlas-page .hero-eyebrow::after {
  content: "";
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.atlas-page .hero-eyebrow::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.atlas-page .page-hero h2 {
  font-family: var(--serif);
  font-size: clamp(46px, 7.4vw, 92px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.012em;
  margin: 0 0 8px;
  color: #fffaf8;
  text-transform: none;
  text-shadow: none;
}

.atlas-page .page-hero h2 em {
  font-style: italic;
  font-weight: 300;
  background: linear-gradient(100deg, var(--gold-soft) 8%, var(--gold) 42%, #b08d27 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}

.atlas-page .hero-rule {
  width: 100%;
  max-width: 340px;
  height: 1px;
  margin: 34px auto 30px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  position: relative;
}

.atlas-page .hero-rule::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--gold);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.65);
}

.atlas-page .page-hero p {
  max-width: 660px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.78;
  color: var(--text-dim);
  font-weight: 300;
  text-transform: none;
  letter-spacing: normal;
}

/* ---------- Section blocks (mirrors the library's frame headers) ---------- */

.atlas-page .page-section {
  padding-top: 74px;
  scroll-margin-top: 150px;
}

.atlas-page .section-head {
  display: flex;
  align-items: baseline;
  gap: 22px;
  padding-bottom: 20px;
  margin-bottom: 38px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.atlas-page .section-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 96px;
  height: 2px;
  background: var(--section-accent, var(--atlas-red));
  box-shadow: 0 0 16px var(--section-glow, rgba(153, 4, 3, 0.6));
}

.atlas-page .section-numeral {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--section-accent, var(--atlas-red));
  padding-top: 6px;
  flex-shrink: 0;
}

.atlas-page .section-heading {
  flex: 1;
  min-width: 0;
}

.atlas-page .section-heading h3 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 400;
  letter-spacing: 0.008em;
  margin: 0 0 7px;
  color: #fffaf8;
  text-transform: none;
}

.atlas-page .section-heading p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-dim);
  font-weight: 300;
  max-width: 640px;
}

.atlas-page .section-count {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

/* Accent tokens, echoing the library's three frames */
.atlas-page .accent-red  { --section-accent: var(--atlas-red-bright); --section-glow: rgba(196, 30, 28, 0.55); }
.atlas-page .accent-grey { --section-accent: #9aa0a6; --section-glow: rgba(154, 160, 166, 0.4); }
.atlas-page .accent-gold { --section-accent: var(--gold); --section-glow: rgba(212, 175, 55, 0.5); }

/* ---------- The shared card ---------- */

.atlas-page .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px;
  max-width: none;
  margin: 0;
}

.atlas-page .atlas-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 34px 30px 32px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: linear-gradient(165deg, rgba(27, 7, 7, 0.86) 0%, rgba(16, 3, 3, 0.86) 70%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  text-align: left;
  overflow: hidden;
  animation: atlasRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease;
}

/* The hairline that lights up on hover — the library's plate edge */
.atlas-page .atlas-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--card-accent, var(--atlas-red)), transparent);
  opacity: 0.5;
  transition: opacity 0.4s ease;
}

.atlas-page .atlas-card:hover,
.atlas-page .atlas-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.12);
  outline: none;
}

.atlas-page .atlas-card:hover::before,
.atlas-page .atlas-card:focus-visible::before {
  opacity: 1;
}

.atlas-page .card-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
  opacity: 0.85;
}

.atlas-page .atlas-card h3,
.atlas-page .atlas-card h4 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: 0.005em;
  margin: 0 0 14px;
  color: #fffaf8;
  text-transform: none;
}

.atlas-page .atlas-card p {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.75;
  font-weight: 300;
  color: var(--text-dim);
}

.atlas-page .atlas-card p:last-child {
  margin-bottom: 0;
}

.atlas-page .atlas-card sup {
  color: var(--gold);
  font-size: 0.68em;
  letter-spacing: 0.06em;
}

.atlas-page .atlas-card ol,
.atlas-page .atlas-card ul {
  margin: 0 0 4px;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.75;
  font-weight: 300;
}

.atlas-page .atlas-card li {
  margin-bottom: 12px;
}

.atlas-page .atlas-card li::marker {
  color: var(--gold);
}

.atlas-page .atlas-card strong {
  color: var(--text);
  font-weight: 600;
}

/* Card that is itself a link */
.atlas-page a.atlas-card {
  text-decoration: none;
  color: inherit;
}

.atlas-page .card-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  transition: gap 0.3s ease, color 0.3s ease;
}

.atlas-page .card-link::after {
  content: "\2192";
  letter-spacing: 0;
}

.atlas-page .card-link:hover,
.atlas-page .atlas-card:hover .card-link {
  gap: 15px;
  color: var(--gold-soft);
}

/* ---------- Prose blocks (long-form guidance) ---------- */

.atlas-page .prose-card {
  padding: 38px 40px 34px;
}

.atlas-page .prose-card h3 {
  font-size: 28px;
}

/* ---------- Reference / citation list ---------- */

.atlas-page .references-section {
  margin-top: 84px;
  padding: 38px 40px 34px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.26);
  box-shadow: none;
  max-width: none;
  text-align: left;
}

.atlas-page .references-section h3 {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 24px;
  border: none;
  padding: 0;
}

.atlas-page .references-section ol {
  margin: 0;
  padding-left: 20px;
}

.atlas-page .references-section li {
  margin-bottom: 16px;
  font-size: 13.5px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--text-faint);
}

.atlas-page .references-section li::marker {
  color: var(--gold);
}

.atlas-page .references-section li:last-child {
  margin-bottom: 0;
}

.atlas-page .references-section a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.atlas-page .references-section a:hover {
  color: var(--gold-soft);
  border-bottom-color: var(--gold);
}

.atlas-page .references-section em {
  color: var(--text-dim);
}

/* ---------- Closing mark ---------- */

.atlas-page .page-coda {
  margin-top: 100px;
  padding-top: 46px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}

.atlas-page .page-coda blockquote {
  margin: 0 auto;
  max-width: 620px;
  font-family: var(--serif);
  font-size: clamp(20px, 2.5vw, 27px);
  font-style: italic;
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-dim);
}

.atlas-page .page-coda cite {
  display: block;
  margin-top: 18px;
  font-family: var(--sans);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Motion ---------- */

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

@media (prefers-reduced-motion: reduce) {
  .atlas-page *,
  .atlas-page *::before,
  .atlas-page *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .atlas-page .page-shell { padding: 0 22px 80px; }
  .atlas-page .page-hero { padding: 84px 0 48px; }

  .atlas-page .section-head {
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .atlas-page .section-count { width: 100%; }

  .atlas-page .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
  }

  .atlas-page .prose-card,
  .atlas-page .references-section { padding: 30px 26px 28px; }
}

@media (max-width: 560px) {
  .atlas-page .page-shell { padding: 0 16px 64px; }
  .atlas-page .page-hero { padding: 70px 0 40px; }

  .atlas-page .hero-eyebrow {
    letter-spacing: 0.28em;
    font-size: 9.5px;
  }

  .atlas-page .hero-eyebrow::before,
  .atlas-page .hero-eyebrow::after { width: 24px; }

  .atlas-page .page-hero p { font-size: 15px; }

  .atlas-page .page-section { padding-top: 56px; }
  .atlas-page .section-numeral { display: none; }

  .atlas-page .card-grid { grid-template-columns: 1fr; }
  .atlas-page .atlas-card { padding: 28px 22px 26px; }
  .atlas-page .atlas-card h3,
  .atlas-page .atlas-card h4 { font-size: 22px; }

  .atlas-page .page-coda { margin-top: 70px; }
}
