/* ============================================================
   TIMELINE & DICTIONARY — shared styles
   g-mac-digital-garden v10.1

   Built on the theme's existing design tokens (theme.json palette +
   font families) rather than a new palette. Reads the same
   --wp--preset--color--* custom properties the rest of the site uses,
   so day/night toggling (body.dark, in style.css) applies here for
   free — no separate dark-mode block needed.

   Two header-offset custom properties are set by timeline-dictionary.js
   at runtime, since the site header is position:sticky and its height
   is responsive (the nav wraps on narrow screens):
     --gmac-header-h   height of the sticky site header
     --gmac-toolbar-h  height of the dictionary's sticky search/A-Z bar
   Both default to 0px so the page still works sanely with JS disabled.
   ============================================================ */

:root {
  --gmac-header-h: 0px;
  --gmac-toolbar-h: 0px;
  --gmac-td-rule: color-mix(in srgb, var(--wp--preset--color--ink) 14%, transparent);
  --gmac-td-spine: color-mix(in srgb, var(--wp--preset--color--mid-grey) 45%, transparent);
  --gmac-td-panel: var(--wp--preset--color--warm-white-2);
  /* Translucent, not solid — the site's ambient dappled-light system sits
     behind every page (#dappled-light, z-index: -1 in style.css) and should
     stay visible through these two pages the same way it does elsewhere on
     the site, not get fully masked by a flat content background. Very faint
     over the main scroll area (G's own call, 2026-10-03: the first pass at
     86% read as still basically opaque); the two sticky bars stay a little
     more solid than that so scrolled-past content doesn't show through them
     messily while they're pinned, but nowhere near the old fully-opaque bg. */
  --gmac-td-bg: color-mix(in srgb, var(--wp--preset--color--warm-white) 18%, transparent);
  --gmac-td-bg-sticky: color-mix(in srgb, var(--wp--preset--color--warm-white) 45%, transparent);
}

.gmac-td-main {
  background-color: var(--gmac-td-bg);
  backdrop-filter: blur(14px);
}

.gmac-td-wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--30) var(--wp--preset--spacing--80);
}

.gmac-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------
   Shared page header
   ------------------------------------------------------------ */

.gmac-td-header {
  padding-bottom: var(--wp--preset--spacing--40);
  border-bottom: 1px solid var(--gmac-td-rule);
  margin-bottom: var(--wp--preset--spacing--50);
}

.gmac-td-title {
  font-size: var(--wp--preset--font-size--xx-large);
  line-height: 1.15;
  margin: 0 0 0.4rem;
}

.gmac-td-subtitle {
  font-family: var(--wp--preset--font-family--inter);
  color: var(--wp--preset--color--mid-grey);
  font-size: var(--wp--preset--font-size--medium);
  margin: 0;
}

.gmac-td-note {
  font-family: var(--wp--preset--font-family--inter);
  color: var(--wp--preset--color--mid-grey);
  font-size: var(--wp--preset--font-size--small);
  font-style: italic;
  margin: 0.6rem 0 0;
}

.gmac-td-crosslink {
  font-family: var(--wp--preset--font-family--inter);
  font-size: var(--wp--preset--font-size--small);
  margin: 1rem 0 0;
}

.gmac-td-crosslink a {
  color: var(--wp--preset--color--rust);
  text-decoration-color: color-mix(in srgb, var(--wp--preset--color--rust) 40%, transparent);
}

.gmac-td-admin-notice {
  font-family: var(--wp--preset--font-family--inter);
  font-size: var(--wp--preset--font-size--small);
  background: color-mix(in srgb, var(--wp--preset--color--rust) 10%, var(--wp--preset--color--warm-white-2));
  border: 1px solid var(--wp--preset--color--rust);
  color: var(--wp--preset--color--ink);
  border-radius: 0.4rem;
  padding: 0.9rem 1.1rem;
  margin: 0 0 var(--wp--preset--spacing--40);
}

.gmac-td-admin-notice ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}


/* ============================================================
   TIMELINE
   ============================================================ */

.gmac-era {
  margin-bottom: var(--wp--preset--spacing--50);
}

.gmac-era-band {
  position: sticky;
  top: var(--gmac-header-h);
  z-index: 4;
  background-color: var(--gmac-td-bg-sticky);
  backdrop-filter: blur(10px);
  padding: 0.75rem 0 0.6rem;
  border-bottom: 1px solid var(--gmac-td-rule);
  margin-bottom: var(--wp--preset--spacing--40);
}

.gmac-era-band .gmac-era-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.gmac-era-band .gmac-era-range {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wp--preset--color--mid-grey);
}

.gmac-spine {
  position: relative;
  padding-left: 1.6rem;
}

.gmac-spine::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  background: var(--gmac-td-spine);
}

.gmac-event {
  position: relative;
  margin: 0 0 1.9rem;
  scroll-margin-top: calc(var(--gmac-header-h) + 4.6rem);
}

.gmac-event::before {
  content: "";
  position: absolute;
  left: -1.42rem;
  top: 0.6rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--wp--preset--color--rust);
  box-shadow: 0 0 0 4px var(--wp--preset--color--warm-white);
}

.gmac-event-year {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--wp--preset--color--mid-grey);
  margin-bottom: 0.15rem;
}

.gmac-event-title {
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 0 0 0.3rem;
}

.gmac-cert {
  display: inline-block;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.14rem 0.45rem;
  border-radius: 0.2rem;
  margin-left: 0.5rem;
  vertical-align: 0.18em;
  white-space: nowrap;
}

.gmac-cert-approx {
  background: transparent;
  color: var(--wp--preset--color--mid-grey);
  border: 1px solid var(--gmac-td-rule);
}

.gmac-cert-disputed {
  background: color-mix(in srgb, var(--wp--preset--color--rust) 14%, var(--gmac-td-panel));
  color: var(--wp--preset--color--rust);
  border: 1px solid transparent;
  font-weight: 600;
}

.gmac-plain {
  margin: 0;
}

.gmac-details {
  margin-top: 0.4rem;
}

.gmac-details summary {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.8rem;
  color: var(--wp--preset--color--rust);
  cursor: pointer;
  list-style: none;
  display: inline-block;
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
  min-height: 1.5rem;
}

.gmac-details summary::-webkit-details-marker {
  display: none;
}

.gmac-details summary::before {
  content: "+ ";
}

.gmac-details[open] summary::before {
  content: "\2212 "; /* minus sign */
}

.gmac-details summary:hover,
.gmac-details summary:focus-visible {
  border-bottom-color: var(--wp--preset--color--rust);
}

.gmac-details[open] summary {
  color: var(--wp--preset--color--mid-grey);
}

.gmac-full {
  margin: 0.5rem 0 0;
  color: var(--wp--preset--color--ink);
}

.gmac-xref,
.gmac-on-timeline {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.8rem;
  margin: 0.55rem 0 0;
}

.gmac-xref a,
.gmac-on-timeline a {
  color: var(--wp--preset--color--rust);
  text-decoration: none;
  border-bottom: 1px solid var(--gmac-td-rule);
}

.gmac-xref a:hover,
.gmac-on-timeline a:hover {
  border-bottom-color: var(--wp--preset--color--rust);
}


/* ============================================================
   DICTIONARY
   ============================================================ */

.gmac-dict-toolbar {
  position: sticky;
  top: var(--gmac-header-h);
  z-index: 4;
  background-color: var(--gmac-td-bg-sticky);
  backdrop-filter: blur(10px);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--gmac-td-rule);
  margin-bottom: var(--wp--preset--spacing--40);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gmac-dict-search {
  display: flex;
  align-items: center;
}

.gmac-dict-search input[type="search"] {
  width: 100%;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--wp--preset--color--mid-grey);
  border-radius: 1.5rem;
  background: var(--wp--preset--color--warm-white-2);
  color: var(--wp--preset--color--ink);
}

.gmac-dict-search input[type="search"]:focus {
  outline: 2px solid var(--wp--preset--color--rust);
  outline-offset: 2px;
}

.gmac-dict-result-count {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.75rem;
  color: var(--wp--preset--color--mid-grey);
  min-height: 1em;
}

.gmac-az-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  font-family: var(--wp--preset--font-family--inter);
}

.gmac-az-index a,
.gmac-az-index span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  min-height: 1.7rem;
  font-size: 0.78rem;
  border-radius: 0.3rem;
  text-decoration: none;
  color: var(--wp--preset--color--ink);
}

.gmac-az-index a:hover,
.gmac-az-index a:focus-visible {
  background: var(--gmac-td-panel);
  color: var(--wp--preset--color--rust);
}

.gmac-az-index span {
  color: var(--wp--preset--color--mid-grey);
  opacity: 0.35;
}

.gmac-dict-section {
  margin-bottom: var(--wp--preset--spacing--60);
}

.gmac-dict-section-heading {
  font-size: var(--wp--preset--font-size--x-large);
  margin: 0 0 0.3rem;
  scroll-margin-top: calc(var(--gmac-header-h) + var(--gmac-toolbar-h) + 1rem);
}

.gmac-dict-section-blurb {
  font-family: var(--wp--preset--font-family--inter);
  color: var(--wp--preset--color--mid-grey);
  font-size: 0.9rem;
  margin: 0 0 1.2rem;
}

.gmac-group-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}

.gmac-group-filter button {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  min-height: 2.2rem;
  border-radius: 1rem;
  border: 1px solid var(--wp--preset--color--mid-grey);
  background: transparent;
  color: var(--wp--preset--color--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gmac-group-filter button[aria-pressed="true"] {
  background: var(--wp--preset--color--rust);
  border-color: var(--wp--preset--color--rust);
  color: var(--wp--preset--color--warm-white);
}

.gmac-group-filter button:hover {
  transform: none;
}

.gmac-dict-entry {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--gmac-td-rule);
  scroll-margin-top: calc(var(--gmac-header-h) + var(--gmac-toolbar-h) + 1rem);
}

.gmac-dict-entry[hidden] {
  display: none;
}

.gmac-dict-entry-heading {
  font-size: 1.08rem;
  margin: 0 0 0.3rem;
  line-height: 1.35;
}

.gmac-dict-meta {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.72rem;
  color: var(--wp--preset--color--mid-grey);
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.gmac-dict-pronounce {
  font-style: italic;
}

.gmac-no-results {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.9rem;
  color: var(--wp--preset--color--mid-grey);
  padding: 1rem 0;
}

.gmac-no-results[hidden] {
  display: none;
}

.gmac-td-noscript {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.78rem;
  color: var(--wp--preset--color--mid-grey);
  border: 1px dashed var(--gmac-td-rule);
  border-radius: 0.4rem;
  padding: 0.6rem 0.9rem;
  margin: 0 0 1rem;
  display: block;
}


/* ============================================================
   FLOATING ERA NAVIGATION (timeline page only)
   Only shown once the viewport is wide enough to hold it clear of
   the centred content column (44rem) without crowding it — hidden
   by default, switched on in the wide-screen block below.
   ============================================================ */

.gmac-era-nav {
  display: none;
}

.gmac-era-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gmac-era-nav a {
  display: block;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 0.78rem;
  line-height: 1.3;
  padding: 0.45rem 0.7rem;
  border-radius: 0.3rem;
  color: var(--wp--preset--color--mid-grey);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.gmac-era-nav a:hover,
.gmac-era-nav a:focus-visible {
  color: var(--wp--preset--color--ink);
  background: color-mix(in srgb, var(--wp--preset--color--mid-grey) 10%, transparent);
}

.gmac-era-nav a.is-active {
  color: var(--wp--preset--color--rust);
  border-left-color: var(--wp--preset--color--rust);
  font-weight: 600;
}


/* ============================================================
   PHONE
   ============================================================ */

@media (max-width: 46rem) {
  .gmac-td-wrap {
    padding-left: var(--wp--preset--spacing--30);
    padding-right: var(--wp--preset--spacing--30);
  }

  .gmac-spine {
    padding-left: 1.3rem;
  }

  .gmac-event::before {
    left: -1.14rem;
  }

  .gmac-az-index a,
  .gmac-az-index span {
    min-width: 1.9rem;
    min-height: 1.9rem;
  }

  .gmac-details summary,
  .gmac-group-filter button {
    min-height: 2.4rem;
  }
}


/* ============================================================
   WIDE SCREEN — floating era nav switches on
   The centred content column is 44rem; this only fires once the
   viewport is wide enough that a right-hand panel clears it with
   real margin either side, rather than crowding the text.
   ============================================================ */

@media (min-width: 80rem) {
  .gmac-era-nav {
    display: block;
    position: fixed;
    top: calc(var(--gmac-header-h) + 2.5rem);
    right: 2rem;
    width: 11rem;
    max-height: calc(100vh - var(--gmac-header-h) - 5rem);
    overflow-y: auto;
    background-color: var(--gmac-td-bg-sticky);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gmac-td-rule);
    border-radius: 0.6rem;
    z-index: 3;
  }
}
