/* Official Temple of Gu visual canon: four colors, no off-palette accents.
   Same palette as templeofgu.com and the tabletop: bg, panel, accent, text. */
:root {
  color-scheme: dark;
  --temple-bg: #495A58;
  --temple-panel: #303636;
  --temple-accent: #FF5E1F;
  --temple-text: #FFFFFF;
  --line: color-mix(in srgb, var(--temple-text) 24%, transparent);
  --muted: color-mix(in srgb, var(--temple-text) 72%, transparent);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--temple-bg);
  color: var(--temple-text);
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 22px 64px;
}

.hero {
  text-align: center;
  border-bottom: 2px solid var(--temple-accent);
  padding-bottom: 30px;
}

.eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--temple-text);
  margin: 0 0 10px;
}

.star {
  color: var(--temple-accent);
  font-size: 2.6rem;
  line-height: 1;
}

h1, h2 { font-family: Georgia, serif; }

h1 {
  font-size: clamp(2.4rem, 6vw, 3.9rem);
  font-weight: 600;
  line-height: 1.12;
  margin: 14px 0 18px;
}

.lede {
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.12rem;
}

.virtues {
  margin-top: 26px;
  color: var(--temple-accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 700;
}

.panel {
  margin-top: 40px;
  background: var(--temple-panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 30px 32px 26px;
}

.panel h2, .chapels-title {
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.promises { padding-left: 1.2em; margin: 14px 0 6px; }
.promises li { margin: 9px 0; }
.promises strong { font-weight: 700; }

.rule {
  margin: 22px 0 6px;
  padding: 14px 18px;
  border-left: 3px solid var(--temple-accent);
  font-style: italic;
  background: color-mix(in srgb, var(--temple-accent) 10%, transparent);
}

.chapels-title { text-align: center; margin-top: 54px; }

.chapels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.chapel {
  background: var(--temple-panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 14px 16px;
  text-align: center;
}

.chapel .sign {
  display: block;
  font-size: 1.12rem;
  font-family: Georgia, serif;
}

.chapel .saint {
  display: block;
  margin-top: 2px;
  font-size: 0.92rem;
  color: var(--muted);
  font-style: italic;
}

.foot {
  margin-top: 58px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.foot p { margin: 2px 0; }
.foot .root { color: var(--temple-accent); letter-spacing: 0.08em; }

/* ---------- The calculator ---------- */

.calc { margin-top: 40px; }

.cast {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-top: 16px;
}
.cast .wide { grid-column: 1 / -1; }

.field label, .by-hand label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.cast input, .cast select {
  width: 100%;
  font: inherit;
  color: var(--temple-text);
  background: var(--temple-bg);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 9px 11px;
  min-height: 44px;
}
.cast input:focus, .cast select:focus, .cast button:focus-visible,
.chart button:focus-visible, .by-hand summary:focus-visible {
  outline: 2px solid var(--temple-accent);
  outline-offset: 2px;
}

.place-field { position: relative; }
.place-list {
  position: absolute;
  z-index: 5;
  left: 0; right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: var(--temple-panel);
  border: 1px solid var(--temple-accent);
  border-radius: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
}
.place-list li { padding: 8px 10px; border-radius: 0.4rem; }
.place-list .option { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.place-list .option:hover, .place-list .option.active { background: var(--temple-bg); }
.place-list .opt-coords { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.place-list .none { color: var(--muted); }

.by-hand summary { cursor: pointer; color: var(--muted); font-size: 0.92rem; }
.by-hand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 10px;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cast button {
  font: inherit;
  font-weight: 700;
  border-radius: 0.6rem;
  padding: 10px 18px;
  min-height: 44px;
  cursor: pointer;
}
.cast .primary { background: var(--temple-accent); color: var(--temple-text); border: 1px solid var(--temple-accent); }
.cast .quiet { background: transparent; color: var(--temple-text); border: 1px solid var(--line); }
.cast-message { margin: 0; min-height: 1.6em; color: var(--temple-accent); }

.result { margin-top: 18px; }

/* South Indian chart: signs fixed, Pisces top left, clockwise. */
.chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 2px solid var(--temple-text);
  background: var(--temple-bg);
}

.box {
  position: relative;
  border: 1px solid var(--temple-text);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.box.lagna {
  background: color-mix(in srgb, var(--temple-accent) 16%, transparent);
  /* the traditional diagonal stroke across the Lagna's corner */
  background-image: linear-gradient(135deg, transparent 0 13%, var(--temple-accent) 13% calc(13% + 2px), transparent calc(13% + 2px));
}

.box-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  padding: 3px 6px 0;
  background: none;
  border: 0;
  color: var(--temple-text);
  font: inherit;
  cursor: pointer;
}
.box-sign { font-size: clamp(0.95rem, 3.4vw, 1.25rem); line-height: 1.2; }
.box-house { font-size: clamp(0.7rem, 2.4vw, 0.85rem); color: var(--muted); font-weight: 700; }
.box.lagna .box-house { color: var(--temple-accent); }

.box-items {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 1px 2px;
  padding: 2px 3px 3px;
}

.planet {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 1px 3px;
  min-height: 24px;
  background: none;
  border: 0;
  border-radius: 0.35rem;
  color: var(--temple-text);
  font: inherit;
  cursor: pointer;
  line-height: 1.2;
}
.planet:hover { background: var(--temple-panel); }
.p-glyph { font-size: clamp(0.95rem, 3.6vw, 1.2rem); }
.p-deg { font-size: clamp(0.6rem, 2.2vw, 0.75rem); color: var(--muted); }
.p-retro { font-size: clamp(0.55rem, 2vw, 0.7rem); color: var(--temple-accent); font-weight: 700; }
.lagna-mark .p-glyph { font-size: clamp(0.7rem, 2.6vw, 0.85rem); font-weight: 700; color: var(--temple-accent); letter-spacing: 0.04em; }

.centre {
  grid-row: 2 / 4;
  grid-column: 2 / 4;
  border: 1px solid var(--temple-text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8px;
  font-size: clamp(0.72rem, 2.7vw, 0.95rem);
  line-height: 1.35;
  min-width: 0;
}
.centre p { margin: 1px 0; overflow-wrap: anywhere; }
.centre-title { font-family: Georgia, serif; font-size: 1.25em; color: var(--temple-accent); }
.centre-place { color: var(--muted); }
.centre-small { color: var(--muted); font-size: 0.85em; margin-top: 4px !important; }

.time-note { max-width: 560px; margin: 8px auto 0; color: var(--muted); font-size: 0.9rem; }
.time-note:empty { display: none; }

.moon {
  display: flex;
  gap: 16px;
  align-items: center;
  max-width: 560px;
  margin: 18px auto 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.moon-disc { flex: 0 0 64px; }
.moon-disc svg { width: 64px; height: 64px; display: block; }
.moon-dark { fill: var(--temple-bg); stroke: var(--line); stroke-width: 2; }
.moon-lit { fill: var(--temple-text); }
.moon-text p { margin: 2px 0; }
.moon-phase { font-family: Georgia, serif; font-size: 1.15rem; }
.moon-nak { color: var(--temple-accent); font-weight: 700; }

.detail {
  max-width: 560px;
  margin: 14px auto 0;
  padding: 14px 16px;
  background: var(--temple-bg);
  border-radius: 1rem;
  scroll-margin: 16px;
}
.detail-hint { margin: 0; color: var(--muted); font-style: italic; }
.detail-title { font-family: Georgia, serif; font-weight: 600; font-size: 1.2rem; margin: 0 0 8px; }
.detail-glyph { color: var(--temple-accent); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Ryan's own words go here (lore.js); an empty slot takes no space. */
.lore { margin-top: 10px; white-space: pre-line; }
.lore:empty { display: none; }

.method { max-width: 560px; margin: 14px auto 0; color: var(--muted); font-size: 0.85rem; text-align: center; }
.foot .credits { margin-top: 10px; font-size: 0.78rem; }

@media (max-width: 560px) {
  .page { padding: 40px 16px 56px; }
  .panel { padding: 22px 16px 20px; }
  .cast { grid-template-columns: 1fr 1fr; }
  .box-head { padding: 2px 4px 0; }
  .planet { padding: 1px 2px; }
}

/* ---------- /embed: the calculator alone, inside another site ---------- */

body.embed { min-height: 0; background: var(--temple-panel); }
.embed .page { max-width: none; padding: 0; }
.embed .calc { margin: 0; border: 0; border-radius: 0; padding: 22px 20px 16px; }
.embed-credit {
  margin: 0;
  padding: 0 20px 18px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.embed-credit a { color: var(--temple-accent); text-decoration: none; }

.demo-title { font-size: 2rem; margin: 0 0 8px; }
.demo-text { margin: 0 0 10px; }
.demo-code {
  margin: 0 0 28px;
  padding: 12px 14px;
  overflow-x: auto;
  background: var(--temple-panel);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  font-size: 0.9rem;
}

/* Sign pop-ups on the doorway grid (Philip's sign descriptions, Nov 15, 2026).
   Additive only: the boxes are native <details>, so no script is involved. */
.signs-hint { text-align: center; color: var(--muted); font-style: italic; margin: 0 0 4px; }
details.chapel { text-align: center; }
details.chapel summary { cursor: pointer; list-style: none; }
details.chapel summary::-webkit-details-marker { display: none; }
details.chapel summary::after {
  content: "+";
  display: block;
  color: var(--temple-accent);
  font-weight: 700;
  line-height: 1;
  margin-top: 2px;
}
details.chapel[open ] summary::after { content: "\2013"; }
details.chapel .sign-desc {
  margin: 10px 0 2px;
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: left;
}

/* House theme line inside the Twelve Houses boxes (Nov 15, 2026). Additive. */
.chapel .house-theme {
  display: block;
  margin-top: 2px;
  font-size: 0.92rem;
  color: var(--muted);
  font-style: italic;
}

/* The Twelve Planets: doorway boxes are doors, and the planet pages' wheel nav
   (Nov 15, 2026). Additive only. */
a.chapel.planet-link { display: block; text-decoration: none; color: var(--temple-text); }
a.chapel.planet-link:hover, a.chapel.planet-link:focus-visible { border-color: var(--temple-accent); }
a.chapel.planet-link .go {
  display: block;
  margin-top: 2px;
  font-size: 0.92rem;
  color: var(--temple-accent);
  font-style: italic;
}
.planet-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 34px;
}
.planet-nav a { color: var(--temple-accent); text-underline-offset: 0.2em; }
.panel a { color: var(--temple-accent); text-underline-offset: 0.2em; }

/* Planet pages: the interpretation text (Nov 15, 2026). Additive only. */
.content p { margin: 0 0 14px; }
.content .qualities { list-style: none; padding: 0; margin: 0 0 14px; }
.content .qualities li { margin: 0 0 9px; }
.content .qualities strong { color: #FFFFFF; }
.content .planet-signs-h { margin-top: 30px; }
.content .closing {
  margin-top: 30px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--temple-accent);
}
.content .return-link { margin-top: 26px; }
.content .return-link a { color: var(--temple-accent); text-underline-offset: 0.2em; }
