/* Lethean Age Monster Handbook -- per-creature stylesheet.
   All stat-block and creature-entry visual formatting lives here.
   Creature HTML files are content-only; no inline styles, no <style> blocks.

   Chapter accent: Hazard Amber -- warning-signal orange/gold, distinct from
   the Verdant green of the player handbooks. Creatures are not players.

   Loaded after rulebooks.css; overrides and extends it for the monster context. */

/* -----------------------------------------------------------------------
   Chapter accent override
   ----------------------------------------------------------------------- */

body.handbook-monster {
  --chapter-accent: #e8a430;
  --chapter-accent-soft: rgba(232, 164, 48, 0.20);
  --chapter-accent-bg: rgba(232, 164, 48, 0.05);
  --chapter-accent-dim: rgba(232, 164, 48, 0.12);
}

/* -----------------------------------------------------------------------
   Creature card container
   ----------------------------------------------------------------------- */

article.creature {
  max-width: 52rem;
  margin: 0 auto;
  padding: 3rem 3rem 4rem;
  background: var(--surface);
  border: 1px solid var(--chapter-accent-soft);
  border-radius: var(--radius-sm);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6), 0 0 120px rgba(232, 164, 48, 0.04);
}

/* Corner etch marks -- field-manual aesthetic */
article.creature::before,
article.creature::after {
  content: "";
  position: absolute;
  width: 1.5rem;
  height: 1.5rem;
  border-color: var(--chapter-accent-soft);
  border-style: solid;
  border-width: 0;
}
article.creature::before {
  top: 0.75rem;
  left: 0.75rem;
  border-top-width: 1px;
  border-left-width: 1px;
}
article.creature::after {
  bottom: 0.75rem;
  right: 0.75rem;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

/* -----------------------------------------------------------------------
   Creature header (name + type line)
   ----------------------------------------------------------------------- */

.creature-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--chapter-accent-soft);
}

.creature-header h1 {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.5rem;
  padding-left: 1.25rem;
  border-left: 4px solid var(--chapter-accent);
  color: var(--on-surface);
  text-transform: uppercase;
}

.creature-type {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chapter-accent);
  margin: 0;
  padding-left: 1.25rem;
}

/* -----------------------------------------------------------------------
   Vignette (opening ecological field account)
   ----------------------------------------------------------------------- */

.vignette {
  margin: 0 0 2.5rem;
  padding: 1.25rem 1.5rem 1.25rem 1.25rem;
  border-left: 3px solid var(--chapter-accent-soft);
  background: var(--chapter-accent-bg);
  font-family: var(--font-body);
  font-style: italic;
  color: rgba(218, 226, 253, 0.80);
  font-size: 15px;
  line-height: 26px;
  position: relative;
}

.vignette p { margin: 0 0 0.5rem; font-style: italic; color: inherit; }
.vignette p:last-child { margin: 0; }

.attribution {
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.05em;
  color: var(--outline);
  margin: 0 !important;
}

/* -----------------------------------------------------------------------
   Ecology, encounter-use, and salvage prose sections
   ----------------------------------------------------------------------- */

.ecology,
.encounter-use,
.salvage {
  margin-bottom: 2rem;
}

.ecology h2,
.encounter-use h2,
.salvage h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chapter-accent);
  border-bottom: 1px solid var(--chapter-accent-soft);
  padding-bottom: 0.4rem;
  margin: 2rem 0 1rem;
}

/* -----------------------------------------------------------------------
   Stat block section wrapper
   ----------------------------------------------------------------------- */

.stat-block {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--surface-container-low);
  border: 1px solid var(--chapter-accent-soft);
  border-radius: var(--radius-sm);
  position: relative;
}

.stat-block::before {
  content: "FIELD_RECORD";
  position: absolute;
  top: -0.6rem;
  left: 1rem;
  background: var(--chapter-accent);
  color: #1a0f00;
  padding: 0.15rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.stat-block h2 {
  display: none; /* "Stat block" heading is implicit from the section label above */
}

/* Variant group labels (e.g. "Light Galloper", "Pit Viper Variant") */
.stat-block h3.variant-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chapter-accent);
  margin: 1.5rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--chapter-accent-soft);
}

.stat-block:has(h3.variant-label)::before { display: none; }

/* -----------------------------------------------------------------------
   Combat stats table (AC / HP / Speed / Initiative)
   ----------------------------------------------------------------------- */

table.combat-stats {
  margin: 0 0 1rem;
  background: transparent;
  border: none;
}

table.combat-stats thead tr { background: var(--chapter-accent-dim); }
table.combat-stats th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--chapter-accent);
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--chapter-accent-soft);
  text-align: center;
}
table.combat-stats td {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
  padding: 0.5rem 0.75rem;
  text-align: center;
  border-bottom: 1px solid var(--outline-variant);
}

/* -----------------------------------------------------------------------
   Six-ability stat bar
   ----------------------------------------------------------------------- */

table.stat-bar {
  margin: 0 0 1.25rem;
  background: transparent;
  border: 1px solid var(--chapter-accent-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

table.stat-bar th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--chapter-accent);
  background: var(--chapter-accent-dim);
  padding: 0.35rem 0;
  text-align: center;
  border-bottom: 1px solid var(--chapter-accent-soft);
  border-right: 1px solid var(--chapter-accent-soft);
  width: calc(100% / 6);
}
table.stat-bar th:last-child { border-right: none; }

table.stat-bar td {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
  padding: 0.5rem 0;
  text-align: center;
  border-right: 1px solid var(--outline-variant);
  background: var(--surface-container-low);
}
table.stat-bar td:last-child { border-right: none; }

/* -----------------------------------------------------------------------
   Saving throws, skills, senses, languages -- detail paragraphs
   ----------------------------------------------------------------------- */

.stat-block > p {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 20px;
  color: var(--on-surface-variant);
  margin: 0.25rem 0;
}

.stat-block > p strong {
  color: var(--chapter-accent);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* -----------------------------------------------------------------------
   CR badge
   ----------------------------------------------------------------------- */

.cr-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1a0f00;
  background: var(--chapter-accent);
  padding: 0.1rem 0.55rem;
  clip-path: polygon(0.4rem 0%, 100% 0%, calc(100% - 0.4rem) 100%, 0% 100%);
  vertical-align: middle;
}

/* -----------------------------------------------------------------------
   Trait blocks (traits, actions, bonus actions, reactions, legendary)
   ----------------------------------------------------------------------- */

.trait-block {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--outline-variant);
}

.trait-block:first-of-type { margin-top: 1.5rem; }

/* Section labels (Actions, Traits, Legendary Actions) */
.trait-block[data-section]::before {
  content: attr(data-section);
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chapter-accent);
  margin-bottom: 0.75rem;
}

.trait-block h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--on-surface);
  margin: 0 0 0.35rem;
  line-height: 1.4;
}

.trait-block p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 24px;
  color: rgba(218, 226, 253, 0.88);
  margin: 0;
}

/* -----------------------------------------------------------------------
   Inline game-term and damage-type chips
   ----------------------------------------------------------------------- */

.keyword {
  font-family: var(--font-mono);
  font-size: 0.82em;
  font-weight: 600;
  color: var(--on-surface);
  background: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  padding: 0.05em 0.35em;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.recharge {
  font-family: var(--font-mono);
  font-size: 0.82em;
  font-weight: 500;
  color: var(--outline);
  letter-spacing: 0.04em;
}

.damage-type {
  font-family: var(--font-mono);
  font-size: 0.82em;
  font-weight: 600;
  color: var(--chapter-accent);
  letter-spacing: 0.04em;
}

/* -----------------------------------------------------------------------
   License page -- quiet, document-like, no chapter accent
   ----------------------------------------------------------------------- */

body.chapter-license {
  --chapter-accent: var(--outline);
  --chapter-accent-soft: rgba(134, 149, 133, 0.20);
  --chapter-accent-bg: transparent;
}

body.chapter-license article {
  max-width: 44rem;
}

body.chapter-license h1 {
  border-left: none;
  border-bottom: 1px solid var(--outline);
  padding-left: 0;
  padding-bottom: 0.5rem;
}

body.chapter-license h2 {
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--outline);
  margin-top: 2rem;
}

/* -----------------------------------------------------------------------
   Responsive adjustments
   ----------------------------------------------------------------------- */

@media (max-width: 640px) {
  article.creature { padding: 2rem 1.25rem 3rem; }
  .creature-header h1 { font-size: 30px; }
  table.stat-bar th,
  table.stat-bar td { font-size: 11px; padding: 0.35rem 0; }
  .stat-block { padding: 1rem; }
}
