/* ============================================================================
   WORKMED DESIGN SYSTEM — ds-site.css
   Chrome del SITIO de documentación (no del sistema de diseño en sí).
   Dogfooding: usa los tokens de ds-core.css.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   Top bar del sitio DS
   -------------------------------------------------------------------------- */
.ds-top {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250,251,253,0.88);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.ds-top__inner { display: flex; align-items: center; gap: 24px; padding: 14px 0; }
.ds-top .brand__img { height: 26px; }
.ds-top__sub {
  font-size: 10.5px; font-weight: 500; color: var(--fg-muted);
  letter-spacing: 0.15em; text-transform: uppercase;
  padding-left: 12px; border-left: 1px solid var(--line); line-height: 1.1;
}
.ds-top__nav { display: flex; gap: 26px; margin-left: auto; }
.ds-top__nav a { font-size: 14px; color: var(--fg-muted); }
.ds-top__nav a:hover { color: var(--fg); }
.ds-top__nav a.active { color: var(--fg); font-weight: 500; }
.ds-top__tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--alert-bg); color: var(--wm-rojo);
}
.ds-burger { display: none; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; place-items: center; }

/* ----------------------------------------------------------------------------
   Layout de documentación (sidebar + contenido)
   -------------------------------------------------------------------------- */
/* Las páginas de docs usan un contenedor más ancho que el landing. */
.container:has(> .ds-docs) { width: min(1600px, 95vw); }
.ds-docs { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: 0; align-items: start; }
.ds-side {
  position: sticky; top: 57px; align-self: start;
  height: calc(100vh - 57px); overflow-y: auto;
  padding: 36px 24px 60px; border-right: 1px solid var(--line-soft);
}
.ds-side__group { margin-bottom: 26px; }
.ds-side__label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-soft); font-weight: 500; margin-bottom: 10px; }
.ds-side__group a { display: block; font-size: 14px; color: var(--fg-muted); padding: 6px 10px; border-radius: var(--r-sm); transition: background .12s ease, color .12s ease; }
.ds-side__group a:hover { background: var(--bg-soft); color: var(--fg); }
.ds-side__group a.active { background: var(--wm-azul-oscuro); color: #fff; font-weight: 500; }

.ds-main { padding: 48px clamp(24px, 5vw, 72px) 120px; min-width: 0; max-width: 1200px; }
/* Nada se corta: previews y código anchos hacen scroll dentro de su caja. */
.ds-main .demo, .ds-main .token-table, .ds-main .code { max-width: 100%; }
.demo__preview { overflow-x: auto; }
.ds-main > section { padding: 0; margin-bottom: 64px; scroll-margin-top: 80px; }
.ds-main h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 8px; }
.ds-main h3 { font-size: 21px; margin: 0 0 6px; }
.ds-lead-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.ds-main p.muted { color: var(--fg-muted); font-size: 15px; max-width: 64ch; }
.ds-anchor { color: var(--fg-soft); font-weight: 300; opacity: 0; transition: opacity .15s; }
.ds-main h3:hover .ds-anchor { opacity: 1; }

/* ----------------------------------------------------------------------------
   Bloque de demo: preview + código
   -------------------------------------------------------------------------- */
.demo { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin: 18px 0 8px; background: #fff; }
.demo__bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.demo__title { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-soft); font-weight: 500; }
.demo__preview { padding: 32px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.demo__preview--stack { flex-direction: column; align-items: stretch; }
.demo__preview--dark { background: var(--wm-azul-oscuro); }
.demo__preview--soft { background: var(--bg-soft); }
.demo__preview--block { display: block; padding: 0; }

.code { position: relative; background: #20263c; border-top: 1px solid rgba(0,0,0,0.2); }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.7; color: #cdd5f0; }
.code .tok-tag { color: #8fb8ff; }
.code .tok-attr { color: #c4a7ff; }
.code .tok-str { color: #9fe0b0; }
.code .tok-com { color: #6b7494; font-style: italic; }
.code__copy {
  position: absolute; top: 10px; right: 10px;
  font-size: 11.5px; font-weight: 500; padding: 6px 12px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85);
  transition: background .15s ease, color .15s ease;
}
.code__copy:hover { background: rgba(255,255,255,0.18); color: #fff; }
.code__copy.copied { background: var(--ok-bg); color: var(--ok-fg); }

details.code-toggle > summary { list-style: none; cursor: pointer; padding: 9px 16px; font-size: 12.5px; color: var(--fg-soft); border: 1px solid var(--line-soft); border-top: none; border-radius: 0 0 var(--r-lg) var(--r-lg); display: flex; align-items: center; gap: 8px; background: var(--bg); }
details.code-toggle > summary::-webkit-details-marker { display: none; }
details.code-toggle[open] > summary { border-radius: 0; }
details.code-toggle > summary::before { content: '›'; transition: transform .2s; }
details.code-toggle[open] > summary::before { transform: rotate(90deg); }
details.code-toggle .code { border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ----------------------------------------------------------------------------
   Swatches de color
   -------------------------------------------------------------------------- */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.swatch { border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; background: #fff; }
.swatch__chip { height: 76px; }
.swatch__body { padding: 12px 14px; }
.swatch__name { font-size: 13.5px; font-weight: 500; color: var(--fg); }
.swatch__var { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--fg-soft); margin-top: 2px; }
.swatch__hex { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--fg-muted); margin-top: 1px; text-transform: uppercase; }

/* ----------------------------------------------------------------------------
   Specimen tipográfico + tablas de tokens
   -------------------------------------------------------------------------- */
.type-row { display: flex; align-items: baseline; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.type-row__meta { width: 150px; flex-shrink: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--fg-soft); }
.type-row__sample { color: var(--fg); min-width: 0; }

.token-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.token-table th { text-align: left; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-soft); font-weight: 500; padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.token-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); }
.token-table code, .ds-main code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--bg-soft); padding: 2px 7px; border-radius: var(--r-xs); color: var(--accent-ink); }
.token-table .demo-radius { background: var(--wm-azul-oscuro); display: inline-block; width: 60px; height: 32px; }
.token-table .demo-shadow { background: #fff; display: inline-block; width: 80px; height: 36px; border-radius: var(--r-sm); }

/* ----------------------------------------------------------------------------
   Tarjetas de plataforma (ecosistema)
   -------------------------------------------------------------------------- */
.eco-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-card); }
.eco-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.eco-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: transparent; }
.eco-card__top { display: flex; align-items: center; justify-content: space-between; }
.eco-card__dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; }
.eco-card h4 { font-size: 17px; }
.eco-card p { font-size: 13.5px; color: var(--fg-muted); line-height: 1.55; }
.eco-card__stack { font-size: 11.5px; letter-spacing: 0.04em; color: var(--fg-soft); font-family: ui-monospace, Menlo, monospace; margin-top: auto; padding-top: 8px; }

/* Feature row */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-card); }
.feature { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 28px; }
.feature__ico { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-soft); color: var(--wm-azul-oscuro); display: grid; place-items: center; margin-bottom: 18px; }
.feature h4 { font-size: 17px; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--fg-muted); line-height: 1.55; }

/* Mini panel de tweaks en vivo */
.live-tweaks { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; padding: 16px 20px; background: var(--bg-soft); border-radius: var(--r-lg); margin-bottom: 18px; }
.live-tweaks__group { display: flex; align-items: center; gap: 10px; }
.live-tweaks__group > span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-soft); font-weight: 500; }

/* Galería de iconos */
.icon-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.icon-gallery figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 8px; border: 1px solid var(--line-soft); border-radius: var(--r-md); color: var(--wm-azul-oscuro); transition: border-color .15s ease, color .15s ease, background .15s ease; }
.icon-gallery figure:hover { border-color: transparent; background: var(--wm-azul-oscuro); color: #fff; }
.icon-gallery figcaption { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--fg-soft); }
.icon-gallery figure:hover figcaption { color: rgba(255,255,255,0.7); }

/* utilidades */
.stack { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.divider { height: 1px; background: var(--line-soft); border: 0; margin: 56px 0; }
.pill-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-soft); font-weight: 500; }

/* ----------------------------------------------------------------------------
   Responsivo del sitio DS
   -------------------------------------------------------------------------- */
@media (max-width: 920px) {
  .ds-docs { grid-template-columns: 1fr; }
  .ds-side {
    position: fixed; inset: 57px auto 0 0; z-index: 55; width: 280px;
    background: var(--bg); transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .ds-side.open { transform: none; }
  .ds-burger { display: grid; }
  .eco-grid, .feature-grid { grid-template-columns: 1fr 1fr; }
  .ds-top__nav { display: none; }
}
@media (max-width: 640px) {
  .eco-grid, .feature-grid { grid-template-columns: 1fr; }
  .type-row { flex-direction: column; gap: 6px; }
  .type-row__meta { width: auto; }
}
