:root {
  --adg-history-blue: var(--blue, #064AC2);
  --adg-history-blue-dark: var(--blue-dark, #0A388F);
  --adg-history-bright: var(--blue-bright, #18A8EF);
  --adg-history-ink: var(--ink, #161A20);
  --adg-history-warm: var(--warm, #FCFBF8);
  --adg-history-pale: var(--pale, #EEF4FA);
  --adg-history-line: #DCE6F1;
}

.adg-history {
  width: min(100% - 2.3rem, 1120px);
  margin: 2rem auto 5rem;
  color: var(--adg-history-ink);
}

/* The configured history landing page may use the viewport width while the
   ordinary page intro/title keeps the theme's comfortable reading measure. */
@media (min-width: 700px) {
  .adg-history-landing-page .entry-content,
  .adg-history-landing-page .content-shell {
    overflow: visible;
  }
  .adg-history-landing-page .adg-history {
    width: calc(100vw - clamp(2.5rem, 6vw, 7rem));
    max-width: none;
    margin-left: 50%;
    margin-right: 0;
    transform: translateX(-50%);
  }
}

.adg-history__filter-wrap {
  margin: 0 0 4.5rem;
  padding: clamp(1.5rem, 3.2vw, 2.8rem);
  border: 1px solid var(--adg-history-line);
  border-radius: 28px;
  background: linear-gradient(135deg, #fff 0%, #f4f8fd 100%);
  box-shadow: 0 18px 48px rgba(10,56,143,.075);
  overflow: hidden;
}
.adg-history__filter-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: clamp(1.7rem, 3vw, 2.5rem);
}
.adg-history__eyebrow {
  margin: 0 0 .45rem;
  color: var(--adg-history-blue);
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
}
.adg-history__filter-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.03;
}
.adg-history__all-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .7rem 1.05rem;
  border: 1px solid var(--adg-history-blue);
  border-radius: 999px;
  background: var(--adg-history-blue);
  color: #fff !important;
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none !important;
  box-shadow: 0 3px 10px rgba(10,56,143,.08);
  transition: box-shadow .18s ease;
}
.adg-history__all-link:hover,
.adg-history__all-link.is-active {
  border-color: var(--adg-history-blue);
  background: var(--adg-history-blue);
  color: #fff !important;
  box-shadow: 0 7px 18px rgba(10,56,143,.16);
}
.adg-history__all-link:focus-visible {
  border-color: var(--adg-history-blue);
  background: var(--adg-history-blue);
  color: #fff !important;
  outline: 3px solid rgba(24,168,239,.38);
  outline-offset: 3px;
  box-shadow: 0 7px 18px rgba(10,56,143,.16);
}

/* Horizontal epoch timeline */
.adg-history__timeline {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
}
.adg-history__timeline-viewport {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(6,74,194,.32) transparent;
  padding: .25rem 0 .7rem;
}
.adg-history__timeline-viewport::-webkit-scrollbar { height: 7px; }
.adg-history__timeline-viewport::-webkit-scrollbar-track { background: transparent; }
.adg-history__timeline-viewport::-webkit-scrollbar-thumb { background: rgba(6,74,194,.26); border-radius: 999px; }
.adg-history__filter {
  position: relative;
  display: flex;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  padding: .1rem .35rem 0;
}
.adg-history__filter::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 1.6rem;
  right: 1.6rem;
  height: 2px;
  background: linear-gradient(90deg, rgba(6,74,194,.18), rgba(6,74,194,.55), rgba(6,74,194,.18));
}
.adg-history__filter-link {
  position: relative;
  z-index: 1;
  flex: 0 0 clamp(210px, 20vw, 300px);
  min-width: 0;
  scroll-snap-align: start;
  display: block;
  margin: 0;
  padding: 2.65rem 1rem 1rem;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #344256;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.adg-history__timeline-marker {
  position: absolute;
  top: 7px;
  left: 1.25rem;
  width: 19px;
  height: 19px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #9bb7df;
  box-shadow: 0 0 0 2px rgba(6,74,194,.18);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.adg-history__filter-period {
  display: block;
  margin: 0 0 .35rem;
  padding: 0;
  background: transparent !important;
  color: var(--adg-history-blue);
  font-size: .76rem;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: .05em;
  text-decoration: none;
  box-shadow: none !important;
}
.adg-history__filter-link > strong {
  display: block;
  margin: 0;
  padding: 0;
  background: transparent !important;
  color: var(--adg-history-ink) !important;
  font-size: clamp(.96rem, 1.35vw, 1.08rem);
  font-weight: 800;
  line-height: 1.28;
  text-decoration: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
.adg-history__filter-link:hover,
.adg-history__filter-link:focus-visible,
.adg-history__filter-link.is-scroll-active {
  background: rgba(238,244,250,.78);
  outline: 0;
}
.adg-history__filter-link:hover .adg-history__timeline-marker,
.adg-history__filter-link:focus-visible .adg-history__timeline-marker,
.adg-history__filter-link.is-scroll-active .adg-history__timeline-marker,
.adg-history__filter-link.is-active .adg-history__timeline-marker {
  background: var(--adg-history-blue);
  box-shadow: 0 0 0 4px rgba(6,74,194,.14);
  transform: scale(1.08);
}
.adg-history__filter-link.is-active {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(6,74,194,.16), 0 8px 24px rgba(10,56,143,.07);
}
.adg-history__filter-link.is-active > strong { color: var(--adg-history-blue-dark) !important; }
.adg-history__filter-link.is-scroll-active > strong { color: var(--adg-history-blue-dark) !important; }
.adg-history__filter-link:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(24,168,239,.35);
}
.adg-history__timeline-button {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 1px solid rgba(6,74,194,.18);
  border-radius: 50%;
  background: #fff;
  color: var(--adg-history-blue-dark);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(10,56,143,.07);
  transition: background .18s ease, color .18s ease, opacity .18s ease;
}
.adg-history__timeline-button:hover:not(:disabled),
.adg-history__timeline-button:focus-visible:not(:disabled) {
  background: var(--adg-history-blue-dark);
  color: #fff;
}
.adg-history__timeline-button:focus-visible { outline: 3px solid rgba(24,168,239,.35); outline-offset: 2px; }
.adg-history__timeline-button:disabled { opacity: .28; cursor: default; box-shadow: none; }

.adg-epoch { scroll-margin-top: 2rem; padding: 0 0 5rem; }
.adg-epoch + .adg-epoch { padding-top: 4.5rem; border-top: 1px solid var(--adg-history-line); }
.adg-epoch[hidden] { display: none !important; }
.adg-epoch__header {
  position: relative;
  display: block;
  margin-bottom: 2.1rem;
  padding-top: .15rem;
}
.adg-epoch__period {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  margin: 0 0 .7rem;
  color: var(--adg-history-blue);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.adg-epoch__period::before {
  content: "";
  width: clamp(2.4rem, 5vw, 4.25rem);
  height: 4px;
  border-radius: 999px;
  background: var(--adg-history-blue);
  flex: none;
}
.adg-epoch__header h2 {
  margin: 0;
  max-width: 26ch;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}
.adg-epoch__description {
  margin-top: 1rem;
  max-width: 52rem;
  color: #4a586b;
  font-size: 1.02rem;
  line-height: 1.7;
}
.adg-epoch__description > :first-child { margin-top: 0; }
.adg-epoch__description > :last-child { margin-bottom: 0; }
.adg-epoch__entries {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(6,74,194,.30) transparent;
  padding: .2rem .15rem .9rem;
}
.adg-epoch__entries::-webkit-scrollbar { height: 8px; }
.adg-epoch__entries::-webkit-scrollbar-track { background: transparent; }
.adg-epoch__entries::-webkit-scrollbar-thumb { background: rgba(6,74,194,.24); border-radius: 999px; }
.adg-epoch__entries:focus-visible {
  outline: 3px solid rgba(24,168,239,.32);
  outline-offset: 4px;
  border-radius: 12px;
}

/* Optional continuous chronological card stream across all epochs. */
.adg-history__stream-wrap { margin-top: .35rem; }
.adg-history__entry-stream {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(6,74,194,.30) transparent;
  padding: .25rem .15rem 1rem;
}
.adg-history__entry-stream::-webkit-scrollbar { height: 8px; }
.adg-history__entry-stream::-webkit-scrollbar-track { background: transparent; }
.adg-history__entry-stream::-webkit-scrollbar-thumb { background: rgba(6,74,194,.24); border-radius: 999px; }
.adg-history__entry-stream:focus-visible {
  outline: 3px solid rgba(24,168,239,.32);
  outline-offset: 4px;
  border-radius: 12px;
}
.adg-history__entry-stream .adg-history-card[hidden] { display: none !important; }
.adg-history-card__epoch-period {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 .9rem;
  color: var(--adg-history-blue);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .045em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.adg-history-card__epoch-period::before {
  content: "";
  width: 1.7rem;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}
.adg-history-card {
  flex: 0 0 clamp(290px, 31vw, 430px);
  align-self: flex-start;
  min-width: 0;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid var(--adg-history-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(10,56,143,.055);
}
.adg-history-card__image { aspect-ratio: 5 / 6; overflow: hidden; background: var(--adg-history-pale); }
.adg-history-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.adg-history-card__body { padding: clamp(1.2rem, 3vw, 1.65rem); }
.adg-history-card h3 {
  margin: 0 0 .6rem;
  color: var(--adg-history-ink);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.18;
}
.adg-history-card__person { margin-top: 1.25rem; padding-top: 1.15rem; border-top: 1px solid var(--adg-history-line); }
.adg-history-card__person-text { color: #4a586b; line-height: 1.68; }
.adg-history-card__person-text > :first-child { margin-top: 0; }
.adg-history-card__person-text > :last-child { margin-bottom: 0; }
.adg-history-card__content { color: #3d4a5b; line-height: 1.72; }
.adg-history-card__content > :first-child { margin-top: 0; }
.adg-history-card__content > :last-child { margin-bottom: 0; }
.adg-history-card__content a { color: var(--adg-history-blue); text-underline-offset: 3px; }
.adg-history-card__content ul, .adg-history-card__content ol { padding-left: 1.25rem; }
.adg-epoch__back { display: inline-flex; gap: .4rem; margin-top: 1.5rem; color: var(--adg-history-blue); font-weight: 800; text-decoration: none; }
.adg-history-empty { margin: 2rem auto; padding: 1rem 1.2rem; border-left: 4px solid var(--adg-history-blue); background: var(--adg-history-pale); }
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }

@media (max-width: 699px) {
  .adg-history { width: min(100% - 1.5rem, 1120px); margin-top: 1.4rem; }
  .adg-history__filter-wrap { border-radius: 22px; padding: 1.35rem; margin-bottom: 3rem; }
  .adg-history__filter-head { align-items: flex-start; flex-direction: column; }
  .adg-history__all-link { align-self: flex-start; }
  .adg-history__timeline { grid-template-columns: minmax(0, 1fr); }
  .adg-history__timeline-button { display: none; }
  .adg-history__filter { padding-inline: .15rem; }
  .adg-history__filter-link { flex-basis: min(76vw, 250px); padding-inline: .8rem; }
  .adg-history-card { flex-basis: min(84vw, 360px); }
  .adg-epoch__entries,
  .adg-history__entry-stream { gap: 1rem; margin-right: calc(-1 * .75rem); padding-right: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .adg-history__all-link,
  .adg-history__filter-link,
  .adg-history__timeline-marker,
  .adg-history__timeline-button { transition: none; }
  .adg-history__timeline-viewport,
  .adg-epoch__entries,
  .adg-history__entry-stream { scroll-behavior: auto; }
}
@media (forced-colors: active) {
  .adg-history__all-link,
  .adg-history__filter-link,
  .adg-history__timeline-button,
  .adg-history-card,
  .adg-history__timeline-marker { border: 1px solid ButtonText; }
  .adg-history__filter::before { background: ButtonText; }
}
