/* ═══════════════════════════════════════════════════════════
   ROOTED STARS: GRIMOIRE REDESIGN
   Threshold Magic. Whisp's Forest. Hekate's Keys.
   ═══════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════
   CRESCENT MOON BACK-TO-TOP BUTTON
   ═══════════════════════════════════════════════════════════ */

.moon-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border: none;
  background: radial-gradient(circle at 30% 50%, transparent 45%, var(--color-moon) 45%);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.moon-top:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 20px rgba(245, 241, 232, 0.2);
}

.moon-top.show {
  opacity: 1;
  visibility: visible;
}

@media screen and (max-width: 600px) {
  .moon-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
  }
}



@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Crimson+Text:ital@0;1&display=swap');

/* ═══════════════════════════════════════════════════════════
   COLOR PALETTE
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Threshold colors: twilight, forest, stone, fire */
  --color-deep-night: #1a1410;
  --color-forest: #2d3a2e;
  --color-stone: #3e3b38;
  --color-charcoal: #2f2a24;
  
  /* Warm accents: copper, gold, candlelight */
  --color-copper: #b8860b;
  --color-gold: #d4a574;
  --color-warm: #f0e8e0;
  --color-cream: #fffcf4;
  
  /* Secondary: whisp colors, moon, threshold */
  --color-whisp-blue: #4a5f7f;
  --color-moon: #f5f1e8;
  --color-accent: #c7b591;
  
  /* Text - increased brightness */
  --text-primary: #e0d9d0;
  --text-secondary: #d4cfc8;
  --text-light: #c5beb6;
  --text-pale: #a89f96;
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL STYLES
   ═══════════════════════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Crimson Text', serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-primary);
  background: linear-gradient(135deg, #2d2620 0%, #1a1410 50%, #261f1a 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Subtle texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(255, 255, 255, 0.02) 4px
    );
  pointer-events: none;
  z-index: -1;
}

/* ═══════════════════════════════════════════════════════════
   CONTAINER & LAYOUT
   ═══════════════════════════════════════════════════════════ */

#container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--color-copper);
  text-align: center;
}

#content {
  flex: 1;
  margin-bottom: 2rem;
}

#footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px dashed var(--color-accent);
  text-align: center;
  opacity: 0.7;
  font-size: 0.9em;
}

/* ═══════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════ */

h1 {
  font-family: 'Caveat', cursive;
  font-size: 3em;
  font-weight: 700;
  color: var(--color-warm);
  margin-bottom: 0.5em;
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
  font-family: 'Caveat', cursive;
  font-size: 2em;
  color: var(--color-gold);
  margin: 1.5em 0 0.8em 0;
  letter-spacing: 0.03em;
}

h3 {
  font-family: 'Caveat', cursive;
  font-size: 1.5em;
  color: var(--color-accent);
  margin: 1.2em 0 0.6em 0;
}

p {
  margin: 1em 0;
  color: var(--text-secondary);
  line-height: 1.8;
  opacity: 1;
}

strong {
  color: var(--color-warm);
  font-weight: 600;
}

a {
  color: var(--color-gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.25s ease;
  position: relative;
}

a:hover {
  color: var(--color-warm);
  border-bottom-color: var(--color-copper);
}

/* ═══════════════════════════════════════════════════════════
   CARDS & CONTAINERS
   ═══════════════════════════════════════════════════════════ */

.card {
  background: rgba(42, 36, 31, 0.6);
  border: 1px solid var(--color-copper);
  border-radius: 4px;
  padding: 1.8em;
  margin: 1.5em 0;
  box-shadow: 
    inset 0 0 20px rgba(255, 255, 255, 0.02),
    0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.card p {
  color: #e0d9d0;
}

.card strong {
  color: var(--color-warm);
  font-weight: 600;
}

.card:hover {
  border-color: var(--color-gold);
  box-shadow: 
    inset 0 0 30px rgba(212, 165, 116, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

.card-featured {
  background: linear-gradient(135deg, rgba(74, 95, 127, 0.3) 0%, rgba(42, 36, 31, 0.7) 100%);
  border: 2px solid var(--color-whisp-blue);
  padding: 2.2em;
}

.card-featured:hover {
  border-color: var(--color-gold);
}

/* ═══════════════════════════════════════════════════════════
   FEATURED SECTION (WHISP & HEKATE)
   ═══════════════════════════════════════════════════════════ */

.threshold-welcome {
  text-align: center;
  margin-bottom: 3rem;
}

.threshold-welcome p {
  font-size: 1.15em;
  color: var(--color-warm);
  line-height: 1.8;
  max-width: 700px;
  margin: 1.5em auto;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2em;
  margin: 2.5em 0;
}

.feature-card {
  background: rgba(42, 36, 31, 0.7);
  border: 2px solid var(--color-copper);
  border-radius: 8px;
  padding: 2em;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover {
  border-color: var(--color-gold);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card h2 {
  position: relative;
  z-index: 1;
  font-size: 1.6em;
  margin-bottom: 0.8em;
}

.feature-card p {
  position: relative;
  z-index: 1;
  font-size: 0.95em;
  line-height: 1.6;
  margin: 0.8em 0;
  color: #d4cfc8;
}

.feature-card .card-link {
  display: inline-block;
  position: relative;
  z-index: 1;
  margin-top: 1.2em;
  padding: 0.6em 1.4em;
  border: 1px solid var(--color-copper);
  border-radius: 4px;
  color: var(--color-gold);
  transition: all 0.2s ease;
}

.feature-card .card-link:hover {
  background: rgba(184, 134, 11, 0.1);
  border-color: var(--color-gold);
  color: var(--color-warm);
}

/* ═══════════════════════════════════════════════════════════
   NAVIGATION & PATHWAYS
   ═══════════════════════════════════════════════════════════ */

.pathways-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.8em;
  margin: 3em 0;
}

.pathway-card {
  background: rgba(47, 42, 36, 0.8);
  border: 2px solid var(--color-accent);
  border-radius: 6px;
  padding: 2em 1.5em;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.pathway-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--color-copper) 0%, transparent 100%);
  opacity: 0;
  border-radius: 6px;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.pathway-card:hover {
  border-color: var(--color-gold);
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(180, 100, 11, 0.2);
}

.pathway-card a {
  display: block;
  text-decoration: none;
}

.pathway-card h3 {
  color: var(--color-warm);
  margin-bottom: 0.6em;
  margin-top: 0;
  font-size: 1.3em;
}

.pathway-card p {
  font-size: 0.9em;
  color: var(--text-light);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   PRACTICE CARDS (for posts, spells, sigils)
   ═══════════════════════════════════════════════════════════ */

.practice-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5em;
  margin: 2em 0;
}

.practice-card {
  background: rgba(42, 36, 31, 0.6);
  border-left: 4px solid var(--color-copper);
  padding: 1.5em;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.practice-card.spell {
  border-left-color: #d4a574;
}

.practice-card.sigil {
  border-left-color: #c7b591;
}

.practice-card.journal {
  border-left-color: #4a5f7f;
}

.practice-card.devotion {
  border-left-color: #b8860b;
}

.practice-card h3 {
  margin-top: 0;
  font-size: 1.15em;
}

.practice-card .card-meta {
  font-size: 0.85em;
  color: var(--text-pale);
  margin-bottom: 0.8em;
}

.practice-card p {
  font-size: 0.95em;
  color: #d4cfc8;
}

.practice-card .card-meta {
  font-size: 0.85em;
  color: #b8b0a8;
  margin-bottom: 0.8em;
}

/* ═══════════════════════════════════════════════════════════
   ALTAR & INTERACTIVE
   ═══════════════════════════════════════════════════════════ */

.altar-stage {
  position: relative;
  max-width: 800px;
  margin: 2em auto;
  border: 3px solid var(--color-copper);
  border-radius: 8px;
  background: rgba(42, 36, 31, 0.8);
  box-shadow: 
    inset 0 0 40px rgba(180, 134, 11, 0.1),
    0 16px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.altar-bg {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0.95) contrast(1.05);
}

.altar-object {
  position: absolute;
  cursor: pointer;
  transition: all 0.2s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.altar-object:hover,
.altar-object:focus {
  filter: drop-shadow(0 8px 16px rgba(184, 134, 11, 0.3));
  transform: scale(1.08) translateY(-4px);
}

.altar-object img {
  width: 100%;
  height: auto;
  display: block;
}

.altar-object span {
  display: inline-block;
  position: absolute;
  bottom: -1.8em;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-charcoal);
  color: var(--color-gold);
  padding: 0.4em 0.8em;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'Crimson Text', serif;
  border: 1px solid var(--color-copper);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.altar-object:hover span {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media screen and (max-width: 768px) {
  h1 {
    font-size: 2.2em;
  }

  #container {
    padding: 1.5rem 1rem;
  }

  .featured-grid {
    grid-template-columns: 1fr;
    gap: 1.5em;
  }

  .pathways-grid {
    grid-template-columns: 1fr;
  }

  .practice-card-container {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 600px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.8em;
  }

  h2 {
    font-size: 1.4em;
  }

  #container {
    padding: 1rem;
  }

  .card {
    padding: 1.2em;
  }

  .feature-card {
    padding: 1.4em;
  }

  .threshold-welcome p {
    font-size: 1em;
  }
}


/* ═══════════════════════════════════════════════════════════
   ROOTED STARS: THREE-COLUMN GRIMOIRE BUILD
   Uses the existing redesign palette; does not alter colors.
   ═══════════════════════════════════════════════════════════ */

#container {
  max-width: 1180px;
}

.rs-layout-grid {
  display: grid;
  grid-template-columns: minmax(150px, 205px) minmax(0, 1fr) minmax(150px, 205px);
  grid-template-areas: "left main right";
  gap: 1.15rem;
  align-items: start;
  width: 100%;
}

.rs-sidebar-left { grid-area: left; }
#content { grid-area: main; min-width: 0; }
.rs-sidebar-right { grid-area: right; }

.rs-sidebar {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rs-widget {
  background: rgba(42, 36, 31, 0.72);
  border: 1px solid var(--color-copper);
  border-radius: 6px;
  padding: 0.8rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 0 24px rgba(184, 134, 11, 0.05);
}

.rs-widget h2 {
  margin: -0.2rem -0.2rem 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--color-accent);
  color: var(--color-gold);
  font-size: 1.35em;
  text-align: center;
}

.rs-widget h2::before { content: "☾ "; opacity: 0.85; }
.rs-widget h2::after { content: " ☽"; opacity: 0.85; }

.rs-widget a {
  display: block;
  padding: 0.22rem 0.35rem;
  margin: 0.16rem 0;
  color: var(--text-secondary);
  border-bottom: 1px dotted rgba(199, 181, 145, 0.35);
}

.rs-widget a:hover {
  color: var(--color-warm);
  background: rgba(184, 134, 11, 0.12);
  border-bottom-color: var(--color-gold);
}

.rs-widget p {
  margin: 0.35rem 0;
  font-size: 0.92em;
  line-height: 1.45;
  color: var(--text-light);
}

.rs-recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rs-recent-list li {
  margin: 0.12rem 0;
}

.rs-widget-more {
  margin-top: 0.5rem !important;
  text-align: center;
  color: var(--color-gold) !important;
}

.rs-button-row {
  display: grid;
  gap: 0.35rem;
}

.rs-button-row span {
  display: block;
  text-align: center;
  padding: 0.18rem 0.35rem;
  border: 1px solid var(--color-accent);
  color: var(--color-warm);
  background: rgba(26, 20, 16, 0.72);
  font-size: 0.9em;
}

/* Archive tag spacing fix */
.post-tags,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  align-items: center;
  margin-top: 0.45rem;
}

.post-tags .tag,
.tag-cloud .tag,
.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  padding: 0.12rem 0.5rem;
  border: 1px solid rgba(199, 181, 145, 0.45);
  border-radius: 999px;
  background: rgba(184, 134, 11, 0.12);
  color: var(--text-secondary);
  font-size: 0.86em;
  line-height: 1.25;
  white-space: nowrap;
}

#postlistdiv li {
  margin-bottom: 1rem;
}

.tag-filter-message {
  margin: 1rem 0;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--color-copper);
  background: rgba(42, 36, 31, 0.58);
  color: var(--text-secondary);
}

/* Template/code readability fix */
.snippet-card {
  background: rgba(42, 36, 31, 0.64);
  border: 1px solid var(--color-copper);
  border-radius: 6px;
  padding: 1.1rem;
  margin: 1.2rem 0;
}

.snippet-card h2 {
  margin-top: 0;
}

pre,
code,
.snippet-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

pre.snippet-code,
.snippet-code,
.snippet-card pre {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(26, 20, 16, 0.82);
  color: var(--text-secondary);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  padding: 1rem;
  margin: 0.8rem 0;
}

.snippet-card code:not(pre code) {
  background: rgba(26, 20, 16, 0.72);
  color: var(--color-warm);
  border: 1px solid rgba(199, 181, 145, 0.35);
  padding: 0.08rem 0.28rem;
  border-radius: 3px;
}

/* ═══════════════════════════════════════════════════════════
   LIBRARY CARDS (sigils, spells, posts)
   ═══════════════════════════════════════════════════════════ */

.library-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2em;
  margin: 2em 0;
  width: 100%;
}

.library-card {
  background: rgba(42, 36, 31, 0.6);
  border: 1px solid var(--color-copper);
  border-radius: 6px;
  padding: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  transition: all 0.3s ease;
}

.library-card:hover {
  border-color: var(--color-gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px);
}

.library-card img {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  display: block !important;
  border-radius: 4px;
  object-fit: contain;
}

.library-card h2 {
  margin: 0.5em 0 0.3em 0;
  font-size: 1.3em;
}

.library-card h2 a {
  color: var(--color-gold);
}

.library-card h2 a:hover {
  color: var(--color-warm);
}

.library-card p {
  margin: 0.5em 0;
  font-size: 0.95em;
  color: var(--text-secondary);
  flex-grow: 1;
}

.library-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: auto;
}

.library-label,
.sigil-status {
  display: inline-block;
  padding: 0.25em 0.6em;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  font-size: 0.85em;
  color: var(--text-light);
  background: rgba(184, 134, 11, 0.08);
}

.sigil-status {
  border-color: var(--color-copper);
  background: rgba(184, 134, 11, 0.15);
}

.sigil-status.status-active {
  color: var(--color-warm);
  border-color: var(--color-gold);
}

.sigil-status.status-template {
  color: var(--text-pale);
  border-color: var(--color-accent);
}

/* Mobile: stack library cards */
@media screen and (max-width: 768px) {
  .library-card-grid {
    grid-template-columns: 1fr;
    gap: 1.5em;
  }
  
  .library-card {
    padding: 1em;
  }
}

@media screen and (max-width: 600px) {
  .library-card-grid {
    gap: 1em;
    margin: 1em 0;
  }
  
  .library-card {
    padding: 0.8em;
  }
  
  .library-card img {
    max-height: 280px;
  }
  
  .library-card h2 {
    font-size: 1.1em;
  }
}

/* Sigil and post image sizing */
.sigil-image-frame {
  max-width: 500px !important;
  margin: 1.5em auto !important;
  padding: 1em;
  text-align: center;
}

.sigil-image-frame img {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 0 auto !important;
  border-radius: 4px;
}

/* Alphabet of Desire and similar reference pages */
.glyph-display {
  max-width: 600px !important;
  margin: 2em auto !important;
  padding: 1em;
  display: block !important;
}

.glyph-display img {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 0 auto !important;
}

/* Catch-all for center-wrapped images */
center img {
  max-width: 90vw !important;
  width: auto !important;
  height: auto !important;
  display: block !important;
  margin: 0 auto !important;
}

/* Mobile image sizing */
@media screen and (max-width: 768px) {
  .sigil-image-frame {
    max-width: 400px !important;
    padding: 0.8em;
  }
  
  .glyph-display {
    max-width: 90vw !important;
  }
}

@media screen and (max-width: 600px) {
  .sigil-image-frame {
    max-width: 280px !important;
    padding: 0.6em;
    margin: 1em auto !important;
  }
  
  .glyph-display {
    max-width: 100vw !important;
    padding: 0.5em;
    margin: 1em auto !important;
  }
  
  center img,
  .glyph-display img {
    max-width: 85vw !important;
  }
}

/* Mobile: main content first, sidebars as compact drawers below. */
@media screen and (max-width: 980px) {
  #container {
    max-width: 900px;
  }

  .rs-layout-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "left"
      "right";
  }

  .rs-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 640px) {
  .rs-sidebar {
    grid-template-columns: 1fr;
  }

  .rs-widget {
    max-height: 12rem;
    overflow: auto;
  }

  .rs-widget h2 {
    position: sticky;
    top: 0;
    background: rgba(42, 36, 31, 0.96);
    z-index: 1;
  }
}


/* Mobile header cleanup: keep title/subtitle separated and remove nav bullets. */
.site-title-card {
  text-align: center;
}

.site-title-link {
  display: block;
  margin: 0 auto 0.25rem auto;
  color: var(--color-gold);
  border-bottom: 0;
}

.site-subtitle {
  display: block;
  max-width: 38rem;
  margin: 0 auto;
  color: var(--text-secondary);
}

.main-nav ul,
#header .main-nav ul,
#header ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav li,
#header .main-nav li,
#header li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav li::marker,
#header li::marker {
  content: "";
}

.main-nav {
  margin-top: 0.75rem;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.main-nav a {
  display: inline-block;
  border-bottom: 0;
}

@media screen and (max-width: 640px) {
  .site-title-link {
    font-size: 1.45em;
    line-height: 1.05;
  }

  .site-subtitle {
    max-width: 18rem;
    line-height: 1.35;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
  }
}
