/* ============================================================
   TDNT · HISTORY PAGES · shared pieces
   Loaded after ../styles.css on every page in /history/.
   Brand colors only (Midnight, Cloud, Sage, Cyan on dark, Cobalt,
   Ember), their official tints, and alpha mixes of them.
   ============================================================ */

/* era tag: "1866 · CABLE" */
.hx-era {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.hx-era b { font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: 0; color: var(--accent); }

/* interactive demo frame: a light card with a header bar */
.hx-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-card);
  overflow: hidden;
}
.hx-stage-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 18px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.hx-stage-bar b { color: var(--fg); font-weight: 500; }
.hx-live { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.hx-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blip 2s ease-in-out infinite; }

/* "receipt" card: time, cost and hands for one era */
.hx-ticket {
  position: relative;
  display: grid;
  gap: 0;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-card);
  font-family: var(--mono);
}
.hx-ticket::before, .hx-ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
}
.hx-ticket::before { left: -8px; clip-path: inset(0 0 0 50%); }
.hx-ticket::after { right: -8px; clip-path: inset(0 50% 0 0); }
.hx-ticket-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 12px; color: var(--fg-mute); }
.hx-ticket-row:first-child { border-top: 0; }
.hx-ticket-row b { font-family: var(--display); font-weight: 400; font-size: 17px; letter-spacing: -0.02em; color: var(--fg); text-align: right; }
.hx-ticket-row b.hot { color: var(--accent); }
.hx-ticket-row b .fig { width: auto; margin-inline: 0; }  /* settled Boldonse values: natural widths */

/* archival photograph in a brand duotone, with credit */
.hx-photo { margin: 0; display: grid; gap: 8px; }
.hx-photo-frame { position: relative; overflow: hidden; border-radius: 12px; background: var(--midnight); aspect-ratio: 4 / 3; }
.hx-photo-frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08) brightness(1.05); mix-blend-mode: luminosity; display: block; }
.hx-photo-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 51, 153, 0.28), rgba(10, 8, 28, 0.35)); mix-blend-mode: multiply; pointer-events: none; }
.hx-photo figcaption { font-size: 12.5px; color: var(--fg-dim); line-height: 1.45; }
.hx-photo figcaption small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--fg-mute); }

/* sources, always shown at the foot of a history page */
.hx-sources { margin: 0; padding: 0; list-style: none; columns: 2 320px; column-gap: 40px; font-size: 13px; line-height: 1.5; color: var(--fg-mute); counter-reset: src; }
.hx-sources li { break-inside: avoid; padding: 0 0 10px 28px; position: relative; counter-increment: src; }
.hx-sources li::before { content: counter(src, decimal-leading-zero); position: absolute; left: 0; font-family: var(--mono); font-size: 11px; color: var(--accent); top: 1px; }
.hx-sources a { color: var(--fg-dim); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.hx-sources a:hover { color: var(--accent); }
.hx-note { font-size: 12.5px; color: var(--fg-mute); font-style: italic; }

/* pager across the history pages: the two pages as stations on one line. Stretches already
   travelled are solid, the ones ahead are dashed, the page you are on is the lit station, and
   hovering a station sends a signal down the line towards it */
.hx-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hx-pager a {
  --node: var(--fg-mute);
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 36px 20px 8px 0;
}
/* each station draws the stretch of line that arrives at it from the previous one */
.hx-pager a::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -100%;
  width: 100%;
  height: 2px;
  background:
    linear-gradient(90deg, transparent, var(--ember) 45%, var(--ember) 55%, transparent) no-repeat -60% 0 / 40% 100%,
    var(--accent);
}
.hx-pager a[aria-current="page"] ~ a::before {
  background:
    linear-gradient(90deg, transparent, var(--ember) 45%, var(--ember) 55%, transparent) no-repeat -60% 0 / 40% 100%,
    repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 11px);
}
.hx-pager a:first-child::before { display: none; }
.hx-pager a::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  z-index: 1;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1.4), background 0.25s, border-color 0.25s;
}
.hx-pager a[aria-current="page"] ~ a::after { border-color: var(--fg-mute); background: var(--bg); }
.hx-pager a[aria-current="page"]::after {
  border-color: var(--ember);
  background: var(--ember);
  animation: hxStation 2.4s ease-out infinite;
}
.hx-pager a:hover::after, .hx-pager a:focus-visible::after { transform: scale(1.35); border-color: var(--ember); }
.hx-pager a:not([aria-current]):hover::before, .hx-pager a:not([aria-current]):focus-visible::before { animation: hxSignal 0.9s cubic-bezier(0.45, 0, 0.2, 1) both; }
.hx-pager a i { font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--accent); }
.hx-pager a[aria-current="page"] i { color: var(--ember); }
.hx-pager a[aria-current="page"] i::after { content: " · You are here"; color: var(--fg-mute); }
.hx-pager a b { font-family: var(--display); font-weight: 400; font-size: 17px; letter-spacing: -0.02em; line-height: 1.15; transition: color 0.25s; }
.hx-pager a:hover b { color: var(--accent); }
.hx-pager a span { font-size: 12.5px; color: var(--fg-mute); line-height: 1.4; }
@keyframes hxStation {
  0% { box-shadow: 0 0 0 0 rgba(229, 88, 44, 0.45); }
  70%, 100% { box-shadow: 0 0 0 12px rgba(229, 88, 44, 0); }
}
@keyframes hxSignal { to { background-position: 160% 0, 0 0; } }
/* phones and tablets: the same line runs down the page; here each station draws the stretch
   that leaves it for the next one */
@media (max-width: 1000px) {
  .hx-pager { grid-template-columns: minmax(0, 1fr); }
  .hx-pager a { padding: 0 0 22px 36px; min-height: 64px; }
  .hx-pager a::before, .hx-pager a[aria-current="page"] ~ a::before { top: 0; bottom: 0; left: 7px; width: 2px; height: auto; }
  .hx-pager a:first-child::before { display: block; }
  .hx-pager a[aria-current="page"]::before, .hx-pager a[aria-current="page"] ~ a::before { background: repeating-linear-gradient(180deg, var(--line) 0 6px, transparent 6px 11px); }
  .hx-pager a:last-child::before { display: none; }
  .hx-pager a::after { top: 2px; }
  .hx-pager a:not([aria-current]):hover::before { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-pager a[aria-current="page"]::after, .hx-pager a:hover::before { animation: none; }
  .hx-pager a::after { transition: none; }
}
