/* ============================================================
   Libre Commons page
   Layout shell copied from Document-Design-Standards.html.
   Commons-specific content styles live below that shell.
   ============================================================ */

:root {
  --ca-text:          #e4e4e8;
  --ca-text-heading:  #fafafa;
  --ca-text-muted:    #b0b0ba;
  --ca-text-faint:    #d4d4dc;
  --ca-text-tag:      #9a9aa4;
  --ca-border:        #1e1e22;
  --ca-border-subtle: #2a2a30;
  --ca-surface:       #111113;
  --ca-surface-hover: #16161a;
  --ca-accent:        #4a7fb5;
  --ca-accent-hover:  #3a6a9a;
  --gt-gutter:        #000;
}

[data-theme="light"] {
  --ca-text:          #3f3f46;
  --ca-text-heading:  #09090b;
  --ca-text-muted:    #5a5a63;
  --ca-text-faint:    #818189;
  --ca-text-tag:      #6e6e78;
  --ca-border:        #e4e4e7;
  --ca-border-subtle: #d4d4d8;
  --ca-surface:       #f4f4f5;
  --ca-surface-hover: #e4e4e7;
  --ca-accent:        #4a7fb5;
  --ca-accent-hover:  #3a6a9a;
  --gt-gutter:        #f7f7f7;
}

@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --ca-text:          #3f3f46;
    --ca-text-heading:  #09090b;
    --ca-text-muted:    #5a5a63;
    --ca-text-faint:    #818189;
    --ca-text-tag:      #6e6e78;
    --ca-border:        #e4e4e7;
    --ca-border-subtle: #d4d4d8;
    --ca-surface:       #f4f4f5;
    --ca-surface-hover: #e4e4e7;
    --ca-accent:        #4a7fb5;
    --ca-accent-hover:  #3a6a9a;
    --gt-gutter:        #f7f7f7;
  }
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--gt-gutter);
  font-size: 16px;
  line-height: 1.8;
}

#scroll-root {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: hidden;
  overflow-x: hidden;
}

/* Reference header */
.nav {
  border-bottom: none;
  position: fixed;
  top: 0 !important;
  left: 50%;
  right: auto;
  width: 800px;
  height: 55px;
  margin: 0;
  transform: translateX(-50%);
  background: var(--nav-blur-bg);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.nav-inner {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
}

.nav-center {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}

.nav-logo {
  gap: 9px;
}

.nav-logo-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: var(--gt-accent, var(--ca-accent));
  border-radius: 5px;
  position: relative;
  top: -1px;
}

.nav-logo-text {
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}

.nav-inner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 40px;
  right: 40px;
  height: 1px;
  background: var(--gt-border, var(--ca-border));
}

.gt-btn-thin {
  height: 28px;
  padding: 0 10px;
  gap: 4px;
}

.theme-label { display: none; }

.theme-icon {
  font-size: 15px;
  line-height: 1;
}

/* Reference page shell */
.preview-page {
  position: relative;
  left: calc((100vw - 100%) / 2);
  max-width: 800px;
  min-height: 100%;
  margin: 0 auto;
  padding: 75px 40px 80px;
  background: var(--gt-bg);
}

.l-page {
  box-sizing: border-box;
}

.l-main {
  min-width: 0;
}

.toc-float,
.l-sidebar {
  position: fixed;
  top: 70px;
  left: calc(50% + 420px);
  z-index: 100;
  width: 160px;
}

.l-sidebar-label {
  font-family: var(--gt-font-mono, 'Geist', monospace);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gt-text-heading, var(--ca-text-heading));
  margin-bottom: 8px;
}

.l-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.l-sidebar-nav a {
  font-family: var(--gt-font-mono, 'Geist', monospace);
  font-size: calc(10px + 4pt);
  color: rgba(128, 128, 128, 0.8);
  text-decoration: none;
  padding: 2px 6px;
  margin: 0 -6px;
  border-radius: 4px;
  display: block;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.l-sidebar-nav a:hover {
  color: var(--gt-text, var(--ca-text-heading));
}

.l-sidebar-nav a.toc-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--gt-accent-text, var(--ca-text-heading));
}

.l-sidebar-nav a.toc-active + a.toc-active {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.l-sidebar-nav a.toc-active:has(+ a.toc-active) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

[data-theme="light"] .l-sidebar-nav a.toc-active {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
}

@media (prefers-color-scheme: light) {
  [data-theme="auto"] .l-sidebar-nav a.toc-active {
    background: rgba(0, 0, 0, 0.08);
    color: #000;
  }
}

/* Commons content */
.l-title-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
}

.l-title-the {
  font-size: 25px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--ca-text-faint);
  line-height: 1;
}

.l-title-name {
  font-size: clamp(36px, 3.2vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ca-text-heading);
  margin: 0;
  max-width: 520px;
}

.l-header {
  padding: 32px 0 20px;
  border-bottom: 1px solid var(--ca-border);
}

.l-headline {
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ca-text-muted);
  margin-bottom: 20px;
}

.l-deck {
  font-size: 17px;
  color: var(--ca-text-muted);
  line-height: 1.7;
  max-width: 715px;
}

.l-section,
.l-pub-card {
  scroll-margin-top: 80px;
}

.l-article {
  padding: 0;
}

.l-section {
  padding: 26px 0;
  border-bottom: 1px solid var(--ca-border);
}

.l-section:last-child,
.l-section#publications {
  border-bottom: none;
}

.l-section-kicker {
  font-family: 'Geist', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ca-text-faint);
  margin-bottom: 16px;
}

.l-section h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ca-text-heading);
  margin-bottom: 20px;
  line-height: 1.25;
}

.l-section p {
  color: var(--ca-text-muted);
  margin-bottom: 16px;
  max-width: 790px;
  line-height: 1.7;
}

.l-section p:last-child {
  margin-bottom: 0;
}

.l-section a {
  color: var(--ca-accent);
  text-decoration: none;
}

.l-section a:hover {
  text-decoration: underline;
}

.l-section ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  max-width: 790px;
}

.l-section ul li {
  position: relative;
  padding: 4px 0 4px 20px;
  color: var(--ca-text-muted);
  font-size: 15px;
  line-height: 1.7;
}

.l-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  background: var(--ca-border-subtle);
  border-radius: 50%;
}

.l-section blockquote {
  border-left: 2px solid var(--ca-accent);
  padding-left: 20px;
  margin: 0 0 20px;
  color: var(--ca-text-heading);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  max-width: 715px;
}

.l-principle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.l-principle {
  background: var(--ca-surface);
  border: 1px solid var(--ca-border);
  border-radius: 10px;
  padding: 24px;
}

.l-principle h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ca-text-heading);
}

.l-principle p {
  font-size: 14px;
  color: var(--ca-text-muted);
  line-height: 1.6;
  margin: 0;
}

.l-pub-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.l-pub-card {
  background: var(--ca-surface);
  border: 1px solid var(--ca-border);
  border-radius: 10px;
  padding: 24px 28px;
  transition: border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.l-pub-card:hover {
  border-color: var(--ca-accent);
}

.l-pub-card h3 {
  font-size: 23px;
  font-weight: 600;
  margin-bottom: 6px;
}

.l-pub-card p {
  font-size: 14px;
  color: var(--ca-text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.l-pub-card p:last-child,
.l-pub-card-header h3 {
  margin-bottom: 0;
}

.l-pub-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.l-pub-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.l-pub-read-btn {
  display: inline-flex;
  align-items: center;
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Cantarell, sans-serif;
  font-size: 18px;
  font-weight: 500;
  padding: 3px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms;
}

.l-pub-read-btn:hover {
  background: var(--accent-hover);
  color: #fff !important;
  text-decoration: none;
}

.l-pub-tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  margin-left: 12px;
}

.l-pub-tag {
  font-size: 12px;
  font-style: italic;
  color: var(--ca-text-tag);
  white-space: nowrap;
}

.l-pub-tag + .l-pub-tag::before {
  content: '\00b7';
  font-size: 14px;
  padding: 0 7px;
  font-style: normal;
}

.l-section--contact {
  padding: 8px 0 96px;
}

.l-contact-card {
  padding: 0;
}

.l-contact-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.l-contact-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 0;
}

.l-contact-row:first-child {
  padding-top: 2px;
}

.l-contact-row:last-child {
  padding-bottom: 0;
}

.l-contact-row-label {
  font-size: 12px;
  font-family: 'Geist', monospace;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ca-text-faint);
}

.l-contact-row a {
  font-size: 18px;
  font-weight: 500;
  color: var(--ca-accent);
  text-decoration: none;
}

.l-contact-row a:hover {
  text-decoration: underline;
}

@media (max-width: 1180px) {
  .l-sidebar {
    display: none;
  }
}

@media (max-width: 1040px) {
  .nav {
    left: 20px;
    right: 20px;
    width: auto;
    transform: none;
  }

  .preview-page {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .preview-page {
    padding-left: 20px;
    padding-right: 20px;
  }

  .nav-inner {
    padding: 0 20px;
  }

  .nav-inner::after {
    left: 20px;
    right: 20px;
  }

  .nav .gt-btn-primary {
    display: none;
  }

  .l-principle-grid {
    grid-template-columns: 1fr;
  }
}
