/* ============================================================
   BUYER GUIDE PAGE
   Namespaced under .bg-*  ·  Depends on tokens in style.css.
   Loaded only by templates/buyer_guide.html.
   ============================================================ */

/* ── Scroll progress ── */
.bg-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--black); z-index: 300;
  transition: width 0.1s linear;
}

/* ── Toolbar above the timeline ── */
.bg-toolbar {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap;
  padding-bottom: 1rem; margin-bottom: 2.75rem;
  border-bottom: 1px solid var(--gray-200);
}
.bg-count {
  font-size: 0.6rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gray-400); font-weight: 600;
}
.bg-toggle {
  background: none; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem; letter-spacing: 0.2em;
  text-transform: uppercase; font-weight: 600; color: var(--gray-600);
  display: inline-flex; align-items: baseline; gap: 0.6rem;
  transition: color 0.15s;
  padding: 0;
}
.bg-toggle:hover { color: var(--black); }
.bg-toggle .bg-toggle-sign {
  font-size: 1.05rem; font-weight: 300; line-height: 0;
  position: relative; top: 0.18rem;
}

/* ── Timeline ── */
.bg-timeline { position: relative; }

.bg-phase {
  position: relative;
  padding: 2.5rem 0 2.5rem 5.5rem;
  scroll-margin-top: 1.5rem;
}
.bg-phase:first-child { padding-top: 0.5rem; }
.bg-phase:last-child  { padding-bottom: 0.5rem; }

/* the spine */
.bg-phase::before {
  content: ""; position: absolute;
  left: 26px; top: 0; bottom: 0; width: 2px;
  transform: translateX(-50%);
  background: var(--gray-200);
  transition: background 0.6s ease;
}
.bg-phase.is-visible::before { background: var(--accent); }

/* phase head */
.bg-phase-head {
  position: relative; margin-bottom: 1.5rem;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.bg-phase.is-visible .bg-phase-head { opacity: 1; transform: translateY(0); }

.bg-marker {
  position: absolute; left: -62px; top: 0;
  transform: translateX(-50%);
  width: 44px; height: 44px;
  background: var(--white);
  border: 1.5px solid var(--gray-400);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem; font-weight: 500; color: var(--gray-400);
  transition: background 0.5s ease, border-color 0.5s ease, color 0.5s ease;
}
.bg-phase.is-visible .bg-marker {
  background: var(--accent); border-color: var(--accent); color: var(--white);
}

.bg-phase-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 0.6rem;
}
.bg-phase-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400; letter-spacing: -0.01em;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.1; color: var(--accent);
  margin-bottom: 0.85rem;
}
.bg-phase-desc {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem; font-weight: 500;
  color: var(--gray-800); line-height: 1.8;
  max-width: 56ch;
}

/* ── Step cards ── */
.bg-step {
  position: relative;
  border: 1px solid var(--gray-200);
  background: var(--white);
  margin-top: 0.75rem;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease,
              border-color 0.15s ease, background 0.15s ease;
}
.bg-phase.is-visible .bg-step {
  opacity: 1; transform: translateY(0);
  transition-delay: calc(0.1s + var(--i) * 0.07s);
}

/* node on the spine */
.bg-node {
  position: absolute; left: -62px; top: 31px;
  transform: translate(-50%, -50%);
  width: 13px; height: 13px;
  background: var(--white);
  border: 1.5px solid var(--gray-400);
  box-shadow: 0 0 0 4px var(--white);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.bg-phase.is-visible .bg-node { border-color: var(--accent); }

.bg-step-head {
  width: 100%; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.15rem 1.5rem; text-align: left;
}
.bg-step-num {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.55rem; font-weight: 400; line-height: 1;
  color: var(--gray-400);
  flex: none; width: 2.1rem;
  transition: color 0.15s ease;
}
.bg-step-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.3rem, 2vw, 1.55rem); font-weight: 500;
  line-height: 1.3; color: var(--black); flex: 1;
  transition: color 0.15s ease;
}
.bg-step-toggle {
  flex: none; width: 1.5rem; text-align: center;
  position: relative; height: 1.5rem;
}
.bg-step-toggle::after {
  content: "+";
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem; font-weight: 300; line-height: 1;
  color: var(--gray-400);
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  transition: color 0.15s ease;
}
.bg-step.is-open .bg-step-toggle::after { content: "\2212"; color: var(--accent); }

@media (hover: hover) {
  .bg-step:hover {
    border-color: var(--accent);
    background: var(--gray-100);
  }
  .bg-phase.is-visible .bg-step:hover { transform: translateY(0); }
  .bg-step:hover .bg-step-title { color: var(--gray-600); }
  .bg-step:hover .bg-step-num   { color: var(--accent); }
  .bg-step:hover .bg-step-toggle::after { color: var(--accent); }
  .bg-step:hover .bg-node { background: var(--accent); border-color: var(--accent); }
}
.bg-step.is-open { border-color: var(--accent); }
.bg-step.is-open .bg-step-num { color: var(--accent); }
.bg-step.is-open .bg-node { background: var(--accent); border-color: var(--accent); }

/* expanding panel */
.bg-step-panel {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.36s cubic-bezier(0.4, 0, 0.2, 1);
}
.bg-step.is-open .bg-step-panel { grid-template-rows: 1fr; }
.bg-step-panel-clip { overflow: hidden; }
.bg-step-panel-body {
  margin: 0 1.5rem 1.4rem 5.15rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
  opacity: 0; transition: opacity 0.3s ease 0.05s;
}
.bg-step.is-open .bg-step-panel-body { opacity: 1; }
.bg-step-panel-body p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.18rem; font-weight: 500;
  color: var(--gray-800); line-height: 1.8;
  max-width: 60ch;
}

/* ── Buyer Agreements section ── */
.bg-statement {
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--black);
  padding: 1.75rem 2rem;
  max-width: 820px;
  margin-bottom: 3rem;
}
.bg-statement p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem; font-weight: 500;
  color: var(--gray-800); line-height: 1.7;
}
.bg-statement strong { color: var(--black); font-weight: 600; }
.bg-source {
  margin-top: 2.5rem; max-width: 760px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem; color: var(--gray-400); line-height: 1.7;
}
.bg-source a {
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
  transition: color 0.15s, border-color 0.15s;
}
.bg-source a:hover { color: var(--black); border-bottom-color: var(--black); }

/* ── Closing CTA ── */
.bg-cta { max-width: 620px; }
.bg-cta .eyebrow { margin-bottom: 1rem; }
.bg-cta h2 {
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  margin-bottom: 1.25rem;
}
.bg-cta h2 em { font-style: italic; }
.bg-cta p {
  font-size: 0.95rem; color: var(--gray-600);
  line-height: 1.85; margin-bottom: 2rem;
}
.bg-signoff {
  margin-top: 3.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem; color: var(--gray-400);
  line-height: 1.75; max-width: 620px;
}
.bg-signoff a {
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
  transition: color 0.15s, border-color 0.15s;
}
.bg-signoff a:hover { color: var(--black); border-bottom-color: var(--black); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .bg-phase { padding-left: 3.75rem; }
  .bg-phase::before { left: 20px; }
  .bg-marker { left: -40px; width: 36px; height: 36px; font-size: 1.15rem; }
  .bg-node { left: -40px; top: 28px; }
  .bg-step-head { gap: 0.9rem; padding: 1rem 1.1rem; }
  .bg-step-num { font-size: 1.35rem; width: 1.7rem; }
  .bg-step-panel-body { margin-left: 4rem; margin-right: 1.1rem; }
  .bg-statement { padding: 1.4rem 1.25rem; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .bg-phase-head, .bg-step { opacity: 1 !important; transform: none !important; }
  .bg-phase::before { background: var(--accent) !important; }
  .bg-marker { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--white) !important; }
  .bg-node { border-color: var(--accent) !important; }
}
