/* ===========================================================================
   GUIDE — /guide (src/guide.js)

   Shared primitives (.page-hero, .section, .btn, .card, .faq) come from
   style.css. This sheet covers the four arrangements specific to this page:
   the numbered concept steps, the module grid, the framework list and the
   phased timeline.
   =========================================================================== */

.guide-section {
  background: var(--surface-page);
}

/* Alternating bands, one tonal step apart with a lit seam — the same way the
   home page separates its sections. */
.guide-section--alt {
  position: relative;
  background: var(--surface-raised);
}
.guide-section--alt::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgb(var(--color-tertiary-rgb) / 0.22) 30%,
    rgb(var(--color-secondary-rgb) / 0.1) 60%,
    transparent
  );
  pointer-events: none;
}

.guide-head {
  max-width: 56ch;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}
.guide-head h2 {
  margin-bottom: 0.6rem;
}
.guide-head .lede {
  font-size: 1rem;
}

.guide-more {
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
}

/* --- The idea, in numbered steps ------------------------------------------ */

.guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.guide-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: start;
  padding: clamp(1.25rem, 2.5vw, 1.85rem);
  border-radius: 16px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
}
.guide-section--alt .guide-step {
  background: var(--surface-page);
}

.guide-step-num {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgb(var(--color-tertiary-rgb) / 0.14);
  border: 1px solid rgb(var(--color-tertiary-rgb) / 0.35);
  color: var(--accent);
  font-family: var(--font-label);
  font-size: 1.05rem;
  font-weight: 700;
}

.guide-step-body {
  min-width: 0;
}
.guide-step-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.guide-step h3 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
}
.guide-step p:last-child {
  margin: 0;
  color: var(--body);
}

/* --- Module grid ----------------------------------------------------------- */

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: clamp(0.85rem, 1.8vw, 1.25rem);
}

.guide-card {
  padding: clamp(1.1rem, 2vw, 1.4rem);
  border-radius: 14px;
  background: var(--surface-page);
  border: 1px solid var(--line);
  transition:
    border-color 0.2s,
    transform 0.2s,
    background-color 0.2s;
}
.guide-card:hover {
  border-color: rgb(var(--color-tertiary-rgb) / 0.35);
  background: rgb(var(--color-tertiary-rgb) / 0.05);
  transform: translateY(-2px);
}
.guide-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}
.guide-card h3 a {
  color: var(--ink);
  text-decoration: none;
}
/* The whole card is the hit area, not just the words in the heading. */
.guide-card h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.guide-card {
  position: relative;
}
.guide-card:hover h3 a {
  color: var(--accent);
}
.guide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.89rem;
  line-height: 1.5;
}

/* --- Framework list -------------------------------------------------------- */

.guide-fw {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.75rem;
}

.guide-fw-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  background: rgb(var(--color-secondary-rgb) / 0.04);
  border: 1px solid var(--line);
  border-left: 3px solid rgb(var(--color-tertiary-rgb) / 0.5);
}
.guide-fw-name {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.guide-fw-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

/* --- Timeline -------------------------------------------------------------- */

.guide-phases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.guide-phase {
  position: relative;
  padding-top: 1.5rem;
  border-top: 2px solid var(--line);
}
/* Marker sitting on the rule above each phase. */
.guide-phase::before {
  content: '';
  position: absolute;
  top: -0.42rem;
  left: 0;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(var(--color-tertiary-rgb) / 0.16);
}

.guide-phase-when {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.guide-phase h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.guide-phase p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* --- FAQ accordion (layout.js faqList) ------------------------------------- */

.faq {
  display: grid;
  gap: 0.6rem;
  max-width: 68ch;
}
.faq details {
  border-radius: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  overflow: hidden;
}
.guide-section--alt .faq details {
  background: var(--surface-page);
}
.faq summary {
  padding: 1rem 1.15rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.97rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker {
  display: none;
}
/* Own marker, so it can rotate when the panel opens. */
.faq summary::after {
  content: '';
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translate(-0.1rem, -0.1rem);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after {
  transform: rotate(-135deg) translate(-0.1rem, -0.1rem);
}
.faq summary:hover {
  background: rgb(var(--color-secondary-rgb) / 0.03);
}
.faq summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.faq-answer {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  font-size: 0.93rem;
}
.faq-answer p {
  margin: 0;
  line-height: 1.6;
}

/* --- Closing CTA ----------------------------------------------------------- */

.guide-cta-section {
  padding-bottom: var(--section-y);
  background: var(--surface-page);
}

.guide-cta {
  padding: clamp(1.75rem, 4vw, 3rem);
  border-radius: 20px;
  text-align: center;
  background:
    radial-gradient(80% 140% at 50% 0%, rgb(var(--color-tertiary-rgb) / 0.14), transparent 60%),
    linear-gradient(180deg, var(--neutral-800), var(--color-neutral));
  border: 1px solid rgb(var(--color-tertiary-rgb) / 0.2);
}
.guide-cta h2 {
  margin: 0 0 0.6rem;
}
.guide-cta p {
  max-width: 52ch;
  margin: 0 auto 1.6rem;
  color: var(--muted);
}

.guide-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

/* ===========================================================================
   RESPONSIVE
   =========================================================================== */

@media (max-width: 640px) {
  /* The number would take a third of the row at this width. */
  .guide-step {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
  }
  .guide-step-num {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.95rem;
  }

  .guide-cta-row .btn {
    width: 100%;
  }
}

@media (min-width: 1600px) {
  .guide-head {
    max-width: 62ch;
  }
  .guide-card p {
    font-size: 0.93rem;
  }
}
