/* Apuesta Cuaderno — base: reset, tokens, tipografía y elementos compartidos */

:root {
  --ink: #0b1b33;
  --ink-soft: #45597a;
  --ink-faint: #6c7f9c;
  --line: #d8e2f4;
  --line-soft: #e7eefb;
  --white: #ffffff;
  --tint: #eef4ff;
  --tint-deep: #e2ebfc;
  --tint-cyan: #eef9fc;
  --blue: #0b57e8;
  --blue-dark: #0842b8;
  --cyan: #06b6d4;
  --cyan-dark: #0b8ba6;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 80px;
  --s-10: 96px;

  --wrap: 1180px;
  --wrap-narrow: 760px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

img { max-width: 100%; height: auto; display: block; border: 0; }

h1, h2, h3, h4 { margin: 0 0 var(--s-4); line-height: 1.18; letter-spacing: -0.01em; }
h1, h2 { font-family: var(--serif); font-weight: 600; }
h3, h4 { font-family: var(--sans); font-weight: 700; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.05rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.25rem); }
h3 { font-size: 1.2rem; line-height: 1.3; }
h4 { font-size: 1.02rem; line-height: 1.35; }

p, ul, ol, dl, table, figure { margin: 0 0 var(--s-4); }
p { max-width: 72ch; }
li { margin-bottom: var(--s-2); }
strong { font-weight: 700; }
small { font-size: 0.82rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s-5); }
.wrap-narrow { max-width: var(--wrap-narrow); }
.section { padding: var(--s-9) 0; }
.section--tint { background: var(--tint); }
.section--cyan { background: var(--tint-cyan); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Enlaces: subrayado que entra al pasar el cursor */
a { color: var(--blue); text-decoration: none; }
.prose a,
a.link {
  color: var(--blue-dark);
  background-image: linear-gradient(var(--blue), var(--blue));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: background-size 0.22s ease;
  padding-bottom: 1px;
}
.prose a:hover, .prose a:focus-visible,
a.link:hover, a.link:focus-visible { background-size: 100% 2px; }

:where(a, button, summary, input, textarea, select):focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
  border-radius: var(--s-1);
}

/* Kicker y regla de acento entre secciones */
.kicker {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: var(--s-3);
}
.rule { width: 56px; height: 4px; border-radius: var(--r-pill); background: var(--blue); border: 0; margin: 0 0 var(--s-5); }
.rule--cyan { background: var(--cyan); }
.rule--center { margin-left: auto; margin-right: auto; }

/* Botones cápsula con etiqueta breve en mayúsculas */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: var(--s-3) var(--s-6);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  background: var(--blue);
  color: var(--white);
}
.btn:hover, .btn:focus-visible { background: var(--blue-dark); }
.btn--ghost { background: var(--white); color: var(--blue-dark); border-color: var(--line); }
.btn--ghost:hover, .btn--ghost:focus-visible { background: var(--tint); border-color: var(--blue); color: var(--blue-dark); }
.btn--block { width: 100%; }

/* Chapas planas */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--tint);
  color: var(--blue-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
}
.badge--blue { background: var(--blue); color: var(--white); }
.badge--cyan { background: var(--cyan); color: #04323c; }
.badge--ink { background: var(--ink); color: var(--white); }
.badge-row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-4); padding: 0; list-style: none; }
.badge-row li { margin: 0; }

/* Marco doble para elementos destacados */
.framed {
  border: 2px solid var(--blue);
  outline: 1px solid var(--blue);
  outline-offset: 5px;
}

/* Franja utilitaria + cabecera de dos pisos */
.utility { background: var(--ink); color: #c9d8ef; font-size: 0.8rem; }
.utility__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s-2) var(--s-5); padding-top: 9px; padding-bottom: 9px;
}
.utility__note { margin: 0; max-width: none; }
.utility__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0; padding: 0; list-style: none; }
.utility__links li { margin: 0; }
.utility__links a { color: var(--white); font-weight: 600; }
.utility__links a:hover { color: var(--cyan); }

.masthead { background: var(--white); border-bottom: 1px solid var(--line); }
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-5); padding-top: var(--s-4); padding-bottom: var(--s-4); flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--ink); }
.brand svg { flex: none; width: 38px; height: 38px; }
.brand__name { font-family: var(--serif); font-size: 1.32rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; }
.brand__name b { font-weight: 600; color: var(--blue); }

.mainnav ul { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0; padding: 0; list-style: none; }
.mainnav li { margin: 0; }
.mainnav a {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 600;
}
.mainnav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--blue);
  transition: right 0.25s ease;
}
.mainnav a:hover::after,
.mainnav a:focus-visible::after,
.mainnav a[aria-current="page"]::after { right: 0; }
.mainnav a[aria-current="page"] { color: var(--blue-dark); }

/* Aviso de edad permanente, debajo de la cabecera */
.agestrip { background: var(--tint); border-bottom: 1px solid var(--line); }
.agestrip__inner {
  display: flex; align-items: center; gap: var(--s-3) var(--s-4);
  flex-wrap: wrap; padding-top: var(--s-3); padding-bottom: var(--s-3);
}
.agestrip__mark {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 26px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--white);
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em;
}
.agestrip__text { margin: 0; max-width: 96ch; font-size: 0.85rem; color: var(--ink-soft); }
.agestrip__text a { color: var(--blue-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* Nota de divulgación de afiliados */
.disclose {
  display: flex; gap: var(--s-4); align-items: flex-start;
  padding: var(--s-4) var(--s-5);
  background: var(--tint-cyan);
  border-radius: var(--r);
  border-left: 4px solid var(--cyan);
}
.disclose p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); max-width: 92ch; }
.disclose strong { color: var(--ink); }

/* Prosa de páginas de contenido */
.prose h2 { margin-top: var(--s-8); }
.prose h3 { margin-top: var(--s-6); }
.prose > *:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: var(--s-5); max-width: 72ch; }
.prose li::marker { color: var(--blue); font-weight: 700; }

.callout {
  padding: var(--s-5);
  border-radius: var(--r);
  background: var(--tint);
  border-left: 4px solid var(--blue);
}
.callout :last-child { margin-bottom: 0; }
.callout h3 { margin-top: 0; }

/* Tablas de datos */
.tablewrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--white); }
table.data { width: 100%; border-collapse: collapse; margin: 0; font-size: 0.92rem; min-width: 720px; }
table.data caption { caption-side: bottom; padding: var(--s-4); font-size: 0.82rem; color: var(--ink-faint); text-align: left; }
table.data th, table.data td { padding: var(--s-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
table.data thead th { background: var(--ink); color: var(--white); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
table.data tbody th { font-weight: 700; color: var(--ink); background: var(--tint); white-space: nowrap; }
table.data tbody tr:last-child th, table.data tbody tr:last-child td { border-bottom: 0; }

/* Sección de protección en el pie */
.protect { background: var(--ink); color: #d5e2f5; padding: var(--s-8) 0 var(--s-7); }
.protect h2 { color: var(--white); font-size: 1.55rem; }
.protect .kicker { color: var(--cyan); }
.protect .rule { background: var(--cyan); }
.protect__lead { max-width: 74ch; margin-bottom: var(--s-6); color: #c3d3ea; }
.protect__grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); margin-bottom: var(--s-5); }
.protect__card { background: #12294a; border-radius: var(--r); padding: var(--s-5); }
.protect__card h3 { color: var(--white); font-size: 1rem; margin-bottom: var(--s-2); }
.protect__card p { font-size: 0.88rem; color: #bfd0e8; margin-bottom: var(--s-4); }
.protect__card a.res {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--white); font-weight: 700; font-size: 0.88rem;
  border-bottom: 2px solid var(--cyan); padding-bottom: 2px; word-break: break-word;
}
.protect__card a.res:hover { color: var(--cyan); }
.protect__helpline {
  display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: var(--s-4) var(--s-7);
  align-items: center;
  padding: var(--s-5) var(--s-6); border-radius: var(--r); background: #12294a; border-left: 4px solid var(--cyan);
}
.protect__helpline p { margin: 0; font-size: 0.9rem; color: #c3d3ea; }
.protect__helpline-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--cyan); font-weight: 700; margin-bottom: var(--s-1); }
.protect__number { display: block; font-family: var(--serif); font-size: 2.1rem; color: var(--white); line-height: 1.05; }

/* Pie */
.footer { background: #071426; color: #a9bcd6; padding: var(--s-8) 0 var(--s-6); font-size: 0.9rem; }
.footer__grid { display: grid; gap: var(--s-6); grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.footer__about p { font-size: 0.88rem; color: #9db1cd; }
.footer .brand { color: var(--white); margin-bottom: var(--s-4); }
.footer .brand__name b { color: var(--cyan); }
.footer h3 { color: var(--white); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--s-4); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 10px; }
.footer a { color: #c3d3ea; }
.footer a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.footer__base { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid #16283f; display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); justify-content: space-between; align-items: flex-start; }
.footer__base p { margin: 0; font-size: 0.8rem; color: #8ba1bf; max-width: 88ch; }
.footer__age { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 700; color: var(--white); }
.footer__age span { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 24px; border-radius: var(--r-pill); background: var(--cyan); color: #04323c; font-size: 0.72rem; font-weight: 800; }

/* Aviso de cookies (no bloqueante) */
.cookiebar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  background: var(--white); border-top: 2px solid var(--blue);
  padding: var(--s-4) 0;
}
.cookiebar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); justify-content: space-between; }
.cookiebar p { margin: 0; font-size: 0.85rem; color: var(--ink-soft); max-width: 78ch; }
.cookiebar__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.cookiebar .btn { min-height: 42px; padding: 10px var(--s-5); }
.cookiebar[hidden] { display: none; }

@media (max-width: 960px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  body { font-size: 16px; }
  .section { padding: var(--s-8) 0; }
  .masthead__inner { flex-direction: column; align-items: flex-start; gap: var(--s-4); }
  .mainnav ul { gap: var(--s-2) var(--s-4); }
  .mainnav a { font-size: 0.9rem; }
  .utility__inner { flex-direction: column; align-items: flex-start; }
  .utility__note { font-size: 0.76rem; }
  .footer__grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .protect__helpline { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
