/* ==========================================================================
   Danti: base del tema
   Alias cortos de los tokens de theme.json, para que el CSS del prototipo
   (base.css, components.css, home.css) pase al tema sin reescribirse.
   ========================================================================== */

:root {
  --c-ink: var(--wp--preset--color--ink);
  --c-ink-2: var(--wp--preset--color--ink-2);
  --c-ink-3: var(--wp--custom--color--ink-3);
  --c-orange: var(--wp--custom--color--orange);
  --c-orange-hover: var(--wp--custom--color--orange-hover);
  --c-orange-text: var(--wp--custom--color--orange-text);
  --c-white: #FFFFFF;
  --c-paper: var(--wp--preset--color--paper);
  --c-well: var(--wp--preset--color--well);
  --c-line: var(--wp--custom--color--line);
  --c-line-strong: var(--wp--custom--color--line-strong);
  --c-text: var(--wp--preset--color--ink);
  --c-text-muted: var(--wp--preset--color--text-muted);
  --c-on-ink: #FFFFFF;
  --c-on-ink-muted: var(--wp--custom--color--on-ink-muted);
  --c-on-orange: var(--wp--preset--color--ink);
  --c-line-on-ink: var(--wp--custom--color--line-on-ink);
  --c-ok: var(--wp--custom--color--ok);
  --c-danger: var(--wp--custom--color--danger);
  --c-unavailable: var(--wp--custom--color--unavailable);

  --ff-sans: var(--wp--preset--font-family--archivo);
  --fs-display-stretch: var(--wp--custom--font--display-stretch);
  --fw-display: var(--wp--custom--font--display-weight);
  --fs-hero: var(--wp--preset--font-size--hero);
  --fs-d1: var(--wp--preset--font-size--d-1);
  --fs-d2: var(--wp--preset--font-size--d-2);
  --fs-d3: var(--wp--preset--font-size--d-3);
  --fs-h4: var(--wp--preset--font-size--h-4);
  --fs-lead: var(--wp--preset--font-size--lead);
  --fs-body: var(--wp--preset--font-size--body);
  --fs-sm: var(--wp--preset--font-size--sm);
  --fs-xs: var(--wp--preset--font-size--xs);
  --lh-tight: var(--wp--custom--line-height--tight);
  --lh-snug: var(--wp--custom--line-height--snug);
  --lh-body: var(--wp--custom--line-height--body);
  --tracking-eyebrow: var(--wp--custom--tracking--eyebrow);

  --s-1: var(--wp--preset--spacing--10);
  --s-2: var(--wp--preset--spacing--20);
  --s-3: var(--wp--preset--spacing--30);
  --s-4: var(--wp--preset--spacing--40);
  --s-5: var(--wp--preset--spacing--50);
  --s-6: var(--wp--preset--spacing--60);
  --s-7: var(--wp--preset--spacing--70);
  --s-8: var(--wp--preset--spacing--80);
  --s-9: var(--wp--preset--spacing--90);
  --s-10: var(--wp--preset--spacing--100);
  --section-y: var(--wp--custom--section-y);
  --gutter: var(--wp--custom--gutter);
  --container: 85rem;

  --r-1: var(--wp--custom--radius--1);
  --r-2: var(--wp--custom--radius--2);
  --r-pill: var(--wp--custom--radius--pill);
  --shadow-overlay: var(--wp--preset--shadow--overlay);
  --ease: var(--wp--custom--motion--ease);
  --t-fast: var(--wp--custom--motion--fast);
  --t-base: var(--wp--custom--motion--base);
  --t-slow: var(--wp--custom--motion--slow);

  --c-pend: #5B3DF0;         /* marcas de pendiente: 6,23:1 sobre blanco */
  --c-pend-bg: rgba(91, 61, 240, .08);
  --fs-price: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  --header-h: 3.5rem;
  --topbar-h: 2rem;
  --z-header: 50;
  --z-menu: 60;
  --z-overlay: 80;
  --z-wa: 40;
}

@media (min-width: 64em) {
  :root { --header-h: 4.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0ms; --t-base: 0ms; --t-slow: 0ms; }
}

/* Títulos del contenido editorial: Archivo condensada (eco del "DANTI" del logo).
   Las secciones del tema usan sus propias clases (.t-d1, .t-d2…). */
.wp-block-post-content :is(h1, h2, h3) {
  font-stretch: var(--fs-display-stretch);
  letter-spacing: -.01em;
}

/* ==========================================================================
   Base del prototipo: reset, tipografía, layout, foco y utilidades
   ========================================================================== */


*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* que ningún display de componente (p. ej. .btn) le gane al atributo */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-text);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"], .list-reset { list-style: none; padding: 0; }

/* ---- Foco visible: tinta sobre claro, naranja sobre carbón ------------- */
:root { --focus: var(--c-ink); }
.on-ink { --focus: var(--c-orange); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--c-orange);
  color: var(--c-on-orange);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: var(--s-2); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---- Superficies -------------------------------------------------------- */
.on-ink {
  background: var(--c-ink);
  color: var(--c-on-ink);
}
.on-well { background: var(--c-well); }

/* ---- Layout ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * .6); }

/* ---- Tipografía --------------------------------------------------------- */
.display,
.t-hero, .t-d1, .t-d2, .t-d3 {
  font-stretch: var(--fs-display-stretch);
  font-weight: var(--fw-display);
  text-transform: uppercase;
  line-height: var(--lh-tight);
  letter-spacing: -.005em;
  text-wrap: balance;
}
.t-hero { font-size: var(--fs-hero); }
.t-d1 { font-size: var(--fs-d1); }
.t-d2 { font-size: var(--fs-d2); }
.t-d3 { font-size: var(--fs-d3); line-height: 1; }

.t-h4 {
  font-size: var(--fs-h4);
  font-weight: 700;
  line-height: var(--lh-snug);
}

.t-lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  max-width: 38em;
}

.t-sm { font-size: var(--fs-sm); line-height: 1.45; }
.t-xs { font-size: var(--fs-xs); line-height: 1.4; }
.t-muted { color: var(--c-text-muted); }
.on-ink .t-muted { color: var(--c-on-ink-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--fs-xs);
  font-weight: 650;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.on-ink .eyebrow { color: var(--c-on-ink-muted); }

/* Líneas de velocidad (motivo del "BIKES" del logo): trazo sólido afinado a la izquierda */
.eyebrow--lines::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  background: currentColor;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

.tabular { font-variant-numeric: tabular-nums; }

/* ---- Botones ------------------------------------------------------------ */
.btn {
  --btn-bg: transparent;
  --btn-fg: currentColor;
  --btn-bd: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 3rem;              /* 48: objetivo táctil */
  padding: 0 var(--s-5);
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--r-2);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
.btn svg { width: 1.125rem; height: 1.125rem; flex: none; }

.btn--primary {
  --btn-bg: var(--c-orange);
  --btn-fg: var(--c-on-orange);
  --btn-bd: var(--c-orange);
}
.btn--primary:hover {
  --btn-bg: var(--c-orange-hover);
  --btn-bd: var(--c-orange-hover);
}

.btn--ink {
  --btn-bg: var(--c-ink);
  --btn-fg: var(--c-on-ink);
  --btn-bd: var(--c-ink);
}
.btn--ink:hover { --btn-bg: var(--c-ink-3); --btn-bd: var(--c-ink-3); }

.btn--outline { --btn-bd: var(--c-ink); --btn-fg: var(--c-ink); }
.btn--outline:hover { --btn-bg: var(--c-ink); --btn-fg: var(--c-on-ink); }

.on-ink .btn--outline { --btn-bd: rgba(255, 255, 255, .5); --btn-fg: var(--c-on-ink); }
.on-ink .btn--outline:hover { --btn-bd: var(--c-orange); --btn-bg: transparent; --btn-fg: var(--c-orange); }

.btn--block { width: 100%; }
.btn--sm { min-height: 2.75rem; padding: 0 var(--s-4); font-size: var(--fs-xs); } /* 44: mínimo táctil */

.btn[disabled],
.btn[aria-disabled="true"] {
  --btn-bg: var(--c-well);
  --btn-fg: var(--c-text-muted);
  --btn-bd: var(--c-line);
  cursor: not-allowed;
}

/* Link con flecha */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
}
.link-arrow svg {
  width: 1rem; height: 1rem;
  transition: transform var(--t-fast) var(--ease);
}
.link-arrow:hover svg:not(.g-logo) { transform: translateX(3px); }
.link-arrow:hover { color: var(--c-orange-text); }
.on-ink .link-arrow:hover { color: var(--c-orange); }

.icon { width: 1.5rem; height: 1.5rem; flex: none; }

/* ---- Revelado al hacer scroll (sutil) ---------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Marcas de PENDIENTE: solo las ve quien edita (danti_pend_visible), nunca un cliente.
   ========================================================================== */
.proto-bar {
  position: relative;
  z-index: 70;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-2) var(--s-4);
  padding: var(--s-2) var(--gutter);
  background: var(--c-pend);
  color: #fff;
  font-size: var(--fs-xs);
  line-height: 1.3;
  text-align: center;
}
.proto-bar button {
  padding: 2px var(--s-2);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--r-1);
  font-weight: 650;
}
.proto-bar button:hover { background: rgba(255, 255, 255, .15); }

/* Bloque pendiente: borde violeta punteado (::after) + etiqueta (::before).
   No usar data-pend en elementos que ya usen ::before/::after. */
[data-pend] { position: relative; }
[data-pend]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 1.5px dashed var(--c-pend);
  border-radius: inherit;
  pointer-events: none;
}
[data-pend]::before {
  content: attr(data-pend);
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 4;
  max-width: calc(100% - var(--s-4));
  padding: 2px 6px;
  border-radius: var(--r-1);
  background: var(--c-pend);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-stretch: 100%;
  letter-spacing: .06em;
  line-height: 1.4;
  text-transform: uppercase;
  pointer-events: none;
}

/* Marcador en línea */
.pend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: var(--s-1);
  padding: 1px 6px;
  border-radius: var(--r-1);
  background: var(--c-pend);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-stretch: 100%;
  letter-spacing: .06em;
  line-height: 1.5;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}
/* Un botón con marcador puede pasar a dos líneas en vez de desbordar */
.btn:has(> .pend) { flex-wrap: wrap; max-width: 100%; white-space: normal; }

html.hide-pend [data-pend]::after,
html.hide-pend [data-pend]::before,
html.hide-pend .pend { display: none !important; }

/* ==========================================================================
   Ajustes del tema de bloques
   ========================================================================== */

/* Las partes de plantilla no agregan caja: así el header sticky se pega al viewport */
.danti-part { display: contents; }

/* Sprite de íconos en línea (wp_body_open) */
.danti-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* En el editor no corre danti.js: lo que se revela al hacer scroll se ve siempre */
.editor-styles-wrapper .reveal,
.block-editor-iframe__body .reveal { opacity: 1; transform: none; }

/* Contenido de páginas y notas (los bloques de Danti traen sus propias clases) */
:where(.wp-block-post-content, .editor-styles-wrapper .is-root-container) :where(h1, h2, h3, h4) {
  font-weight: 800;
  line-height: var(--lh-snug);
  text-transform: uppercase;
  margin-block: 1.5em .5em;
}
:where(.wp-block-post-content, .editor-styles-wrapper .is-root-container) :where(h1) { font-size: var(--fs-d1); line-height: var(--lh-tight); }
:where(.wp-block-post-content, .editor-styles-wrapper .is-root-container) :where(h2) { font-size: var(--fs-d2); }
:where(.wp-block-post-content, .editor-styles-wrapper .is-root-container) :where(h3) { font-size: var(--fs-d3); }
:where(.wp-block-post-content, .editor-styles-wrapper .is-root-container) :where(h4) { font-size: var(--fs-h4); text-transform: none; }
:where(.wp-block-post-content) :where(p, ul, ol) { margin-block: 0 1em; }
:where(.wp-block-post-content) a { text-decoration: underline; }
:where(.wp-block-post-content) a:hover { text-decoration: none; }
