/* ============================================================
   STACK UNIVERSE — stack-shared.css
   Shared by every chamber page beyond the Threshold (Reception,
   Library, and whatever comes next). Import this FIRST in each
   page's own stylesheet, then add only what's unique to that page.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;900&family=EB+Garamond:ital,wght@0,400;1,400;1,500&family=Cinzel:wght@400;600&display=swap');

:root {
  --ink: #07060a;
  --stone-1: #241c14;
  --stone-2: #14100b;
  --ember: #d69a4d;
  --gold: #e8c77a;
  --parchment: #f1e6c9;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--ink);
  font-family: 'EB Garamond', serif;
  color: var(--parchment);
}

/* ---------- Hero shell (each page supplies its own --hero-image) ---------- */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}
/* Used by page-destination.php / page.php when a new Cave page hasn't had
   a featured image set yet — collapses to content height instead of a
   mostly-empty full-viewport section. */
.hero.hero-no-image {
  height: auto;
  min-height: 42vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 3rem;
}
.hero-art {
  position: absolute;
  inset: 0;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  filter: saturate(1.03) contrast(1.02);
}
.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, rgba(0,0,0,0) 38%, rgba(0,0,0,0.5) 100%);
}
#ember-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.lamp-glow {
  position: absolute;
  width: 10vw; height: 10vw;
  max-width: 150px; max-height: 150px;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255,205,120,0.55) 0%, rgba(255,160,70,0.22) 45%, rgba(255,160,70,0) 72%);
  animation: lamp-breathe 5s ease-in-out infinite;
}
@keyframes lamp-breathe {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.9; }
}
.hero-copy {
  position: absolute;
  left: 6%;
  bottom: 14%;
  width: min(660px, 48%);
  color: #fdf9ef;
}
.kicker {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  color: rgba(232,199,122,0.75);
  text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}
.hero-copy h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  letter-spacing: 0.02em;
  margin: 0.25em 0 0.1em;
  text-shadow: 0 3px 14px rgba(0,0,0,0.7);
}
.subhead {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  color: var(--gold);
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}
.hero-welcome {
  margin-top: 0.9em;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.6;
  text-shadow: 0 2px 8px rgba(0,0,0,0.75), 0 0 14px rgba(0,0,0,0.5);
}
.scroll-cue {
  position: absolute;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: rgba(241,230,201,0.75);
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-shadow: 0 2px 5px rgba(0,0,0,0.8);
  animation: cue-bob 2.4s ease-in-out infinite;
}
.scroll-arrow { font-size: 0.9rem; margin-top: 2px; }
@keyframes cue-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 6px); }
}

/* ---------- Content body shell ---------- */
.chamber-body {
  position: relative;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(214,154,77,0.08) 0%, rgba(214,154,77,0) 45%),
    radial-gradient(ellipse at 80% 100%, rgba(138,90,34,0.14) 0%, rgba(138,90,34,0) 55%),
    linear-gradient(180deg, var(--stone-2) 0%, var(--stone-1) 40%, var(--stone-2) 100%);
  padding-bottom: 3rem;
}
section { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem 1rem; }
section h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.2rem, 1.9vw, 1.55rem);
  letter-spacing: 0.14em;
  color: var(--ember);
  text-align: center;
  margin-bottom: 1.4rem;
}

/* ---------- Notices ---------- */
.notice-board {
  background: rgba(10,8,6,0.4);
  border: 1px solid rgba(214,154,77,0.25);
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  max-width: 900px;
  margin: 0 auto;
}
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(214,154,77,0.12);
}
.notice:last-child { border-bottom: none; }
.notice-flame {
  color: var(--ember);
  text-shadow: 0 0 8px rgba(214,154,77,0.8);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}
.notice p { margin: 0; font-size: 1.15rem; line-height: 1.55; }
.notice strong { color: var(--gold); font-weight: 600; }

/* ---------- "Dig card" grid (reused for any 3-up feature grid) ---------- */
.dig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.dig-card {
  background: linear-gradient(180deg, rgba(42,33,24,0.55), rgba(23,18,13,0.75));
  border: 1px solid rgba(214,154,77,0.3);
  border-radius: 10px;
  overflow: hidden;
}
.dig-image { width: 100%; aspect-ratio: 16/10; overflow: hidden; }
.dig-image img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.05) contrast(1.02); }
.dig-card h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--parchment);
  margin: 0.9rem 1.2rem 0.3rem;
}
.dig-status {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--ember);
  margin: 0 1.2rem 0.7rem;
}
.dig-card p { font-size: 1.08rem; line-height: 1.6; margin: 0 1.2rem 0.8rem; }
.dig-future {
  font-style: italic;
  color: var(--gold);
  font-size: 1.02rem !important;
  border-top: 1px solid rgba(214,154,77,0.2);
  padding-top: 0.7rem;
  margin-bottom: 1.1rem !important;
}

/* ---------- Actions row ---------- */
.actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem;
  text-align: center; padding-top: 1.5rem;
}
.action-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--parchment);
  background: rgba(214,154,77,0.12);
  border: 1px solid rgba(214,154,77,0.5);
  border-radius: 6px;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.action-btn:hover { background: rgba(214,154,77,0.24); box-shadow: 0 0 18px rgba(214,154,77,0.35); }
.action-btn.primary { background: rgba(214,154,77,0.85); color: #1a1409; font-weight: 600; }
.action-btn.primary:hover { background: var(--gold); }

/* ---------- "Receive Cave Updates" modal ---------- */
.updates-panel {
  position: fixed; inset: 0; margin: auto;
  width: min(420px, 88vw); height: fit-content;
  background: rgba(12,9,6,0.96);
  border: 1px solid rgba(214,154,77,0.45);
  border-radius: 10px;
  padding: 1.8rem 1.8rem 1.5rem;
  text-align: center;
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 20;
}
.updates-panel.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.updates-panel h3 { font-family: 'Playfair Display', serif; color: var(--gold); margin: 0 0 0.4rem; }
.updates-panel p { font-size: 0.9rem; margin: 0 0 1rem; }
#updates-form { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
#updates-form input {
  flex: 1 1 200px; padding: 0.6rem 0.8rem; border-radius: 5px;
  border: 1px solid rgba(214,154,77,0.4); background: rgba(255,255,255,0.05);
  color: var(--parchment); font-family: 'EB Garamond', serif; font-size: 0.95rem;
}
#updates-form button {
  font-family: 'Cinzel', serif; font-size: 0.78rem; letter-spacing: 0.08em;
  padding: 0.6rem 1.1rem; border-radius: 5px; border: none;
  background: var(--ember); color: #1a1409; cursor: pointer;
}
.updates-note { font-size: 0.82rem; color: var(--gold); min-height: 1.2em; }
.updates-close {
  position: absolute; top: 8px; right: 12px; background: none; border: none;
  color: rgba(241,230,201,0.6); font-size: 1.3rem; cursor: pointer;
}
.updates-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 15;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.updates-overlay.is-open { opacity: 1; pointer-events: auto; }

.chamber-footer {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(241,230,201,0.4);
  padding-top: 2rem;
}

@media (max-width: 760px) {
  .hero { height: 100vh; }
  .hero-copy { width: 84%; left: 8%; bottom: 12%; }
  .dig-grid { grid-template-columns: 1fr; }
  .actions { flex-direction: column; align-items: stretch; }
}
