/* ============================================================
   ACRICA · Design System — Documentation page layout
   ============================================================ */

.ds-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .ds-shell { grid-template-columns: 1fr; } }

/* ---- Sidebar ---- */
.ds-side {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: var(--sp-5) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-5);
}
@media (max-width: 900px) { .ds-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); } }
.ds-brand { display: flex; align-items: center; gap: var(--sp-3); }
.ds-brand img { width: 48px; height: 48px; border-radius: var(--r-sm); object-fit: contain; background: #fff; padding: 3px; border: 1px solid var(--border); }
.ds-brand b { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: var(--tracking-tight); display: block; }
.ds-brand span { font-size: var(--fs-xs); color: var(--text-subtle); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.ds-nav { display: flex; flex-direction: column; gap: 1px; }
.ds-nav a {
  display: flex; align-items: center; gap: 0.6em; padding: 0.6em 0.8em; border-radius: var(--r-sm);
  color: var(--text-muted); text-decoration: none; font-size: var(--fs-sm); font-weight: 500;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.ds-nav a:hover { background: var(--surface-2); color: var(--text); }
.ds-nav a.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.ds-nav .num { font-family: var(--font-display); font-size: var(--fs-xs); color: var(--text-subtle); width: 1.4em; }

/* ---- Main ---- */
.ds-main { min-width: 0; }
.ds-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); padding: var(--sp-3) clamp(1.25rem, 5vw, 3rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.ds-topbar .controls { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
/* Mesma prioridade do site.css: em tela estreita o botao de tema vira so icone. */
@media (max-width: 560px) { .ds-topbar [data-theme-label] { display: none; } }
.ds-eyebrow { font-size: var(--fs-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-subtle); font-weight: 700; }

.ds-section { padding: var(--sp-8) clamp(1.25rem, 5vw, 3rem); border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.ds-section:last-child { border-bottom: 0; }
.ds-section__head { max-width: var(--maxw-prose); margin-bottom: var(--sp-6); }
.ds-section__head h2 { font-size: var(--fs-h2); margin-bottom: var(--sp-3); }
.ds-section__head p { color: var(--text-muted); font-size: var(--fs-lead); }
.ds-kicker { display: inline-flex; align-items: center; gap: 0.5em; margin-bottom: var(--sp-3); }

/* ---- Hero ---- */
.ds-hero { padding: var(--sp-9) clamp(1.25rem, 5vw, 3rem) var(--sp-8); position: relative; overflow: hidden; }
.ds-hero__inner { max-width: 880px; position: relative; z-index: 2; }
.ds-hero h1 { font-size: var(--fs-display); margin: var(--sp-4) 0; }
.ds-hero p { font-size: var(--fs-lead); color: var(--text-muted); max-width: 60ch; }
.ds-hero__blob { position: absolute; inset: auto -8% -40% auto; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--sun-soft), transparent 70%); pointer-events: none; }
.ds-hero__blob2 { position: absolute; inset: -20% auto auto -10%; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle at 60% 60%, var(--brand-soft), transparent 70%); pointer-events: none; }

/* ---- Tone pillars ---- */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--sp-4); }
.pillar { padding: var(--sp-5); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
.pillar h3, .pillar h4 { font-size: var(--fs-h4); margin-bottom: var(--sp-2); display: flex; align-items: center; gap: 0.5em; }
.pillar p { color: var(--text-muted); font-size: var(--fs-sm); }
.pillar__mark { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; }

/* ---- Color swatches ---- */
/* `1fr` tem piso de min-content: o rotulo hex de 11px nao encolhia e a grade
   estourava a tela em 320px. `minmax(0,1fr)` deixa a coluna encolher. */
.swatch-scale { display: grid; grid-template-columns: repeat(10, minmax(0,1fr)); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
@media (max-width: 700px) { .swatch-scale { grid-template-columns: repeat(5, minmax(0,1fr)); } }
@media (max-width: 400px) { .swatch-scale__chip { font-size: 10px; padding: 6px; } }
.swatch-scale__chip { aspect-ratio: 1 / 1.25; display: flex; flex-direction: column; justify-content: flex-end; padding: 8px; font-size: 11px; font-weight: 600; }
.scale-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-3); }
.scale-title h3, .scale-title h4 { font-size: var(--fs-h4); }
.scale-title span { font-size: var(--fs-xs); color: var(--text-subtle); font-family: var(--font-body); }
.scales { display: flex; flex-direction: column; gap: var(--sp-5); }

.semantic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: var(--sp-3); }
.semantic { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.semantic__sw { height: 64px; }
.semantic__meta { padding: var(--sp-3); }
.semantic__meta b { font-size: var(--fs-sm); display: block; }
.semantic__meta code { font-size: var(--fs-xs); color: var(--text-subtle); }

/* ---- Contrast badge ---- */
.aa { display: inline-flex; align-items: center; gap: 0.35em; font-size: 11px; font-weight: 700; padding: 0.2em 0.6em; border-radius: var(--r-pill); background: var(--success-soft); color: var(--success); }

/* ---- Type specimens ---- */
.type-row { display: grid; grid-template-columns: 120px 1fr; gap: var(--sp-5); padding: var(--sp-4) 0; border-top: 1px solid var(--border); align-items: baseline; }
@media (max-width: 640px) { .type-row { grid-template-columns: 1fr; gap: var(--sp-2); } }
.type-row__meta { font-size: var(--fs-xs); color: var(--text-subtle); }
.type-row__meta b { display: block; color: var(--text); font-size: var(--fs-sm); }

/* ---- Spacing viz ---- */
.space-row { display: flex; align-items: center; gap: var(--sp-4); padding: 0.5em 0; }
.space-row__bar { height: 18px; background: var(--accent); border-radius: 4px; }
.space-row__meta { font-size: var(--fs-sm); color: var(--text-muted); }
.space-row__meta b { color: var(--text); font-family: var(--font-display); }

/* ---- Radii viz ---- */
.radii-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: var(--sp-4); }
.radii-cell { text-align: center; }
.radii-cell__box { height: 88px; background: var(--brand-soft); border: 2px solid var(--brand); margin-bottom: var(--sp-2); }
.radii-cell small { font-size: var(--fs-xs); color: var(--text-subtle); }

/* ---- Elevation ---- */
.elev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: var(--sp-5); }
.elev-cell { background: var(--surface); border-radius: var(--r-md); height: 110px; display: grid; place-items: end center; padding-bottom: var(--sp-3); font-size: var(--fs-xs); color: var(--text-subtle); }

/* ---- Component demo frames ---- */
.demo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-6); margin-bottom: var(--sp-4); }
.demo + .demo-label, .demo-label { font-size: var(--fs-xs); color: var(--text-subtle); letter-spacing: var(--tracking-wide); text-transform: uppercase; font-weight: 700; margin-bottom: var(--sp-3); }
.demo-grid { display: grid; gap: var(--sp-5); }
.demo-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.demo-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }

.a11y-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: var(--sp-4); }
.a11y-item { display: flex; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
.a11y-item svg { flex: none; width: 26px; height: 26px; color: var(--brand); }
.a11y-item b { display: block; margin-bottom: 0.25em; }
.a11y-item p { font-size: var(--fs-sm); color: var(--text-muted); }

.ds-footer { padding: var(--sp-7) clamp(1.25rem,5vw,3rem); color: var(--text-subtle); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between; }

/* Placeholder image style */
.ph { background:
    linear-gradient(135deg, var(--brand-soft), var(--sun-soft));
  display: grid; place-items: center; color: var(--brand-ink); }
.ph svg { width: 34%; height: 34%; opacity: 0.5; }
