
/* ===========================================================
   SACRED SONS — Community Relational Training Visual Guide
   =========================================================== */

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

:root {
  --content-scale: 1;
  --gold: #b7932b;
  --gold-light: #d4b56a;
  --gold-deep: #8a6f1e;
  --black: #0c0a08;
  --char: #161310;
  --char-2: #1f1a15;
  --char-3: #2a241d;
  --cream: #ede4d3;
  --cream-mute: #a89e8d;
  --rule: rgba(183, 147, 43, 0.22);
  --rule-soft: rgba(237, 228, 211, 0.08);
  --heading: #ffffff;
  --sidebar-bg: linear-gradient(180deg, #0d0b09 0%, #060504 100%);
  --mobile-bar-bg: rgba(10, 8, 7, 0.92);
  --cover-bg: radial-gradient(ellipse at top, rgba(183, 147, 43, 0.16), transparent 60%),
              linear-gradient(180deg, #0c0a08 0%, #161310 60%, #1a1612 100%);
  --img-shadow: 0 16px 56px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--rule);
  --quote-mark-opacity: 0.55;
  --sidebar-w: 300px;
  --sidebar-collapsed-w: 56px;
  --header-h: 64px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

[data-theme="light"] {
  --gold: #8a6f1e;
  --gold-light: #b7932b;
  --gold-deep: #6e5817;
  --black: #faf6ef;
  --char: #f0e9da;
  --char-2: #ffffff;
  --char-3: #f7f1e3;
  --cream: #1f1a14;
  --cream-mute: #786a55;
  --rule: rgba(138, 111, 30, 0.28);
  --rule-soft: rgba(31, 26, 20, 0.08);
  --heading: #1a1612;
  --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #faf6ef 100%);
  --mobile-bar-bg: rgba(255, 250, 240, 0.92);
  --cover-bg: radial-gradient(ellipse at top, rgba(138, 111, 30, 0.18), transparent 60%),
              linear-gradient(180deg, #ffffff 0%, #faf6ef 60%, #f3ecda 100%);
  --img-shadow: 0 14px 40px rgba(80, 60, 30, 0.12), 0 0 0 1px rgba(138, 111, 30, 0.20);
  --quote-mark-opacity: 0.4;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

html, body {
  background: var(--black);
  color: var(--cream);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}

body {
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(183, 147, 43, 0.06), transparent 60%),
    linear-gradient(180deg, var(--char) 0%, var(--black) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--black); }

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--heading);
  letter-spacing: -0.005em;
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  margin-bottom: 28px;
}

h2 {
  font-size: clamp(30px, 4vw, 46px);
  margin: 0 0 36px;
  position: relative;
  padding-bottom: 22px;
}
h2::after {
  content: '';
  display: block;
  width: 56px;
  height: 2px;
  background: var(--gold);
  position: absolute;
  bottom: 0; left: 0;
}

h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  margin: 64px 0 20px;
  color: var(--heading);
  scroll-margin-top: 32px;
}

h4 {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 32px 0 14px;
}

p {
  margin: 0 0 20px;
  color: var(--cream);
  max-width: 68ch;
}

p strong { color: var(--heading); font-weight: 600; }

a { color: var(--gold-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }

ul, ol { margin: 0 0 24px; padding-left: 24px; }
li { margin-bottom: 10px; max-width: 68ch; }
ul li::marker { color: var(--gold); }

/* Numbered protocol */
ol {
  list-style: none;
  counter-reset: order;
  padding-left: 0;
}
ol > li {
  counter-increment: order;
  position: relative;
  padding: 6px 0 6px 60px;
  margin-bottom: 18px;
}
ol > li::before {
  content: counter(order, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  width: 38px; height: 38px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--gold);
  background: rgba(183, 147, 43, 0.06);
}

/* ============ LAYOUT ============ */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ============ SIDEBAR (DESKTOP) ============ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--rule);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: width 0.36s var(--ease);
}

.sidebar-header {
  padding: 26px 24px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
  min-height: 88px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: opacity 0.2s;
}
.sidebar-logo img {
  height: 40px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(183,147,43,0.2));
}

.sidebar-toggle {
  background: none;
  border: 1px solid var(--rule);
  color: var(--gold);
  width: 34px; height: 34px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: rgba(183, 147, 43, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
}
.sidebar-toggle svg {
  width: 14px; height: 14px;
  transition: transform 0.32s var(--ease);
}

.sidebar-controls,
.drawer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  background: none;
  border: 1px solid var(--rule);
  color: var(--gold);
  width: 34px; height: 34px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s, color .2s;
  flex-shrink: 0;
  padding: 0;
}
.icon-btn:hover {
  background: rgba(183, 147, 43, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
}
.icon-btn svg {
  width: 14px; height: 14px;
  display: block;
}

.mobile-header .icon-btn { width: 38px; height: 38px; }
.mobile-header .icon-btn svg { width: 16px; height: 16px; }
.drawer-header .icon-btn { width: 38px; height: 38px; }
.drawer-header .icon-btn svg { width: 16px; height: 16px; }

.sidebar-nav {
  padding: 24px 0 32px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-deep) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--gold-deep); border-radius: 2px; }

.nav-section { margin-bottom: 24px; }

.nav-section-title {
  display: block;
  padding: 0 24px 10px;
  font-family: 'Open Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 11px 24px 11px 22px;
  font-size: 14px;
  color: var(--cream-mute);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-link:hover {
  color: var(--cream);
  background: rgba(183, 147, 43, 0.05);
}
.nav-link.active {
  color: #fff;
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(183,147,43,0.16), transparent 70%);
  font-weight: 600;
}

.sidebar-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--rule);
  font-family: 'Open Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream-mute);
  text-align: center;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}

/* COLLAPSED STATE (DESKTOP) */
.layout.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-w);
}
.layout.sidebar-collapsed .sidebar-logo,
.layout.sidebar-collapsed .sidebar-nav,
.layout.sidebar-collapsed .sidebar-footer {
  opacity: 0;
  pointer-events: none;
}
.layout.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}
.layout.sidebar-collapsed .main {
  margin-left: var(--sidebar-collapsed-w);
}

/* ============ MAIN ============ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  transition: margin-left 0.36s var(--ease);
}

.module {
  max-width: 820px;
  margin: 0 auto;
  padding: 96px 64px 100px;
  scroll-margin-top: 16px;
}

.module + .module {
  border-top: 1px solid var(--rule);
}

/* ============ MOBILE HEADER ============ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--mobile-bar-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--rule);
  z-index: 60;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
}

.mobile-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.mobile-logo img {
  height: 36px;
  width: auto;
  max-width: 56px;
  object-fit: contain;
  display: block;
}

.mobile-current {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  overflow: hidden;
}
.mobile-current span {
  font-family: 'Open Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.mobile-current strong {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}

.hamburger {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--gold);
  width: 38px; height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.hamburger:hover { background: rgba(183, 147, 43, 0.12); border-color: var(--gold); }
.hamburger svg { width: 16px; height: 16px; }

.scroll-progress {
  position: absolute;
  bottom: -1px; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-light));
  width: 0%;
  transition: width 0.1s linear;
}

/* ============ MOBILE DRAWER ============ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 86%;
  max-width: 360px;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--rule);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.36s var(--ease);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 88px;
}
.drawer-header img { height: 36px; display: block; }

.drawer-close {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--gold);
  width: 38px; height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.drawer-close:hover { background: rgba(183, 147, 43, 0.12); border-color: var(--gold); }
.drawer-close svg { width: 16px; height: 16px; }

.drawer-nav {
  padding: 22px 0 32px;
  overflow-y: auto;
  flex: 1;
}

/* ============ COVER ============ */
.cover-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px;
  background: var(--cover-bg);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}

.cover-section::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90vmin; height: 90vmin;
  max-width: 800px; max-height: 800px;
  background: radial-gradient(circle, rgba(183, 147, 43, 0.10), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.cover-section > * { position: relative; z-index: 1; }

.cover-section::after {
  content: '';
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 56px;
  background: linear-gradient(180deg, transparent, var(--gold));
  z-index: 1;
}

.cover-logo {
  display: block;
  height: clamp(80px, 10vw, 120px);
  width: auto;
  margin: 0 auto 36px;
  filter: drop-shadow(0 4px 28px rgba(183, 147, 43, 0.32));
  animation: coverLogoIn 1.2s var(--ease) both;
}

@keyframes coverLogoIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cover-eyebrow {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 32px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.cover-eyebrow::before, .cover-eyebrow::after {
  content: '';
  width: 36px; height: 1px;
  background: var(--gold);
}

.cover-section h1 {
  font-size: clamp(48px, 8vw, 104px);
  line-height: 1.02;
  font-weight: 800;
  margin: 0 0 28px;
  max-width: 14ch;
  color: var(--heading);
}

.cover-section .subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 26px);
  color: var(--cream);
  margin: 0 0 36px;
  font-weight: 400;
  max-width: 36ch;
  line-height: 1.4;
}

.cover-section .org-credit {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}

/* ============ IMAGES ============ */
.image-container {
  margin: 48px 0;
}
.image-container img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: var(--img-shadow);
}

.photo-credit {
  font-family: 'Open Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-mute);
  text-align: right;
  margin: 14px 0 0;
}
.photo-credit:empty { display: none; }

/* ============ QUOTES ============ */
.quote {
  position: relative;
  margin: 64px 0;
  padding: 56px 44px 40px;
  background: linear-gradient(180deg, var(--char-2), var(--char));
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.55;
  color: var(--cream);
  font-weight: 400;
}

.quote::before {
  content: "\201C";
  position: absolute;
  top: -6px; left: 24px;
  font-family: 'Playfair Display', serif;
  font-size: 110px;
  font-weight: 700;
  font-style: normal;
  color: var(--gold);
  line-height: 1;
  opacity: var(--quote-mark-opacity);
  pointer-events: none;
}

.quote-author {
  margin-top: 28px;
  font-family: 'Open Sans', sans-serif;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ============ JOURNAL ============ */
.journal-section {
  margin: 72px 0 0;
  padding: 44px 44px 40px;
  background: linear-gradient(135deg, rgba(183, 147, 43, 0.06), rgba(183, 147, 43, 0.02));
  border: 1px solid var(--rule);
  border-radius: 4px;
  position: relative;
}

.journal-section::before {
  content: 'Reflection';
  position: absolute;
  top: -11px; left: 24px;
  background: var(--black);
  padding: 0 14px;
  font-family: 'Open Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.journal-section h4 {
  margin: 0 0 22px;
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.journal-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.journal-section li {
  padding: 14px 0 14px 28px;
  position: relative;
  border-bottom: 1px solid var(--rule);
  margin: 0;
  max-width: none;
  color: var(--cream);
  font-size: 16px;
}
.journal-section li:last-child { border-bottom: none; padding-bottom: 0; }
.journal-section li::before {
  content: '';
  position: absolute;
  left: 0; top: 24px;
  width: 14px; height: 1px;
  background: var(--gold);
}

/* ============ FRAMEWORK CARDS ============ */
.framework-intro {
  margin: 22px 0;
  padding: 26px 30px;
  background: var(--char-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  transition: border-color .2s, background .2s;
}
.framework-intro:hover { border-color: rgba(183, 147, 43, 0.4); background: var(--char-3); }
.framework-intro p { margin: 0; max-width: none; }
.framework-intro h4 { margin: 0 0 10px; }

.section-break {
  height: 1px;
  margin: 0;
  scroll-margin-top: 32px;
}

/* ============ MEDIA QUERIES ============ */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .mobile-header { display: flex; }
  .main {
    margin-left: 0;
    padding-top: var(--header-h);
  }
  .module { padding: 64px 32px 80px; }
  .cover-section {
    min-height: calc(100vh - var(--header-h) - 150px);
    padding: 60px 28px 80px;
  }
  .quote { padding: 44px 32px 32px; }
  .journal-section { padding: 36px 28px 32px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; line-height: 1.7; }
  h2 { margin-bottom: 28px; padding-bottom: 18px; }
  h3 { margin: 48px 0 16px; }
  .module { padding: 48px 20px 64px; }
  .cover-section { padding: 48px 20px 72px; }
  .cover-section h1 { font-size: clamp(40px, 12vw, 64px); }
  .cover-eyebrow { font-size: 10px; gap: 12px; margin-bottom: 24px; }
  .cover-eyebrow::before, .cover-eyebrow::after { width: 24px; }
  .quote {
    padding: 40px 24px 24px;
    margin: 44px -4px;
    font-size: 17px;
  }
  .quote::before { font-size: 84px; left: 14px; }
  .journal-section { padding: 32px 22px 28px; margin: 56px -4px 0; }
  .framework-intro { padding: 22px 22px; margin: 18px 0; }
  ol > li { padding-left: 50px; }
  ol > li::before { width: 34px; height: 34px; font-size: 12px; }
  .image-container { margin: 32px -4px; }
  .image-container img { border-radius: 0; }
}

/* ============ NAVIGATION — LOCKED TO DARK ============ */
/* Mobile bar, desktop sidebar, and mobile drawer always use the dark
   palette regardless of the theme toggle. */
.mobile-header,
.sidebar,
.drawer {
  background: linear-gradient(180deg, #0d0b09 0%, #060504 100%) !important;
  border-color: rgba(183, 147, 43, 0.22) !important;
}
.mobile-header {
  background: rgba(10, 8, 7, 0.94) !important;
  border-bottom: 1px solid rgba(183, 147, 43, 0.22) !important;
}

/* Text inside dark menus */
.mobile-header .mobile-current span,
.sidebar .nav-section-title,
.drawer .nav-section-title { color: #b7932b !important; }

.mobile-header .mobile-current strong { color: #ffffff !important; }

.sidebar .nav-link,
.drawer .nav-link { color: #a89e8d !important; }
.sidebar .nav-link:hover,
.drawer .nav-link:hover {
  color: #ede4d3 !important;
  background: rgba(183, 147, 43, 0.05) !important;
}
.sidebar .nav-link.active,
.drawer .nav-link.active {
  color: #ffffff !important;
  border-left-color: #b7932b !important;
  background: linear-gradient(90deg, rgba(183,147,43,0.16), transparent 70%) !important;
}

.sidebar .sidebar-header,
.drawer .drawer-header {
  border-bottom-color: rgba(183, 147, 43, 0.22) !important;
}

.sidebar .sidebar-footer {
  border-top-color: rgba(183, 147, 43, 0.22) !important;
  color: #a89e8d !important;
}

.sidebar-nav::-webkit-scrollbar-thumb { background: #8a6f1e !important; }

/* Buttons inside dark menus */
.mobile-header .hamburger,
.mobile-header .icon-btn,
.sidebar .sidebar-toggle,
.sidebar .icon-btn,
.drawer .drawer-close,
.drawer .icon-btn {
  border-color: rgba(183, 147, 43, 0.32) !important;
  color: #b7932b !important;
  background: transparent !important;
}
.mobile-header .hamburger:hover,
.mobile-header .icon-btn:hover,
.sidebar .sidebar-toggle:hover,
.sidebar .icon-btn:hover,
.drawer .drawer-close:hover,
.drawer .icon-btn:hover {
  background: rgba(183, 147, 43, 0.14) !important;
  border-color: #b7932b !important;
  color: #d4b56a !important;
}

/* ============ LIGHT MODE — JOURNAL HEADING ============ */
[data-theme="light"] .journal-section h4 { color: #4a3920; }

/* ============ HIDE CONTENT IMAGES (toggle) ============ */
/* Targets only content photo wrappers. Brand logos in chrome stay visible. */
html[data-images="hidden"] .main .image-container { display: none; }

/* ============ CONTENT FONT SCALING ============ */
/* Scoped to .main so it never affects sidebar / mobile bar / drawer chrome.
   Each rule wraps its existing font-size in a calc() multiplied by --content-scale. */
.main { font-size: calc(17px * var(--content-scale)); }
.main p { font-size: inherit; }
.main h1 { font-size: calc(clamp(40px, 6vw, 72px) * var(--content-scale)); }
.main h2 { font-size: calc(clamp(30px, 4vw, 46px) * var(--content-scale)); }
.main h3 { font-size: calc(clamp(22px, 2.6vw, 30px) * var(--content-scale)); }
.main h4 { font-size: calc(12px * var(--content-scale)); }
.main .cover-section h1 { font-size: calc(clamp(48px, 8vw, 104px) * var(--content-scale)); }
.main .cover-section .subtitle { font-size: calc(clamp(18px, 2.4vw, 26px) * var(--content-scale)); }
.main .cover-section .org-credit { font-size: calc(11px * var(--content-scale)); }
.main .cover-eyebrow { font-size: calc(11px * var(--content-scale)); }
.main .quote { font-size: calc(clamp(18px, 1.7vw, 22px) * var(--content-scale)); }
.main .quote-author { font-size: calc(11px * var(--content-scale)); }
.main .journal-section h4 { font-size: calc(clamp(20px, 2vw, 26px) * var(--content-scale)); }
.main .journal-section li { font-size: calc(16px * var(--content-scale)); }
.main .framework-intro h4 { font-size: calc(12px * var(--content-scale)); }
.main .photo-credit { font-size: calc(10px * var(--content-scale)); }
.main ol > li::before { font-size: calc(14px * var(--content-scale)); }

/* ============ SETTINGS PANEL ============ */
.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: transparent;
  pointer-events: none;
}
.settings-backdrop.open { pointer-events: auto; }

.settings-panel {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  right: 16px;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: linear-gradient(180deg, #161310 0%, #0a0807 100%);
  color: #ede4d3;
  border: 1px solid rgba(183, 147, 43, 0.32);
  border-radius: 8px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  z-index: 110;
  padding: 22px 22px 18px;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  font-family: 'Open Sans', sans-serif;
}
.settings-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.settings-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.settings-panel-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: 0;
}
.settings-panel-header p {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #b7932b;
  margin: 0 0 2px;
  max-width: none;
}
.settings-close {
  background: none;
  border: 1px solid rgba(183, 147, 43, 0.32);
  color: #b7932b;
  width: 28px; height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, border-color .2s, color .2s;
  padding: 0;
}
.settings-close:hover {
  background: rgba(183, 147, 43, 0.14);
  border-color: #b7932b;
  color: #d4b56a;
}
.settings-close svg { width: 12px; height: 12px; }

.settings-row {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(183, 147, 43, 0.18);
}
.settings-row:first-of-type {
  margin-top: 18px;
  padding-top: 18px;
}

.settings-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.settings-label {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #b7932b;
  font-weight: 700;
}

/* Theme toggle (switch) */
.theme-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.theme-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.theme-switch-track {
  width: 44px;
  height: 24px;
  background: rgba(183, 147, 43, 0.22);
  border-radius: 12px;
  position: relative;
  transition: background 0.22s var(--ease);
  display: inline-block;
}
.theme-switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #b7932b;
  border-radius: 50%;
  transition: transform 0.22s var(--ease), background 0.22s var(--ease);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.theme-switch input:checked + .theme-switch-track {
  background: #b7932b;
}
.theme-switch input:checked + .theme-switch-track .theme-switch-thumb {
  transform: translateX(20px);
  background: #fff;
}

.settings-row-mode-label {
  font-size: 13px;
  color: #ede4d3;
  font-weight: 500;
}

/* Font size slider */
.slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.slider-mark {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #b7932b;
  flex-shrink: 0;
  line-height: 1;
}
.slider-mark-small { font-size: 12px; }
.slider-mark-large { font-size: 22px; }

input[type="range"].font-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(183, 147, 43, 0.22);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"].font-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #b7932b;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(183, 147, 43, 0.5);
  transition: transform 0.15s ease;
}
input[type="range"].font-slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
input[type="range"].font-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #b7932b;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(183, 147, 43, 0.5);
}

.slider-value {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #a89e8d;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.settings-reset {
  margin-top: 22px;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(183, 147, 43, 0.32);
  border-radius: 4px;
  padding: 10px 14px;
  color: #b7932b;
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.settings-reset:hover {
  background: rgba(183, 147, 43, 0.14);
  border-color: #b7932b;
  color: #d4b56a;
}

.settings-footnote {
  margin: 18px 0 0;
  text-align: center;
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: rgba(168, 158, 141, 0.7);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: none;
}
.settings-footnote svg {
  width: 11px;
  height: 11px;
  color: #b7932b;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
}
.settings-footnote a {
  color: #b7932b;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s;
}
.settings-footnote a:hover {
  color: #d4b56a;
  text-decoration: underline;
}

/* Mobile: panel pins to the top, just under the mobile header */
@media (max-width: 600px) {
  .settings-panel {
    top: calc(var(--header-h) + 8px);
    bottom: auto;
    left: 14px;
    right: 14px;
    width: auto;
    max-width: none;
    transform: translateY(-8px) scale(0.98);
  }
  .settings-panel.open { transform: translateY(0) scale(1); }
}




/* ============ MULTI-PARAGRAPH FRAMEWORK CARDS ============ */
.framework-intro p + p { margin-top: 12px !important; }
.framework-intro h4 + p { margin-top: 0; }

/* ============ BODY-LEVEL SECTION DIVIDER (h4 eyebrow) ============ */
/* Single allowed heading style inside the module body — generous breathing room. */
.main .module > h4 {
  margin-top: 64px;
  margin-bottom: 18px;
}
.main .module > h4:first-child { margin-top: 0; }
/* Prevent runs of consecutive eyebrows feeling crowded */
.main .module > h4 + h4 { margin-top: 28px; }

/* ============ NUMBERED PROTOCOL — bold lead inside <li> ============ */
.main .module > ol > li > strong {
  color: var(--gold);
  letter-spacing: 0.02em;
  display: inline;
}

/* ============ MULTI-PAGE NAV ACTIVE STATE ============ */
.nav-link[data-active="1"] {
  color: #ffffff !important;
  border-left-color: #b7932b !important;
  background: linear-gradient(90deg, rgba(183,147,43,0.16), transparent 70%) !important;
}

/* ============ NAV LINK — EYEBROW + TITLE LAYOUT ============ */
.nav-link {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 24px 14px 22px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
}
.nav-link .nav-eyebrow {
  font-family: 'Open Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #b7932b !important;
  display: block;
}
.nav-link .nav-title {
  font-size: 13px;
  line-height: 1.35;
  display: block;
  font-family: 'Open Sans', sans-serif !important;
  font-weight: 500;
  color: #a89e8d !important;     /* gray default */
}
.nav-link-module .nav-title {
  font-size: 13px;
}
.nav-link:hover .nav-title {
  color: #ede4d3 !important;
}
.nav-link[data-active="1"] .nav-title {
  color: #ffffff !important;     /* white when active */
  font-weight: 600;
}
.nav-link[data-active="1"] .nav-eyebrow {
  color: #d4b56a !important;
}

/* Gold section header — same size as the "Module 0X" eyebrows */
.sidebar .nav-section-title,
.drawer .nav-section-title {
  font-family: 'Open Sans', sans-serif;
  font-size: 10px !important;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #b7932b !important;
  padding: 0 24px 8px 22px;
  line-height: 1.3;
}

/* ============ MODULE INDEX (cards on home) ============ */
.module-index {
  max-width: 820px;
  margin: 0 auto;
  padding: 80px 64px 32px;
}
.module-index h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  margin-bottom: 16px;
}
.module-index-lede {
  color: var(--cream-mute);
  margin-bottom: 36px;
  font-size: 16px;
  max-width: 56ch;
}
.module-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.module-card {
  display: grid;
  grid-template-columns: 56px 1fr 24px;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  background: var(--char-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  text-decoration: none;
  color: var(--cream);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.module-card:hover {
  background: var(--char-3);
  border-color: rgba(183, 147, 43, 0.6);
  transform: translateY(-1px);
}
.module-card-num {
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  color: var(--gold);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.module-card-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--heading);
  line-height: 1.3;
}
.module-card-arrow {
  color: var(--gold);
  font-size: 20px;
  transition: transform .2s var(--ease);
}
.module-card:hover .module-card-arrow { transform: translateX(4px); }

@media (max-width: 600px) {
  .module-index { padding: 56px 20px 24px; }
  .module-card { padding: 18px 20px; gap: 14px; grid-template-columns: 44px 1fr 20px; }
  .module-card-num { font-size: 24px; }
  .module-card-title { font-size: 16px; }
}

/* ============ PAGER (prev/next at module bottoms) ============ */
.pager {
  max-width: 820px;
  margin: 40px auto 80px;
  padding: 32px 64px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pager-link {
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  background: var(--char-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  text-decoration: none;
  transition: background .2s var(--ease), border-color .2s var(--ease);
  min-width: 0;
}
.pager-prev { text-align: left; }
.pager-next { text-align: right; }
.pager-link:hover {
  background: var(--char-3);
  border-color: rgba(183, 147, 43, 0.6);
}
.pager-direction {
  font-family: 'Open Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.pager-target {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: var(--heading);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 600px) {
  .pager { padding: 28px 20px 0; gap: 10px; }
  .pager-link { padding: 14px 16px; }
  .pager-target { font-size: 14px; }
}

/* ============ MODULE COVER (per-module hero, mirrors Welcome) ============ */
.main .cover-section.module-cover {
  min-height: 88vh;
  border-bottom: 1px solid var(--rule);
}
.main .cover-section.module-cover h1 {
  max-width: 18ch;
}
.main .cover-section.module-cover .subtitle {
  max-width: 44ch;
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.45;
  font-style: italic;
  color: var(--cream);
  opacity: 0.92;
  margin: 0 0 36px;
}
.main .cover-section.module-cover .org-credit {
  letter-spacing: 0.36em;
}
@media (max-width: 1024px) {
  .main .cover-section.module-cover { min-height: 72vh; }
}
@media (max-width: 600px) {
  .main .cover-section.module-cover { min-height: 64vh; }
}

/* ============ MODULE PAGE HEADER (legacy small hero — still used elsewhere) ============ */
.module-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 96px 64px 8px;
}
.module-hero-eyebrow {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.module-hero-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--gold);
}
.module-hero h1 {
  font-size: clamp(31px, 4.25vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  color: var(--heading);
}
/* Tight spacing between hero and the first body content */
.module-hero + .module {
  padding-top: 20px;
}
.module-hero + .module > *:first-child { margin-top: 0; }

@media (max-width: 1024px) {
  .module-hero { padding: 64px 32px 8px; }
  .module-hero + .module { padding-top: 16px; }
}
@media (max-width: 600px) {
  .module-hero { padding: 48px 20px 6px; }
  .module-hero h1 { font-size: clamp(26px, 6.8vw, 38px); }
  .module-hero + .module { padding-top: 12px; }
}

/* ============ BODY READING LINE-HEIGHT (universal bump) ============ */
.main p, .main li, .framework-intro p { line-height: 2; }

/* ============ PULL QUOTE ============ */
/* Quote text matches body paragraph size — distinction is italic + tracking, not size. */
.main .quote {
  font-size: inherit;
  line-height: 2;
  font-style: italic;
  letter-spacing: 0.03em;
}
.main .quote-author { letter-spacing: 0.22em; }

/* ============ RICH LIST (title + description list items) ============ */
.main ul.rich-list,
.main ol.rich-list {
  list-style: none;
  padding-left: 0;
  margin: 24px 0;
}
.main ul.rich-list > li,
.main ol.rich-list > li {
  padding: 16px 0 16px 22px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  margin: 0;
  line-height: 1.7;
}
.main ul.rich-list > li:last-child,
.main ol.rich-list > li:last-child { border-bottom: none; }
.main ul.rich-list > li::before {
  content: '';
  position: absolute;
  left: 0; top: 28px;
  width: 12px; height: 1px;
  background: var(--gold);
}
.main ol.rich-list { counter-reset: rl; }
.main ol.rich-list > li { counter-increment: rl; padding-left: 44px; }
.main ol.rich-list > li::before {
  content: counter(rl, decimal-leading-zero);
  position: absolute;
  left: 0; top: 18px;
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold);
}
.main .rich-list-title {
  display: block;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--heading);
  margin-bottom: 4px;
  line-height: 1.25;
}
.main .rich-list-desc {
  display: block;
  color: var(--cream);
  font-size: 15px;
  line-height: 1.7;
}

/* ============ MOBILE NOW-READING — auto-scroll if overflowed ============ */
.mobile-current strong {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
/* When the title is wider than its container, animate a back-and-forth slide.
   Gated by a class added in JS so static (fitting) titles don't move. */
.mobile-current.is-overflowing strong {
  animation: nowReadingSlide var(--nr-duration, 8s) ease-in-out var(--nr-delay, 1.2s) infinite alternate;
  text-overflow: clip;
  width: max-content;
  max-width: none;
}
@keyframes nowReadingSlide {
  0%   { transform: translateX(0); }
  100% { transform: translateX(var(--nr-shift, 0)); }
}

/* ============ SETTINGS PANEL — flush top-left next to sidebar (desktop) ============ */
@media (min-width: 1025px) {
  .settings-panel {
    top: 16px !important;
    left: calc(var(--sidebar-w) + 16px) !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-8px) scale(0.98);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), left 0.36s var(--ease) !important;
  }
  .settings-panel.open {
    transform: translateX(0) scale(1);
  }
  body.sidebar-collapsed .settings-panel {
    left: calc(var(--sidebar-collapsed-w) + 16px) !important;
  }
}

/* ============ SIDEBAR — NOW READING (above Introduction) ============ */
.sidebar .sidebar-now-reading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 4px 24px 22px 22px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.sidebar .sidebar-now-reading-eyebrow {
  font-family: 'Open Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #b7932b !important;
}
.sidebar .sidebar-now-reading strong {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff !important;
  line-height: 1.4;
  width: 100%;
  letter-spacing: 0;
  text-transform: none;
}
.layout.sidebar-collapsed .sidebar-now-reading { opacity: 0; pointer-events: none; }
/* Hide the old empty footer slot the chrome reserves */
.sidebar .sidebar-footer { display: none; }

/* ============ SEARCH-JUMP FLASH ============ */
.search-target-flash {
  animation: searchFlash 1.6s ease-out;
}
@keyframes searchFlash {
  0%   { background: rgba(183, 147, 43, 0.32); }
  100% { background: transparent; }
}

/* ============ SEARCH FAB + OVERLAY ============ */
.search-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 24px rgba(183, 147, 43, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 80;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.search-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 32px rgba(183, 147, 43, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.5);
}
.search-fab:active { transform: translateY(0); }
.search-fab svg { width: 22px; height: 22px; }
@media (max-width: 600px) {
  .search-fab { right: 18px; bottom: 18px; width: 52px; height: 52px; }
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 4, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 24px;
  animation: searchOverlayIn 0.22s var(--ease);
}
.search-overlay[hidden] { display: none; }
@keyframes searchOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.search-modal {
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 120px);
  background: linear-gradient(180deg, #161310 0%, #0a0807 100%);
  border: 1px solid rgba(183, 147, 43, 0.32);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'Open Sans', sans-serif;
}
.search-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(183, 147, 43, 0.22);
  flex-shrink: 0;
}
.search-modal-icon {
  width: 18px; height: 18px;
  color: #b7932b;
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ede4d3;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  padding: 8px 4px;
  outline: none;
  min-width: 0;
}
.search-input::placeholder { color: #786a55; }
.search-close {
  background: none;
  border: 1px solid rgba(183, 147, 43, 0.32);
  color: #b7932b;
  width: 32px; height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background .15s, border-color .15s;
}
.search-close:hover {
  background: rgba(183, 147, 43, 0.14);
  border-color: #b7932b;
}
.search-close svg { width: 14px; height: 14px; }

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: #8a6f1e transparent;
}
.search-results::-webkit-scrollbar { width: 6px; }
.search-results::-webkit-scrollbar-thumb { background: #8a6f1e; border-radius: 3px; }

.search-empty,
.search-no-results {
  padding: 22px 22px 26px;
  color: #a89e8d;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  max-width: none;
}
.search-empty em {
  color: #b7932b;
  font-style: normal;
  font-weight: 600;
}

.search-result {
  display: block;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(183, 147, 43, 0.12);
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.search-result:hover { background: rgba(183, 147, 43, 0.06); }
.search-result:last-child { border-bottom: none; }

.search-result-meta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #b7932b;
  margin-bottom: 4px;
}
.search-result-section {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #786a55;
  margin-left: 10px;
}
.search-result-snippet {
  color: #ede4d3;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}
.search-result-snippet mark {
  background: rgba(183, 147, 43, 0.32);
  color: #ffffff;
  padding: 0 2px;
  border-radius: 2px;
}

/* ============ INTERACTIVE FORM (Netlify Forms — Module 10 practicum) ============ */
.main .crt-form {
  margin: 0;
}
.main .crt-intro {
  margin: 0 0 24px;
  line-height: 2;
}
.main .crt-instruction {
  margin: 16px 0;
  color: var(--cream-mute);
  font-style: italic;
  line-height: 1.85;
}
.main fieldset.crt-form-section {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 28px 32px 24px;
  margin: 32px 0;
  background: linear-gradient(180deg, var(--char-2), var(--char));
}
.main fieldset.crt-form-section legend {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(20px, 2vw, 26px);
  color: var(--heading);
  padding: 0 12px;
  letter-spacing: -0.005em;
}
.main .crt-field {
  display: block;
  margin: 18px 0;
}
.main .crt-field-label {
  display: block;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 8px;
  line-height: 1.5;
}
.main .crt-form input[type="text"],
.main .crt-form input[type="email"],
.main .crt-form textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 12px 14px;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  color: var(--cream);
  line-height: 1.6;
  transition: border-color .2s, background .2s;
  resize: vertical;
}
[data-theme="light"] .main .crt-form input[type="text"],
[data-theme="light"] .main .crt-form input[type="email"],
[data-theme="light"] .main .crt-form textarea {
  background: rgba(255, 255, 255, 0.5);
  color: var(--cream);
}
.main .crt-form input[type="text"]:focus,
.main .crt-form input[type="email"]:focus,
.main .crt-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.4);
}
.main .crt-form textarea {
  min-height: 80px;
  font-family: 'Open Sans', sans-serif;
}

.main .crt-choice-group {
  margin: 18px 0;
}
.main .crt-choices {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}
.main .crt-choices-checkbox { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.main .crt-choices-radio {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.main .crt-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: rgba(0, 0, 0, 0.15);
}
.main .crt-choice:hover {
  border-color: rgba(183, 147, 43, 0.5);
  background: rgba(183, 147, 43, 0.06);
}
.main .crt-choice input[type="checkbox"],
.main .crt-choice input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--gold);
  border-radius: 3px;
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  margin-top: 2px;
  transition: background .15s;
}
.main .crt-choice input[type="radio"] { border-radius: 50%; }
.main .crt-choice input:checked {
  background: var(--gold);
}
.main .crt-choice input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--black);
  font-weight: 700;
}
.main .crt-choice input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--black);
}
.main .crt-choice-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--cream);
}

.main .crt-form-actions {
  margin: 40px 0 0;
  text-align: center;
}
.main .crt-form-submit {
  background: var(--gold);
  color: var(--black);
  border: none;
  padding: 14px 32px;
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.main .crt-form-submit:hover {
  background: var(--gold-light);
}
.main .crt-form-submit:active {
  transform: translateY(1px);
}
.main .crt-form-note {
  margin: 18px auto 0;
  max-width: 56ch;
  font-size: 12px;
  color: var(--cream-mute);
  line-height: 1.6;
  font-style: italic;
}
@media (max-width: 600px) {
  .main fieldset.crt-form-section { padding: 22px 22px 20px; }
  .main .crt-choices-checkbox { grid-template-columns: 1fr; }
}

/* ============ PROTOCOL LIST (Ethics Violation, ORDER, Six Principles) ============ */
.main .module > ol.protocol-list,
.main .module > * > ol.protocol-list {
  list-style: none;
  counter-reset: proto;
  padding-left: 0;
  margin: 32px 0;
}
.main ol.protocol-list > li {
  counter-increment: proto;
  position: relative;
  padding: 24px 28px 22px 92px;
  margin: 0 0 14px;
  background: linear-gradient(180deg, var(--char-2), var(--char));
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  min-height: 84px;
}
.main ol.protocol-list > li::before {
  content: counter(proto, decimal-leading-zero);
  position: absolute;
  left: 24px;
  top: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--gold);
  background: rgba(183, 147, 43, 0.08);
  border: 1px solid var(--gold);
  border-radius: 50%;
  line-height: 1;
}
.main ol.protocol-list .protocol-step-title {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 700;
  color: var(--heading);
  line-height: 1.25;
  margin-bottom: 10px;
}
.main ol.protocol-list > li > p {
  margin: 0 0 10px;
  line-height: 1.85;
}
.main ol.protocol-list > li > p:last-child { margin-bottom: 0; }
.main ol.protocol-list > li > ul {
  margin: 8px 0 12px;
  padding-left: 22px;
}
.main ol.protocol-list > li > ul li {
  line-height: 1.7;
  margin-bottom: 6px;
}
@media (max-width: 600px) {
  .main ol.protocol-list > li { padding: 22px 22px 20px 22px; }
  .main ol.protocol-list > li::before {
    position: static;
    margin-bottom: 12px;
    width: 44px; height: 44px;
    font-size: 16px;
  }
}

/* ============ SECTION HEADING (Playfair white, mid-page section breaks) ============ */
.main h3.section-heading {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(26px, 3vw, 36px);
  color: var(--heading);
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 56px 0 12px;
  scroll-margin-top: 24px;
}
.main h3.section-heading:first-child { margin-top: 0; }

.main .section-subtitle {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--cream);
  line-height: 1.4;
  margin: 0 0 36px;
  font-style: normal;
  opacity: 0.85;
}

/* ============ EYEBROW (small caps gold label, V1 style) ============ */
.main h4.eyebrow {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 38px 0 14px;
  line-height: 1.4;
}
.main h4.eyebrow + p {
  margin-top: 0;
}

/* ============ FRAMEWORK CARD (nested labels — Safety / Substances / Sexuality) ============ */
.main .framework-card {
  margin: 16px 0;
  padding: 22px 26px 20px;
  background: linear-gradient(180deg, var(--char-2), var(--char));
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.main .framework-card p {
  margin: 0;
  line-height: 1.85;
  color: var(--cream);
}
.main .framework-card-label {
  color: var(--gold);
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  font-size: 1.05em;
}
.main .framework-card + .framework-card { margin-top: 12px; }
@media (max-width: 600px) {
  .main .framework-card { padding: 18px 20px; }
}

/* ============ LABEL CARD (rich nested content — Vagus Nerve Awareness etc.) ============ */
/* Word like "Confidentiality" is the visual focus; body sits underneath. */
.main .label-card {
  margin: 28px 0;
  padding: 24px 28px 22px;
  background: linear-gradient(180deg, var(--char-2), var(--char));
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
}
.main .label-card-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 1.9vw, 24px);
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 10px;
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.main .label-card p {
  margin: 0 0 14px;
  color: var(--cream);
  line-height: 2;
}
.main .label-card p:last-child { margin-bottom: 0; }
.main .label-card ul {
  margin: 8px 0 14px;
  padding-left: 22px;
}
.main .label-card ul li {
  margin-bottom: 6px;
  line-height: 1.7;
}
.main .label-card .label-card-subhead {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 18px 0 10px;
}
.main .label-card + .label-card { margin-top: 16px; }
@media (max-width: 600px) {
  .main .label-card { padding: 22px 22px 20px; margin: 22px 0; }
}
