/* The historical page: a timeline you scroll, with live solids in the margin of
   the story. Shares the walkthrough's document styling and adds the timeline
   rail and the era headers. */

/* ------------------------------------------------------------------ rail */

#rail a {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 9px;
}
#rail a em {
  flex: none;
  width: 34px;
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.7;
}

/* ------------------------------------------------------------------ eras */

.era {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 64px 0 -18px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.era::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.doc-body section { padding-top: 42px; }

.when {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font: 600 11.5px var(--mono);
  letter-spacing: 0.02em;
}
.doc-body section h2 { margin-top: 2px; }
.who {
  margin: -8px 0 16px;
  font-size: 13.5px;
  color: var(--dim);
}

/* a pull-out for the human detail */
.person {
  display: flex;
  gap: 14px;
  margin: 20px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.person-mark {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
  color: var(--accent-2);
  font-size: 15px;
}
.person-body { font-size: 14.5px; line-height: 1.62; }
.person-body b { color: var(--text); }
.person-body p { margin: 0 0 8px; }
.person-body p:last-child { margin-bottom: 0; }

/* an unexpected cross-field link */
.link-out {
  margin: 20px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--accent-2);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--accent-2) 7%, transparent);
  font-size: 14.5px;
  line-height: 1.62;
}
.link-out b { color: var(--text); }
.link-out .tag {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}

/* ------------------------------------------------------------------ figures */

.hfig {
  margin: 20px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  min-height: 120px;
}
.hfig:empty::after {
  content: "…";
  display: block;
  padding: 40px 0;
  text-align: center;
  color: var(--dim);
}
.hfig-wide { margin-left: -60px; margin-right: -60px; }
@media (max-width: 900px) { .hfig-wide { margin-left: 0; margin-right: 0; } }

/* ------------------------------------------------------------------ gallery of eras */

.solids-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.solid-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-align: center;
  font-size: 12px;
}
.solid-card img {
  width: 100%; max-width: 72px;
  border-radius: 6px;
  background: #fff;
}
.solid-card b { display: block; margin-top: 6px; font-size: 12.5px; }
.solid-card span { color: var(--dim); font-size: 11px; }

/* ------------------------------------------------------------------ sources */

details.sources {
  margin: 14px 0 0;
  font-size: 13px;
}
details.sources summary {
  cursor: pointer;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.03em;
}
details.sources ul { margin: 8px 0 0; padding-left: 18px; }
details.sources li { margin: 5px 0; color: var(--dim); line-height: 1.5; }
details.sources a { color: var(--accent-2); }

/* ------------------------------------------------ period photographs */

.hist-photo { margin: 20px 0; }
.hist-photo img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #efe9dd;
  cursor: zoom-in;
}
.hist-photo figcaption {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--dim);
}
.hist-photo figcaption b { color: var(--text); font-weight: 600; }
.hist-photo .credit {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--dim) 78%, transparent);
}
.hist-photo .credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* two or three side by side */
.photo-row { display: grid; gap: 14px; margin: 20px 0; }
.photo-row.two   { grid-template-columns: 1fr 1fr; }
.photo-row.three { grid-template-columns: repeat(3, 1fr); }
.photo-row .hist-photo { margin: 0; }
@media (max-width: 760px) { .photo-row.two, .photo-row.three { grid-template-columns: 1fr; } }

/* narrow portraits should not fill the column */
.hist-photo.portrait img { max-width: 300px; margin-inline: auto; }

/* ------------------------------------------------ lightbox */

#lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: none; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, 0.88);
}
#lightbox.on { display: grid; }
#lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }
#lightbox .close {
  position: absolute; top: 14px; right: 18px;
  border: 0; background: none; color: #fff; font-size: 26px; cursor: pointer;
}

/* ------------------------------------------------ a row of preset viewers */

.hfig-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
@media (max-width: 760px) { .hfig-trio { grid-template-columns: 1fr; } }
.hfig-trio figure { margin: 0; }
.hfig-trio .hfig { margin: 0; padding: 8px; min-height: 0; }
.hfig-trio figcaption { margin-top: 6px; font-size: 12px; line-height: 1.5; }
.hfig-trio figcaption b { display: block; color: var(--text); }
.hfig-trio figcaption span { color: var(--dim); font-size: 11px; }
.hfig-trio code { font-size: 10.5px; }

/* ------------------------------------------------ the Kepler–Poinsot cards */

.solids-strip { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
a.solid-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 10px 11px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.solid-card img {
  width: 100%;
  max-width: 148px;
  aspect-ratio: 1;
  object-fit: contain;
  background: none;          /* the renders carry their own transparency */
  border-radius: 0;
}
a.solid-card b { margin-top: 4px; font-size: 13px; line-height: 1.3; }
a.solid-card span { color: var(--dim); font-size: 11px; line-height: 1.45; }
a.solid-card em {
  margin-top: 5px;
  font-style: normal;
  font-size: 11px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}
a.solid-card:hover { border-color: var(--accent); transform: translateY(-2px); }
a.solid-card:hover em { opacity: 1; }
@media (hover: none) { a.solid-card em { opacity: 1; } }
