/* site.css — Cosmic Footprint Society
   Sections: tokens → reset → header → nav → hero → layout → content →
             states → iframes → forms → footer → quicklinks → responsive →
             gdoc-overrides (typography for injected Google Doc HTML)        */

/* ══ Design tokens ═══════════════════════════════════════════════════ */
:root {
  --page-bg:    #e8e2d5;   /* parchment / warm margin */
  --paper:      #ffffff;   /* white paper surface      */
  --header-bg:  #ffffff;
  --border:     #cfc9bc;
  --border-lt:  #e4dfd5;
  --text:       #1c1917;   /* warm near-black          */
  --text-muted: #7c7468;
  --accent:     #1e3a8a;   /* academic navy            */
  --accent-dim: rgba(30,58,138,.07);
  --link:       #1e3a8a;
  --cta:        #1e3a8a;
  --cta-hover:  #1d4ed8;
  --red:        #991b1b;   /* Nature-like heading red  */
  --lh:         1.55;      /* global line-height       */
  --para-gap:   .5em;      /* uniform pre/post paragraph spacing */
  --header-h:   56px;
  --content-w:  760px;
  --r:          4px;
  --ease:       cubic-bezier(.4,0,.2,1);
}

/* ══ Reset ════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ══ Header ═══════════════════════════════════════════════════════════ */
/* sticky: follows page flow, sticks once hero scrolls away */
.site-header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  z-index: 1000;
  background: #060e1f;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}
.header-logo {
  width: 24px; height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.header-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .01em;
  color: #fff;
  position: relative;
}
.header-title::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,.75);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform .2s var(--ease);
}
.header-brand.active .header-title::after { transform: scaleX(1); }

.header-sep {
  width: 1px; height: 18px;
  background: rgba(255,255,255,.15);
  flex-shrink: 0;
}

/* ══ Nav ══════════════════════════════════════════════════════════════ */
/* Nav with overflow arrows */
.nav-outer {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.nav-arrow {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.5);
  font-size: .85rem;
  cursor: pointer;
  display: none;          /* shown by JS when needed */
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
  line-height: 1;
}
.nav-arrow.visible { display: flex; }
.nav-arrow:hover { color: #fff; background: rgba(255,255,255,.12); }

.nav-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-scroll::-webkit-scrollbar { display: none; }

.header-nav {
  display: flex;
  gap: 0;
  white-space: nowrap;
}

.nav-tab {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: var(--r);
  font-size: .78rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  letter-spacing: .01em;
  transition: color .15s var(--ease), background .15s var(--ease);
  white-space: nowrap;
  position: relative;
}
.nav-tab::after {
  content: '';
  position: absolute;
  bottom: 0; left: 12px; right: 12px;
  height: 2px;
  background: rgba(255,255,255,.75);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform .2s var(--ease);
}
.nav-tab:hover  { color: #fff; }
.nav-tab.active { color: #fff; font-weight: 600; }
.nav-tab.active::after { transform: scaleX(1); }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--r);
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-icon:hover { border-color: rgba(255,255,255,.40); background: rgba(255,255,255,.25); }

.btn-join {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--r);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .02em;
  font-family: 'Inter', sans-serif;
  transition: background .15s var(--ease);
}
.btn-join:hover { background: rgba(255,255,255,.25); }

.btn-mobile-menu {
  display: none; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.30);
  border-radius: var(--r);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-mobile-menu:hover { background: rgba(255,255,255,.25); }

/* ══ Mobile FAB ═══════════════════════════════════════════════════════ */
/* Mobile outline FAB */
.fab-outline {
  display: none;
  position: fixed;
  bottom: 22px; right: 18px;
  z-index: 970;
  align-items: center; gap: 7px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: .82rem; font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.fab-outline:hover { background: var(--accent-dk, #1a5dbf); }
.fab-outline:active { transform: scale(.96); }
.fab-outline svg { flex-shrink: 0; }
.fab-outline.fab-hidden { display: none !important; }

/* ══ Mobile nav ═══════════════════════════════════════════════════════ */
.mobile-nav {
  display: none;
  position: sticky;
  top: var(--header-h);
  left: 0; right: 0;
  background: #060e1f;
  border-bottom: 1px solid rgba(255,255,255,.08);
  z-index: 999;
  padding: 8px;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-tab {
  text-align: left; padding: 9px 12px; width: 100%;
  border-radius: var(--r); font-size: .85rem;
}
.mobile-nav .nav-tab::after { display: none; }
.mobile-nav .nav-tab.active { background: rgba(255,255,255,.1); }

/* ══ Hero ═════════════════════════════════════════════════════════════ */
.hero-banner {
  position: relative;
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060e1f;
}
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.hero-nebula {
  position: absolute; inset: -20% -10%;
  background:
    radial-gradient(ellipse 60% 80% at 15% 60%, rgba(30,58,138,.45) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 30%, rgba(88,28,135,.3) 0%, transparent 70%),
    radial-gradient(ellipse 70% 50% at 50% 50%, rgba(10,20,50,.5) 0%, transparent 80%);
  animation: hero-drift 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes hero-drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(2%,1%) scale(1.07); }
}
.hero-content {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 20px;
  padding: 0 28px;
  max-width: var(--content-w);
  width: 100%;
}
.hero-logo-xl {
  width: 62px; height: 62px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}
.hero-title-block { display: flex; flex-direction: column; gap: 7px; }
.hero-society {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem; font-weight: 700;
  color: #fff; letter-spacing: .02em; line-height: 1.2;
}
.hero-tagline {
  font-family: 'Inter', sans-serif;
  font-size: .76rem;
  color: rgba(255,255,255,.6);
  letter-spacing: .03em;
}

/* ══ Nav dropdown ═════════════════════════════════════════════════════ */
.nav-dropdown {
  display: none;
  position: fixed;
  /* top/left set by JS on open */
  z-index: 980;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: calc(var(--r) + 2px);
  box-shadow: 0 10px 32px rgba(0,0,0,.18);
  min-width: 200px; max-width: 300px;
  max-height: 60vh; overflow-y: auto;
  animation: dd-in .15s var(--ease);
}
@keyframes dd-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-dropdown.open { display: block; }
.nav-dropdown-list {
  padding: 8px 6px 10px;
  display: flex; flex-direction: column; gap: 1px;
}
.nav-dd-item {
  display: block; width: 100%;
  text-align: left; padding: 5px 8px;
  border-radius: var(--r); border: none; background: none;
  cursor: pointer; color: var(--text);
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: .83rem; line-height: 1.4;
  transition: background .12s, color .12s;
}
.nav-dd-item:hover { background: var(--accent-dim); color: var(--accent); }
.nav-dd-item[data-level="1"] { font-weight: 600; font-size: .88rem; }
.nav-dd-item[data-level="2"] { padding-left: 18px; }
.nav-dd-item[data-level="3"] { padding-left: 34px; font-size: .79rem; color: var(--text-muted); }
.nav-dd-divider { height: 1px; background: var(--border-lt); margin: 4px 0; }
.nav-dd-header {
  font-family: 'Inter', sans-serif;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); padding: 12px 8px 8px;
}

/* ══ Layout ═══════════════════════════════════════════════════════════ */
/* Page body */
.page-body {
  min-height: 100vh;
}

/* White paper card centered on parchment */
.paper-card {
  max-width: var(--content-w);
  margin: 0 auto;
  background: var(--paper);
  min-height: calc(100vh - var(--header-h));
  box-shadow: 0 0 0 1px var(--border-lt), 0 4px 32px rgba(0,0,0,.08);
}

/* Section title bar */
.section-bar {
  display: none;
  padding: 28px 36px 20px;
  border-bottom: 1px solid var(--border-lt);
}
.section-bar.visible { display: block; }

.section-bar-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.section-bar h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

/* [layout] directive */
/* full-width: paper card expands to full viewport width */
.paper-card.layout-full { max-width: none !important; }

/* [Page: iframe:] — iframe embedded in the content column */
.page-iframe-wrap {
  width: 100%; min-height: 80vh;
  border: none; display: flex; flex-direction: column;
}
.page-iframe-wrap iframe {
  width: 100%; flex: 1; border: none;
  min-height: 80vh;
}

/* [Page: site:] — full-width breakout iframe (escapes paper column) */
.page-site-wrap {
  position: fixed;
  top: var(--header-h, 56px); left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex; flex-direction: column;
  background: #fff;
}
.page-site-wrap iframe {
  width: 100%; flex: 1; border: none;
}

/* ══ Content ══════════════════════════════════════════════════════════ */
#doc-content {
  padding: 28px 36px 80px;
  overflow-x: hidden;
}

/* Google Doc content typography — base fallbacks (gdoc-overrides below wins via !important) */
#doc-content .doc-content {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.9rem;
  line-height: var(--lh);
  color: var(--text);
}

/* ══ States ═══════════════════════════════════════════════════════════ */
.state-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 80px 0;
  color: var(--text-muted); font-size: .9rem;
}
.spinner {
  width: 26px; height: 26px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state-error { padding: 40px; text-align: center; color: var(--red); font-size: .9rem; }

/* Shimmer animation (images + iframes while loading) */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}

/* ══ Iframes ══════════════════════════════════════════════════════════ */
/* full column width, centered */
.iframe-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 28px auto;    /* auto centers when wrapper has explicit max-width */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* iframe fills wrapper width */
}
.responsive-iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;       /* centers iframe when JS sets a narrower max-width */
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: transparent;
}
/* iframe loading overlay */
.iframe-loader {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r);
  z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, var(--border-lt) 25%, var(--border) 50%, var(--border-lt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  transition: opacity .35s;
}
.iframe-loader.done { opacity: 0; }
.iframe-loader .spinner {
  width: 22px; height: 22px;
  border: 2px solid rgba(0,0,0,.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-fullscreen {
  position: absolute;
  top: 8px; right: 8px; z-index: 5;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 3px 9px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity .2s, color .15s;
  backdrop-filter: blur(4px);
}
.iframe-wrapper:hover .btn-fullscreen { opacity: 1; }
.btn-fullscreen:hover { color: var(--text); }

/* ══ CTA popup button ══════════════════════════════════════════════════ */
.cta-btn-wrap {
  display: flex;
  justify-content: center;
  margin: 2em 0;
}

/* -- Type 1 (default): solid filled red -------------------------------- */
.btn-cta-popup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--cta-btn-color, var(--red));
  color: #fff !important;
  border: 2px solid transparent;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: 0 4px 16px rgba(153,27,27,.25);
  transition: background .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .15s var(--ease),
              box-shadow .18s var(--ease);
}
.btn-cta-popup:hover {
  background: #7f1d1d;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(153,27,27,.40);
}
.btn-cta-popup:active { transform: translateY(0); }

/* -- Type 2: ghost outline red ----------------------------------------- */
.btn-cta-popup.cta-type-2 {
  background: transparent;
  color: var(--cta-btn-color, var(--red)) !important;
  border-color: var(--cta-btn-color, var(--red));
  box-shadow: none;
}
.btn-cta-popup.cta-type-2:hover {
  background: var(--cta-btn-color, var(--red));
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(153,27,27,.20);
}

/* -- Type 3: pill gradient red ----------------------------------------- */
.btn-cta-popup.cta-type-3 {
  background: linear-gradient(135deg, var(--cta-btn-color, var(--red)) 0%, #7f1d1d 100%);
  border-radius: 50px;
  padding: 16px 44px;
  font-size: 1.05rem;
  letter-spacing: .04em;
  box-shadow: 0 6px 24px rgba(153,27,27,.30);
}
.btn-cta-popup.cta-type-3:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(153,27,27,.45);
}

/* -- Type 4: navy solid ------------------------------------------------- */
.btn-cta-popup.cta-type-4 {
  background: var(--cta-btn-color, var(--accent));
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(30,58,138,.22);
}
.btn-cta-popup.cta-type-4:hover {
  background: #162d6e;
  box-shadow: 0 8px 24px rgba(30,58,138,.35);
}

/* -- Type 5: navy ghost ------------------------------------------------- */
.btn-cta-popup.cta-type-5 {
  background: transparent;
  color: var(--cta-btn-color, var(--accent)) !important;
  border-color: var(--cta-btn-color, var(--accent));
  box-shadow: none;
}
.btn-cta-popup.cta-type-5:hover {
  background: var(--cta-btn-color, var(--accent));
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(30,58,138,.22);
}

/* -- Type 6: parchment warm (paper-toned, dark text) -------------------- */
.btn-cta-popup.cta-type-6 {
  background: #f5f0e8;
  color: var(--text) !important;
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  font-weight: 500;
}
.btn-cta-popup.cta-type-6:hover {
  background: #ece5d8;
  border-color: var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}

/* -- Type 7: charcoal dark ---------------------------------------------- */
.btn-cta-popup.cta-type-7 {
  background: #1c1917;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
}
.btn-cta-popup.cta-type-7:hover {
  background: #292524;
  box-shadow: 0 8px 24px rgba(0,0,0,.34);
}

/* -- Type 8: minimal text link + arrow ---------------------------------- */
.btn-cta-popup.cta-type-8 {
  background: transparent;
  color: var(--cta-btn-color, var(--accent)) !important;
  border: none;
  box-shadow: none;
  padding: 4px 0;
  font-size: .97rem;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(30,58,138,.35);
}
.btn-cta-popup.cta-type-8::after { content: ' →'; }
.btn-cta-popup.cta-type-8:hover {
  color: var(--red) !important;
  text-decoration-color: currentColor;
  transform: none;
  box-shadow: none;
}
.btn-cta-popup.cta-type-8 .cta-icon { display: none; }

/* -- Type 9: academic seal (square, uppercase, spaced) ------------------ */
.btn-cta-popup.cta-type-9 {
  background: transparent;
  color: var(--cta-btn-color, var(--red)) !important;
  border: 1.5px solid var(--cta-btn-color, var(--red));
  border-radius: 0;
  padding: 12px 36px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .76rem;
  box-shadow: inset 0 0 0 3px rgba(153,27,27,.06), 0 0 0 4px rgba(153,27,27,.04);
}
.btn-cta-popup.cta-type-9:hover {
  background: var(--cta-btn-color, var(--red));
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(153,27,27,.22);
}

/* -- Type 10: wide declaration strip ------------------------------------ */
.btn-cta-popup.cta-type-10 {
  width: 100%;
  justify-content: center;
  background: transparent;
  color: var(--cta-btn-color, var(--text)) !important;
  border: none;
  border-top: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
  border-radius: 0;
  padding: 18px 32px;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: none;
}
.btn-cta-popup.cta-type-10:hover {
  background: rgba(0,0,0,.025);
  border-color: var(--cta-btn-color, var(--text-muted));
  transform: none;
  box-shadow: none;
}
.cta-btn-wrap:has(.cta-type-10) { margin-left: -36px; margin-right: -36px; }

.cta-icon { font-size: 1.1em; }

/* ══ Hyperlink styles (set via [link style: X] in #parameters) ════════ */
/* accent: navy, no underline, reveals on hover */
.doc-links-accent a { color: var(--accent); text-decoration: none; }
.doc-links-accent a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* minimal: muted dotted underline */
.doc-links-minimal a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.doc-links-minimal a:hover { color: var(--accent); text-decoration-style: solid; }

/* classic: navy + always underlined, academic journal style */
.doc-links-classic a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.doc-links-classic a:hover { color: var(--red); }

/* red: authority red, no underline */
.doc-links-red a { color: var(--red); text-decoration: none; }
.doc-links-red a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ══ Forms ════════════════════════════════════════════════════════════ */
/* Google Form modal */
.gform-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(28,25,23,.55);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 16px;
}
.gform-overlay.open { display: flex; }
.gform-card {
  background: #fff; border-radius: 8px;
  width: 100%; max-width: 450px; max-height: 90vh;
  position: relative; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: modal-in .2s var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.gform-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 26px; height: 26px;
  background: #1e293b; color: #fff; border: none; border-radius: 50%;
  font-size: .95rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; line-height: 1;
}
.gform-close:hover { background: #991b1b; }
#gform-iframe {
  display: block; width: 118%; height: 540px; border: none;
  transform: scale(.847); transform-origin: 0 0;
}

/* ══ Footer ═══════════════════════════════════════════════════════════ */
.site-footer-bar {
  background: #060e1f;
  color: rgba(255,255,255,.7);
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  line-height: 1.7;
  padding: 32px 36px 28px;
}
.site-footer-bar .doc-content {
  max-width: var(--content-w);
  margin: 0 auto;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
}
.footer-col {
  padding: 0 32px;
  border-left: 1px solid rgba(255,255,255,.07);
}
.footer-col:first-child { border-left: none; padding-left: 0; }
.footer-col > *:first-child { margin-top: 0 !important; }
.site-footer-bar a { color: rgba(255,255,255,.75); text-decoration: underline; }
.site-footer-bar a:hover { color: #fff; }
/* Override gdoc-overrides so text is light on dark footer bg */
.site-footer-bar .doc-content,
.site-footer-bar .doc-content p,
.site-footer-bar .doc-content li,
.site-footer-bar .doc-content span { color: rgba(255,255,255,.75) !important; }
/* Footer headings — match the SECTIONS/QUICK ACTIONS label style */
.site-footer-bar .doc-content h1,
.site-footer-bar .doc-content h2,
.site-footer-bar .doc-content h3,
.site-footer-bar .doc-content h4 {
  font-family: 'Inter', sans-serif !important;
  font-size: .68rem !important;
  font-weight: 700 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  color: rgba(255,255,255,.45) !important;
  margin: 0 0 10px !important;
  line-height: 1.3 !important;
}

/* ══ Quicklinks ═══════════════════════════════════════════════════════ */
/* [quicklinks] block */
.quicklinks-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px 36px;
  margin: 20px 0 8px;
  padding: 24px;
  background: var(--accent-dim, rgba(30,80,180,.07));
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.ql-col h4 {
  font-family: 'Inter', sans-serif;
  font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 10px;
}
.ql-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.ql-col a { color: var(--accent); text-decoration: none; font-size: .87rem; }
.ql-col a:hover { text-decoration: underline; }

/* Quicklinks cols inside footer — use footer palette */
.site-footer-bar .ql-col h4 { color: rgba(255,255,255,.45); }
.site-footer-bar .ql-col a  { color: rgba(255,255,255,.75); text-decoration: none; }
.site-footer-bar .ql-col a:hover { color: #fff; }

/* ── Footer meta bar: bake status + edit link ─────────────────────── */
.footer-meta-bar {
  max-width: var(--content-w);
  margin: 18px auto 0;
  padding-top: 11px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .70rem;
  color: rgba(255,255,255,.28);
  font-family: 'Inter', sans-serif;
}
.footer-meta-bar a       { color: rgba(255,255,255,.35) !important; text-decoration: none !important; }
.footer-meta-bar a:hover { color: rgba(255,255,255,.65) !important; }
.fmb-sep { color: rgba(255,255,255,.14); }
.fmb-rebake {
  background: none; border: none; padding: 0; cursor: pointer;
  color: rgba(255,255,255,.35); font-size: .70rem; font-family: 'Inter', sans-serif;
}
.fmb-rebake:hover:not(:disabled) { color: rgba(255,255,255,.75); }
.fmb-rebake:disabled { cursor: default; }

/* ══ Paged layout (§ page-break marker) ══════════════════════════════ */
/* Column: fully transparent, no shadow */
.paper-card.paged-mode           { background: transparent !important; box-shadow: none !important; }
/* Keep section title bar white */
.paper-card.paged-mode .section-bar { background: #ffffff; }
#doc-content.paged-mode          { padding: 0 !important; background: transparent !important; }

/* Layout: flex column of sheets */
.paper-card.paged-mode .paged-layout {
  display: flex;
  flex-direction: column;
  gap: 2.4em;
  padding-bottom: 2.4em;
}

/* Sheets: .page-sheet has no doc-content class, so gdoc-override
   background:transparent !important does not apply here. */
.page-sheet {
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.07);
  padding: 28px 36px;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 860px) {
  .page-sheet { padding: 18px 18px; }
}
/* H1 inside page sheets: section-bar-label treatment.
   #doc-content .page-sheet .doc-content h1 beats #doc-content .doc-content h1 (more specific). */
#doc-content .page-sheet .doc-content h1 {
  font-family: 'Inter', sans-serif !important;
  font-size: .68rem !important;
  font-weight: 600 !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
  color: var(--red) !important;
  margin: 0 0 .5em !important;
  line-height: 1.4 !important;
}

/* ══ Responsive ═══════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .nav-outer, .header-sep { display: none; }
  .header-actions { flex: 1; }
  .btn-mobile-menu { display: flex; margin-left: auto; }
  .paper-card { box-shadow: none; }
  /* Uniform button visibility */
  .btn-icon {
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.30);
    color: #fff;
  }
  .fab-outline { display: flex; }
}
@media (max-width: 600px) {
  :root { --header-h: 50px; }
  .header-title { display: none; }
  .btn-join .btn-join-label { display: none; }
  .btn-join { padding: 6px 10px; }
  .section-bar, #doc-content { padding-left: 18px; padding-right: 18px; }
  .section-bar h1 { font-size: 1.3rem; }
  #gform-iframe { width: 100%; height: 480px; transform: none; }
  .hero-banner { height: 150px; }
  .hero-logo-xl { width: 44px; height: 44px; }
  .hero-society { font-size: 1.1rem; }
  .nav-dropdown-list { padding-left: 18px; padding-right: 18px; }
  .footer-cols { grid-template-columns: 1fr; }
  .footer-col { border-left: none; border-top: 1px solid rgba(255,255,255,.07); padding: 20px 0 0; }
  .footer-col:first-child { border-top: none; padding-top: 0; }
  .site-footer-bar { padding: 24px 18px 20px; }
}

/* ══ Gdoc-overrides ═══════════════════════════════════════════════════
   Enforce academic typography on all injected Google Doc content.
   gdoc-style is sanitized to strip color, background, font-family,
   font-size — so these declarations win cleanly via normal cascade.    */

/* Base */
#doc-content .doc-content {
  font-family: 'Source Serif 4', Georgia, serif !important;
  font-size: 0.9rem !important;
  line-height: var(--lh) !important;
  color: var(--text) !important;
  background: transparent !important;
  text-align: left !important;
  text-indent: 0 !important;
}
#doc-content .doc-content * {
  background-color: transparent !important;
}

/* Headings — Playfair Display, academic scale */
#doc-content .doc-content h1 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 1.65rem !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  margin: 1.3em 0 .35em !important;
  color: var(--text) !important;
}
#doc-content .doc-content h2 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  margin: 1.1em 0 .3em !important;
  color: var(--text) !important;
}
#doc-content .doc-content h3 {
  font-family: 'Source Serif 4', Georgia, serif !important;
  font-size: 1.08rem !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  margin: 1em 0 .25em !important;
  color: var(--text) !important;
}
#doc-content .doc-content h4,
#doc-content .doc-content h5,
#doc-content .doc-content h6 {
  font-family: 'Source Serif 4', Georgia, serif !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  margin: 1em 0 .3em !important;
  color: var(--text) !important;
}

/* Paragraphs & inline */
#doc-content .doc-content p {
  font-family: 'Source Serif 4', Georgia, serif !important;
  font-size: 0.9rem !important;
  line-height: var(--lh) !important;
  color: var(--text) !important;
  margin: .75em 0 !important;
  text-align: justify !important;
  text-indent: 0 !important;
  overflow-wrap: break-word !important;
}
#doc-content .doc-content span {
  font-family: inherit !important;
  font-size: inherit !important;
  color: inherit !important;
}

/* Preserve bold & italic; no underline on headings */
#doc-content .doc-content strong,
#doc-content .doc-content b     { font-weight: 700 !important; }
#doc-content .doc-content em,
#doc-content .doc-content i     { font-style: italic !important; }
#doc-content .doc-content h1,
#doc-content .doc-content h2,
#doc-content .doc-content h3,
#doc-content .doc-content h4,
#doc-content .doc-content h5,
#doc-content .doc-content h6    { text-decoration: none !important; }

/* Links */
#doc-content .doc-content a     { color: var(--link) !important; text-decoration: none; }
#doc-content .doc-content a:hover { text-decoration: underline; }

/* Lists — full reset then our style */
#doc-content .doc-content ul,
#doc-content .doc-content ol    {
  font-family: 'Source Serif 4', Georgia, serif !important;
  font-size: 0.9rem !important;
  line-height: var(--lh) !important;
  color: var(--text) !important;
  padding-left: 1.8em !important;
  margin: .4em 0 .4em 0 !important;
  list-style-position: outside !important;
}
#doc-content .doc-content ul    { list-style-type: disc !important; }
#doc-content .doc-content ol    { list-style-type: decimal !important; }
#doc-content .doc-content li    {
  color: var(--text) !important;
  font-family: 'Source Serif 4', Georgia, serif !important;
  font-size: 0.9rem !important;
  line-height: var(--lh) !important;
  margin: .18em 0 !important;
  padding-left: 0 !important;
  display: list-item !important;
  text-align: left !important;
}
/* Suppress any gdoc pseudo-element markers — we use list-style-type */
#doc-content .doc-content li::before,
#doc-content .doc-content li::after { content: none !important; display: none !important; }
/* nested lists */
#doc-content .doc-content ul ul,
#doc-content .doc-content ol ul  { list-style-type: circle !important; }
#doc-content .doc-content ul ul ul,
#doc-content .doc-content ol ol ul { list-style-type: square !important; }
#doc-content .doc-content ul ul,
#doc-content .doc-content ol ul,
#doc-content .doc-content ul ol,
#doc-content .doc-content ol ol  { margin: .1em 0 !important; padding-left: 1.4em !important; }

/* Tables */
#doc-content .doc-content td,
#doc-content .doc-content th    { font-family: 'Source Serif 4', Georgia, serif !important;
                                  font-size: .95rem !important;
                                  color: var(--text) !important;
                                  border-color: var(--border) !important; }

/* Images — default: auto size, centered, overflow-capped.
   [image ...] directive in the doc overrides via inline styles. */
#doc-content .doc-content img   { max-width: 100% !important; width: auto; height: auto !important;
                                  border-radius: 4px; display: block; margin: 1.2em auto; }
/* Image wrapper spans: ensure they don't overflow column */
#doc-content .doc-content span  { max-width: 100%; }

/* Image shimmer — shows while proxy-fetch is in progress.
   Uses background-image !important so it wins over
   "background-color: transparent !important" from the * rule above.
   Higher specificity via :not(.img-loaded) beats the * selector. */
#doc-content .doc-content img:not(.img-loaded) {
  min-height: 80px !important;
  background-image: linear-gradient(
    90deg,
    var(--border-lt) 25%,
    var(--border)    50%,
    var(--border-lt) 75%
  ) !important;
  background-size: 200% 100% !important;
  background-color: var(--border-lt) !important;
  animation: shimmer 1.5s ease-in-out infinite !important;
}
#doc-content .doc-content img.img-loaded {
  background-image: none !important;
  background-color: transparent !important;
  animation: none !important;
  min-height: unset !important;
}

/* Iframe loader overlay — same shimmer pattern.
   Also needs !important because it lives inside .doc-content */
#doc-content .doc-content .iframe-loader {
  background-image: linear-gradient(
    90deg,
    var(--border-lt) 25%,
    var(--border)    50%,
    var(--border-lt) 75%
  ) !important;
  background-size: 200% 100% !important;
  background-color: var(--border-lt) !important;
  animation: shimmer 1.5s ease-in-out infinite !important;
}

/* ══ Auth UI ══════════════════════════════════════════════════════════ */

/* Status bar in header */
.auth-status {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
  font-size: .73rem;
  color: rgba(255,255,255,.65);
  max-width: 260px;
  overflow: hidden;
}
.auth-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.22);
  flex-shrink: 0;
}
.auth-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-dev {
  color: #fbbf24;
  font-family: monospace;
  font-size: .75rem;
}
.auth-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r);
  color: rgba(255,255,255,.75);
  font-family: 'Inter', sans-serif;
  font-size: .70rem;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.auth-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* Hide auth-status on very small screens (mobile menu handles it differently) */
@media (max-width: 600px) { .auth-status { display: none; } }

/* ── Nav level dots ─────────────────────────────────────────────────── */
.nav-tab .lvl-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Restricted content gate ────────────────────────────────────────── */
.restricted-gate {
  padding: 64px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.restricted-icon  { font-size: 2.4rem; }
.restricted-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.restricted-desc {
  font-size: .87rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 380px;
}
.restricted-desc em { font-style: normal; font-weight: 600; color: var(--text); }
.restricted-btn {
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.restricted-btn:hover { background: var(--cta-hover, #1d4ed8); }

/* ── Access checking placeholder ────────────────────────────────────── */
.access-checking {
  padding: 80px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: .88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ── Restricted interactive iframe (full-height embed) ──────────────── */
.restricted-iframe-wrap {
  width: 100%;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  position: relative;
}
.restricted-iframe-wrap iframe {
  flex: 1;
  border: none;
  min-height: 80vh;
  width: 100%;
}

/* ── Comment / suggest modification button ──────────────────────────── */
.comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  color: var(--accent);
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
  margin: 12px 0 16px;
}
.comment-btn:hover { background: rgba(30,58,138,.14); }

/* ── Dev level badge (fixed bottom-left, Cmd+Shift+L) ──────────────── */
.dev-level-badge {
  position: fixed;
  bottom: 14px; left: 14px;
  z-index: 9999;
  background: #1e293b;
  color: #fbbf24;
  font-family: monospace;
  font-size: .72rem;
  padding: 4px 10px;
  border-radius: 999px;
  pointer-events: none;
  display: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.dev-level-badge.visible { display: block; }
