/* ──────────────────────────────────────────────────────────────────
 * /css/human-design-gate.css — the 64 gate pages (/human-design/gate-N/).
 *
 * Own file for the routed gate template only (human-design-gate.php);
 * the hub's css/human-design.css is untouched. Follows the CN animal
 * page aesthetic (chinese-astrology-animal.css) in the HD vocabulary.
 *
 * Brand palette (never hardcode elsewhere): parchment #FBF3DC, ink #2D1F38,
 * burgundy/wine #6B1F2C, aubergine #3A1F38, gold #B89150 / #D4AC68 / #8E6E3A.
 * ────────────────────────────────────────────────────────────────── */

body.hdg-body {
  --hdg-parchment: #FBF3DC;
  --hdg-ink:       #2D1F38;
  --hdg-wine:      #6B1F2C;
  --hdg-gold:      #B89150;
  --hdg-gold-lt:   #D4AC68;
  --hdg-gold-dk:   #8E6E3A;
  background: var(--hdg-parchment);
}

/* ═══════════════ SHARED FURNITURE ═══════════════ */
.hdg-wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
.hdg-wrap--narrow { max-width: 820px; }

.hdg-section { padding: 3rem 0 2.6rem; }

.hdg-eyebrow {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #77592B;
  text-align: center;
  margin-bottom: 0.5rem;
}

.hdg-h2 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  letter-spacing: 0.03em;
  color: var(--hdg-ink);
  text-align: center;
  margin: 0 0 0.6rem;
}
.hdg-h2 em { font-style: italic; color: var(--hdg-wine); }

.hdg-rule {
  width: 88px; height: 1px;
  margin: 0.4rem auto 1.7rem;
  background: linear-gradient(90deg, transparent, var(--hdg-gold), transparent);
}

/* ═══════════════ HERO ═══════════════ */
.hdg-hero {
  position: relative;
  text-align: center;
  padding: 2.6rem 1.25rem 2.9rem;
  background:
    radial-gradient(720px 340px at 50% 0%, rgba(212, 172, 104, 0.18), rgba(212, 172, 104, 0) 70%),
    var(--hdg-parchment);
}
/* Back link FAR LEFT of the hero, yes-no-tarot pattern (absolute, pulls in
   as the viewport narrows, goes static-centered on small screens) */
.hdg-hero { position: relative; }
.hdg-back {
  position: absolute;
  top: 1.5rem;
  left: max(1.25rem, calc(50% - 620px));
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'EB Garamond', serif;
  font-variant: small-caps;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--hdg-wine);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(107, 31, 44, 0.4);
  transition: color 0.15s, border-color 0.15s;
  z-index: 3;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .hdg-back { position: static; display: inline-flex; margin: 0 auto 1.4rem; }
}
.hdg-back::before { content: '←'; font-style: italic; }
.hdg-back:hover { color: var(--hdg-gold-dk, #8E6E3A); border-color: var(--hdg-gold, #B89150); }

.hdg-dept {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #77592B;
}
.hdg-hero-rule {
  width: 130px; height: 1px;
  margin: 0.8rem auto;
  background: linear-gradient(90deg, transparent, var(--hdg-gold), transparent);
  position: relative;
}
.hdg-hero-rule .m {
  position: absolute; top: -0.72em; left: 50%; transform: translateX(-50%);
  color: var(--hdg-gold); font-size: 0.72rem;
}

.hdg-hero h1 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(2rem, 5.4vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: 0.02em;
  color: var(--hdg-ink);
  margin: 0.75rem auto 0.5rem;
  max-width: 22ch;
}
.hdg-hero h1 em { font-style: italic; color: var(--hdg-wine); }

.hdg-hero-script {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  line-height: 1.5;
  color: rgba(45, 31, 56, 0.82);
  max-width: 52ch;
  margin: 0 auto 0.8rem;
}

.hdg-iching {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hdg-gold-dk);
}

.hdg-hero-fleuron { color: var(--hdg-gold); font-size: 1.3rem; margin-top: 0.9rem; }

/* ═══════════════ FACT STRIP ═══════════════ */
.hdg-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  max-width: 960px;
  margin: 1.7rem auto 0;
}
.hdg-fact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  min-width: 205px;
  padding: 0.95rem 1.35rem 1rem;
  text-decoration: none;
  text-align: center;
  background: linear-gradient(180deg, #FFFBEF 0%, #FBF3DC 100%);
  border: 1px solid rgba(184, 145, 80, 0.5);
  border-top: 3px solid var(--hdg-gold);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(45, 31, 56, 0.08), inset 0 0 0 1px rgba(255, 251, 239, 0.6);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
a.hdg-fact:hover {
  transform: translateY(-2px);
  border-color: var(--hdg-gold);
  box-shadow: 0 6px 18px rgba(45, 31, 56, 0.14);
}
.hdg-fact .k {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #77592B;
}
.hdg-fact .v {
  font-family: 'EB Garamond', serif;
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.25;
  color: var(--hdg-wine);
}
/* Label pinned top on both cards; a value with no sub-line (the CENTER card)
   centers itself in the leftover height to match its taller sibling */
.hdg-fact .v:last-child { margin-block: auto; }
.hdg-fact .s {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.12rem;
  color: #6B1F2C;
}

/* ═══════════════ PROSE + BODYGRAPH COLUMNS ═══════════════ */
.hdg-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 2.6rem;
  align-items: start;
}
.hdg-prose-col .hdg-eyebrow,
.hdg-prose-col .hdg-h2 { text-align: left; }
.hdg-prose-col .hdg-rule { margin-left: 0; }

.hdg-prose p {
  font-family: 'EB Garamond', serif;
  font-size: clamp(1.16rem, 2.2vw, 1.28rem); /* site-standard reading size */
  line-height: 1.72;
  color: var(--hdg-ink);
  margin: 0 0 1.15rem;
}
.hdg-prose p:first-of-type::first-letter {
  font-family: 'Cinzel Decorative', serif;
  font-size: 3.1em;
  line-height: 0.82;
  float: left;
  padding: 0.06em 0.12em 0 0;
  color: var(--hdg-wine);
}

.hdg-graph-col { position: sticky; top: 90px; }
.hdg-graph-card {
  padding: 1.1rem 1.1rem 1.2rem;
  background: linear-gradient(180deg, #FFFBEF 0%, #FBF3DC 100%);
  border: 1px solid rgba(184, 145, 80, 0.55);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(45, 31, 56, 0.14), inset 0 0 0 1px rgba(255, 251, 239, 0.6);
  text-align: center;
}
.hdg-graph-card svg { display: block; width: 100%; height: auto; }
.hdg-graph-caption {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.16rem;
  line-height: 1.55;
  color: #4A3A55;
  margin: 0.8rem auto 0;
  max-width: 30ch;
}
/* Locator numbers were pale gold on parchment — ink them for legibility */
.hdg-graph-card svg text { fill: #4A3421 !important; }

/* ═══════════════ THE SIX LINES ═══════════════ */
.hdg-lines-band {
  background: linear-gradient(180deg, var(--hdg-parchment) 0%, #F6ECD2 55%, var(--hdg-parchment) 100%);
}
.hdg-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 720px;
  margin: 0 auto;
}
.hdg-lines li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 1rem;
  align-items: center;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.7rem;
  background: linear-gradient(180deg, #FFFBEF 0%, #FBF3DC 100%);
  border: 1px solid rgba(184, 145, 80, 0.45);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(45, 31, 56, 0.06);
}
.hdg-line-medallion {
  grid-row: 1 / span 2;
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
  padding-top: 0.12em; /* Cinzel digits sit high — optically recenters in the ring */
  color: var(--hdg-wine);
  background: radial-gradient(circle at 32% 30%, #FFFBEF, #F3E7C4);
  border: 2px solid var(--hdg-gold);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 251, 239, 0.7), 0 1px 5px rgba(45, 31, 56, 0.14);
}
.hdg-line-label {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #77592B;
  align-self: end;
}
.hdg-line-text {
  font-family: 'EB Garamond', serif;
  font-size: 1.14rem;
  line-height: 1.5;
  color: var(--hdg-ink);
  align-self: start;
}
.hdg-lines-note {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.22rem;
  text-align: center;
  color: #3E2C4A;
  margin: 1.4rem auto 0;
  max-width: 56ch;
}
.hdg-lines-note a { color: #6B1F2C; font-weight: 700; }

/* ═══════════════ FAQ ═══════════════ */
.hdg-faq { max-width: 760px; margin: 0 auto; }
.hdg-faq .faq-item {
  border: 1px solid rgba(184, 145, 80, 0.5);
  border-radius: 10px;
  margin-bottom: 0.85rem;
  background: linear-gradient(180deg, #FFFBEF 0%, #FBF3DC 100%);
  overflow: hidden;
}
.hdg-faq .faq-item summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 1.05rem 3.4rem 1.05rem 1.3rem;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--hdg-wine);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.hdg-faq .faq-item summary::-webkit-details-marker { display: none; }
/* Moon chip — sitewide FAQ pattern (yes-no-tarot): burgundy moon in a
   gold-ringed vellum circle; open = inverted chip, rotated */
.hdg-faq .faq-icon {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--hdg-gold);
  background: #FFFBEF;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease, border-color 0.3s ease;
  pointer-events: none;
}
.hdg-faq .faq-icon svg { width: 18px; height: 18px; display: block; fill: var(--hdg-wine); transition: fill 0.3s ease; }
.hdg-faq .faq-item[open] .faq-icon {
  background: var(--hdg-wine);
  border-color: var(--hdg-wine);
  transform: translateY(-50%) rotate(180deg);
}
.hdg-faq .faq-item[open] .faq-icon svg { fill: #D4AC68; }
.hdg-faq .faq-body {
  padding: 0 1.3rem 1.15rem;
  font-family: 'EB Garamond', serif;
  font-size: clamp(1.16rem, 2.2vw, 1.28rem);
  line-height: 1.72;
  color: var(--hdg-ink);
}

/* ═══════════════ CLOSING CTA ═══════════════ */
.hdg-close-cta {
  text-align: center;
  padding: 3rem 1.25rem 3.2rem;
  background:
    radial-gradient(620px 300px at 50% 100%, rgba(212, 172, 104, 0.16), rgba(212, 172, 104, 0) 70%);
}
.hdg-close-cta .hdg-h2 { margin-bottom: 0.6rem; }
.hdg-close-deck {
  font-family: 'EB Garamond', serif;
  font-size: 1.16rem;
  line-height: 1.65;
  color: var(--hdg-ink);
  max-width: 56ch;
  margin: 0 auto 1.6rem;
}
.hdg-cta-wrap { text-align: center; }
.hdg-cta {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--hdg-parchment);
  text-decoration: none;
  padding: 0.95rem 2.1rem;
  background: linear-gradient(180deg, #7E2534 0%, var(--hdg-wine) 55%, #4A1620 100%);
  border: 1px solid rgba(212, 172, 104, 0.7);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(107, 31, 44, 0.34), inset 0 1px 0 rgba(255, 251, 239, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.hdg-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(107, 31, 44, 0.42), inset 0 1px 0 rgba(255, 251, 239, 0.22);
}

/* ═══════════════ PREV / NEXT PAGER ═══════════════ */
.hdg-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem 1rem;
}
.hdg-pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.25rem;
  text-decoration: none;
  background: linear-gradient(180deg, #FFFBEF 0%, #FBF3DC 100%);
  border: 1px solid rgba(184, 145, 80, 0.5);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(45, 31, 56, 0.07);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.hdg-pager-link:hover {
  transform: translateY(-2px);
  border-color: var(--hdg-gold);
  box-shadow: 0 6px 18px rgba(45, 31, 56, 0.14);
}
.hdg-pager-next { text-align: right; align-items: flex-end; }
.hdg-pager-link .k {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #77592B;
}
.hdg-pager-link .v {
  font-family: 'EB Garamond', serif;
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.3;
  color: var(--hdg-wine);
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 900px) {
  .hdg-cols { grid-template-columns: 1fr; gap: 2rem; }
  .hdg-graph-col { position: static; }
  .hdg-graph-card { max-width: 380px; margin: 0 auto; }
}
@media (max-width: 560px) {
  .hdg-section { padding: 2.4rem 0 2rem; }
  .hdg-facts { gap: 0.7rem; }
  .hdg-fact { min-width: 0; flex: 1 1 100%; }
  .hdg-pager { grid-template-columns: 1fr; }
  .hdg-pager-next { text-align: left; align-items: flex-start; }
  .hdg-prose p:first-of-type::first-letter { font-size: 2.6em; }
}
