/* ---------------------------------------------------------------------------
   Draft guides (/guides, /guides?set=X)
   Long-form article styling on top of landing.css's tokens and site-header/
   site-footer. Comfortable reading width, styled markdown output (headings,
   tables, lists), and the embedded card-image rows the guides ship with.
   --------------------------------------------------------------------------- */

.header-nav a.is-active { color: var(--gold); }

.guide-page {
  padding: 48px 0 80px;
}

.guide-wrap {
  max-width: 780px;
}

/* ---- Article typography --------------------------------------------------
   The guide bodies are rendered markdown; these rules style the generic
   elements markdown produces (h1-h3, p, ul/ol, table, a, img, hr, strong). */

.guide-article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 20px;
}

.guide-article h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  font-weight: 600;
  color: var(--ink);
  margin: 42px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.guide-article h2:first-of-type { border-top: none; padding-top: 0; }

.guide-article h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--gold-soft);
  margin: 28px 0 10px;
}

.guide-article p {
  color: var(--ink);
  line-height: 1.68;
  font-size: 0.98rem;
  margin: 0 0 16px;
}

.guide-article a { color: var(--gold); text-underline-offset: 3px; }
.guide-article a:hover { color: var(--gold-soft); }

.guide-article strong { color: var(--ink); font-weight: 700; }

.guide-article ul, .guide-article ol {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.6;
}
.guide-article li { margin: 6px 0; }
.guide-article li::marker { color: var(--gold); }

.guide-article hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

/* Embedded hero/gallery rows already carry `display:flex; flex-wrap:wrap`
   inline; this is a defensive fallback for any row that doesn't. Plain
   (non-!important) so it never fights an inline style that's already set. */
.guide-article div[style*="display:flex"] { flex-wrap: wrap; }

.guide-article img { height: auto; }

/* ---- Tables ---------------------------------------------------------------
   Markdown tables (archetype rankings, common rankings). Horizontal scroll
   on narrow viewports keeps wide tables from forcing page-level overflow. */

.guide-article table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin: 0 0 22px;
}
.guide-article th, .guide-article td {
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
}
.guide-article thead th {
  color: var(--gold-soft);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.guide-article td { color: var(--muted); }
.guide-article tr:first-child td { color: var(--ink); }

/* ---- Guide index (/guides, no set param) ---------------------------------- */

.guide-index-head { margin-bottom: 32px; }
.guide-index-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}
.guide-index-lede {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 56ch;
  margin: 0;
}

.guide-index-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr; /* equal-height rows so all cards match */
  gap: 20px;
}

.guide-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.guide-card-art {
  display: block;
  margin: -22px -24px 4px;
}
.guide-card-art img {
  display: block;
  width: 100%;
  aspect-ratio: 1640 / 680;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}
.guide-hero {
  display: block;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin: 22px 0 26px;
  box-shadow: 0 18px 44px -22px rgba(0, 0, 0, 0.7);
}
.guide-card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}
.guide-card h2 a { color: var(--ink); text-decoration: none; }
.guide-card h2 a:hover { color: var(--gold-soft); }
.guide-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.55; margin: 0; flex: 1; }
.guide-card-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  align-self: flex-start;
}
.guide-card-link:hover { color: var(--gold-soft); }

@media (max-width: 880px) {
  .guide-index-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .guide-page { padding: 32px 0 56px; }
  .guide-article h2 { margin-top: 32px; }
  .guide-article th, .guide-article td { padding: 6px 9px; font-size: 0.78rem; }
  .guide-card { padding: 18px 20px; }
  .guide-card-art { margin: -18px -20px 4px; }
  .guide-hero { margin: 16px 0 20px; border-radius: 10px; }
}
