/*##############################################################################
# Script:        wisdom.css          (stylesheet, loaded by frontend/pages/wisdom.html and the /wisdom/<slug> subpage)
# Created by:    Matthew Boucher
# Start date:    2026-10-07
# Location:      <project root>/frontend/css/wisdom.css   (main script: <project root>/aiacolyte.py; subscripts: <project root>/subscripts/aiacolyte/)
# Description:   The look of the Ancient Magical Wisdom section on top of styles.css and admin.css: the /wisdom
#                page's background picture ("A Gathering of Teachings", darkened, body.wisdom-page) and the Personality
#                Test tab's (the mind among the stars, body.is-personality); the two tabs
#                (Wisdom and Skills, .wisdom-tabs), the
#                library splash's per-group sections (each a group heading and a table of that group's
#                subjects, reusing the admin table style), and the subpage itself — the AI-written article
#                (an intro, headed sections and the document's own pictures as figures), a picture gallery
#                for any pulled image not placed in the text, and the slide-text outline shown when a page
#                was not AI-written. The subject's accent colour, pulled from the document, tints the
#                headings and rules through the --wisdom-accent variable set on the subject card.
#                Works with the main script, which serves it as /static/css/wisdom.css; aiacolyte.py
#                --checkup confirms it is in place.
# Reads:         the tokens and classes of styles.css and admin.css; the --wisdom-accent variable set inline on the subject card
# Writes:        nothing
# Sensitive:     none needed
# Arguments:     none (a stylesheet cannot take flags)
##############################################################################*/

/* a monospace snippet, for file names and the /wisdom/<name> address */
.wisdom-mono {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--gold-bright);
  white-space: nowrap;
}

/* ---------- the library splash: a separate table per group ---------- */
.wisdom-group {
  margin: 26px 0 0;
}

.wisdom-group__title {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin: 0 0 12px;
  padding-bottom: 8px;
  font-size: 1.4rem;
  color: var(--parchment);
  border-bottom: 1px solid var(--line);
}

.wisdom-group__title .count {
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: italic;
  color: var(--text-faint);
}

.wisdom-row__desc {
  margin-top: 4px;
  max-width: 70ch;
}

/* ---------- the subject subpage: /wisdom/<slug> ---------- */
.wisdom-subject {
  --wisdom-accent: var(--gold);   /* overridden inline with the colour pulled from the document */
}

.wisdom-subject h1 {
  margin-top: 12px;
  color: var(--wisdom-accent);
}

.wisdom-subject__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 20px 0 6px;
}

/* ---------- the rendered article ---------- */
.wisdom-article {
  margin-top: 24px;
}

.wisdom-article__intro {
  max-width: 70ch;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.wisdom-article__intro p + p,
.wisdom-section p + p {
  margin-top: 0.8em;
}

.wisdom-section {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.wisdom-section > h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: var(--wisdom-accent);
}

.wisdom-section p {
  max-width: 70ch;
  line-height: 1.65;
  color: var(--text);
}

/* a picture pulled from the document */
.wisdom-figure {
  margin: 0 0 16px;
}

.wisdom-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c0a08;
}

.wisdom-figure figcaption {
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-faint);
}

/* an illustration Claude drew for a section (not a picture from the document) */
.wisdom-figure--drawn img {
  border-color: color-mix(in srgb, var(--wisdom-accent) 45%, var(--line));
  background: radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--wisdom-accent) 10%, transparent), transparent 70%), #0c0a08;
}

.wisdom-figure--drawn figcaption::before {
  content: "\2726\00a0";   /* ✦ : this picture was drawn for the page */
  color: var(--wisdom-accent);
}

/* a picture that reads better beside the text */
.wisdom-section > .wisdom-figure {
  float: right;
  width: min(42%, 340px);
  margin: 0 0 14px 22px;
}

@media (max-width: 680px) {
  .wisdom-section > .wisdom-figure {
    float: none;
    width: 100%;
    margin: 0 0 16px;
  }
}

/* the gallery of pictures not placed in the text */
.wisdom-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.wisdom-gallery .wisdom-figure {
  margin: 0;
}

/* the PowerPoint slide-text outline (shown when a page was not AI-written) */
.wisdom-outline {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.wisdom-slide {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(43, 39, 102, 0.16), transparent 70%), #16120e;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wisdom-slide__num {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.wisdom-slide__text {
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: var(--text);
}

@media (max-width: 560px) {
  .wisdom-slide {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}

/* The two tabs on /wisdom: Wisdom and Skills (owner's instruction 2026-10-20), styled like the home page's tabs */
.wisdom-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 6px 0 26px;
}

.wisdom-tabs__tab {
  appearance: none;
  cursor: pointer;
  background: rgba(10, 8, 7, 0.6);   /* stays readable over the page pictures */
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6em 1.4em;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.wisdom-tabs__tab:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.wisdom-tabs__tab:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.wisdom-tabs__tab[aria-selected="true"] {
  color: var(--ink-1);
  background: var(--gold);
  border-color: var(--gold);
}

.wisdom-panel[hidden] {
  display: none;
}

.wisdom-panel:focus-visible {
  outline: none;
}

.wisdom-intro {
  max-width: 72ch;
  margin: 0 0 22px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* The Personality Test tab: the self-contained test served at /wisdom/personality, embedded and auto-sized by wisdom.js. */
.testme-frame {
  display: block;
  width: 100%;
  border: 0;
  min-height: 520px;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
}

/* ---------- the /wisdom page's background: "A Gathering of Teachings" (owner's picture, 2026-10-21) ---------- */
/* fixed behind the page and darkened so every word stays easy to read; a fixed layer rather than background-attachment:
   fixed, which phones ignore. The tarot tab swaps in its own picture (tarot.css, body.is-tarot, loaded after this file). */
body.wisdom-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(10, 8, 7, 0.8), rgba(10, 8, 7, 0.9) 45%, rgba(10, 8, 7, 0.95)),
    url("/static/assets/img/wisdom-teachings.webp") center 30% / cover no-repeat;
}

@media (max-width: 800px) {
  body.wisdom-page::before {
    background:
      linear-gradient(to bottom, rgba(10, 8, 7, 0.8), rgba(10, 8, 7, 0.9) 45%, rgba(10, 8, 7, 0.95)),
      url("/static/assets/img/wisdom-teachings-768.webp") center 30% / cover no-repeat;
  }
}

/* ---------- the page's background while the Personality Test tab is open (wisdom.js sets body.is-personality) ---------- */
/* the owner's picture of the mind among the stars (2026-10-21), fixed and darkened; html raises it over the page's own */
html body.is-personality::before {
  background:
    linear-gradient(to bottom, rgba(10, 8, 7, 0.78), rgba(10, 8, 7, 0.88) 45%, rgba(10, 8, 7, 0.95)),
    url("/static/assets/img/personality-mind.webp") 65% 30% / cover no-repeat;
}

@media (max-width: 800px) {
  html body.is-personality::before {
    background:
      linear-gradient(to bottom, rgba(10, 8, 7, 0.78), rgba(10, 8, 7, 0.88) 45%, rgba(10, 8, 7, 0.95)),
      url("/static/assets/img/personality-mind-768.webp") 70% 30% / cover no-repeat;
  }
}

/*##############################################################################
# End of wisdom.css
##############################################################################*/
