/*
Theme Name: Ash & Oath
Theme URI: https://example.com/
Author: Jon
Description: A minimal, dark reading theme for the Ash & Oath Black Templar vignette series. Blackletter display, Garamond body, one ember accent. Content model: an "Entry" post type grouped into "Vignette" terms, ordered within each vignette.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ash-and-oath
*/

/* ============================================================
   Tokens
   Layout: a single centred reading column on near-black; one
   thin orbit arc as the only ornament; blackletter display +
   Garamond body, ember accent used sparingly.
   ============================================================ */
:root {
  --bg: #0a0a0b;
  --bg-raised: #121215;
  --fg: #e5ded1;          /* warm ash / parchment */
  --muted: #8c867b;       /* ash grey */
  --faint: #58544d;
  --accent: #E34234;      /* ember / oxblood */
  --line: rgba(229, 222, 209, 0.12);
  --line-soft: rgba(229, 222, 209, 0.06);
  --display: "Pirata One", "Times New Roman", serif;
  --body: "Vollkorn", serif;
  --col: 50rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 1.22rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---- orbit flourish (shared) ---- */
.ao-orbit {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.46;
}
.ao-orbit circle { stroke: var(--line); fill: none; }
.ao-orbit .node { fill: var(--accent); stroke: none; }
.ao-orbit--reader {
  top: 50%; left: 0;
  transform: translate(-55%, -50%);
  width: 70vmin; height: 70vmin; max-width: 680px; max-height: 680px;
}
.ao-orbit--home {
  top: -12vmin; right: -18vmin;
  width: 80vmin; height: 80vmin; max-width: 760px; max-height: 760px;
}

/* ---- sigil / star glyphs ---- */
.sigil path, .sigil circle { stroke: var(--accent); fill: none; stroke-width: 1.3; }
.star path { fill: var(--accent); }

/* ============================================================
   Top bar (all pages)
   ============================================================ */
#progress {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  height: 2px; width: 0%;
  background: var(--accent);
  z-index: 40;
  transition: width 0.1s linear;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 31;
}
.ao-bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.ao-bar__inner {
  max-width: 46rem;
  margin: 0 auto;
  padding-block: 0.85rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--fg);
  white-space: nowrap;
}
.wordmark .sigil { width: 20px; height: 20px; flex: none; }
.contents-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.contents-btn:hover { color: var(--fg); border-color: var(--muted); }

/* ============================================================
   Reader (single entry)
   ============================================================ */
.reader {
  position: relative;
  z-index: 1;
  max-width: var(--col);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: clamp(3rem, 8vw, 5.5rem) 4rem;
}
.eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.4rem;
}
.eyebrow .sep { color: var(--faint); margin: 0 0.5em; }

.entry-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: 0.01em;
  margin: 0 0 1.8rem;
  text-wrap: balance;
  color: var(--fg);
}
.rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--faint);
  margin: 0 0 2.4rem;
}
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rule .star { width: 12px; height: 12px; }

.entry-body p { margin: 0 0 1.4rem; text-wrap: pretty; font-size: 20px }
.entry-body > p:first-of-type::first-letter {
  font-family: var(--display);
  font-size: 3.4em;
  float: left;
  line-height: 0.76;
  padding: 0.06em 0.12em 0 0;
  color: var(--accent);
}
.entry-body em, .entry-body i { color: var(--fg); }
.entry-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* prev / next */
.pager {
  max-width: var(--col);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-bottom: 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.pg {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.1rem 1.2rem;
  background: var(--bg-raised);
  min-height: 5.2rem;
  transition: border-color 0.2s;
}
.pg:hover { border-color: var(--accent); }
.pg.next { text-align: right; align-items: flex-end; }
.pg.is-empty { opacity: 0.32; pointer-events: none; }
.pg .lbl {
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.pg .ttl {
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1.1;
  color: var(--fg);
}

/* ============================================================
   Contents overlay
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 6, 7, 0.9);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: max(20px, env(safe-area-inset-top, 0px)) 20px 20px;
  overflow-y: auto;
}
.overlay[hidden] { display: none; }
.sheet { width: 100%; max-width: var(--col); margin: clamp(1.5rem, 8vh, 5rem) 0 3rem; }
.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
  margin-bottom: 1.8rem;
}
.sheet-head h2 { font-family: var(--display); font-weight: 400; font-size: 2rem; margin: 0; letter-spacing: 0.02em; }
.close-x { background: none; border: none; color: var(--muted); font-size: 1.7rem; line-height: 1; cursor: pointer; font-family: var(--body); }
.close-x:hover { color: var(--fg); }
.toc-vig { margin-bottom: 2.2rem; }
.toc-vig__name { font-family: var(--display); font-size: 1.5rem; color: var(--fg); margin: 0 0 0.2rem; }
.toc-vig__meta { font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint); margin: 0 0 1rem; }
.toc-entry {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  width: 100%;
  border-top: 1px solid var(--line-soft);
  padding: 0.7rem 0.1rem;
  color: var(--fg);
  font-size: 1.05rem;
  transition: color 0.15s;
}
.toc-entry:hover { color: var(--accent); }
.toc-entry .num { font-size: 0.72rem; letter-spacing: 0.2em; color: var(--faint); min-width: 2.4rem; }
.toc-entry.active, .toc-entry.active .num { color: var(--accent); }

/* ============================================================
   Home (front page)
   ============================================================ */
.home-wrap {
  position: relative;
  z-index: 1;
  max-width: 50rem;
  margin: 0 auto;
  padding-left: max(22px, env(safe-area-inset-left, 0px));
  padding-right: max(22px, env(safe-area-inset-right, 0px));
}
.hero { padding-block: clamp(2.5rem, 9vw, 5rem) clamp(2.5rem, 7vw, 4.5rem); }
.hero__mark { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 2.4rem; }
.hero__mark .sigil { width: 26px; height: 26px; flex: none; }
.hero__kicker { 
	font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
.hero__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.4rem, 14vw, 7rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  margin: 0 0 1.6rem;
  text-wrap: balance;
}
.hero__lede { font-size: clamp(1.2rem, 2.6vw, 1.4rem); color: var(--fg); margin: 0 0 0.9rem; line-height: 1.5; }
.hero__lede.dim { color: var(--muted); font-size: 1.12rem; }

.index-head { display: flex; align-items: center; gap: 1rem; margin: 0 0 0.5rem; }
.index-head span { font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.index-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.vig {
  display: block;
  border-top: 1px solid var(--line-soft);
  padding: 2.1rem 0;
  transition: padding-left 0.25s ease;
}
.vig:hover { padding-left: 0.6rem; }
.vig:first-of-type { border-top: none; }
.vig__top { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 0.5rem; }
.vig__num { font-family: var(--display); font-size: 1.1rem; color: var(--accent); min-width: 2.2rem; flex: none; }
.vig__name { font-family: var(--display); font-size: clamp(1.9rem, 5.5vw, 2.6rem); line-height: 1.05; color: var(--fg); transition: color 0.2s; }
.vig:hover .vig__name { color: var(--accent); }
.vig__desc { color: var(--muted); margin: 0 0 1.1rem 3.2rem; font-size: 1.1rem; max-width: 90% }
.vig__entries { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin: 0 0 0 3.2rem; padding: 0; list-style: none; }
.vig__entries li { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.82rem; letter-spacing: 0.04em; color: var(--muted); }
.vig__entries li:hover { color: var(--fg); }
.vig__entries .en-num { font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }

.site-foot {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding-left: max(22px, env(safe-area-inset-left, 0px));
  padding-right: max(22px, env(safe-area-inset-right, 0px));
}
.site-foot__inner {
  margin-top: 4rem;
  border-top: 1px solid var(--line-soft);
  padding-block: 2.2rem 4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--faint);
  font-size: 16px;
  letter-spacing: 0.08em;
}
.site-foot .sigil { width: 16px; height: 16px; }
.site-foot .sigil path, .site-foot .sigil circle { stroke: var(--faint); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 460px) {
  body { font-size: 1.12rem; }
  .pager { grid-template-columns: 1fr; }
  .bar-current { display: none; }
  .vig__desc, .vig__entries { margin-left: 0; }
  .vig__entries { gap: 0.4rem 1rem; }
  .entry-body p { line-height: 1.5 }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.fade { animation: ao-fade 0.45s ease; }
@keyframes ao-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
