/* LifeByLogic glossary layout v1 (October 25, 2026).
   One layout for every glossary entry: the same header, the same reading
   column at every width, the same quick answer, contents box, section
   headings and closing blocks. Linked last in the head of each
   glossary/<term>/index.html, after the page's own styles, so the frame here
   wins over the older per-page rules; everything is scoped to the entry's
   <main class="gl-main">. Text never meets the window's edge: the column keeps
   a side gutter of 20 to 40 px, and boxes keep their text 20 px or more from
   their own border. Served immutable: a change needs a new file name. */

.gl-main {
  --gl-col: 720px;
  --gl-gutter: clamp(20px, 5.2vw, 40px);
  --gl-accent: #5EC4C9;
  --gl-accent-soft: rgba(94, 196, 201, 0.10);
  --gl-accent-line: rgba(94, 196, 201, 0.45);
  --gl-bg: #0B0D12;
  --gl-raised: #10131A;
  --gl-text: #F4F2ED;
  --gl-text-2: #C9CFDA;
  --gl-muted: #9AA3B5;
  --gl-rule: rgba(255, 255, 255, 0.08);
  --gl-rule-soft: rgba(255, 255, 255, 0.05);
  --gl-display: "Fraunces", Georgia, Cambria, serif;
  --gl-body: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gl-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  /* The older per-page rules read these names. */
  --accent: var(--gl-accent);
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
  color: var(--gl-text);
  font-family: var(--gl-body);
  overflow-wrap: break-word;
}
.gl-main[data-lab="behavior"] { --gl-accent: #E06868; --gl-accent-soft: rgba(224, 104, 104, 0.10); --gl-accent-line: rgba(224, 104, 104, 0.45); }
.gl-main[data-lab="crossroads"] { --gl-accent: #E4A24B; --gl-accent-soft: rgba(228, 162, 75, 0.10); --gl-accent-line: rgba(228, 162, 75, 0.45); }
.gl-main[data-lab="life"] { --gl-accent: #56B86C; --gl-accent-soft: rgba(86, 184, 108, 0.10); --gl-accent-line: rgba(86, 184, 108, 0.45); }

/* ── The reading column ── */
.gl-main .gl-hero-inner,
.gl-main .gl-body {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--gl-col) + 2 * var(--gl-gutter));
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gl-gutter);
  padding-right: var(--gl-gutter);
}
.gl-main .gl-body { padding-bottom: clamp(40px, 8vw, 80px); }
.gl-main .gl-body > * { max-width: 100%; margin-left: 0; margin-right: 0; box-sizing: border-box; }
.gl-main .gl-body :is(img, svg, video, iframe, figure, pre) { max-width: 100%; }
/* Older wrappers inside the column add no width or gutter of their own. */
.gl-main .gl-body :is(.legal-body, .glossary-body, .entry-body, .layout, .layout > article) {
  display: block;
  max-width: none;
  width: auto;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
.gl-main .gl-body table { max-width: 100%; }

/* ── The header ── */
.gl-main .gl-hero {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: clamp(36px, 7vw, 72px) 0 clamp(28px, 4.5vw, 44px);
  border-bottom: 1px solid var(--gl-rule-soft);
  background: none;
}
.gl-main .gl-hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -15%;
  width: 60%;
  height: 140%;
  background: radial-gradient(ellipse at center, var(--gl-accent-soft), transparent 70%);
  pointer-events: none;
}
.gl-main .gl-hero-inner { position: relative; }

.gl-main .gl-crumbs { margin: 0 0 clamp(20px, 4vw, 32px); padding: 0; }
.gl-main .gl-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0; padding: 0; }
.gl-main .gl-crumbs li {
  font-family: var(--gl-mono);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gl-muted);
}
.gl-main .gl-crumbs li + li::before { content: "/"; margin: 0 0.6em; color: rgba(255, 255, 255, 0.28); }
.gl-main .gl-crumbs a { color: var(--gl-accent); text-decoration: none; }
.gl-main .gl-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }

.gl-main .gl-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-family: var(--gl-mono);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gl-muted);
}
.gl-main .gl-glyph { font-family: var(--gl-display); font-style: italic; font-size: 1.375rem; letter-spacing: 0; color: var(--gl-accent); }
.gl-main .gl-eyebrow::after { content: ""; flex: 0 1 64px; height: 1px; background: var(--gl-rule); }

.gl-main .gl-hero h1 {
  margin: 0 0 16px;
  font-family: var(--gl-display);
  font-size: clamp(2.125rem, 1.55rem + 2.6vw, 3.5rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--gl-text);
  text-wrap: balance;
}
.gl-main .gl-hero h1 em { font-style: italic; color: var(--gl-accent); }
.gl-main .gl-lede {
  max-width: 62ch;
  margin: 0 0 8px;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--gl-text-2);
}

.gl-main .gl-dates,
.gl-main .gl-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 36px;
  margin: 24px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--gl-rule-soft);
}
.gl-main .gl-dates > div,
.gl-main .gl-facts > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gl-main .gl-facts > div { flex: 1 1 180px; }
.gl-main .gl-dates dt,
.gl-main .gl-facts dt {
  font-family: var(--gl-mono);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gl-muted);
}
.gl-main .gl-dates dd,
.gl-main .gl-facts dd { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--gl-text-2); }
.gl-main .gl-facts dd a { color: inherit; text-decoration: underline; text-decoration-color: var(--gl-accent-line); text-underline-offset: 3px; }

.gl-main .gl-byline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--gl-rule-soft);
}
.gl-main .gl-person {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0;
  font-family: var(--gl-mono);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
.gl-main .gl-role { min-width: 96px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gl-muted); }
.gl-main .gl-person a {
  color: var(--gl-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--gl-accent-line);
  text-underline-offset: 3px;
}
.gl-main .gl-person a:hover { text-decoration-color: var(--gl-accent); }
.gl-main .gl-spec { text-transform: uppercase; letter-spacing: 0.1em; color: var(--gl-accent); }
.gl-main .gl-note {
  margin: 18px 0 0;
  font-family: var(--gl-display);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--gl-text-2);
}

/* ── The quick answer ── */
.gl-main .gl-body .gl-answer {
  margin: clamp(28px, 5vw, 44px) 0 24px;
  padding: clamp(20px, 4.4vw, 28px) clamp(20px, 4.4vw, 32px);
  max-width: none;
  background: var(--gl-raised);
  border: 1px solid var(--gl-rule);
  border-top: 3px solid var(--gl-accent);
  border-radius: 12px;
}
.gl-main .gl-answer .quick-answer-eyebrow {
  margin: 0 0 10px;
  font-family: var(--gl-mono);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gl-accent);
}
.gl-main .gl-answer h2 {
  margin: 0 0 12px;
  font-family: var(--gl-display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--gl-text);
}
.gl-main .gl-answer h2 em { font-style: italic; color: var(--gl-accent); }
.gl-main .gl-answer p {
  max-width: none;
  margin: 0 0 12px;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--gl-text-2);
}
.gl-main .gl-answer p:last-child { margin-bottom: 0; }
.gl-main .gl-answer .qa-keyterm,
.gl-main .gl-answer strong { font-weight: 600; color: var(--gl-text); }
.gl-main .gl-answer a { color: var(--gl-accent); text-decoration: underline; text-underline-offset: 2px; }
/* The plain answer leads; the research definition follows it. */
.gl-main .gl-answer p.gl-plain { font-size: 1.125rem; color: var(--gl-text); }
.gl-main .gl-answer .gl-traits { margin: 0 0 12px; padding: 0 0 0 1.1em; }
.gl-main .gl-answer .gl-traits li { margin: 0 0 6px; font-size: 1rem; line-height: 1.6; color: var(--gl-text-2); overflow-wrap: anywhere; }
.gl-main .gl-answer .gl-traits a { font-weight: 600; }
/* The facts box sits below the answer, after the reader has what they came for. */
.gl-main .gl-body > .gl-facts { margin: 0 0 8px; padding: 0 0 20px; border-top: 0; border-bottom: 1px solid var(--gl-rule-soft); }

/* ── Contents ── */
.gl-main .gl-body .entry-toc {
  margin: 24px 0 8px;
  padding: 20px 24px;
  max-width: none;
  background: var(--gl-raised);
  border: 1px solid var(--gl-rule);
  border-left: 3px solid var(--gl-accent);
  border-radius: 0 10px 10px 0;
}
.gl-main .gl-body .entry-toc-label {
  margin: 0 0 12px;
  font-family: var(--gl-mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gl-muted);
}
.gl-main .gl-body .entry-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: gl-toc; columns: 2 240px; column-gap: 32px; }
.gl-main .gl-body .entry-toc li {
  counter-increment: gl-toc;
  display: flex;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.45;
  break-inside: avoid;
}
.gl-main .gl-body .entry-toc li::before {
  content: counter(gl-toc, lower-roman) ".";
  flex: 0 0 28px;
  min-width: 0;
  margin: 0;
  font-family: var(--gl-display);
  font-style: italic;
  font-weight: 300;
  color: var(--gl-accent);
}
.gl-main .gl-body .entry-toc a { color: var(--gl-text-2); text-decoration: none; border-bottom: 1px solid transparent; }
.gl-main .gl-body .entry-toc a:hover { color: var(--gl-accent); border-bottom-color: var(--gl-accent); }

/* ── Sections ── */
.gl-main .gl-body .legal-section { padding: 32px 0; border-bottom: 1px solid var(--gl-rule-soft); max-width: none; }
.gl-main .gl-body .legal-section:last-child { border-bottom: none; }
.gl-main .gl-body .legal-section-header { display: flex; align-items: baseline; gap: 12px; margin: 0 0 20px; }
.gl-main .gl-body .legal-section-num {
  flex: 0 0 auto;
  min-width: 32px;
  font-family: var(--gl-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--gl-accent);
}
.gl-main .gl-body h2 {
  font-family: var(--gl-display);
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--gl-text);
}
.gl-main .gl-body h3 {
  font-family: var(--gl-display);
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--gl-text);
}
.gl-main .gl-body > :is(section, div, aside, nav) :is(p, li) { max-width: 68ch; }
.gl-main .gl-body .legal-section :is(p, li) { font-size: 1.0625rem; line-height: 1.72; color: var(--gl-text-2); }
.gl-main .gl-body .legal-section a:not([class]) { color: var(--gl-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* ── Boxes inside the column keep their text off their borders ── */
.gl-main .gl-body :is(.definition-callout, .edu-note, .nuance-callout, .info-callout, .method-callout, .example-callout, .care-callout, .myth-block, .misconception, .definition-box, .callout, .note, .caution, .source-note, .editorial-note) {
  box-sizing: border-box;
  max-width: none;
  padding: 16px 20px;
}
.gl-main .gl-body :is(.cta-panel, .calc-cta, .support-panel, .related-tools, .crosslinks, .compare-card, .dsm-card, .factor-card, .severity-card, .trajectory-card, .polarity-card, .lens-card, .modality-card, .tool-card, .related-card, .related-item, .card, .cite-box) {
  box-sizing: border-box;
  max-width: 100%;
  padding-left: max(20px, var(--gl-pad-x, 0px));
  padding-right: max(20px, var(--gl-pad-x, 0px));
}
.gl-main .gl-body .cta-panel { padding-top: 24px; padding-bottom: 24px; }
.gl-main .gl-body .cta-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.gl-main .gl-body .faq-item h3 { margin: 0 0 10px; max-width: 60ch; }
.gl-main .gl-body .faq-item p { margin: 0; }
.gl-main .gl-body .cite-format > summary { padding: 12px 16px; }
.gl-main .gl-body .cite-format pre { padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.gl-main .gl-body .cite-meta { font-size: 1rem; }
.gl-main .gl-body .data-table,
.gl-main .gl-body .table-wrap { max-width: 100%; overflow-x: auto; }

@media (max-width: 640px) {
  .gl-main .gl-hero h1 { overflow-wrap: anywhere; hyphens: auto; }
  .gl-main .gl-dates { gap: 14px 28px; }
  .gl-main .gl-role { min-width: 0; }
  .gl-main .gl-body .entry-toc { padding: 18px 20px; }
  .gl-main .gl-body .legal-section-num { min-width: 24px; font-size: 1.125rem; }
  /* Tables fit the phone instead of running past its edge (Theory of Mind set a 540px floor). */
  .gl-main .gl-body .table-wrap table { min-width: 0; }
  .gl-main .gl-body .table-wrap th,
  .gl-main .gl-body .table-wrap td { overflow-wrap: anywhere; }
}
