/* ============================================================
   CM DESCANSO · BASE  ·  v4  ·  "El oficio del descanso"
   Tipografia con caracter (Bricolage display, Hanken body),
   etiquetas mono tipo ficha tecnica, citas en Newsreader cursiva,
   grano textil. Scope: body.cmd / .cmd-scope.
   ============================================================ */

/* box-sizing global: Elementor lo daba por defecto; el block theme no. Sin esto,
   width:100% + padding-inline desbordaba (el hero en movil salia a 438px en un
   viewport de 390 = overflow horizontal). border-box es el estandar que Woo y todo
   lo demas asumen. */
.cmd-scope *, .cmd-scope *::before, .cmd-scope *::after { box-sizing: border-box; }

body.cmd {
  background: var(--cmd-paper);
  color: var(--cmd-text);
  font-family: var(--cmd-font-body);
  font-size: var(--cmd-fs-body);
  line-height: var(--cmd-lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Grano textil muy sutil (OKA es limpio: casi imperceptible) */
body.cmd::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: var(--cmd-grain); background-size: 160px 160px;
  opacity: .025; mix-blend-mode: multiply;
}
body.cmd > * { position: relative; z-index: 1; }

/* Titulares: Fraunces serif display, editorial, alto contraste optico */
.cmd-scope h1, .cmd-scope h2, .cmd-scope h3, .cmd-display, .cmd-mega {
  font-family: var(--cmd-font-display);
  font-optical-sizing: auto;
  color: var(--cmd-ink);
  font-weight: 480;
  letter-spacing: var(--cmd-tr-display);
  line-height: var(--cmd-lh-tight);
  margin: 0 0 var(--cmd-s4);
  text-wrap: balance;
}
.cmd-mega    { font-size: var(--cmd-fs-mega); line-height: var(--cmd-lh-mega); font-weight: 560; }
.cmd-display { font-size: var(--cmd-fs-display); line-height: var(--cmd-lh-display); font-weight: 560; }
.cmd-scope h1 { font-size: var(--cmd-fs-h1); }
.cmd-scope h2 { font-size: var(--cmd-fs-h2); line-height: var(--cmd-lh-snug); }
.cmd-scope h3 { font-size: var(--cmd-fs-h3); line-height: var(--cmd-lh-snug); letter-spacing: -.01em; }
.cmd-scope p  { margin: 0 0 var(--cmd-s4); text-wrap: pretty; }
.cmd-scope a  { color: var(--cmd-green); text-decoration: none; text-underline-offset: 3px; }
.cmd-scope a:hover { text-decoration: underline; }

/* Enfasis en negrita dentro del texto (como E72H) */
.cmd-scope strong, .cmd-scope b { color: var(--cmd-ink); font-weight: 600; }

/* Eyebrow / label fino en sans MAYUSCULA tracked, muted (como OKA) */
.cmd-eyebrow {
  font-family: var(--cmd-font-body); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cmd-muted);
}
.cmd-data { font-family: var(--cmd-font-mono); font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* Cita / caption en Newsreader cursiva */
.cmd-caption, .cmd-quote {
  font-family: var(--cmd-font-serif); font-style: italic; font-size: 1.02rem;
  color: var(--cmd-green); line-height: 1.45; letter-spacing: .005em;
}

/* Subrayado dibujado a mano (en UNA palabra clave, ocre, como E72H) */
.cmd-ul { position: relative; white-space: nowrap; }
.cmd-ul::after {
  content: ""; position: absolute; left: -.04em; right: -.04em; bottom: -.06em; height: .34em;
  background: no-repeat center/100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 8 C 45 3, 90 12, 135 6 S 188 4, 197 8' fill='none' stroke='%23B0792E' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

.cmd-lead  { font-size: var(--cmd-fs-lead); line-height: 1.5; color: var(--cmd-text); max-width: 46ch; }
.cmd-muted { color: var(--cmd-muted); }
.cmd-price, .cmd-num { font-family: var(--cmd-font-mono); font-variant-numeric: tabular-nums; }

/* El contenedor central del sistema. OJO con el `margin-inline: auto`:
   `.cmd-container` es (0,1,0) y Elementor declara sobre `.e-con` (tambien (0,1,0))
   un `margin-inline-start: var(--margin-inline-start)` que resuelve a 0px. Empate de
   especificidad, y como el design system se encola a PRIORIDAD 5 (antes que Elementor,
   ver R26), gana Elementor: el margen se quedaba en 0 y TODA la web aparecia corrida a
   la izquierda, con el hueco entero a la derecha. El `max-width` si aplicaba, porque
   nadie se lo disputa; por eso el bloque medía 1300 pero pegado al borde.
   Con `.cmd-scope` delante subimos a (0,2,0) y ganamos sin recurrir a !important.
   Regla general: cualquier propiedad de CAJA (margin, padding, width, flex) que el
   sistema ponga sobre un elemento que tambien es `.e-con` necesita esta especificidad. */
.cmd-scope .cmd-container,
.cmd-container { max-width: var(--cmd-container); padding-inline: var(--cmd-s5); }
.cmd-scope .cmd-container { margin-inline: auto; }
.cmd-section   { padding-block: var(--cmd-section); }
.cmd-scope img { display: block; max-width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
