/* Ludic Mind Lab sub-site — minimal functional skin (1:1 content copy, restyle later).
   Standalone: base.css is not loaded, so lab.css owns the tokens.
   Default matches the main site default = light; dark follows data-theme. */

:root {
  --lab-bg: #fbfaf7;
  --lab-bg-soft: #f1eee6;
  --lab-fg: #20242b;
  --lab-muted: #5c6572;
  --lab-line: #d9d4c8;
  --lab-accent: #9a6b00;
  --lab-accent-2: #1a5b99;
  --lab-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lab-font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --lab-bg: #0e1116;
  --lab-bg-soft: #141922;
  --lab-fg: #dce3ec;
  --lab-muted: #8b96a5;
  --lab-line: #232b38;
  --lab-accent: #e3b23c;
  --lab-accent-2: #7fb0e6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--lab-bg);
  color: var(--lab-fg);
  font-family: var(--lab-font);
  font-size: 16px;
  line-height: 1.6;
  /* sticky footer: keep the footer pinned to the viewport bottom on short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--lab-accent-2); }
a:hover { text-decoration: none; }

/* ── header ─────────────────────────────────────────── */
.lab-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: var(--lab-bg-soft);
  border-bottom: 1px solid var(--lab-line);
}

.lab-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lab-muted);
  font-size: 14px;
  text-decoration: none;
}

.lab-back-arrow { font-size: 16px; }

.lab-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lab-brand img { height: 30px; width: auto; }

.lab-brand-name {
  font-family: var(--lab-font-display);
  font-size: 17px;
  letter-spacing: 0.02em;
}

.lab-brand-name b { color: var(--lab-accent); font-weight: 700; }

/* theme toggle — same button as the main site shell (base.css pattern) */
.lab-head .theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 12px;
  border: 1px solid var(--lab-line);
  border-radius: 8px;
  background: transparent;
  color: var(--lab-muted);
  cursor: pointer;
  transition: border-color 200ms, color 200ms;
}

.lab-head .theme-toggle:hover { color: var(--lab-fg); border-color: var(--lab-muted); }
.lab-brand .theme-icon { display: none; }
:root[data-theme="dark"] .theme-sun,
:root:not([data-theme="dark"]) .theme-moon { display: none; }
:root[data-theme="dark"] .theme-moon { display: block; }
:root:not([data-theme="dark"]) .theme-sun { display: block; }

/* ── layout ─────────────────────────────────────────── */
.lab-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px 48px;
  gap: 36px;
  flex: 1 0 auto;
  width: 100%;
}

/* ── nav ────────────────────────────────────────────── */
.lab-nav {
  position: sticky;
  top: 78px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 15px;
}

.lab-nav-link {
  display: block;
  padding: 7px 12px;
  border-radius: 7px;
  color: var(--lab-fg);
  text-decoration: none;
}

.lab-nav-link:hover { background: var(--lab-bg-soft); }

.lab-nav-link.on {
  background: var(--lab-bg-soft);
  color: var(--lab-accent);
  font-weight: 600;
}

.lab-nav-group { border-radius: 7px; }

.lab-nav-group summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 7px;
  font-weight: 600;
}

.lab-nav-group summary::-webkit-details-marker { display: none; }

.lab-nav-group summary::before { content: "▸ "; color: var(--lab-muted); }
.lab-nav-group[open] summary::before { content: "▾ "; }

.lab-nav-group summary a { color: var(--lab-fg); text-decoration: none; }
.lab-nav-group summary a:hover { color: var(--lab-accent); }

.lab-nav-group ul {
  list-style: none;
  margin: 2px 0 6px;
  padding: 0 0 0 18px;
  border-left: 1px solid var(--lab-line);
}

.lab-nav-group li a {
  display: block;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--lab-muted);
  text-decoration: none;
  font-size: 14px;
}

.lab-nav-group li a:hover { color: var(--lab-fg); }
.lab-nav-group li a.on { color: var(--lab-accent); font-weight: 600; }

.lab-nav-home { margin-top: 18px; border-top: 1px solid var(--lab-line); padding-top: 12px; color: var(--lab-muted); }

/* ── content ────────────────────────────────────────── */
.lab-title {
  font-family: var(--lab-font-display);
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--lab-line);
}

.lab-body { max-width: 62rem; }

.lab-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Align + center blocks of logos/images (e.g. sponsors row on About).
   Drupal inline heights stay, flex middle-aligns them. */
.lab-body p:has(img) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.lab-body img { vertical-align: middle; }

/* Sponsor logos on About: uniform height so the row reads aligned */
.page-lab-about .lab-body p:has(img) img {
  height: 72px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.lab-body video { max-width: 100%; height: auto; border-radius: 8px; }

.lab-body h2, .lab-body h3, .lab-body h4 {
  font-family: var(--lab-font-display);
  line-height: 1.3;
  margin-top: 1.6em;
}

.lab-body h2 { font-size: 22px; }
.lab-body h3 { font-size: 18px; }

.lab-body table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 14px; }

.lab-body th, .lab-body td {
  border: 1px solid var(--lab-line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.lab-body th { background: var(--lab-bg-soft); }

.lab-body hr { border: 0; border-top: 1px solid var(--lab-line); margin: 1.6em 0; }

.lab-body blockquote {
  margin: 1.2em 0;
  padding: 4px 18px;
  border-left: 3px solid var(--lab-accent);
  color: var(--lab-muted);
}

/* ── project cards (projects page) ──────────────────── */
.lab-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.lab-card {
  background: var(--lab-bg-soft);
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  overflow: hidden;
}

.lab-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.lab-card h2 {
  font-family: var(--lab-font-display);
  font-size: 17px;
  margin: 14px 16px 8px;
}

.lab-card-list {
  list-style: none;
  margin: 0 16px 16px;
  padding: 0;
  font-size: 14px;
}

.lab-card-list li { padding: 3px 0; }
.lab-card-list a { text-decoration: none; }
.lab-card-list a:hover { text-decoration: underline; }

/* ── TRA timeline (G4C deck style) ──────────────────── */
.tra-timeline {
  position: relative;
  margin: 22px 0 30px;
  padding-left: 26px;
}

.tra-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--lab-line);
}

.tra-tl-item { position: relative; padding: 0 0 26px 14px; }
.tra-tl-item:last-child { padding-bottom: 0; }

.tra-tl-dot {
  position: absolute;
  left: -26px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lab-accent);
  border: 3px solid var(--lab-bg);
  box-shadow: 0 0 0 1px var(--lab-accent);
}

.tra-tl-body h3 {
  font-family: var(--lab-font-display);
  font-size: 17px;
  margin: 0 0 6px;
}

.tra-tl-year {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--lab-bg-soft);
  border: 1px solid var(--lab-line);
  color: var(--lab-muted);
  font-size: 12px;
  font-weight: 500;
  vertical-align: middle;
}

.tra-tl-body p { margin: 0; color: var(--lab-muted); font-size: 15px; }

/* ── TRA artwork collage ────────────────────────────── */
.tra-collage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px;
  margin: 18px 0 8px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  overflow: hidden;
}

.tra-collage img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

/* ── TRA builds ─────────────────────────────────────── */
.tra-builds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 18px 0 8px;
}

.tra-build {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--lab-bg-soft);
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--lab-fg);
  transition: border-color 200ms, transform 200ms;
}

a.tra-build:hover {
  border-color: var(--lab-accent);
  transform: translateY(-2px);
}

.tra-build-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--lab-accent);
  color: var(--lab-bg);
}

.tra-build-title { font-family: var(--lab-font-display); font-size: 18px; font-weight: 700; }
.tra-build-desc { color: var(--lab-muted); font-size: 14px; }
.tra-build-link { margin-top: 6px; color: var(--lab-accent-2); font-weight: 600; font-size: 14px; }
.tra-build-link.tra-build-pending { color: var(--lab-muted); font-style: italic; }

/* ── footer ─────────────────────────────────────────── */
.lab-foot {
  border-top: 1px solid var(--lab-line);
  padding: 18px 28px 26px;
  text-align: center;
  color: var(--lab-muted);
  font-size: 13px;
  flex-shrink: 0;
}

.lab-foot a { color: var(--lab-muted); }

@media (max-width: 860px) {
  .lab-shell { grid-template-columns: 1fr; padding: 22px 16px 40px; gap: 20px; }
  .lab-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .lab-brand-name { display: none; }
}