/* Theme — design-system styleguide
 *
 * Visualisers used only on the /design-system page. Loaded site-wide because
 * the playbook keeps CSS file-based; the selectors are scoped behind specific
 * .ds-* classes so they have no effect outside the styleguide page.
 */

/* ─── Section heads (numbered, with red eyebrow) ────────────────────────── */
.ds-section-head { max-width: 720px; }
.ds-section-num {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 11px;
  letter-spacing: var(--wp--custom--tracking--eyebrow);
  text-transform: uppercase;
  color: var(--wp--preset--color--red);
}

/* ─── Color swatches ────────────────────────────────────────────────────── */
.ds-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.ds-swatch {
  border-radius: var(--wp--custom--radii--md);
  overflow: hidden;
  border: 1px solid var(--wp--preset--color--line-soft);
  background: var(--wp--preset--color--white);
  transition:
    transform var(--wp--custom--dur--med) var(--wp--custom--ease--out),
    box-shadow var(--wp--custom--dur--med) var(--wp--custom--ease--out);
}
.ds-swatch:hover {
  transform: translateY(-3px);
  box-shadow: var(--wp--preset--shadow--hover);
}
.ds-swatch__chip {
  height: 108px;
  border-bottom: 1px solid var(--wp--preset--color--line-soft);
}
.ds-swatch__meta { padding: 12px 14px 14px; }
.ds-swatch__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--wp--preset--color--fg-1);
}
.ds-swatch__hex,
.ds-swatch__var {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 11px;
  color: var(--wp--preset--color--fg-3);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.ds-swatch__var { opacity: 0.7; }
.ds-swatch__role {
  font-size: 11px;
  color: var(--wp--preset--color--fg-3);
  margin-top: 8px;
  line-height: 1.4;
}
/* Override core/group default block-gap inside swatch meta — paragraphs stack tight */
.ds-swatch__meta > * { margin-block-start: 0; }
.ds-swatch__meta > * + * { margin-block-start: 0; }
.ds-swatch__chip { min-height: 108px; }

/* ─── Pairing grid container (auto-fit) ─────────────────────────────────── */
.ds-pairing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* ─── Type-scale rows ───────────────────────────────────────────────────── */
.ds-type-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--wp--preset--color--line-soft);
  align-items: baseline;
}
.ds-type-row:first-of-type { border-top: 0; }
.ds-type-row__meta {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--wp--preset--color--fg-3);
  text-transform: uppercase;
  line-height: 1.6;
}
.ds-type-row__meta strong {
  display: block;
  font-family: var(--wp--preset--font-family--mono);
  font-size: 10px;
  color: var(--wp--preset--color--fg-2);
  margin-top: 6px;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.ds-type-row__sample { color: var(--wp--preset--color--fg-1); }
.ds-type-row__sample.is-h1 {
  font-family: var(--wp--preset--font-family--serif);
  font-size: clamp(48px, 7vw, 84px);
  font-weight: 600;
  letter-spacing: -0.024em;
  line-height: 0.98;
}
.ds-type-row__sample.is-h2 {
  font-family: var(--wp--preset--font-family--serif);
  font-size: clamp(36px, 4.8vw, 56px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.02;
}
.ds-type-row__sample.is-h3 {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.ds-type-row__sample.is-h4 {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.2;
}
.ds-type-row__sample.is-body-lg { font-size: 19px; line-height: 1.45; }
.ds-type-row__sample.is-body    { font-size: 17px; line-height: 1.5; }
.ds-type-row__sample.is-eyebrow {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wp--preset--color--fg-3);
}

/* ─── Family cards (Serif · Sans · Mono) ────────────────────────────────── */
.ds-family-card {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--line-soft);
  border-radius: var(--wp--custom--radii--lg);
  padding: 24px;
}
.ds-family-card__sample {
  font-size: 28px;
  line-height: 1.15;
  margin: 14px 0 20px;
  color: var(--wp--preset--color--fg-1);
  letter-spacing: -0.02em;
}
.ds-family-card.is-mono .ds-family-card__sample {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ds-family-card__name {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 11px;
  color: var(--wp--preset--color--fg-3);
}
.ds-family-card__stack {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 11px;
  color: var(--wp--preset--color--fg-3);
  margin-top: 4px;
  opacity: 0.7;
}

/* ─── Radii visualisers ─────────────────────────────────────────────────── */
.ds-radii-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}
.ds-radius {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--line-soft);
  border-radius: var(--wp--custom--radii--md);
  padding: 14px;
}
.ds-radius__chip {
  height: 56px;
  background: var(--wp--preset--color--cream);
  border: 1px solid var(--wp--preset--color--line-soft);
}
.ds-radius__chip.r-xs   { border-radius: var(--wp--custom--radii--xs); }
.ds-radius__chip.r-sm   { border-radius: var(--wp--custom--radii--sm); }
.ds-radius__chip.r-md   { border-radius: var(--wp--custom--radii--md); }
.ds-radius__chip.r-lg   { border-radius: var(--wp--custom--radii--lg); }
.ds-radius__chip.r-xl   { border-radius: var(--wp--custom--radii--xl); }
.ds-radius__chip.r-xxl  { border-radius: var(--wp--custom--radii--xxl); }
.ds-radius__chip.r-pill { border-radius: var(--wp--custom--radii--pill); }
.ds-radius__name {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 11px;
  color: var(--wp--preset--color--fg-2);
  margin-top: 10px;
}
.ds-radius__val {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 10px;
  color: var(--wp--preset--color--fg-3);
}

/* ─── Spacing visualiser (red bars sized to each token) ─────────────────── */
.ds-spacing-list { width: 100%; }
.ds-spacing-row {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  gap: 16px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--wp--preset--color--line-soft);
}
.ds-spacing-row:first-child { border-top: 0; }
.ds-spacing-row__name {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 12px;
  color: var(--wp--preset--color--fg-2);
}
.ds-spacing-row__bar {
  height: 12px;
  background: var(--wp--preset--color--red);
  border-radius: 2px;
}
.ds-spacing-row__bar.s-10  { width: 4px; }
.ds-spacing-row__bar.s-20  { width: 8px; }
.ds-spacing-row__bar.s-30  { width: 12px; }
.ds-spacing-row__bar.s-40  { width: 16px; }
.ds-spacing-row__bar.s-50  { width: 24px; }
.ds-spacing-row__bar.s-60  { width: 32px; }
.ds-spacing-row__bar.s-70  { width: 48px; }
.ds-spacing-row__bar.s-80  { width: 64px; }
.ds-spacing-row__bar.s-90  { width: 96px; }
.ds-spacing-row__bar.s-100 { width: 120px; }
.ds-spacing-row__val {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 12px;
  color: var(--wp--preset--color--fg-3);
  text-align: right;
}

/* ─── Badges & chips ────────────────────────────────────────────────────── */
.ds-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--wp--custom--radii--pill);
  font-family: var(--wp--preset--font-family--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.ds-badge.is-new      { background: var(--wp--preset--color--red); color: #fff; }
.ds-badge.is-spotlight{ background: var(--wp--preset--color--yellow); color: var(--wp--preset--color--fg-1); }
.ds-badge.is-live     { background: rgba(235, 32, 61, 0.10); color: var(--wp--preset--color--red); }
.ds-badge.is-clinical { background: var(--wp--preset--color--blue-deep); color: #fff; }
.ds-badge.is-tag      { background: rgba(43, 54, 74, 0.06); color: var(--wp--preset--color--fg-2); }
.ds-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: var(--wp--custom--radii--pill);
  font-family: var(--wp--preset--font-family--mono);
  font-size: 11px;
  color: var(--wp--preset--color--fg-2);
  letter-spacing: 0.02em;
}
.ds-chip::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wp--preset--color--red);
  box-shadow: 0 0 0 0 rgba(235, 32, 61, 0.45);
  animation: ds-pulse 1.6s var(--wp--custom--ease--out) infinite;
}
@keyframes ds-pulse {
  70%  { box-shadow: 0 0 0 10px rgba(235, 32, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(235, 32, 61, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ds-chip::before { animation: none; }
}

/* ─── Color-pairing tiles ───────────────────────────────────────────────── */
.ds-pairing {
  border-radius: var(--wp--custom--radii--lg);
  padding: 28px 24px;
  border: 1px solid var(--wp--preset--color--line-soft);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ds-pairing__label {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
}
.ds-pairing__title {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-weight: 600;
}
.ds-pairing__body { font-size: 13px; opacity: 0.78; line-height: 1.5; }
.ds-pairing__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  width: fit-content;
}

/* ─── Logo lockups ──────────────────────────────────────────────────────── */
.ds-lockup {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--line-soft);
  border-radius: var(--wp--custom--radii--lg);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  gap: 10px;
}
.ds-lockup.is-dark {
  background: var(--wp--preset--color--blue-deep);
  border-color: transparent;
  color: var(--wp--preset--color--yellow);
}
.ds-lockup .site-logo-icon {
  width: 32px;
  height: 30px;
  color: var(--wp--preset--color--red);
}
.ds-lockup.is-dark .site-logo-icon {
  width: 56px;
  height: 52px;
  color: var(--wp--preset--color--yellow);
}
.ds-lockup__word {
  font-family: var(--wp--preset--font-family--serif);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.005em;
  color: var(--wp--preset--color--red);
}
.ds-lockup__word.is-large { font-size: 36px; }

/* ─── Striped placeholder for imagery ───────────────────────────────────── */
.ds-placeholder {
  background:
    repeating-linear-gradient(
      45deg,
      var(--wp--preset--color--cream) 0 6px,
      #eee5d4 6px 12px
    );
  border-radius: var(--wp--custom--radii--md);
  border: 1px solid var(--wp--preset--color--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--wp--preset--font-family--mono);
  font-size: 11px;
  color: var(--wp--preset--color--fg-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  aspect-ratio: 4 / 5;
}

/* ─── Token reference table ─────────────────────────────────────────────── */
.ds-tokens {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--line-soft);
  border-radius: var(--wp--custom--radii--lg);
  padding: 0 24px;
}
.ds-tokens__row {
  display: grid;
  grid-template-columns: 180px 1fr 200px;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--wp--preset--color--line-soft);
  align-items: center;
}
.ds-tokens__row:first-child { border-top: 0; }
.ds-tokens__name {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 12px;
  color: var(--wp--preset--color--fg-2);
}
.ds-tokens__desc { font-size: 13px; color: var(--wp--preset--color--fg-3); }
.ds-tokens__val {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 12px;
  color: var(--wp--preset--color--fg-3);
  text-align: right;
}

/* ─── Footer demo (re-uses .site-footer chrome but capped width) ────────── */
.ds-footer-demo {
  background: var(--wp--preset--color--blue-deep);
  color: var(--wp--preset--color--fg-on-dark);
  border-radius: var(--wp--custom--radii--lg);
  padding: 56px 40px 40px;
}
.ds-footer-demo .ds-footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}
.ds-footer-demo h4 {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wp--preset--color--yellow);
  font-weight: 500;
}
.ds-footer-demo ul {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ds-footer-demo ul li { font-size: 14px; opacity: 0.82; }
.ds-footer-demo .ds-footer-base {
  border-top: 1px solid var(--wp--preset--color--line-on-dark);
  margin-top: 48px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font-family: var(--wp--preset--font-family--mono);
  font-size: 12px;
  color: var(--wp--preset--color--fg-on-dark-3);
  letter-spacing: 0.04em;
}
.ds-footer-demo .ds-footer-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--wp--preset--color--yellow);
  margin-bottom: 24px;
}
.ds-footer-demo .ds-footer-mark .site-logo-icon {
  width: 32px;
  height: 30px;
  color: var(--wp--preset--color--yellow);
}
.ds-footer-demo .ds-footer-tagline {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.018em;
}

/* ─── Responsive collapses ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ds-type-row { grid-template-columns: 1fr; gap: 10px; }
  .ds-tokens__row { grid-template-columns: 1fr; }
  .ds-tokens__val { text-align: left; }
  .ds-spacing-row { grid-template-columns: 80px 1fr 60px; }
  .ds-footer-demo .ds-footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .ds-footer-demo .ds-footer-cols { grid-template-columns: 1fr; }
  .ds-footer-demo .ds-footer-base { flex-direction: column; gap: 8px; }
}
