/*
  LIVING KINGDOM — CrossAIHub Atlas v1.0
  A living museum of Christian knowledge.
  Faith first. AI servant. Family first.
  King James Version verbatim only. Matthew 6 anonymity.
*/

:root {
  /* Core palette — lighter, brighter royal museum (v1.1 · 2026-07-15)
     The Director asked all shades to be closer to bright than to dark. */
  --lk-ivory:        #FDF6E5;   /* page canvas — brighter */
  --lk-ivory-soft:   #FFFAEE;   /* card canvas — near-white */
  --lk-parchment:    #F5E7C8;   /* subtle contrast surface */
  --lk-gold:         #D4A94A;   /* Christ, Nativity, sacred — lighter */
  --lk-gold-warm:    #B58628;   /* gold on light bg */
  --lk-purple:       #7A5D96;   /* royal — much lighter, warmer */
  --lk-purple-deep:  #5C3E7A;   /* headers, high-emphasis */
  --lk-wine:         #B85670;   /* accent — rose-wine, brighter */
  --lk-wine-deep:    #8B3A4F;   /* hover/pressed */
  --lk-navy:         #3A4A6C;   /* body text, footer depth — softer slate */
  --lk-navy-soft:    #5A6485;   /* muted text */

  /* Category tints */
  --cat-people:     var(--lk-wine);
  --cat-places:     var(--lk-navy);
  --cat-scripture:  var(--lk-gold-warm);

  /* Semantic tokens */
  --page-bg:        var(--lk-ivory);
  --card-bg:        var(--lk-ivory-soft);
  --text:           var(--lk-navy);
  --text-muted:     var(--lk-navy-soft);
  --link:           var(--lk-wine);
  --link-hover:     var(--lk-gold-warm);
  --sacred:         var(--lk-gold);
  --border-line:    rgba(60, 42, 85, 0.14);
  --border-strong:  rgba(60, 42, 85, 0.28);
  --shadow-soft:    0 2px 8px rgba(30, 42, 68, 0.06);
  --shadow-lifted:  0 6px 24px rgba(30, 42, 68, 0.10);

  /* Typography */
  --font-serif: "Cormorant Garamond", "Cormorant", "EB Garamond", "Georgia", serif;
  --font-body:  "Source Serif Pro", "Source Serif 4", "Georgia", "Cambria", serif;
  --font-sans:  system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Rhythm */
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;
  --content-max: 780px;
  --wide-max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Skip link */
.lk-skip {
  position: absolute; left: -10000px; top: auto;
  background: var(--lk-navy); color: var(--lk-ivory);
  padding: var(--space-3) var(--space-5);
  z-index: 999;
}
.lk-skip:focus { left: var(--space-4); top: var(--space-4); border-radius: var(--radius-s); }

/* Header — royal band */
.lk-header {
  background: linear-gradient(180deg, var(--lk-purple-deep) 0%, var(--lk-purple) 100%);
  color: var(--lk-ivory);
  border-bottom: 1px solid var(--lk-gold);
}
.lk-header .lk-header-inner {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.lk-brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--lk-ivory);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.lk-brand em {
  color: var(--lk-gold);
  font-style: normal;
  font-weight: 500;
}
.lk-nav { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.lk-nav a {
  color: var(--lk-ivory);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: var(--space-1) 0;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}
.lk-nav a:hover { color: var(--lk-gold); border-bottom-color: var(--lk-gold); }
.lk-nav a[aria-current="page"] { color: var(--lk-gold); border-bottom-color: var(--lk-gold); }

/* Hero — atrium only */
.lk-hero {
  position: relative;
  min-height: 62vh;
  background: #0F1A2E center/cover no-repeat;
  color: var(--lk-ivory);
  overflow: hidden;
  border-bottom: 2px solid var(--lk-gold);
}
.lk-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,26,46,0.10) 0%, rgba(15,26,46,0.55) 60%, rgba(15,26,46,0.85) 100%);
  pointer-events: none;
}
.lk-hero-inner {
  position: relative; z-index: 2;
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: var(--space-12) var(--space-5) var(--space-10);
  text-align: center;
}
.lk-hero h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  color: var(--lk-ivory);
  margin: 0 0 var(--space-3);
  letter-spacing: 0.01em;
}
.lk-hero h1 span {
  color: var(--lk-gold);
  font-style: italic;
}
.lk-hero p {
  color: var(--lk-ivory);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 640px;
  margin: 0 auto var(--space-5);
  opacity: 0.92;
}
.lk-hero-verse {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--lk-gold);
  margin-top: var(--space-4);
}

/* Article page top strip (per category) */
.lk-page-strip {
  height: 3px;
  background: var(--cat-color, var(--lk-gold));
}
.lk-page-strip[data-cat="people"]    { background: var(--cat-people); }
.lk-page-strip[data-cat="places"]    { background: var(--cat-places); }
.lk-page-strip[data-cat="scripture"] { background: var(--cat-scripture); }

/* Article shell */
.lk-article-shell {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-10);
}
.lk-breadcrumbs {
  font-family: var(--font-serif);
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-5);
}
.lk-breadcrumbs a { color: var(--link); text-decoration: none; }
.lk-breadcrumbs a:hover { color: var(--link-hover); }
.lk-breadcrumbs .sep { color: var(--border-strong); margin: 0 var(--space-2); }

.lk-cat-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cat-color, var(--lk-purple));
  border: 1px solid var(--cat-color, var(--lk-purple));
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  margin-bottom: var(--space-4);
}
[data-cat="people"]    .lk-cat-tag { color: var(--cat-people); border-color: var(--cat-people); }
[data-cat="places"]    .lk-cat-tag { color: var(--cat-places); border-color: var(--cat-places); }
[data-cat="scripture"] .lk-cat-tag { color: var(--cat-scripture); border-color: var(--cat-scripture); }

.lk-article-shell h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 1.15;
  color: var(--lk-purple-deep);
  margin: 0 0 var(--space-3);
}
.lk-article-shell > p:first-of-type,
.lk-article-shell .lk-lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--lk-purple);
  line-height: 1.6;
  margin: 0 0 var(--space-6);
}
.lk-article-shell section {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-line);
}
.lk-article-shell section:first-of-type { border-top: none; padding-top: 0; }
.lk-article-shell h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--lk-purple-deep);
  margin: 0 0 var(--space-3);
}
.lk-article-shell p { margin: 0 0 var(--space-4); font-size: 1.05rem; }
.lk-article-shell ul {
  padding-left: var(--space-5);
  margin: 0 0 var(--space-4);
}
.lk-article-shell li { margin: var(--space-2) 0; }
.lk-article-shell a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(139,58,79,0.35);
  transition: color 160ms ease, border-color 160ms ease;
}
.lk-article-shell a:hover { color: var(--link-hover); border-bottom-color: var(--link-hover); }

/* KJV citations — subtle gold border */
.lk-article-shell strong {
  color: var(--lk-purple-deep);
  font-weight: 600;
}
.lk-article-shell li strong + span,
.lk-article-shell li span {
  color: var(--text);
}

/* Christ Jesus link — always gold */
.lk-article-shell a[href*="/atlas/christ-jesus/"] {
  color: var(--sacred);
  border-bottom-color: var(--sacred);
  font-weight: 500;
}

/* Timeline strip (footer of each article) */
.lk-timeline {
  background: linear-gradient(180deg, var(--lk-parchment) 0%, var(--lk-ivory) 100%);
  border-top: 1px solid var(--border-line);
  padding: var(--space-6) var(--space-5);
}
.lk-timeline-inner {
  max-width: var(--wide-max);
  margin: 0 auto;
}
.lk-timeline h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--lk-purple-deep);
  margin: 0 0 var(--space-4);
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.lk-timeline-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  position: relative;
  padding: var(--space-3) 0;
}
.lk-timeline-rail::before {
  content: "";
  position: absolute;
  left: 3%; right: 3%; top: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--lk-purple) 0%, var(--lk-wine) 40%, var(--lk-gold) 55%, var(--lk-wine) 70%, var(--lk-purple) 100%);
  z-index: 0;
}
.lk-era {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-s);
  transition: background 160ms ease, transform 160ms ease;
}
.lk-era:hover { background: rgba(200, 155, 60, 0.10); transform: translateY(-1px); }
.lk-era:hover .lk-era-dot { background: var(--lk-gold); border-color: var(--lk-gold-warm); }
.lk-era:hover .lk-era-name { color: var(--lk-gold-warm); }
.lk-era-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--lk-ivory);
  border: 2px solid var(--lk-purple);
  box-shadow: var(--shadow-soft);
}
.lk-era-name {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lk-purple-deep);
  text-align: center;
  line-height: 1.2;
}
.lk-era[data-highlight="true"] .lk-era-dot {
  background: var(--lk-gold);
  border-color: var(--lk-gold-warm);
  width: 16px; height: 16px;
  box-shadow: 0 0 0 4px rgba(200, 155, 60, 0.18);
}
.lk-era[data-highlight="true"] .lk-era-name {
  color: var(--lk-gold-warm);
  font-weight: 600;
  font-size: 0.78rem;
}
.lk-timeline-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-family: var(--font-serif);
  font-style: italic;
  margin: var(--space-4) 0 0;
}
.lk-timeline-clear {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(139,58,79,0.35);
  margin-left: var(--space-2);
  font-style: normal;
}
.lk-timeline-clear:hover { color: var(--link-hover); border-bottom-color: var(--link-hover); }

/* Footer */
.lk-footer {
  background: var(--lk-navy);
  color: var(--lk-ivory);
  padding: var(--space-8) var(--space-5) var(--space-6);
  text-align: center;
  border-top: 2px solid var(--lk-gold);
}
.lk-footer-verse {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--lk-gold);
  font-size: 1.15rem;
  margin: 0 0 var(--space-3);
}
.lk-footer-meta {
  color: var(--lk-ivory);
  opacity: 0.7;
  font-size: 0.9rem;
  margin: 0;
}
.lk-footer a { color: var(--lk-gold); text-decoration: none; }
.lk-footer a:hover { text-decoration: underline; }

/* Atrium filters */
.lk-filters {
  background: var(--lk-ivory-soft);
  border-bottom: 1px solid var(--border-line);
  padding: var(--space-5);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(1.1) blur(6px);
}
.lk-filters-inner {
  max-width: var(--wide-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  justify-content: center;
}
.lk-filter {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--lk-purple-deep);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  cursor: pointer;
  transition: all 160ms ease;
}
.lk-filter:hover { border-color: var(--lk-gold); color: var(--lk-gold-warm); }
.lk-filter[aria-pressed="true"] {
  background: var(--lk-purple);
  color: var(--lk-ivory);
  border-color: var(--lk-purple);
}

.lk-search {
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  background: var(--lk-ivory);
  color: var(--text);
  min-width: 220px;
}
.lk-search:focus {
  outline: none;
  border-color: var(--lk-gold);
  box-shadow: 0 0 0 3px rgba(200, 155, 60, 0.18);
}

/* Atrium — seven worlds section */
.lk-worlds {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: var(--space-10) var(--space-5) var(--space-6);
  text-align: center;
}
.lk-worlds h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--lk-purple-deep);
  margin: 0 0 var(--space-2);
}
.lk-worlds > p {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto var(--space-6);
}
.lk-worlds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  text-align: left;
}
.lk-world {
  background: var(--card-bg);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-m);
  padding: var(--space-5);
  text-decoration: none;
  color: var(--text);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.lk-world:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lifted);
  border-color: var(--lk-gold);
}
.lk-world .lk-world-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lk-parchment);
  color: var(--lk-purple-deep);
  font-family: var(--font-serif);
  font-weight: 600;
}
.lk-world h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--lk-purple-deep);
}
.lk-world p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Atrium — knowledge grid */
.lk-grid-section {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-10);
}
.lk-grid-section h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  color: var(--lk-purple-deep);
  margin: 0 0 var(--space-4);
  text-align: center;
}
.lk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}
.lk-card {
  background: var(--card-bg);
  border: 1px solid var(--border-line);
  border-left: 4px solid var(--cat-color, var(--lk-purple));
  border-radius: var(--radius-m);
  padding: var(--space-4) var(--space-5);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.lk-card[data-cat="people"]    { border-left-color: var(--cat-people); }
.lk-card[data-cat="places"]    { border-left-color: var(--cat-places); }
.lk-card[data-cat="scripture"] { border-left-color: var(--cat-scripture); }
.lk-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lifted);
  border-color: var(--lk-gold);
}
.lk-card .lk-card-cat {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lk-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--lk-purple-deep);
  margin: 0;
}
.lk-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}
.lk-card.lk-featured {
  border-left-color: var(--lk-gold);
  background: linear-gradient(135deg, var(--lk-ivory-soft) 0%, var(--lk-parchment) 100%);
}
.lk-card.lk-featured h3 { color: var(--lk-gold-warm); }

.lk-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-6);
  font-style: italic;
}

/* Return path (bottom of article) */
.lk-return {
  max-width: var(--content-max);
  margin: var(--space-8) auto 0;
  padding: var(--space-5);
  text-align: center;
}
.lk-return a {
  display: inline-block;
  font-family: var(--font-serif);
  color: var(--lk-purple-deep);
  text-decoration: none;
  border: 1px solid var(--lk-purple);
  border-radius: 999px;
  padding: var(--space-2) var(--space-5);
  transition: all 160ms ease;
}
.lk-return a:hover {
  background: var(--lk-purple);
  color: var(--lk-ivory);
}

/* Mobile */
@media (max-width: 720px) {
  html { font-size: 16px; }
  .lk-header-inner { justify-content: center; }
  .lk-nav { justify-content: center; gap: var(--space-3); }
  .lk-hero-inner { padding: var(--space-8) var(--space-4); }
  .lk-article-shell { padding: var(--space-6) var(--space-4) var(--space-8); }
  .lk-timeline-rail { flex-wrap: wrap; }
  .lk-timeline-rail::before { display: none; }
  .lk-era { flex: 1 0 30%; padding: var(--space-2); }
  .lk-worlds-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .lk-grid { grid-template-columns: 1fr; }
  .lk-filters { position: static; }
  .lk-search { min-width: 0; width: 100%; max-width: 320px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Print */
@media print {
  .lk-header, .lk-footer, .lk-timeline, .lk-filters, .lk-return { display: none; }
  body { background: white; color: black; }
  .lk-article-shell { max-width: none; padding: 0; }
}
