/* ================================================================
   SHARED-LIGHT.CSS — Paper Reading Theme
   The Institute for Cognitive Sovereignty

   Light-theme styles shared across all ~175 paper pages.
   Each page sets series-specific accent colors via CSS custom properties.

   Usage:
     <link rel="stylesheet" href="/css/shared.css">
     <link rel="stylesheet" href="/css/shared-light.css">
     <style>:root { --accent: #1a3a2a; --accent-light: rgba(26,58,42,0.07); --callout-num: #2a6b2a; }</style>
   ================================================================ */

/* ========== LIGHT THEME TOKENS ========== */
:root {
  --bg: #fafaf8;
  --surface: #fff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-light: #9a9a9d;
  --heading: #0f172a;
  --border: #e5e5e5;
  --border-light: #f0f0ee;
  --text-bright: #ededfa;
  /* accent, accent-light, callout-num set per-page */
}

/* ========== BASE ========== */
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ========== BREADCRUMB ========== */
.breadcrumb { padding: 1.5rem 2rem 0; max-width: 1200px; margin: 0 auto; }
.breadcrumb a, .breadcrumb span { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 0.5rem; color: var(--border); }
.breadcrumb .current { color: var(--text); }

/* ========== PAPER HEADER ========== */
.paper-header {
  background: linear-gradient(180deg, #06060f 0%, #0f172a 45%, var(--bg) 100%);
  padding: 4rem 2rem 5rem;
  text-align: center;
}
.paper-header__badge {
  display: inline-block;
  background: var(--accent-light, rgba(0,0,0,0.1));
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.4rem 1.25rem;
  border-radius: 100px;
  margin-bottom: 2rem;
  border: 1px solid rgba(255,255,255,0.08);
}
.paper-header__title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-bright);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.paper-header__subtitle {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-style: italic;
  color: #a1a1aa;
  max-width: 660px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.paper-header__meta {
  font-size: 0.85rem;
  color: rgba(204,204,224,0.45);
  margin-bottom: 2rem;
}
.paper-header__meta span { margin: 0 0.75rem; }
.paper-header__btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.paper-header__btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.paper-header__btn--primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.paper-header__btn--primary:hover { opacity: 0.88; }
.paper-header__btn--outline { background: transparent; color: rgba(204,204,224,0.45); border: 1px solid rgba(255,255,255,0.15); }
.paper-header__btn--outline:hover { color: var(--text-bright); border-color: rgba(255,255,255,0.35); }

/* ========== HOOK NUMBERS / STATS ========== */
.hook-numbers {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 3rem 2rem;
  max-width: 720px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.hook-stat { text-align: center; }
.hook-stat__value {
  font-family: 'Fraunces', serif;
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--callout-num, var(--accent));
}
.hook-stat__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== PAPER LAYOUT (sidebar + body) ========== */
.paper-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
  gap: 4rem;
}

/* ========== SECTION SIDEBAR / TOC ========== */
.section-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.section-sidebar__title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-left: 0.75rem;
}
.section-sidebar__list { list-style: none; }
.section-sidebar__list li { margin-bottom: 0.15rem; }
.section-sidebar__list a {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.15s;
  line-height: 1.4;
}
.section-sidebar__list a:hover { color: var(--text); background: var(--accent-light); }
.section-sidebar__list a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-light);
  font-weight: 500;
}
.section-sidebar::-webkit-scrollbar { width: 3px; }
.section-sidebar::-webkit-scrollbar-track { background: transparent; }
.section-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ========== PAPER BODY ========== */
.paper-body { flex: 1; max-width: 720px; min-width: 0; }
.paper-body h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--heading);
  margin: 3rem 0 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.paper-body h2:first-child { margin-top: 0; }
.paper-body h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--heading);
  margin: 2rem 0 0.75rem;
  line-height: 1.35;
}
.paper-body p {
  font-family: 'Fraunces', serif;
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.paper-body strong { color: var(--heading); font-weight: 600; }
.paper-body em { font-style: italic; }
.paper-body ul, .paper-body ol {
  font-family: 'Fraunces', serif;
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.paper-body li { margin-bottom: 0.5rem; }
.paper-body blockquote {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--accent-light);
  border-radius: 0 8px 8px 0;
  line-height: 1.75;
}
.paper-body section { margin-bottom: 3rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--border); }
.paper-body section:last-of-type { border-bottom: none; }

/* ========== EPIGRAPH ========== */
.epigraph {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-style: italic;
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.5rem;
  margin: 0 0 3rem 0;
  background: var(--accent-light);
  border-radius: 0 8px 8px 0;
  line-height: 1.7;
}
.epigraph cite { font-size: 0.78rem; color: var(--text-light); font-style: normal; }

/* ========== SECTION NUMBER ========== */
.section-num {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--callout-num, var(--accent));
  display: block;
  margin-bottom: 0.35rem;
}

/* ========== NAMED CONDITIONS / DEFINITIONS ========== */
.named-condition {
  border: 1px solid var(--accent);
  background: var(--accent-light);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}
.named-condition__label, .named-condition-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--callout-num, var(--accent));
  margin-bottom: 0.5rem;
}
.named-condition__name, .named-condition-name {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 0.75rem;
}
.named-condition__def, .named-condition p {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  margin: 0;
}

/* ========== COUNTERPOINT BOXES ========== */
.counterpoint {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}
.counterpoint__label, .counterpoint-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.counterpoint__head, .counterpoint-head {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 0.75rem;
}
.counterpoint p {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.counterpoint p:last-child { margin-bottom: 0; }

/* ========== CITATION BLOCK ========== */
.cite-block {
  margin: 3rem 0 1rem;
  padding: 1.5rem;
  background: var(--accent-light);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 4px;
}
.cite-block__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.cite-block__text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.cite-block__text em { font-style: italic; }
.cite-copy-btn {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.cite-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ========== SECTION DIVIDER ========== */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ========== PAPER NAVIGATION ========== */
.end-nav a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
.end-nav a:hover { color: var(--heading); }
.end-nav__left, .end-nav-left { text-align: left; }
.end-nav__right, .end-nav-right { text-align: right; }

/* ========== DATA TABLES ========== */
.data-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-family: 'DM Sans', sans-serif; font-size: 0.88rem; }
.data-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--accent-light);
  color: var(--callout-num, var(--accent));
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--accent);
  white-space: nowrap;
}
.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: top;
  line-height: 1.5;
}
.data-table tr:last-child td { border-bottom: none; }

/* ========== SOURCES / REFERENCES ========== */
.sources-list { list-style: none; }
.sources-list li {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}
.sources-list li:last-child { border-bottom: none; }

/* ========== RELATED PROJECTS CARD ========== */
.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}
.related-card__title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.related-card__list { list-style: none; }
.related-card__list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
}
.related-card__list li:last-child { border-bottom: none; }
.related-card__list strong { color: var(--accent); font-weight: 600; }
.related-card__list span { color: var(--text-muted); }

/* ========== PAPER METADATA BAR ========== */
.paper-metadata {
  max-width: 800px;
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.paper-metadata span {
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}
.paper-metadata em { font-style: normal; color: var(--text-muted); }
.paper-metadata a { color: var(--accent); text-decoration: none; }
.paper-metadata a:hover { text-decoration: underline; }

/* ========== ABSTRACT / CALLOUT ========== */
.abstract, .paper-abstract {
  background: #f8f9fa;
  border-left: 3px solid var(--accent);
  padding: 1.5rem 1.75rem;
  margin-bottom: 3rem;
  font-size: 0.95rem;
  line-height: 1.7;
}
.abstract-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

/* ========== SERIES-SPECIFIC CALLOUT (generic) ========== */
.callout, [class$="-callout"] {
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 6px 6px 0;
}
.callout-label, [class$="-callout-label"] {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ========== PAPER CARD (series listing in sidebar) ========== */
.paper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 2rem;
}
.paper-card-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.9rem;
}
.paper-card-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.paper-card-item:last-child { margin-bottom: 0; }
.paper-card-num {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
}
.paper-card-title { font-size: 0.8rem; color: var(--text-muted); line-height: 1.35; }
.paper-card-item.current .paper-card-num { color: var(--accent); }
.paper-card-item.current .paper-card-title { color: var(--text); font-weight: 500; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .section-sidebar { display: none; }
  .paper-layout { flex-direction: column; gap: 2rem; padding: 2rem 1.25rem; }
  .paper-header__title { font-size: 2.5rem; }
  .paper-header { padding: 3rem 1.5rem 4rem; }
  .hook-numbers { gap: 1.5rem; padding: 2rem 1.25rem; }
  .hook-stat__value { font-size: 1.75rem; }
  .paper-body h2 { font-size: 1.5rem; }
  .paper-body p, .paper-body ul, .paper-body ol { font-size: 1.05rem; }
}

@media (max-width: 600px) {
  .paper-header__title { font-size: 2rem; }
  .paper-header { padding: 2.5rem 1rem 3rem; }
  .hook-numbers { flex-direction: column; gap: 1rem; align-items: center; }
  .paper-layout { padding: 1.5rem 1rem; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 0.5rem 0.5rem; }
}

@media (max-width: 360px) {
  .paper-body { font-size: 1rem; }
  .paper-header__title { font-size: 1.75rem; }
  .hook-stat__value { font-size: 1.5rem; }
}

/* ========== PRINT ========== */
@media print {
  @page { size: auto; margin: 0.75in 0.85in; }
  html { font-size: 11pt; }
  body { background: #fff !important; color: #000 !important; }
  nav, .site-nav, footer, .breadcrumb, .section-sidebar, .hook-numbers, .paper-metadata, .hq-widget { display: none !important; }
  .paper-header { background: none !important; padding: 1.5rem 0 !important; text-align: left !important; }
  .paper-header__title { color: #000 !important; }
  .paper-header__subtitle { color: #444 !important; }
  .paper-layout { display: block !important; }
  h2, h3, h4 { color: #000 !important; }
  a { color: inherit; text-decoration: none; }
  .callout, .named-condition, .counterpoint { break-inside: avoid; }
  table { break-inside: avoid; }
}
