/**
 * docs-index.css — Public Documentation Portal Styles
 *
 * Styles for the public-facing documentation home page (/docs/index.html).
 * Follows the same design tokens as style.css (:root variables).
 * Sections: docs-topbar, docs-hero, docs-grid, docs-card, docs-links, responsive.
 */

body.docs-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: var(--lh-body);
}

.docs-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-12);
}

.docs-topbar {
  --toolbar-gap: var(--space-4);
  justify-content: space-between;
  margin-bottom: var(--space-7);
}

.docs-brand {
  --toolbar-gap: var(--space-3-5);
  flex-wrap: nowrap;
}

.docs-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
  background: var(--brand);
  border: 1px solid var(--brand);
  -webkit-mask-image: url("/static/core/img/logo.svg");
  mask-image: url("/static/core/img/logo.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  flex-shrink: 0;
}

/* The small caps line above the brand and above the title of a guide. */
.docs-kicker,
.docs-label {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.09375rem;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}

.docs-label {
  display: inline-block;
  margin-bottom: var(--space-2);
}

.docs-brand h1 {
  font-size: var(--fs-3xl);
  line-height: 1.1;
  margin: 0;
  font-family: var(--font-heading);
}

.docs-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
  padding: var(--space-3) var(--space-4-5);
  background: var(--brand);
  color: var(--on-brand);
  border:1px solid var(--brand);
  white-space: nowrap;
}

.docs-home-btn:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--on-brand);
}

.docs-main {
  --stack-gap: var(--space-6);
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

/* The card is an .app-panel with the card modifier. */
.docs-card {
  --panel-pad: var(--space-5-5);
}

.docs-card:focus-within {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 4px var(--focus-shadow), var(--shadow-sm);
}

.docs-card-head {
  display: flex;
  gap: var(--space-3-5);
  align-items: flex-start;
  margin-bottom: var(--space-4-5);
}

/* The icon of a card is an .app-icon-badge. */
.docs-card-head .app-icon-badge svg {
  color: inherit;
  stroke: currentColor;
}

.docs-card h2 {
  font-size: var(--fs-lg);
  line-height: var(--lh-heading);
  margin: 0 0 0.375rem;
}

.docs-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: var(--lh-tight);
}

.docs-links {
  --stack-gap: var(--space-2-5);
}

.docs-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  --panel-pad: var(--space-3) var(--space-3-5);
  --panel-radius: var(--radius-xl);
}

.docs-file-row > span {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text-primary);
}

a.docs-file-row {
  color: var(--text-primary);
  font-size: var(--fs-body);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

a.docs-file-row:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.docs-home-btn:focus-visible,
a.docs-file-row:focus-visible {
  box-shadow: 0 0 0 4px var(--focus-shadow);
}

/* --- Guide view (one rendered guide, docs-public.js showGuide()) --- */
.docs-guide-header {
  --toolbar-gap: var(--space-4);
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.docs-guide-header h2 {
  font-size: var(--fs-2xl);
  line-height: var(--lh-heading);
  margin: var(--space-1) 0 0;
  font-family: var(--font-heading);
}

.docs-guide-actions {
  --toolbar-gap: var(--space-2);
}

/* Not-found state reuses .docs-card (docs-hero/docs-card pattern); only the spacing
   above its own back-to-list link is specific to this block. */
#docsGuideNotFound .docs-home-btn {
  margin-top: var(--space-4);
}

@media (max-width: 900px) {
  .docs-topbar,
  .docs-hero,
  .docs-guide-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .docs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .docs-shell {
    padding: var(--space-5) var(--space-4) var(--space-8);
  }

  .docs-brand h1 {
    font-size: var(--fs-2xl);
  }

  .docs-hero h2 {
    font-size: var(--fs-2xl-sm);
  }

  .docs-file-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
