/* public/theme.css
   Orthodox Wisdom — the one design shared by the public site, the Clergy tool
   (/priest) and the admin page (November 15, 2026, at Bardo's word: "all 3
   sites are designed differently... I need some consistency").

   The colours are the public site's (warm parchment, ink, gold); the type and
   the red are the Clergy tool's (Cormorant Garamond for display, EB Garamond
   for reading, an oxblood red). Red is what you can act on (links, buttons,
   the wordmark, what is selected); gold is ornament (the cross, rules, the
   writing cursor). Each page's own stylesheet maps its names onto these.

   Also here: the pieces every page shares: the header, the companion (the
   small Priest at the top right) and the pen that writes while the library is
   searched. Both are drawn and moved by public/ow-kit.js. */

:root {
  --ow-ground: #f9ecd6;
  --ow-card: #fff7ea;
  --ow-band: #f5dfb4;
  --ow-band-soft: #f7e7c8;
  --ow-mat: #f0dfbb;
  --ow-ink: #201f1d;
  --ow-ink-mid: #443c36;
  --ow-ink-soft: #5c5245;
  --ow-ink-faint: #6b6155;
  --ow-red: #7a1f23;
  --ow-red-deep: #5a1519;
  --ow-on-red: #fbf4e6;
  --ow-red-tint: rgba(122, 31, 35, 0.07);
  --ow-gold: #ab7a2d;
  --ow-gold-text: #6c480d;
  --ow-gold-tint: rgba(171, 122, 45, 0.11);
  --ow-line: rgba(60, 42, 12, 0.26);
  --ow-line-strong: rgba(60, 42, 12, 0.38);
  --ow-hair: rgba(60, 42, 12, 0.17);
  --ow-radius: 6px;
  --ow-radius-inner: 3px;
  --ow-radius-overlay: 10px;
  --ow-display: 'Cormorant Garamond', 'Cormorant', Garamond, Georgia, serif;
  --ow-text: 'EB Garamond', Garamond, Georgia, serif;
  /* the companion's place: its size, and the room it may drift in */
  --ow-mascot-size: 64px;
  --ow-mascot-roam-x: 22px;
  --ow-mascot-roam-y: 9px;
  --ow-mascot-top: 8px;
  --ow-mascot-right: 30px;
  --ow-header-reserve: 132px;
  color-scheme: light;
}

/* ── The header every page wears ─────────────────────────────────────────── */
.ow-header {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  min-height: 80px; padding: 12px var(--ow-header-reserve) 12px 40px;
  background: var(--ow-band-soft);
  border-bottom: 1px solid var(--ow-line);   /* one rule under the header, nothing above it (November 16) */
}
.ow-brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.ow-wordmark {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  font-family: var(--ow-display); font-weight: 700; font-size: 25px; line-height: 1; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ow-red);
}
.ow-wordmark:hover { color: var(--ow-red-deep); }
/* No font-family on the cross, on purpose: the glyph falls back to the system serif. */
.ow-wordmark-cross { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 46px; line-height: 0.8; letter-spacing: 0; color: var(--ow-gold); }
.ow-brand-for { font-family: var(--ow-text); font-style: italic; font-size: 19px; color: var(--ow-ink-soft); }
.ow-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ow-pill {
  font-family: var(--ow-text); font-size: 15px; color: var(--ow-red); border: 1px solid var(--ow-red);
  border-radius: 999px; padding: 2px 12px; white-space: nowrap;
}
.ow-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px;
  font-family: var(--ow-text); font-size: 17px; line-height: 1.2; white-space: nowrap; text-decoration: none; cursor: pointer;
  color: var(--ow-ink-mid); background: transparent; border: 1px solid var(--ow-line-strong); border-radius: var(--ow-radius);
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.ow-btn:hover { border-color: var(--ow-red); color: var(--ow-ink); }
.ow-btn.is-accent { color: var(--ow-red); border-color: var(--ow-red); }
.ow-btn.is-accent:hover { background: var(--ow-red-tint); color: var(--ow-red-deep); }
.ow-btn.is-primary { color: var(--ow-on-red); background: var(--ow-red); border-color: var(--ow-red); }
.ow-btn.is-primary:hover { background: var(--ow-red-deep); border-color: var(--ow-red-deep); color: var(--ow-on-red); }

/* ── The companion ───────────────────────────────────────────────────────── */
.ow-mascot {
  position: fixed; z-index: 30; top: var(--ow-mascot-top); right: var(--ow-mascot-right);
  width: var(--ow-mascot-size); height: var(--ow-mascot-size);
  pointer-events: none; -webkit-user-select: none; user-select: none;
  will-change: transform; transform: translate3d(0, 0, 0);
}
.ow-mascot-figure { position: absolute; inset: 0; transform-origin: 50% 70%; will-change: transform; pointer-events: auto; }
/* The note under him (November 16): only his figure takes the pointer, never the room he drifts in. */
.ow-mascot-tip {
  position: absolute; top: calc(100% + 10px); right: -4px; padding: 6px 12px; white-space: nowrap;
  font-family: var(--ow-text); font-style: italic; font-size: 16px; line-height: 1.2; color: var(--ow-ink);
  background: var(--ow-card); border: 1px solid var(--ow-line-strong); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(60, 42, 12, 0.14);
  opacity: 0; transform: translateY(-4px) scale(0.96); transform-origin: calc(100% - 26px) 0;
  transition: opacity 0.16s ease, transform 0.16s ease; pointer-events: none;
}
.ow-mascot-tip::before {       /* the small point, under his middle */
  content: ''; position: absolute; top: -6px; right: calc(var(--ow-mascot-size) / 2 - 2px); width: 10px; height: 10px;
  background: var(--ow-card); border-left: 1px solid var(--ow-line-strong); border-top: 1px solid var(--ow-line-strong);
  transform: rotate(45deg);
}
.ow-mascot.is-talking .ow-mascot-tip { opacity: 1; transform: none; }
.ow-mascot.is-running .ow-mascot-tip { opacity: 0; }
.ow-mascot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ow-mascot .ow-streaks { opacity: 0; transition: opacity 0.12s ease; }
.ow-mascot.is-running .ow-streaks { opacity: 0.85; }
.ow-mascot svg { filter: drop-shadow(0 2px 2px rgba(60, 42, 12, 0.18)); }
.ow-mascot .ow-feet { opacity: 0; transition: opacity 0.12s ease; }
.ow-mascot.is-running .ow-shadow { opacity: 0; }
.ow-mascot.is-running .ow-feet { opacity: 1; }
.ow-mascot .ow-foot { transform-box: fill-box; transform-origin: 50% 0%; }
.ow-mascot.is-running .ow-foot-a { animation: owFootA 0.22s linear infinite; }
.ow-mascot.is-running .ow-foot-b { animation: owFootB 0.22s linear infinite; }
@keyframes owFootA { 0%, 100% { transform: translate(-9%, 0) rotate(24deg); } 50% { transform: translate(14%, -12%) rotate(-26deg); } }
@keyframes owFootB { 0%, 100% { transform: translate(14%, -12%) rotate(-26deg); } 50% { transform: translate(-9%, 0) rotate(24deg); } }
.ow-mascot.is-running .ow-hat { animation: owHatBob 0.22s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes owHatBob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-1.6px) rotate(-2.5deg); } }
.ow-mascot.is-popping .ow-mascot-figure { animation: owPop 0.38s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes owPop { 0% { transform: scale(0) rotate(-25deg); } 70% { transform: scale(1.14) rotate(4deg); } 100% { transform: scale(1) rotate(0deg); } }
.ow-puff {
  position: fixed; z-index: 29; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: rgba(120, 96, 60, 0.32); pointer-events: none; animation: owPuff 0.3s ease-out forwards;
}
@keyframes owPuff { from { opacity: 0.9; transform: scale(0.5); } to { opacity: 0; transform: scale(2.4) translateY(-8px); } }

/* ── The pen that writes while the library is searched ───────────────────── */
.ow-pen { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 0 12px; }
.ow-pen svg { display: block; width: min(100%, 400px); height: auto; overflow: visible; }
.ow-pen-label {
  margin: 0; font-family: var(--ow-text); font-style: italic; font-size: 18px; line-height: 1.4; color: var(--ow-ink-soft);
}
.ow-pen-label::after { content: '…'; display: inline-block; width: 1.2em; text-align: left; animation: owDots 1.6s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes owDots { 0% { width: 0; } 100% { width: 1.2em; } }
.ow-pen .ow-ink { fill: none; stroke: var(--ow-ink); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ow-pen .ow-rule { stroke: var(--ow-hair); stroke-width: 1; }
.ow-pen .ow-quill { will-change: transform; }

/* ── Small screens ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  :root {
    --ow-mascot-size: 48px; --ow-mascot-roam-x: 6px; --ow-mascot-roam-y: 5px;
    --ow-mascot-top: 9px; --ow-mascot-right: 12px; --ow-header-reserve: 74px;
  }
  .ow-header { min-height: 66px; padding: 10px var(--ow-header-reserve) 10px 16px; gap: 6px 10px; justify-content: flex-start; }
  .ow-brand { display: contents; }              /* the wordmark on one row; "for the Clergy" and the links share the next */
  .ow-wordmark { font-size: 16px; letter-spacing: 0.1em; gap: 8px; }
  .ow-wordmark-cross { font-size: 32px; }
  .ow-brand-for { font-size: 15px; }
  .ow-header-actions { margin-left: auto; gap: 6px; flex-wrap: nowrap; }
  .ow-btn { min-height: 32px; padding: 0 9px; font-size: 14px; }
  .ow-pill { font-size: 12.5px; padding: 1px 8px; }
  .ow-mascot-tip { font-size: 15px; right: -2px; }
  .ow-pen-label { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .ow-pen-label::after { animation: none; width: 1.2em; }
}
