/* CJC + Ipa Store — Simbolos Culturais Brasileiros (cordel-almanac) */

/* =========================================================
   CSS CUSTOM PROPERTIES
   ========================================================= */
:root {
  --primary:          #009739;
  --primary-50:       #0F3324;
  --primary-300:      #1F6B43;
  --primary-500:      #2E9E5B;
  --primary-900:      #072117;
  --secondary:        #F2B705;
  --secondary-50:     #3A2E07;
  --secondary-900:    #8A6A02;
  --accent:           #FF6F61;
  --accent-dim:       #C9483E;
  --sky:              #5FB6E6;
  --sky-dim:          #2E7CA8;
  --purple:           #A86BE0;
  --purple-dim:       #6E3FA0;
  --brown-wood:       #8B4513;
  --neutral-50:       #FBF6E9;
  --neutral-100:      #F2EAD3;
  --neutral-200:      #D9CBA6;
  --neutral-400:      #A7B7A5;
  --neutral-500:      #7E9482;
  --neutral-700:      #234A37;
  --neutral-800:      #143226;
  --neutral-900:      #0C2A1F;
  --background:       #0C2A1F;
  --background-band:  #0F3324;
  --surface:          #143226;
  --surface-card:     #FBF6E9;
  --surface-card-alt: #F2EAD3;
  --text:             #FBF6E9;
  --text-muted:       #A7B7A5;
  --text-dim:         #7E9482;
  --text-on-card:     #143226;
  --text-on-card-muted: #3F5B49;
  --rule-carved:      #1F6B43;
  --rule-gold:        #F2B705;
  --max-width:        74rem;
  --article-max-width: 44rem;
  --container-px:     clamp(1.1rem, 3.5vw, 2.25rem);
  --font-display:     'Bitter', 'Roboto Slab', Georgia, 'Times New Roman', serif;
  --font-body:        'Mukta', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius-btn:       2px;
  --radius-card:      2px;
}

/* =========================================================
   RESET
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.68;
  color: var(--text);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }

/* =========================================================
   TYPOGRAPHY SCALE
   ========================================================= */
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--text);
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--text-on-card);
}
h3 {
  font-family: var(--font-body);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-on-card);
}
h4 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-on-card);
}
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }
em { font-style: italic; }
small { font-size: 0.875rem; line-height: 1.55; }

/* On-dark overrides */
.on-dark h2 { color: var(--text); }
.on-dark h3 { color: var(--text); }
.on-dark h4 { color: var(--text-muted); }

/* Eyebrow label */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--secondary);
  display: block;
  margin-bottom: 0.5rem;
}
.eyebrow-on-card {
  color: var(--brown-wood);
}

/* Lede / intro paragraph */
.lede {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* =========================================================
   CONTAINER & LAYOUT
   ========================================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-px);
}
.container--narrow {
  max-width: var(--article-max-width);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

/* =========================================================
   WOODCUT ORNAMENT SVG HELPERS
   ========================================================= */
/* Star glyph rendered as inline SVG via ::before / ::after or explicit spans */
.woodcut-star {
  display: inline-block;
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-right: 0.35em;
  fill: var(--secondary);
}
.woodcut-star--small {
  width: 8px;
  height: 8px;
}

/* Azulejo corner ornament — 14px tile motif */
.azulejo {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--sky);
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
}
.azulejo::before, .azulejo::after {
  content: '';
  position: absolute;
  background: var(--sky);
  border-radius: 50%;
}
.azulejo::before {
  width: 5px; height: 5px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* =========================================================
   CARVED RULES
   ========================================================= */
.carved-rule {
  border: none;
  height: 0;
  border-top: 2px solid var(--rule-gold);
  box-shadow: 0 3px 0 0 var(--rule-carved);
  margin: 1.5rem 0;
}
.carved-rule--full {
  margin: 1.5rem calc(var(--container-px) * -1);
}
.hairline {
  border: none;
  height: 1px;
  background: rgba(251, 246, 233, 0.14);
  margin: 1rem 0;
}
.hairline--card {
  background: rgba(20, 50, 38, 0.18);
}

/* =========================================================
   HEADER / NAV
   ========================================================= */
.site-header {
  background: var(--background-band);
  border-bottom: 2px solid var(--secondary);
  box-shadow: 0 5px 0 0 var(--rule-carved);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
  gap: 1rem;
}
.site-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-brand-star {
  width: 12px;
  height: 12px;
  fill: var(--secondary);
  flex-shrink: 0;
}

/* Desktop nav */
.site-nav { display: none; }
@media (min-width: 900px) {
  .site-nav {
    display: block;
  }
  .site-nav ul {
    display: flex;
    gap: 1.75rem;
    align-items: center;
  }
  .site-nav a {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    transition: color 200ms ease-out, border-color 200ms ease-out;
  }
  .site-nav a:hover,
  .site-nav a[aria-current="page"] {
    color: var(--text);
    border-bottom-color: var(--secondary);
  }
}

/* Mobile nav (no-JS <details>) */
.mobile-nav-toggle {
  display: flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--secondary);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
}
@media (min-width: 900px) {
  .mobile-nav-toggle { display: none; }
}
.mobile-nav {
  display: none;
  background: var(--surface);
  border: 1px solid var(--secondary);
  border-top: 2px solid var(--secondary);
  position: absolute;
  top: 3.75rem;
  left: 0;
  right: 0;
  z-index: 99;
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
}
.mobile-nav a {
  display: block;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.6rem var(--container-px);
}
.mobile-nav a:hover { color: var(--text); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  background: var(--background-band);
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0.75rem;
  border: 2px solid var(--secondary);
  box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 7px var(--rule-carved);
  pointer-events: none;
  z-index: 1;
}
/* Azulejo corner ornaments as pseudo-elements */
.hero-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.hero-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--sky);
}
.hero-corner--tl { top: 0.5rem; left: 0.5rem; border-right: none; border-bottom: none; }
.hero-corner--tr { top: 0.5rem; right: 0.5rem; border-left: none; border-bottom: none; }
.hero-corner--bl { bottom: 0.5rem; left: 0.5rem; border-right: none; border-top: none; }
.hero-corner--br { bottom: 0.5rem; right: 0.5rem; border-left: none; border-top: none; }

.hero-inner {
  position: relative;
  z-index: 3;
}
.hero-content {
  max-width: var(--article-max-width);
}
.hero h1 {
  margin-bottom: 0.75rem;
}
.hero .eyebrow {
  margin-bottom: 0.75rem;
}
.hero .eyebrow-rule {
  width: 3rem;
  height: 2px;
  background: var(--secondary);
  box-shadow: 0 3px 0 0 var(--rule-carved);
  margin-bottom: 1rem;
}
.hero .lede {
  margin-bottom: 1.5rem;
  max-width: 48ch;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

/* Hero grid with stat blocks */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 3rem;
  }
}

/* Stat block stack */
.stat-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (min-width: 900px) {
  .stat-stack {
    grid-template-columns: 1fr 1fr;
    width: 16rem;
  }
}

/* Inner page hero */
.hero--inner {
  padding: 2.5rem 0 2rem;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-btn);
  cursor: pointer;
  border: none;
  transition: background-color 200ms ease-out, box-shadow 200ms ease-out;
}
.btn-primary {
  background: var(--accent);
  color: var(--text-on-card);
  border: 2px solid var(--secondary);
  box-shadow: 0 0 0 0 transparent;
}
.btn-primary:hover {
  background: var(--accent-dim);
  box-shadow: 3px 3px 0 0 var(--brown-wood);
}
.btn-primary:active {
  box-shadow: 1px 1px 0 0 var(--brown-wood);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--secondary);
}
.btn-secondary:hover {
  box-shadow: 3px 3px 0 0 var(--brown-wood);
}
.btn-secondary:active {
  box-shadow: 1px 1px 0 0 var(--brown-wood);
}
.btn:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
}

/* =========================================================
   STAT BLOCK
   ========================================================= */
.stat-block {
  background: var(--surface-card);
  border: 2px solid var(--secondary);
  box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px var(--rule-carved);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  position: relative;
}
.stat-block .azulejo-ornament {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
}
.stat-block-num {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.0;
  color: var(--text-on-card);
  display: block;
}
.stat-block-caption {
  font-family: var(--font-body);
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brown-wood);
  display: block;
  margin-top: 0.3rem;
}
.stat-block-arm {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.arm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.arm-dot--gold { background: var(--secondary); }
.arm-dot--sky  { background: var(--sky); }
.arm-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-card-muted);
}

/* =========================================================
   MAIN LAYOUT — 12-COL ALMANAC GRID
   ========================================================= */
.page-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 1024px) {
  .page-body {
    grid-template-columns: 1fr 17rem;
    align-items: start;
  }
}

.article-panel {
  background: var(--surface-card);
  border: 1px solid var(--rule-carved);
  border-radius: var(--radius-card);
  padding: 2.5rem 2rem;
  position: relative;
}
.article-panel::before,
.article-panel::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--sky);
}
.article-panel::before { top: 0.5rem; left: 0.5rem; border-right: none; border-bottom: none; }
.article-panel::after  { bottom: 0.5rem; right: 0.5rem; border-left: none; border-top: none; }

.article-content {
  color: var(--text-on-card);
  font-size: 1.0625rem;
  line-height: 1.68;
}
.article-content h2 {
  color: var(--text-on-card);
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}
.article-content h2:first-child { margin-top: 0; }
.article-content h3 {
  color: var(--text-on-card);
  margin-top: 1.75rem;
  margin-bottom: 0.4rem;
}
.article-content h4 {
  margin-top: 1.25rem;
  margin-bottom: 0.3rem;
}
.article-content p { margin-bottom: 1rem; }
.article-content ul,
.article-content ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 0.4rem; }
.article-content a {
  color: var(--primary-300);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-content a:hover { color: var(--primary-500); }
.article-content blockquote {
  border-left: 3px solid var(--purple-dim);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
}

/* Section marker */
.section-marker {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.section-marker-eyebrow {
  font-family: var(--font-body);
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brown-wood);
}
.section-h2-rule {
  border: none;
  height: 0;
  border-top: 2px solid var(--secondary);
  box-shadow: 0 3px 0 0 var(--rule-carved);
  margin-bottom: 1rem;
}

/* Inline citation markers */
sup a.cite-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary-900);
  text-decoration: none;
  padding: 0 0.1em;
  transition: color 200ms ease-out;
}
sup a.cite-link:hover {
  color: var(--secondary);
}

/* =========================================================
   ALMANAQUE RAIL (SIDEBAR)
   ========================================================= */
.almanac-rail {
  padding: 1.5rem 0;
}
@media (min-width: 1024px) {
  .almanac-rail {
    padding: 1.5rem 0 1.5rem 2rem;
    border-left: 1px solid rgba(251, 246, 233, 0.14);
    position: sticky;
    top: calc(3.75rem + 1.5rem);
  }
}

.rail-block {
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--secondary);
  padding-top: 0.75rem;
}
.rail-block-title {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.rail-block ul {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.rail-block a {
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-decoration: none;
}
.rail-block a:hover { color: var(--text); }

/* Component legend */
.rail-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rail-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.legend-glyph {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.legend-glyph--gold { fill: var(--secondary); }
.legend-glyph--sky { fill: none; stroke: var(--sky); stroke-width: 1.5; }

/* Regulatory chips */
.reg-chips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.reg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid;
  border-radius: 2px;
  padding: 0.3rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.reg-chip--coral {
  border-color: var(--accent-dim);
  color: var(--accent);
}
.reg-chip--gold {
  border-color: var(--secondary-900);
  color: var(--secondary);
}
.reg-chip--sky {
  border-color: var(--sky-dim);
  color: var(--sky);
}

/* Citation density stars */
.cite-density {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
}
.cite-density svg {
  width: 10px;
  height: 10px;
  fill: var(--secondary);
  opacity: 0.7;
}

/* =========================================================
   CONTENT SECTION (page body bands)
   ========================================================= */
.content-band {
  padding: 3rem 0;
}
.content-band--dark {
  background: var(--background);
}
.content-band--band {
  background: var(--background-band);
}

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: var(--surface-card);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-card);
  padding: 1.6rem;
  position: relative;
  transition: box-shadow 200ms ease-out;
}
.card:hover {
  box-shadow: 3px 3px 0 0 var(--brown-wood);
}
.card-corner-ornament {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--sky);
}
.card-corner-ornament--tl { top: 0.5rem; left: 0.5rem; border-right: none; border-bottom: none; }
.card-corner-ornament--br { bottom: 0.5rem; right: 0.5rem; border-left: none; border-top: none; }
.card-eyebrow {
  font-family: var(--font-body);
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brown-wood);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-on-card);
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(20, 50, 38, 0.18);
  padding-bottom: 0.5rem;
}
.card-body {
  color: var(--text-on-card);
  font-size: 0.9375rem;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================================
   CALLOUTS
   ========================================================= */
.callout {
  background: var(--surface-card);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-card);
  padding: 1.4rem;
  margin: 1.5rem 0;
}
.callout--regulatory {
  border-color: var(--surface-card);
  border-left: 4px solid var(--sky-dim);
}
.callout--caution {
  border-color: var(--surface-card);
  border-left: 4px solid var(--accent-dim);
}
.callout-eyebrow {
  font-family: var(--font-body);
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.callout--regulatory .callout-eyebrow { color: var(--sky-dim); }
.callout--caution .callout-eyebrow { color: var(--accent-dim); }
.callout--default .callout-eyebrow { color: var(--brown-wood); }
.callout-body {
  color: var(--text-on-card);
  font-size: 0.9375rem;
}

/* =========================================================
   PULL QUOTE
   ========================================================= */
.pull-quote {
  border-left: 3px solid var(--purple-dim);
  padding: 0.75rem 1.5rem;
  margin: 2rem 0;
}
.pull-quote blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-on-card);
}
.pull-quote .quote-star {
  display: inline;
  vertical-align: middle;
  margin-right: 0.3em;
}
.pull-quote cite {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--purple-dim);
  margin-top: 0.5rem;
  font-style: normal;
}

/* =========================================================
   TABLES
   ========================================================= */
.almanac-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.almanac-table {
  width: 100%;
  border-top: 2px solid var(--secondary);
  border-bottom: 1px solid var(--rule-carved);
}
.almanac-table thead th {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brown-wood);
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--secondary);
  background: var(--surface-card);
}
.almanac-table tbody td {
  font-size: 0.9375rem;
  color: var(--text-on-card);
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(20, 50, 38, 0.18);
  vertical-align: top;
  background: var(--surface-card);
}
.almanac-table tbody tr:hover td {
  border-left: 2px solid var(--secondary);
  padding-left: calc(1rem - 2px);
}
.almanac-table .num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* =========================================================
   FIGURES
   ========================================================= */
.figure-frame {
  margin: 2rem 0;
  border: 2px solid var(--secondary);
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
}
.figure-frame::after {
  content: '';
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--sky);
  border-left: none;
  border-bottom: none;
}
.figure-frame img {
  width: 100%;
  height: auto;
}
.figure-caption {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--brown-wood);
  background: var(--surface-card);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.figure-caption-dark {
  color: var(--secondary);
  background: var(--surface);
}

/* =========================================================
   REFERENCES LIST
   ========================================================= */
.references-list {
  list-style: none;
  counter-reset: ref-counter;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.references-list li {
  counter-increment: ref-counter;
  background: var(--surface-card);
  border-left: 3px solid var(--secondary);
  padding: 0.75rem 1rem 0.75rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-on-card);
  position: relative;
  border-radius: 0 2px 2px 0;
}
.references-list li::before {
  content: counter(ref-counter);
  position: absolute;
  left: -1.5rem;
  width: 1.25rem;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--secondary);
}
.references-list a {
  color: var(--sky-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.references-list a:hover { color: var(--sky); }
.ref-doi, .ref-pmid {
  font-size: 0.8125rem;
  color: var(--text-on-card-muted);
  font-weight: 500;
  display: block;
  margin-top: 0.2rem;
}

/* =========================================================
   COMPONENT CHIPS
   ========================================================= */
.component-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid;
  border-radius: 2px;
  padding: 0.2rem 0.4rem;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.chip--gold {
  border-color: var(--secondary-900);
  color: var(--secondary);
  background: var(--surface-card);
}
.chip--sky {
  border-color: var(--sky-dim);
  color: var(--sky-dim);
  background: var(--surface-card);
}

/* =========================================================
   FAQ ACCORDION
   ========================================================= */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}
.faq-item {
  background: var(--surface-card);
  border: 1px solid rgba(20, 50, 38, 0.18);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.faq-question {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-on-card);
  padding: 1rem 1.25rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-question:hover { background: rgba(20, 50, 38, 0.05); }
.faq-question .faq-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--secondary);
  stroke-width: 2;
  transition: transform 200ms ease-out;
}
.faq-item.is-open .faq-question .faq-icon { transform: rotate(45deg); }
.faq-answer {
  display: none;
  padding: 0 1.25rem 1rem;
  color: var(--text-on-card);
  font-size: 0.9375rem;
  border-top: 1px solid rgba(20, 50, 38, 0.12);
}
.faq-item.is-open .faq-answer { display: block; }

/* =========================================================
   CONTACT FORM
   ========================================================= */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-field label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brown-wood);
}
.form-field input,
.form-field select,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-on-card);
  background: var(--surface-card);
  border: 1px solid rgba(20, 50, 38, 0.35);
  border-radius: var(--radius-card);
  padding: 0.7rem 0.9rem;
  width: 100%;
  transition: border-color 200ms ease-out;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
  border-color: var(--secondary);
}
.form-field textarea { min-height: 8rem; resize: vertical; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  margin-top: 4rem;
}
.footer-top {
  background: var(--background-band);
  border-top: 2px solid var(--secondary);
  box-shadow: inset 0 5px 0 0 var(--rule-carved);
  padding: 3rem 0 2rem;
}
.footer-azulejo-strip {
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--sky) 0px 4px,
    transparent 4px 10px
  );
  margin-bottom: 1.5rem;
}
.footer-disclaimer {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.footer-disclaimer svg {
  flex-shrink: 0;
  fill: var(--secondary);
}
.footer-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
  .footer-columns { grid-template-columns: repeat(4, 1fr); }
}
.footer-col-heading {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.75rem;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.footer-col a {
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
}
.footer-col a:hover { color: var(--secondary); }

.footer-divider {
  border: none;
  height: 1px;
  background: var(--rule-carved);
  margin: 1.5rem 0 0;
}
.footer-bottom {
  background: var(--background);
  padding: 1rem 0;
}
.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-colophon {
  font-size: 0.8125rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.footer-copyright {
  font-size: 0.8125rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.footer-copyright svg {
  fill: var(--secondary);
}

/* =========================================================
   BREADCRUMB
   ========================================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.75rem 0;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep {
  color: var(--text-dim);
}

/* =========================================================
   404 PAGE
   ========================================================= */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem var(--container-px);
}
.error-page h1 {
  font-size: clamp(4rem, 12vw, 8rem);
  color: var(--secondary);
  line-height: 1;
  margin-bottom: 1rem;
}
.error-page p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

/* =========================================================
   UTILITY
   ========================================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
