/* About media strip + hero + videos + sidebar TOC, appended to base stylesheet */

/* hero image under greeting */
.hero { margin-top: 44px; }
.hero img {
  width: 100%; max-height: 520px; object-fit: cover;
  border-radius: 10px; display: block;
}

/* about media strip */
.about-media {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px; margin-top: 36px;
}
.about-shot img {
  width: 100%; height: 160px; object-fit: cover; border-radius: 8px;
  display: block; cursor: zoom-in; transition: opacity 0.18s ease;
}
.about-shot:hover img { opacity: 0.85; }

/* videos */
.vid { margin-top: 12px; }
.vid video {
  width: 100%; border-radius: 8px; display: block;
  background: #000; aspect-ratio: 16 / 9;
}
.vid figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.media .vid:first-child { margin-top: 0; }

/* rotation media column stacks gallery + videos */
.media { display: grid; gap: 14px; align-content: start; }

/* ---------- sidebar TOC ---------- */
body { position: relative; }

.toc {
  position: fixed;
  left: max(18px, calc(50vw - 590px - 190px));
  top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 4px;
  width: 170px; z-index: 30;
}
.toc a {
  font-size: 13px; color: var(--muted); text-decoration: none;
  padding: 5px 12px; border-left: 2px solid var(--line);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc a:hover { color: var(--text); }
.toc a.active {
  color: var(--text); border-left-color: var(--accent); font-weight: 500;
}

/* keep content clear of the rail on wide screens, hide it on narrow */
@media (max-width: 1420px) {
  .toc { display: none; }
}


/* ---------- dropdown entries ---------- */
details.entry { border-top: 1px solid var(--line); }
details.entry:first-of-type { border-top: 1px solid var(--line); }

details.entry > summary {
  list-style: none; cursor: pointer;
  padding: 26px 0 24px;
  display: grid; gap: 6px;
  min-height: 44px;
}
details.entry > summary::-webkit-details-marker { display: none; }
details.entry > summary:hover h3 { color: var(--accent); }

.sum-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.sum-head h3 { font-size: clamp(22px, 3vw, 28px); transition: color 0.15s ease; }
.sum-preview { color: var(--muted); font-size: 14.5px; }

details.entry .body {
  display: grid; grid-template-columns: minmax(300px, 5fr) 7fr;
  gap: 40px; padding: 4px 0 48px;
  align-items: start;
}
details.entry .text { max-width: 560px; }
details.entry .define { margin: 0 0 14px; }
details.entry ul { margin: 0 0 0 20px; display: grid; gap: 8px; }
details.entry li::marker { color: var(--accent); }
details.entry .lesson { margin-top: 20px; color: var(--muted); }
details.entry .media { display: grid; gap: 14px; align-content: start; }

details.entry[open] > summary { padding-bottom: 18px; }

/* solo entries (extras has no media sometimes) keep grid safe */
details.entry .media:empty { display: none; }

@media (max-width: 860px) {
  details.entry .body { grid-template-columns: 1fr; gap: 22px; padding-bottom: 40px; }
  details.entry .text { max-width: none; }
}

/* details elements must not inherit the old two-column .entry grid */
details.entry { display: block; }

/* nested TOC children */
.toc a.indent { padding-left: 26px; font-size: 12.5px; }
.toc a.child-active { color: var(--text); }

/* ---------- section folds ---------- */
details.fold > summary {
  list-style: none; cursor: pointer; min-height: 44px;
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: 8px 0 22px;
}
details.fold > summary::-webkit-details-marker { display: none; }
.fold-title { font-family: "Archivo", sans-serif; font-weight: 600; letter-spacing: -0.015em;
  font-size: clamp(22px, 3vw, 28px); transition: color 0.15s ease; }
details.fold > summary:hover .fold-title { color: var(--accent); }
.fold-count { color: var(--muted); font-size: 14px; }

/* entries inside a fold: flat, no per-entry collapse */
.fold-body .entry, .fold-body details.entry { display: block; }
.fold-body article.entry { padding: 34px 0; border-top: 1px solid var(--line); }
.fold-body article.entry:first-of-type { border-top: 0; padding-top: 10px; }
.fold-body .entry.solo { max-width: var(--reading); }
.fold-body h3 { font-size: clamp(20px, 2.6vw, 26px); }

/* two-col inside folds (gallery entries) */
.fold-body article.entry.two { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 40px; align-items: start; max-width: none; }
@media (max-width: 860px) { .fold-body article.entry.two { grid-template-columns: 1fr; gap: 22px; } }

/* inline logo badges (meclab) */
.logo-row { display: flex; gap: 14px; margin-top: 18px; align-items: center; }
.logo-badge { display: inline-flex; align-items: center; height: 40px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.logo-badge img { height: 22px; width: auto; display: block; }
.logo-badge:hover { border-color: var(--accent); }

/* ---------- dropdown indicators + animation ---------- */
.fold > summary { position: relative; padding-right: 40px; }
.fold-chev {
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--muted);
}
.fold > summary:hover .fold-chev { color: var(--accent); }
.fold[open] > .fold-chev, .fold[open] > summary .fold-chev { transform: translateY(-50%) rotate(180deg); }

/* count bubble */
.fold-count {
  color: var(--muted); font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
}

/* smooth open animation */
.fold-body { overflow: hidden; }
.fold[open] .fold-body { animation: foldIn 0.32s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes foldIn {
  from { opacity: 0; transform: translateY(-8px); max-height: 0; }
  to { opacity: 1; transform: translateY(0); max-height: 2400px; }
}
@media (prefers-reduced-motion: reduce) {
  .fold[open] .fold-body { animation: none; }
  .fold-chev { transition: none; }
}

/* TOC children: hidden until parent fold opens, then slide in */
.toc a.hidden-child { display: none; }
.toc a.revealed { display: block; animation: tocIn 0.25s ease; }
@keyframes tocIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* passage logos inline with links */
.passage-logo { height: 14px; width: auto; vertical-align: -2px; margin-left: 5px; }

/* ---------- make fold affordance unmistakable ---------- */
details.fold > summary {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #F2F2EE;
  padding: 18px 20px;
  margin-top: 10px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
details.fold > summary:hover {
  border-color: var(--accent);
  background: #EDEDF6;
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.10);
}
details.fold[open] > summary {
  border-color: var(--accent);
  background: #EDEDF6;
  border-bottom: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  margin-bottom: 0;
}

/* explicit helper text under the title */
.fold-hint { display: block; color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* chevron gets a visible circular hit area */
.fold-chev {
  width: 34px; height: 34px;
  border: 1.5px solid var(--line); border-radius: 50%;
  background: #fff;
  padding: 7px;
  right: 16px;
}
details.fold > summary:hover .fold-chev { border-color: var(--accent); }
details.fold[open] > summary .fold-chev { border-color: var(--accent); }

/* body connects visually to the open summary */
details.fold[open] .fold-body {
  border: 1px solid var(--accent);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  padding: 0 24px 8px;
  background: rgba(255, 255, 255, 0.55);
}
details.fold[open] .fold-body .entry:first-of-type { border-top: 0; }

.fold-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
details.fold > summary { display: block; position: relative; }
details.fold > summary .fold-chev { top: 26px; }
