/* Mwata Kazembe Kingdom — Institutional Design System */

:root {
  --royal-blue: #405f8f;
  --royal-blue-mid: #355280;
  --ceremonial-red: #f71932;
  --oxblood: #4a0404;
  --ivory: #f4f0e6;
  --parchment: #e8e0d0;
  --ink: #121212;
  --bronze: #9a7b4f;
  --river: #3d6b7a;
  --stone: #4a4f57;
  --white: #ffffff;
  --surface: #faf9f6;
  --border: rgba(12, 31, 61, 0.12);
  --shadow: 0 8px 28px rgba(12, 31, 61, 0.06);
  --font-serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --header-h: 72px;
  --utility-h: 36px;
  --container: min(1200px, 92vw);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hero-object-position-desktop: center 18%;
  --hero-object-position-mobile: center top;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding-top: var(--header-h);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

main,
section,
header,
footer {
  max-width: 100%;
}

a {
  color: var(--royal-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ceremonial-red);
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  color: var(--royal-blue);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--royal-blue);
  color: var(--white);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Utility bar — ceremonial red: social / contact links */
.utility-bar {
  background: var(--ceremonial-red);
  color: var(--white);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  min-height: var(--utility-h);
}

.utility-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.45rem 4vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.utility-bar a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.utility-bar a:hover {
  color: var(--white);
}

.utility-left {
  display: flex;
  gap: 1.25rem;
}

.utility-right {
  display: flex;
  gap: 1rem;
}

/* Header — royal blue: coat of arms, brand, navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--royal-blue);
  border-bottom: 5px solid var(--white);
  box-shadow: 0 2px 16px rgba(12, 31, 61, 0.18);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.65rem clamp(16px, 4vw, 24px);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  min-width: 0;
}

.brand:hover {
  color: inherit;
}

/* Coat of arms in header — no border/box, transparent background preserved */
.brand-coat-of-arms {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* Fallback text mark (hidden when image loads) */
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--royal-blue);
  color: var(--bronze);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid var(--bronze);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--white);
}

.brand-text span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bronze);
  font-weight: 600;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav-item {
  position: relative;
}

.nav-item > a {
  display: block;
  padding: 0.5rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ivory);
}

.nav-item > a.is-active,
.nav-item:hover > a {
  color: var(--white);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  z-index: 50;
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.nav-dropdown a:hover {
  background: var(--ivory);
  color: var(--ceremonial-red);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  background: var(--white);
  color: var(--royal-blue);
  border: none;
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
}

.menu-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-bars span {
  width: 18px;
  height: 2px;
  background: currentColor;
}

/* Mobile drawer — full-width dropdown below sticky header */
.mobile-drawer {
  position: fixed;
  top: var(--drawer-top, var(--header-h));
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(12, 31, 61, 0.45);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s;
}

.mobile-drawer.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer-panel {
  position: relative;
  width: 100%;
  max-height: calc(100vh - var(--drawer-top, var(--header-h)));
  background: var(--white);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
  box-shadow: 0 8px 32px rgba(12, 31, 61, 0.18);
}

.mobile-drawer.open .mobile-drawer-panel {
  transform: translateY(0);
  opacity: 1;
}

.drawer-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  color: var(--stone);
  border-radius: 3px;
  z-index: 1;
}

.mobile-nav {
  padding: 3.25rem clamp(16px, 4vw, 24px) 1.5rem;
}

.mobile-nav-top {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.65rem 0;
  color: var(--royal-blue);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.mobile-sub a {
  display: block;
  padding: 0.4rem 0 0.4rem 0.75rem;
  font-size: 0.9rem;
  color: var(--stone);
  text-decoration: none;
}

.mobile-nav-group {
  margin-bottom: 0.5rem;
}

/* Pages */
.page {
  display: none;
}

.page.active {
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
}

.container.narrow {
  max-width: 780px;
}

.section {
  padding: 4rem 0;
}

.section:nth-child(even) {
  background: var(--white);
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--bronze);
  margin: 0 0 0.5rem;
}

.section-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  margin: 0 0 0.75rem;
}

.section-deck {
  max-width: 62ch;
  color: var(--stone);
  margin: 0 0 2rem;
}

.lead-statement {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  line-height: 1.5;
  color: var(--royal-blue);
  text-align: center;
  margin: 0;
}

/* Hero */
.royal-hero {
  position: relative;
  color: var(--white);
}

.royal-hero-split {
  display: grid;
  grid-template-columns: 1fr min(48%, 520px);
  min-height: min(78vh, 720px);
  background: var(--royal-blue);
  align-items: stretch;
}

.royal-hero-split .hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.5rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 36rem;
}

.royal-hero-split .hero-media {
  position: relative;
  min-height: 280px;
  overflow: hidden;
}

.royal-hero-split .hero-media img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  object-position: var(--hero-object-position-desktop);
}

.royal-hero-split .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to left,
    transparent 0%,
    rgba(12, 31, 61, 0.15) 30%,
    rgba(12, 31, 61, 0.45) 100%
  );
  pointer-events: none;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-object-position-desktop);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(12, 31, 61, 0.75) 0%,
    rgba(12, 31, 61, 0.35) 50%,
    rgba(12, 31, 61, 0.12) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 4vw 5rem;
  max-width: 900px;
}

.hero-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 1rem;
}

.royal-hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: var(--white);
  margin: 0 0 1rem;
  max-width: 16ch;
}

.hero-sub {
  font-size: 1.05rem;
  max-width: 52ch;
  opacity: 0.92;
  margin-bottom: 1.75rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: var(--ceremonial-red);
  color: var(--white);
  border-color: var(--ceremonial-red);
}

.btn-primary:hover {
  background: var(--oxblood);
  color: var(--white);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--royal-blue);
  border-color: var(--royal-blue);
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
}

.link-arrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ceremonial-red);
}

.link-arrow::after {
  content: " →";
}

/* Cards */
.authority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1.25rem;
}

.authority-card {
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.card-media {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--parchment);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-media-placeholder {
  display: grid;
  place-items: center;
  color: var(--stone);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.authority-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.office-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bronze);
  margin: 0;
}

.authority-card h3 {
  font-size: 1.25rem;
  margin: 0;
}

/* Facts strip */
.facts-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.fact-cell {
  background: var(--royal-blue);
  color: var(--ivory);
  padding: 1.25rem;
}

.fact-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bronze);
  margin-bottom: 0.35rem;
}

.fact-cell strong {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
}

/* Governance panel */
.governance-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 1rem;
}

.gov-node {
  background: var(--white);
  border-left: 4px solid var(--ceremonial-red);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.gov-node[data-tier="1"] {
  border-left-color: var(--bronze);
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-mid) 100%);
  color: var(--ivory);
}

.gov-node[data-tier="1"] h3 {
  color: var(--white);
  font-size: 1.5rem;
}

.gov-tier {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.gov-node h3 {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.1rem;
}

/* Communications */
.comm-grid,
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
}

.comm-card,
.news-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.25rem;
}

.comm-category {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--river);
}

.comm-card h3,
.news-card h3 {
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.comm-card time,
.news-card time {
  font-size: 0.8rem;
  color: var(--stone);
}

.is-placeholder {
  border-style: dashed;
  opacity: 0.92;
}

/* Pillars */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 1rem;
}

.pillar-card {
  background: var(--ivory);
  border: 1px solid var(--border);
  padding: 1.25rem;
}

.pillar-card h3 {
  font-size: 1.05rem;
  margin-top: 0;
}

/* Split feature */
.split-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.split-media img {
  border: 1px solid var(--border);
}

.caption {
  font-size: 0.78rem;
  color: var(--stone);
  margin-top: 0.5rem;
}

.ceremony-stages {
  padding-left: 1.1rem;
  margin: 1rem 0;
}

.ceremony-stages li {
  margin-bottom: 0.35rem;
}

/* History */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
}

.history-chapter {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-top: 3px solid var(--bronze);
}

.chapter-marker {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ceremonial-red);
}

.triumph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
}

.triumph-card {
  background: var(--royal-blue);
  color: var(--ivory);
  padding: 1.25rem;
}

.triumph-card h3 {
  color: var(--white);
  font-size: 1.1rem;
}

/* Map */
.map-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

.map-figure {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 0.5rem;
}

.map-figure figcaption {
  font-size: 0.78rem;
  color: var(--stone);
  padding: 0.75rem 0.5rem 0;
}

.map-aside ul {
  padding-left: 1.1rem;
}

.agency-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 0.75rem;
}

.agency-list li {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1rem;
}

.badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  margin-top: 0.35rem;
}

.badge-required {
  background: var(--parchment);
  color: var(--ceremonial-red);
  border: 1px dashed var(--ceremonial-red);
}

/* Page heroes */
.page-hero {
  position: relative;
  background: var(--royal-blue);
  color: var(--white);
  padding: 3.5rem 0;
}

.page-hero-compact {
  padding: 3rem 0;
}

.page-hero-mutomboko,
.page-hero .page-hero-bg {
  min-height: 280px;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  color: var(--white);
  margin: 0.25rem 0 0.5rem;
}

.page-hero .eyebrow {
  color: var(--bronze);
}

.page-body {
  padding: 2.5rem clamp(16px, 4vw, 24px) 4rem;
}

.subsection {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.profile-portrait figcaption {
  font-size: 0.78rem;
  color: var(--stone);
  margin-top: 0.5rem;
}

.table-wrap {
  overflow-x: auto;
}

.ruler-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ruler-table th,
.ruler-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.ruler-table th {
  background: var(--royal-blue);
  color: var(--white);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.is-uncertain {
  background: rgba(154, 123, 79, 0.08);
}

.confidence {
  font-size: 0.75rem;
  color: var(--stone);
}

.symbol-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 1rem;
}

.gallery-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  background: var(--parchment);
  color: var(--stone);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.ceremony-step {
  border-left: 3px solid var(--ceremonial-red);
  padding: 0 0 1.25rem 1rem;
  margin-bottom: 1rem;
}

.step-day {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bronze);
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline-entry {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1rem;
}

.timeline-entry.is-current {
  border-left: 4px solid var(--ceremonial-red);
}

.timeline-reign {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--river);
}

/* Accordions */
.accordion-trigger {
  width: 100%;
  text-align: left;
  background: var(--royal-blue);
  color: var(--white);
  border: none;
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.accordion-panel {
  display: none;
  padding: 1rem;
  background: var(--ivory);
  border: 1px solid var(--border);
  border-top: none;
}

.accordion-panel.open {
  display: block;
}

/* Newsroom */
.news-tools {
  margin-bottom: 1.5rem;
}

.news-tools input {
  width: 100%;
  max-width: 400px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  font: inherit;
  margin: 0.5rem 0 1rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-btn {
  border: 1px solid var(--border);
  background: var(--white);
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--royal-blue);
  color: var(--white);
  border-color: var(--royal-blue);
}

.publication-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
}

.publication-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.25rem;
}

/* Archive register */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
}

.archive-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--royal-blue);
  padding: 1.25rem;
}

.archive-card.is-pending {
  border-left-color: var(--border);
  background: var(--surface);
}

.archive-type {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--river);
}

.archive-card h3 {
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.archive-card time {
  font-size: 0.8rem;
  color: var(--stone);
}

/* Credited media figure groups (Office of the Mwata) */
.media-figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.media-figure-grid-3 {
  margin-top: 1rem;
}

.media-figure {
  margin: 0;
}

.media-figure .figure-media {
  background: var(--surface);
  border: 1px solid var(--border);
}

.media-figure .figure-media img {
  width: 100%;
  height: 300px;
  object-fit: contain;
  object-position: center;
  display: block;
}

.media-figure .figure-credit {
  margin-top: 0.5rem;
}

/* Public Records & Media (supporting media block) */
.media-records {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.media-records-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--royal-blue-mid);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.media-records-deck {
  font-size: 0.9rem;
  color: var(--stone);
  max-width: 60ch;
  margin: 0 0 1.5rem;
}

.media-video {
  margin: 0 0 1.25rem;
  max-width: 760px;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16 / 9) {
  .video-embed {
    height: 0;
    padding-bottom: 56.25%;
  }
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-embed-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-mid) 100%);
  color: var(--ivory);
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
}

.video-embed-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ceremonial-red);
  color: #fff;
  font-size: 1.2rem;
  padding-left: 4px;
}

.video-embed-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.video-embed-play:hover .video-embed-icon {
  transform: scale(1.06);
}

.media-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--stone);
  margin-top: 0.6rem;
}

.media-refs-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--royal-blue-mid);
  margin: 1.5rem 0 0.75rem;
}

.media-ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
}

.media-ref-list li {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--river);
  padding: 1rem 1.1rem;
}

.media-ref-source {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone);
  margin-top: 0.2rem;
}

.media-ref-list p {
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 1rem;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.25rem;
}

/* Footer */
.site-footer {
  background: var(--royal-blue);
  color: var(--parchment);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 4vw;
}

.footer-brand strong {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.footer-col h3 {
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

.footer-col h3 a,
.footer-col ul a {
  color: var(--parchment);
  text-decoration: none;
  font-size: 0.82rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.25rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.8rem;
}

.footer-bottom a {
  color: var(--bronze);
}

.section-cta {
  margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 960px) {
  .primary-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .split-feature,
  .map-layout,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .gov-node[data-tier="1"] {
    grid-column: auto;
  }
}

@media (max-width: 600px) {
  .brand-text strong {
    font-size: 1rem;
  }

  .brand-text span {
    display: none;
  }

  .header-inner {
    gap: 0.75rem;
  }
}

@media (max-width: 900px) {
  .royal-hero-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .royal-hero-split .hero-media {
    order: -1;
    max-height: 42vh;
  }

  .royal-hero-split .hero-media img {
    object-position: var(--hero-object-position-mobile);
  }

  .royal-hero-split .hero-overlay {
    background: linear-gradient(
      to bottom,
      transparent 30%,
      rgba(12, 31, 61, 0.5) 100%
    );
  }

  .royal-hero-split .hero-content {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .royal-hero {
    min-height: auto;
  }

  .hero-ctas {
    flex-direction: column;
  }

  .hero-ctas .btn {
    width: 100%;
  }

  .facts-strip {
    grid-template-columns: 1fr;
  }
}

/* ——— Refinement: credits, motion, interactivity ——— */

.hero-credit {
  margin-top: 1rem;
  font-size: 0.72rem;
  opacity: 0.85;
  letter-spacing: 0.04em;
}

.glance-media {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1.5rem;
  align-items: start;
}

.glance-media .credited-figure {
  margin: 0;
}

.glance-media .figure-media {
  border: 1px solid var(--border);
}

.glance-media .figure-media img {
  width: 100%;
  height: auto;
  display: block;
}

.glance-flag .figure-media {
  background: var(--white);
}

.glance-map {
  max-width: 100%;
}

.identity-figure {
  max-width: 460px;
  margin: 0 0 2rem 0;
}

.identity-figure .figure-media {
  background: var(--white);
  border: 1px solid var(--border);
}

.identity-figure .figure-media img {
  width: 100%;
  height: auto;
  display: block;
}

.figure-credit,
.image-credit {
  display: block;
  font-size: 0.72rem;
  color: var(--stone);
  margin-top: 0.45rem;
}

.figure-credit a {
  color: var(--river);
}

.has-hover-credit {
  position: relative;
  overflow: hidden;
}

.hover-credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.55rem 0.75rem;
  font-size: 0.68rem;
  color: var(--white);
  background: linear-gradient(transparent, rgba(12, 31, 61, 0.88));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.has-hover-credit:hover .hover-credit,
.has-hover-credit:focus-within .hover-credit,
.gallery-item .hover-credit {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item .hover-credit {
  opacity: 1;
  transform: none;
  position: static;
  background: none;
  color: var(--stone);
  padding: 0.35rem 0 0;
}

.reveal-block {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.reveal-block.is-visible {
  opacity: 1;
  transform: none;
}

.story-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.story-chips {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.story-chip {
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.story-chip:hover,
.story-chip:focus-visible {
  border-color: var(--bronze);
  box-shadow: var(--shadow);
}

.history-detail {
  background: var(--ivory);
  border: 1px solid var(--border);
  padding: 1.25rem;
  min-height: 220px;
}

.history-detail-placeholder {
  color: var(--stone);
  margin: 0;
}

.lineage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 1rem;
}

.lineage-card {
  background: var(--white);
  border: 1px solid var(--border);
  overflow: hidden;
}

.lineage-card.is-current {
  border-left: 4px solid var(--ceremonial-red);
}

.lineage-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1rem;
  cursor: pointer;
  font: inherit;
}

.lineage-panel {
  display: none;
  padding: 0 1rem 1rem;
}

.lineage-card.open .lineage-panel {
  display: block;
}

.lineage-reign {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--river);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.verify-note {
  font-size: 0.82rem;
  color: var(--ceremonial-red);
}

.journey-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.journey-rail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.journey-step {
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  font: inherit;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.journey-step span {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bronze);
}

.journey-step.active {
  background: var(--royal-blue);
  border-color: var(--royal-blue);
  color: var(--white);
}

.journey-step.active span {
  color: var(--bronze);
}

.journey-panel {
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.25rem;
}

.journey-panel.active {
  display: block;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
}

.people-card {
  background: var(--white);
  border: 1px solid var(--border);
}

.people-card-body {
  padding: 1rem;
}

.premium-gallery .gallery-item {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.gallery-item-media {
  aspect-ratio: 4/3;
  overflow: hidden;
  border: 1px solid var(--border);
}

.gallery-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

img[data-credit-id="mutomboko-dance-2017-01"] {
  object-position: center 15% !important;
}

.gallery-item:hover .gallery-item-media img {
  transform: scale(1.04);
}

.gallery-item-title {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--royal-blue);
}

.visit-cta-panel {
  background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-mid) 100%);
  color: var(--ivory);
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.visit-cta-panel .section-head h2,
.visit-cta-panel .eyebrow {
  color: var(--white);
}

.visit-cta-panel .section-deck {
  color: var(--parchment);
}

.visit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.visit-note {
  margin: 0;
  font-size: 0.9rem;
}

.timeline-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}

.timeline-entry {
  cursor: pointer;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.timeline-entry.selected {
  border-color: var(--bronze);
  box-shadow: var(--shadow);
}

.timeline-detail {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  background: var(--ivory);
  border: 1px solid var(--border);
  padding: 1rem;
  min-height: 180px;
}

.timeline-detail.open {
  border-left: 4px solid var(--ceremonial-red);
}

.hidden {
  display: none !important;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 300;
  background: rgba(12, 31, 61, 0.08);
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--bronze), var(--ceremonial-red));
  transition: width 0.12s linear;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(12, 31, 61, 0.88);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-inner {
  max-width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--white);
  padding: 1rem;
}

.lightbox-inner img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--white);
  border: none;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
}

.lightbox-caption h3 {
  margin: 0.75rem 0 0.35rem;
}

.lightbox-caption p {
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 960px) {
  .story-layout,
  .journey-shell,
  .timeline-layout {
    grid-template-columns: 1fr;
  }

  .journey-rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .journey-step {
    min-width: 140px;
  }
}

/* News ticker */
.news-ticker {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--ceremonial-red);
  color: var(--white);
  padding: 0.55rem 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ticker-label {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 1rem;
  color: var(--bronze);
}

.ticker-track {
  display: flex;
  gap: 2.5rem;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
}

.ticker-track a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.ticker-track a:hover {
  color: var(--bronze);
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Home section nav */
.home-section-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.5rem 4vw;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.home-section-nav::-webkit-scrollbar {
  display: none;
}

.home-section-link {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--royal-blue);
  padding: 0.4rem 0.65rem;
  border: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.home-section-link:hover,
.home-section-link.active {
  color: var(--ceremonial-red);
  border-color: var(--border);
  background: var(--ivory);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--royal-blue);
  color: var(--ivory);
  padding: 1.35rem;
  border-top: 3px solid var(--bronze);
}

.stat-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--white);
  line-height: 1.1;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bronze);
  margin-top: 0.35rem;
}

.stat-note {
  font-size: 0.82rem;
  opacity: 0.88;
  margin: 0.5rem 0 0;
}

/* Royal spotlight */
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 1rem;
}

.spotlight-card {
  background: var(--white);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.spotlight-body {
  padding: 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.spotlight-person {
  font-size: 0.85rem;
  color: var(--stone);
  margin: 0;
}

/* Full lineage rail */
.lineage-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.lineage-rail {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}

.lineage-rail-item {
  flex: 0 0 168px;
  scroll-snap-align: start;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 0.75rem;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.lineage-rail-item.active,
.lineage-rail-item.is-current {
  border-color: var(--ceremonial-red);
  box-shadow: var(--shadow);
}

.lineage-rail-item.is-uncertain {
  border-style: dashed;
}

.lineage-rail-num {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--bronze);
}

.lineage-rail-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--royal-blue);
  margin-top: 0.25rem;
}

.lineage-rail-name,
.lineage-rail-reign {
  display: block;
  font-size: 0.78rem;
  color: var(--stone);
}

.lineage-detail {
  background: var(--ivory);
  border: 1px solid var(--border);
  border-left: 4px solid var(--ceremonial-red);
  padding: 1.5rem;
  min-height: 200px;
}

.lineage-detail-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.lineage-detail-media-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lineage-detail-media {
  background: var(--parchment);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
}

.lineage-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lineage-detail-credit {
  display: block;
  font-size: 0.6rem;
  color: var(--stone);
  text-align: center;
  line-height: 1.2;
}

.lineage-detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lineage-detail-info h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--royal-blue-mid);
}

.lineage-detail-info p {
  margin: 0 0 0.5rem 0;
}

.lineage-detail-info ul {
  margin: 0 0 0.5rem 0;
  padding-left: 1.25rem;
}

@media (max-width: 768px) {
  .lineage-detail-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .lineage-detail-media-wrap {
    max-width: 180px;
    margin: 0 auto;
  }
}

.lineage-detail-placeholder {
  color: var(--stone);
  margin: 0;
}

.media-sources-panel {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.media-sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.media-source-item {
  background: var(--ivory);
  border: 1px solid var(--border);
  padding: 1rem;
}

.media-source-item span {
  display: block;
  font-size: 0.75rem;
  color: var(--bronze);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

.media-source-item p {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--stone);
}

@media (max-width: 960px) {
  .spotlight-grid {
    grid-template-columns: 1fr;
  }
}

.pending-note {
  font-size: 0.88rem;
  color: var(--stone);
  font-style: italic;
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  background: var(--parchment);
  border-left: 3px solid var(--bronze);
}

.editorial-note {
  font-size: 0.9rem;
  color: var(--stone);
  margin-top: 1rem;
  max-width: 65ch;
}

.official-notice-strip {
  background: var(--ivory);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.notice-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}

.notice-strip-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ceremonial-red);
}

.notice-strip-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.notice-strip-item {
  font-size: 0.88rem;
  color: var(--royal-blue);
  text-decoration: none;
}

.notice-strip-item span {
  font-weight: 700;
  margin-right: 0.35rem;
}

.clan-registry-wrap {
  max-width: 100%;
  margin-top: 1.5rem;
}

.clan-registry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.clan-registry-table th,
.clan-registry-table td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.clan-registry-table th {
  background: var(--royal-blue);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.clan-registry-table tbody tr:nth-child(even) {
  background: rgba(64, 95, 143, 0.04);
}

.clan-registry-table tbody tr:hover {
  background: rgba(64, 95, 143, 0.07);
}

/* Empty-state row — spans all columns */
.registry-empty-row td {
  text-align: center;
  color: var(--stone);
  padding: 2rem 1.5rem;
  font-style: italic;
  font-size: 0.92rem;
  border: 1px solid var(--border);
}

.verification-badge {
  font-size: 0.75rem;
  color: var(--bronze);
  font-weight: 600;
}

.gov-institution-grid,
.agency-grid,
.clan-roles-grid,
.ruler-profiles-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
}

.gov-institution-card,
.agency-card,
.clan-role-card,
.ruler-profile-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.25rem;
}

.ruler-profile-card {
  grid-column: 1 / -1;
  max-width: 72ch;
}

.source-citation {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
}

.source-citation a {
  color: var(--river);
}

.profile-events {
  margin: 0.5rem 0;
  padding-left: 1.2rem;
}

.source-note {
  font-size: 0.85rem;
  color: var(--stone);
}

.news-ticker-static .ticker-track {
  animation: none;
  flex-wrap: wrap;
  white-space: normal;
}

.stats-grid-inline {
  margin-top: 1.5rem;
}

.gallery-item-type {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bronze);
  margin-top: 0.25rem;
}

.lineage-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(min(280px, 100%), 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .lineage-shell {
    grid-template-columns: 1fr;
  }
}

/* ——— Museum Showcase Styling ——— */
.museum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.museum-item {
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.museum-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(12, 31, 61, 0.12);
}

.museum-media {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  background: var(--parchment);
}

.museum-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.museum-item:hover .museum-media img {
  transform: scale(1.03);
}

.museum-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.museum-era {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ceremonial-red);
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.museum-body h3 {
  margin: 0 0 0.5rem 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--royal-blue-mid);
}

.museum-body p {
  font-size: 0.88rem;
  color: var(--stone);
  line-height: 1.5;
  margin: 0 0 1rem 0;
  flex-grow: 1;
}

.museum-evidence {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--stone);
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin: 0;
}


/* ——— Store and Cart Styling ——— */
.store-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.cart-toggle-btn {
  background: var(--royal-blue);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 2px;
  position: relative;
  transition: background 0.2s var(--ease);
}

.cart-toggle-btn:hover {
  background: var(--royal-blue-mid);
}

.cart-badge {
  background: var(--ceremonial-red);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: absolute;
  top: -6px;
  right: -6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.product-media {
  aspect-ratio: 1/1;
  background: var(--parchment);
  overflow: hidden;
  position: relative;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

.product-card:hover .product-media img {
  transform: scale(1.02);
}

.product-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-category {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--stone);
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.product-body h3 {
  margin: 0 0 0.35rem 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink);
}

.product-body p {
  font-size: 0.85rem;
  color: var(--stone);
  line-height: 1.4;
  margin: 0 0 1rem 0;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 0.88rem;
  margin-top: auto;
}

.product-price {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--royal-blue-mid);
}

.btn-add-cart {
  background: var(--white);
  border: 1px solid var(--royal-blue);
  color: var(--royal-blue);
  padding: 0.4rem 0.88rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.btn-add-cart:hover {
  background: var(--royal-blue);
  color: var(--white);
}

/* Cart Slide-out Drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.4);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 90vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 36px rgba(0, 0, 0, 0.12);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--royal-blue-mid);
}

.cart-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--stone);
}

.cart-items-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-empty-msg {
  text-align: center;
  color: var(--stone);
  margin-top: 3rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 0.75rem;
  align-items: center;
}

.cart-item-media {
  width: 60px;
  height: 60px;
  background: var(--parchment);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-info h4 {
  margin: 0 0 0.15rem 0;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--ink);
}

.cart-item-price {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--royal-blue-mid);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.cart-qty-btn {
  background: var(--parchment);
  border: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.cart-item-qty-val {
  font-size: 0.8rem;
  font-weight: 600;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--stone);
  cursor: pointer;
  font-size: 0.75rem;
  text-decoration: underline;
  padding: 0;
}

.cart-item-remove:hover {
  color: var(--ceremonial-red);
}

.cart-footer {
  padding: 1.5rem;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
}

.btn-checkout {
  background: var(--ceremonial-red);
  color: var(--white);
  border: none;
  width: 100%;
  padding: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s var(--ease);
}

.btn-checkout:hover {
  background: var(--oxblood);
}


/* ——— Donations and Giving Tiers ——— */
.donations-deck {
  max-width: 48rem;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.donation-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.donation-tier-card {
  background: var(--white);
  border: 2px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
}

.donation-tier-card:hover {
  border-color: var(--royal-blue);
  transform: translateY(-2px);
}

.donation-tier-card.active {
  border-color: var(--ceremonial-red);
  background: rgba(247, 25, 50, 0.02);
}

.donation-tier-card.active::before {
  content: "✔";
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--ceremonial-red);
  color: var(--white);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.65rem;
  display: grid;
  place-items: center;
}

.donation-tier-val {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--royal-blue-mid);
  margin-bottom: 0.25rem;
}

.donation-tier-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.donation-tier-desc {
  font-size: 0.8rem;
  color: var(--stone);
  line-height: 1.4;
  margin: 0;
}

.custom-donation-input-group {
  max-width: 24rem;
  margin-bottom: 2rem;
}

.custom-donation-input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.input-currency-wrap {
  position: relative;
}

.input-currency-symbol {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--stone);
}

.custom-amount-field {
  width: 100%;
  padding: 0.65rem 0.65rem 0.65rem 24px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
}

.donation-form-panel {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 32rem;
}

.donation-form-panel h3 {
  margin: 0 0 1.25rem 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--royal-blue-mid);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}


/* ——— Membership Forms & Printable Certificates ——— */
.membership-layout {
  display: grid;
  grid-template-columns: minmax(min(320px, 100%), 440px) 1fr;
  gap: 2.5rem;
  align-items: start;
}

.membership-form-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.membership-form-wrap h3 {
  margin: 0 0 1.25rem 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--royal-blue-mid);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.form-control {
  padding: 0.6rem;
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--royal-blue);
}

/* Certificate Parchment Display */
.certificate-preview-panel {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.certificate-preview-panel h3 {
  margin: 0 0 1.5rem 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--stone);
  text-align: center;
  width: 100%;
}

.certificate-card {
  width: 100%;
  max-width: 580px;
  background: linear-gradient(135deg, #fbf7ef 0%, #f4edd8 100%);
  border: 12px double #a18357;
  padding: 2rem;
  box-shadow: inset 0 0 40px rgba(161, 131, 87, 0.15), var(--shadow);
  position: relative;
  text-align: center;
  color: #3b2f1f;
  font-family: var(--font-serif);
  overflow: hidden;
  box-sizing: border-box;
}

/* Border Accent corners */
.certificate-card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(161, 131, 87, 0.4);
  pointer-events: none;
}

.cert-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #7a603c;
  margin-bottom: 0.75rem;
  display: block;
}

.cert-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: #4a3418;
  margin: 0 0 1rem 0;
  line-height: 1.1;
  border-bottom: 1px solid rgba(161, 131, 87, 0.3);
  padding-bottom: 0.75rem;
}

.cert-statement {
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 1.25rem;
  color: #5c4a34;
  display: block;
}

.cert-name {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ceremonial-red);
  margin: 0.75rem 0;
  font-family: var(--font-serif);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  display: block;
}

.cert-desc {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  line-height: 1.5;
  color: #5c4a34;
  margin: 1rem auto;
  max-width: 32rem;
  display: block;
}

.cert-meta-row {
  display: flex;
  justify-content: space-around;
  margin-top: 1.75rem;
  border-top: 1px solid rgba(161, 131, 87, 0.2);
  padding-top: 1rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
}

.cert-meta-item strong {
  display: block;
  font-size: 0.82rem;
  color: #4a3418;
  margin-bottom: 0.15rem;
}

.cert-seal {
  width: 55px;
  height: 55px;
  background: radial-gradient(circle, #f71932 0%, #a00617 100%);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25), inset 0 0 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
  font-weight: 700;
  font-size: 0.8rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  margin: 1.25rem auto 0;
  position: relative;
}

.cert-seal::after {
  content: "OFFICIAL SEAL";
  position: absolute;
  font-size: 0.35rem;
  bottom: 8px;
  letter-spacing: 0.05em;
  color: rgba(255, 215, 0, 0.8);
}

.cert-print-btn {
  margin-top: 1.5rem;
  background: var(--royal-blue);
  color: var(--white);
  border: none;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 2px;
}

.cert-print-btn:hover {
  background: var(--royal-blue-mid);
}

@media (max-width: 960px) {
  .membership-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ——— Card hover lift (desktop pointer devices only) ——— */
.authority-card,
.comm-card,
.news-card,
.pillar-card,
.clan-role-card,
.gov-institution-card,
.agency-card {
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .authority-card:hover,
  .comm-card:hover,
  .news-card:hover,
  .pillar-card:hover,
  .gov-institution-card:hover,
  .agency-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(12, 31, 61, 0.1);
  }
}

/* ——— Back to top button ——— */
.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.25rem;
  z-index: 150;
  width: 44px;
  height: 44px;
  background: var(--royal-blue);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), visibility 0.3s, transform 0.3s var(--ease), background 0.2s var(--ease);
  box-shadow: 0 4px 18px rgba(12, 31, 61, 0.22);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--ceremonial-red);
}

/* ——— Footer identity ——— */
.footer-brand-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.footer-coa {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  opacity: 0.9;
}

.footer-tagline {
  font-size: 0.72rem;
  color: var(--bronze);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0.15rem 0 0;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--parchment);
  opacity: 0.75;
  margin: 0.35rem 0 0;
}

/* ——— Comprehensive reduced-motion support ——— */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-block {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .ticker-track {
    animation: none;
  }
}

