/* ── Headers Reference Pages ──────────────────────────────────────── */

/* Index page */
.headers-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}
.headers-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}
.headers-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: .5rem;
}
.headers-hero p {
  font-size: 1rem;
  color: var(--fg-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}
.headers-section {
  margin-bottom: 2.5rem;
}
.headers-section__title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.headers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.header-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(99, 102, 241, .1);
}
.header-card__name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .5rem;
}
.header-card__name code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .9rem;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
}
.header-card__summary {
  font-size: .85rem;
  color: var(--fg-muted);
  line-height: 1.5;
  flex: 1;
}
.headers-cta {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.headers-cta p {
  margin-bottom: .75rem;
  color: var(--fg);
  font-weight: 500;
}
.headers-cta a {
  display: inline-block;
  padding: .6rem 1.5rem;
  background: var(--accent);
  color: var(--white);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: .9rem;
  transition: opacity .2s;
}
.headers-cta a:hover { opacity: .85; }

/* Detail page */
.header-detail {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}
.header-detail__back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 1.5rem;
}
.header-detail__back:hover { text-decoration: underline; }
.header-detail__category {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
  margin-bottom: .5rem;
}
.header-detail__title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--fg);
  margin-bottom: .75rem;
  font-family: 'JetBrains Mono', 'Inter', monospace;
}
.header-detail__summary {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.header-detail__section {
  margin-bottom: 2rem;
}
.header-detail__section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1rem;
}
.header-detail pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 0 0 1rem;
}
.header-detail pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--fg);
  background: none;
  border: none;
  padding: 0;
}
.header-detail__content p {
  font-size: .95rem;
  line-height: 1.8;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}
.header-detail__content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: .15em .4em;
  border-radius: 4px;
}
.header-detail__cta {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.header-detail__cta p {
  margin-bottom: .75rem;
  color: var(--fg);
  font-weight: 500;
}
.header-detail__cta a {
  display: inline-block;
  padding: .6rem 1.5rem;
  background: var(--accent);
  color: var(--white);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: .9rem;
  transition: opacity .2s;
}
.header-detail__cta a:hover { opacity: .85; }

/* Related cards */
.header-detail__related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}
.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s;
}
.related-card:hover {
  border-color: var(--accent);
}
.related-card__title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: .4rem;
}
.related-card__title code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
}
.related-card__desc {
  font-size: .8rem;
  color: var(--fg-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive */
@media (max-width: 600px) {
  .headers-hero h1 { font-size: 1.5rem; }
  .header-detail__title { font-size: 1.4rem; }
  .headers-grid { grid-template-columns: 1fr; }
  .header-detail__related { grid-template-columns: 1fr; }
}

/* ── Focus-visible (accessibility) ── */
:focus-visible {
  outline: 2px solid var(--accent, #59a8ff);
  outline-offset: 2px;
  border-radius: 4px;
}
