/* ============================================================================
   footprint-lab.com — Guides blog module (loads after styles.css)
   ----------------------------------------------------------------------------
   The /guides/ education hub: hub page (page-guides.html), article template
   (single.html), archives (archive.html), and article prose. Inherits every
   token from the design system — nothing here redefines brand values.

   WordPress block output (.wp-block-*) and the static v2 prototypes share
   these classes, so selectors stay structural (element inside class) rather
   than block-specific wherever possible.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   B1. Article hero
   -------------------------------------------------------------------------- */
.guide-hero { padding-block: clamp(40px, 6vw, 72px) 0; }

.guide-hero .crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-3);
  margin-bottom: 22px;
}
.guide-hero .crumbs a { color: var(--text-3); }
.guide-hero .crumbs a:hover { color: var(--accent-text); }
/* Category link(s) rendered by the post-terms block inside the crumb row */
.guide-hero .crumbs .wp-block-post-terms { display: inline; }

.guide-hero h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  max-width: 26ch;
}
.guide-hero .lead { margin-top: 16px; }

.guide-meta { margin-top: 24px; }
/* The post-date block carries .meta-pill via className; keep its time quiet */
.guide-meta time { color: inherit; }

/* ----------------------------------------------------------------------------
   B2. Article layout — sticky TOC rail + measure-capped body
   -------------------------------------------------------------------------- */
.guide-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(36px, 5vw, 56px);
}
.guide-layout--no-toc { grid-template-columns: minmax(0, 1fr); }

/* The rail owns stickiness so the partner card and TOC scroll as one unit */
.guide-rail { position: sticky; top: 92px; display: grid; gap: 20px; align-content: start; }
.guide-rail .guide-toc { position: static; }

/* ATAS partner card — the one third-party link allowed in the rail */
.rail-atas {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  transition: border-color .15s var(--ease), box-shadow .2s var(--ease);
}
.rail-atas:hover {
  border-color: var(--accent-line);
  box-shadow: 0 0 24px -8px rgba(56, 189, 248, .4);
}
.rail-atas__tag {
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.rail-atas img { height: 20px; width: auto; display: block; margin: 12px 0 8px; }
.rail-atas p { font-size: .82rem; color: var(--text-2); line-height: 1.5; margin: 0 0 10px; }
.rail-atas__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent-text);
}
.rail-atas .arrow { transition: transform .15s var(--ease); }
.rail-atas:hover .arrow { transform: translateX(3px); }

/* Image variant — official ATAS banner artwork instead of the native card.
   Markup: <div class="rail-atas-wrap">
             <a class="rail-atas rail-atas--image" href="…" target="_blank"
                rel="sponsored nofollow noopener"><img src="…/atas-banner.png" …></a>
             <p class="rail-partner-note">Partner link · atas.net</p>
           </div> */
.rail-atas--image { padding: 0; overflow: hidden; }
.rail-atas--image img { display: block; width: 100%; height: auto; margin: 0; }
.rail-partner-note {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: right;
  margin-top: 6px;
}

.guide-toc__title {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
.guide-toc__list { display: grid; }
.guide-toc__list a {
  display: block;
  font-size: .84rem;
  line-height: 1.45;
  color: var(--text-2);
  padding: 6px 0 6px 14px;
  border-left: 1px solid var(--border);
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.guide-toc__list a:hover { color: var(--text); }
.guide-toc__list a.is-active { color: var(--cyan); border-left-color: var(--cyan); }

/* ----------------------------------------------------------------------------
   B3. Article prose — reading typography over the design system
   -------------------------------------------------------------------------- */
.guide-body { max-width: 70ch; font-size: 1.02rem; }
.guide-body > * + * { margin-top: 18px; }

.guide-body p { line-height: 1.75; }
.guide-body a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s var(--ease);
}
.guide-body a:hover { text-decoration-color: var(--accent-2); }

/* scroll-margin keeps anchored headings clear of the floating header */
.guide-body h2 {
  margin-top: 54px;
  font-size: clamp(1.35rem, 1.15rem + .8vw, 1.7rem);
  scroll-margin-top: 96px;
}
.guide-body h2:first-child { margin-top: 0; }
.guide-body h3 { margin-top: 34px; font-size: 1.12rem; scroll-margin-top: 96px; }
.guide-body h4 { margin-top: 26px; font-size: 1rem; }

.guide-body ul,
.guide-body ol {
  padding-left: 22px;
  display: grid;
  gap: 10px;
  color: var(--text-2);
  line-height: 1.65;
}
.guide-body li::marker { color: var(--accent-text); }

.guide-body blockquote {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--cyan);
  border-radius: var(--r-sm);
  padding: 18px 22px;
  margin-top: 26px;
}
.guide-body blockquote p { color: var(--text); font-size: 1.02rem; }

.guide-body img {
  width: 100%;
  height: auto;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.guide-body figure { margin-top: 28px; }
.guide-body figcaption {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-3);
  margin-top: 10px;
}
/* Inline SVG infographics ship with their own frame; skip the img ring */
.guide-body figure.guide-svg img,
.guide-body figure.guide-svg svg { border: 0; border-radius: 0; }

.guide-body table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.guide-body th {
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-hover);
}
.guide-body td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.guide-body code {
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--text);
  background: rgba(24, 24, 27, .8);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
}

.guide-body hr {
  border: 0;
  height: 1px;
  margin-top: 48px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0), rgba(34, 211, 238, .45), rgba(34, 211, 238, 0));
}

/* Key-idea callout — drop into article HTML as
   <div class="guide-note"><span class="label">Key idea</span><p>…</p></div> */
.guide-note {
  background: var(--accent-weak);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  padding: 18px 22px;
  margin-top: 26px;
}
.guide-note .label {
  display: block;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 8px;
}
.guide-note p { color: var(--text); font-size: .98rem; line-height: 1.65; }

/* ----------------------------------------------------------------------------
   B4. End-of-article CTA — the slot competitors fill with exchange ads
   -------------------------------------------------------------------------- */
.guide-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--card-solid), var(--card-solid)) padding-box,
    linear-gradient(120deg, rgba(56, 189, 248, .55), rgba(144, 137, 252, .25) 45%, var(--border)) border-box;
  border-radius: var(--r);
  padding: 28px;
  margin-top: 64px;
  box-shadow: 0 20px 60px -28px rgba(31, 143, 230, .45);
}
.guide-cta__copy { max-width: 52ch; }
.guide-cta__copy h3 { margin-bottom: 6px; }
.guide-cta__copy p { font-size: .95rem; }
.guide-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ----------------------------------------------------------------------------
   B5. Previous / next guide
   -------------------------------------------------------------------------- */
.guide-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 46px;
}
.guide-nav > div,
.guide-nav > a {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 20px;
  transition: border-color .15s var(--ease);
}
.guide-nav > div:hover,
.guide-nav > a:hover { border-color: var(--border-hover); }
.guide-nav a { color: var(--text); font-weight: 600; font-size: .92rem; line-height: 1.4; }
.guide-nav a:hover { color: var(--accent-text); }
.guide-nav .next { text-align: right; }
/* Empty slot (first/last post) keeps the grid but draws nothing */
.guide-nav > div:empty { border: 0; background: none; }

/* ----------------------------------------------------------------------------
   B6. Guide cards — hub sections, related guides, archives
   (post-template renders <ul class="guide-grid"><li>…)
   -------------------------------------------------------------------------- */
ul.guide-grid { list-style: none; padding: 0; margin: 0; }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.guide-grid > li {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px;
  transition: border-color .15s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
}
.guide-grid > li:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 20px 50px -24px rgba(31, 143, 230, .35);
}
.guide-grid .wp-block-post-terms,
.guide-grid .guide-card__cat {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.guide-grid .wp-block-post-terms a,
.guide-grid .guide-card__cat a { color: var(--text-3); }
.guide-grid h3 { font-size: 1.02rem; line-height: 1.35; }
.guide-grid h3 a { color: var(--text); }
.guide-grid h3 a:hover { color: var(--accent-text); }
.guide-grid p { font-size: .88rem; line-height: 1.55; }

/* ----------------------------------------------------------------------------
   B7. Hub page (/guides/) + archives
   -------------------------------------------------------------------------- */
.guides-hero { text-align: center; padding-block: clamp(56px, 8vw, 96px) clamp(8px, 2vw, 24px); }
.guides-hero h1 { max-width: 20ch; margin-inline: auto; }
.guides-hero .lead { margin-inline: auto; margin-top: 16px; }
.guides-hero .trust-row { justify-content: center; }

.cluster-section .section-head { margin-bottom: 28px; }
.cluster-section .section-head p { max-width: 62ch; }
.cluster-count {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-3);
  margin-left: 10px;
}

.archive-head { max-width: 720px; margin-bottom: 34px; }
.archive-head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin-top: 16px; }

/* Query pagination (archives) */
.guide-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
  font-family: var(--font-mono);
  font-size: .85rem;
}
.guide-pagination a,
.guide-pagination .current,
.guide-pagination span {
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 7px 14px;
}
.guide-pagination a:hover { color: var(--text); border-color: var(--border-hover); }
.guide-pagination .current { color: var(--cyan); border-color: rgba(34, 211, 238, .35); }

/* ----------------------------------------------------------------------------
   B8. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1020px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  /* Rail becomes quiet blocks above the article instead of a sticky column */
  .guide-rail { position: static; }
  .guide-toc {
    position: static;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px 18px;
  }
}
@media (max-width: 900px) {
  .guide-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .guide-grid { grid-template-columns: 1fr; }
  .guide-nav { grid-template-columns: 1fr; }
  .guide-nav .next { text-align: left; }
}
