/* ==========================================================================
   Renddi · Base
   Fuente, reset, tipografía, accesibilidad, botones y utilidades.
   Requiere: tokens.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fuente autoalojada (sin llamadas a terceros: RGPD y rendimiento)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   2. Reset mínimo
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body,
h1,
h2,
h3,
h4,
p,
figure,
ul,
ol {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   3. Documento y tipografía
   -------------------------------------------------------------------------- */
body {
  min-height: 100vh;
  background-color: var(--rd-bg);
  color: var(--rd-text);
  font-family: var(--rd-font-sans);
  font-size: var(--rd-text-m);
  font-weight: var(--rd-weight-regular);
  line-height: var(--rd-leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-weight: var(--rd-weight-bold);
  line-height: var(--rd-leading-snug);
  letter-spacing: var(--rd-tracking-heading);
  text-wrap: balance;
}

h1 {
  font-size: var(--rd-text-display);
  font-weight: var(--rd-weight-black);
  line-height: var(--rd-leading-tight);
  letter-spacing: var(--rd-tracking-display);
}

h2 {
  font-size: var(--rd-text-2xl);
}

h3 {
  font-size: var(--rd-text-l);
}

p {
  max-width: var(--rd-measure);
  text-wrap: pretty;
}

a {
  color: var(--rd-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* --------------------------------------------------------------------------
   4. Accesibilidad
   -------------------------------------------------------------------------- */

/* Foco visible solo con teclado, siempre con contraste suficiente */
:focus-visible {
  outline: 3px solid var(--rd-focus);
  outline-offset: 3px;
  border-radius: var(--rd-radius-s);
}

/* Enlace para saltar al contenido */
.rd-skip-link {
  position: absolute;
  top: var(--rd-space-2);
  left: var(--rd-space-2);
  z-index: calc(var(--rd-z-menu) + 1);
  padding: var(--rd-space-2) var(--rd-space-4);
  background: var(--rd-text);
  color: var(--rd-black-pearl);
  font-weight: var(--rd-weight-bold);
  border-radius: var(--rd-radius-s);
  transform: translateY(-200%);
}

.rd-skip-link:focus {
  transform: none;
}

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

/* Movimiento reducido: sin animaciones ni transiciones */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

/* --------------------------------------------------------------------------
   6. Botones (BEM: rd-btn, rd-btn--primary, rd-btn--small)
   -------------------------------------------------------------------------- */
.rd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rd-space-2);
  min-height: var(--rd-btn-h);
  padding: 0 var(--rd-btn-px);
  border: 0;
  border-radius: var(--rd-radius-pill);
  font-size: var(--rd-text-s);
  font-weight: var(--rd-weight-bold);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--rd-duration-fast) ease,
    transform var(--rd-duration-fast) ease,
    box-shadow var(--rd-duration-base) ease;
}

.rd-btn--primary {
  background-color: var(--rd-cta-bg);
  color: var(--rd-cta-text);
  box-shadow: var(--rd-shadow-cta);
}

.rd-btn--primary:hover {
  background-color: var(--rd-cta-bg-hover);
  transform: translateY(-1px);
}

.rd-btn--primary:active {
  transform: translateY(0);
}

.rd-btn--small {
  --rd-btn-h: 2.75rem;   /* 44px: mínimo táctil WCAG 2.5.5 */
  --rd-btn-px: 1.125rem;
}

/* Enlace secundario de texto (sin aspecto de botón) */
.rd-text-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--rd-text);
  font-size: var(--rd-text-s);
  font-weight: var(--rd-weight-medium);
  text-decoration: underline;
  text-decoration-color: var(--rd-text-muted-on-dark);
}

.rd-text-link:hover {
  text-decoration-color: var(--rd-burnt-orange);
}

/* --------------------------------------------------------------------------
   7. Secciones (rd-section) y antetítulo (rd-eyebrow)
   -------------------------------------------------------------------------- */
.rd-section {
  padding-block: var(--rd-section-space);
}

.rd-section__head {
  max-width: 40rem;
  margin-bottom: var(--rd-space-7);
}

.rd-section__title {
  max-width: 20ch;
}

/* Antetítulo con píxel naranja, eco del mosaico del logo */
.rd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--rd-space-2);
  margin-bottom: var(--rd-space-4);
  color: var(--rd-text-muted-on-dark);
  font-size: var(--rd-text-xs);
  font-weight: var(--rd-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rd-eyebrow::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 1px;
  background-color: var(--rd-burnt-orange);
}

/* --------------------------------------------------------------------------
   8. Aparición al entrar en pantalla (js/reveal.js añade .rd-is-visible)
   Solo con JS: sin JS todo se muestra desde el principio.
   -------------------------------------------------------------------------- */
.rd-js [data-rd-reveal] > * {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 600ms var(--rd-ease-out),
    transform 600ms var(--rd-ease-out);
  transition-delay: calc(var(--rd-i, 0) * 80ms);
}

.rd-js [data-rd-reveal].rd-is-visible > * {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   9. Componentes compartidos: entradilla de sección, botón secundario, checklist
   -------------------------------------------------------------------------- */
.rd-section__lead {
  margin-top: var(--rd-space-4);
  color: var(--rd-text-muted-on-dark);
  font-size: var(--rd-text-l);
  line-height: 1.5;
}

/* Botón secundario: contorno claro sobre oscuro */
.rd-btn--secondary {
  background-color: transparent;
  color: var(--rd-text);
  box-shadow: inset 0 0 0 1px var(--rd-text-muted-on-dark);
}

.rd-btn--secondary:hover {
  background-color: var(--rd-surface);
  box-shadow: inset 0 0 0 2px var(--rd-burnt-orange);
}

/* Lista con píxel turquesa como viñeta */
.rd-checklist {
  display: grid;
  gap: var(--rd-space-3);
}

.rd-checklist li {
  position: relative;
  padding-left: var(--rd-space-5);
  color: var(--rd-text-muted-on-dark);
  font-size: var(--rd-text-s);
  line-height: 1.5;
}

.rd-checklist li::before {
  content: "";
  position: absolute;
  top: 0.5em;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 1px;
  background-color: var(--rd-pixel-teal);
}
