/* Restaurante Inteligente, sitio público.
 * Una sola hoja para todas las páginas: inicio, 404 y documentos legales.
 * Sin fuentes web, sin dependencias externas.
 *
 * Contraste: el rojo de marca (#ff3131) da 3.7:1 sobre blanco, así que solo se usa
 * para acentos, iconos y texto grande. El texto rojo pequeño sobre fondo claro usa
 * --red-text (5.7:1). Sobre --ink el rojo de marca sí cumple AA (5.1:1).
 */

:root {
  color-scheme: light;

  --red: #ff3131;
  --red-hover: #e01e1e;
  --red-tint: #fdeaea;
  --red-text: #c81e1e;     /* texto y enlaces rojos sobre fondo claro */
  --red-deep: #a31515;     /* hover de enlaces sobre fondo claro */
  --red-on-dark: #ff5c5c;  /* enlaces sobre --ink */

  --ink: #121214;
  --ink-soft: #181818;     /* fondo del hero: el mismo del arte ri-wave.jpg */
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #424245;
  --muted: #6e6e73;
  --border: #e3e3e8;

  --radius: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --gutter: 16px;
  --max: 1040px;
  --max-narrow: 760px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}

/* ── Base ─────────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

main { display: block; flex: 1 0 auto; }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { margin: 0; }

a {
  color: var(--red-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--red-deep); }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 0.75rem; }

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

.kicker {
  margin: 0 0 0.75rem;
  color: var(--red-text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ── Header ───────────────────────────────────────────────────────────── */

.site-header {
  background: var(--ink);
  border-bottom: 3px solid var(--red);
}

.header-inner {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 6px;
}
.brand img {
  display: block;
  height: 40px;
  width: auto;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.875rem;
  line-height: 1.65;
  padding-block: 2.5rem 2rem;
}

.footer-inner {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

.footer-mark { display: block; width: 32px; height: 32px; }

.footer-legal strong { color: #fff; font-weight: 700; letter-spacing: 0.01em; }
.footer-legal a { color: var(--red-on-dark); overflow-wrap: anywhere; }
.footer-legal a:hover { color: #fff; }

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
}
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-nav a[aria-current="page"] {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.footer-copy {
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8125rem;
}

/* Aviso de marcas. Toma la línea divisoria que antes llevaba .footer-copy.
 * rgba(255,255,255,0.6) sobre --ink da 7.1:1. La línea ocupa todo el ancho y el
 * padding derecho limita el texto a ~70ch sin acortar la línea. */
.footer-disclaimer {
  padding-top: 1.25rem;
  padding-right: max(0px, calc(100% - 70ch));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.footer-disclaimer + .footer-copy {
  margin-top: -0.5rem;
  padding-top: 0;
  border-top: 0;
}

@media (min-width: 820px) {
  .footer-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "mark legal nav"
      "disclaimer disclaimer disclaimer"
      "copy copy copy";
    column-gap: 1.5rem;
    row-gap: 1.75rem;
  }
  .footer-mark { grid-area: mark; margin-top: 0.15rem; }
  .footer-legal { grid-area: legal; }
  .footer-nav { grid-area: nav; align-items: flex-end; }
  .footer-nav a { min-height: 32px; }
  .footer-disclaimer { grid-area: disclaimer; }
  .footer-disclaimer + .footer-copy { margin-top: -0.75rem; }
  .footer-copy { grid-area: copy; }
}

/* ── Botones ──────────────────────────────────────────────────────────── */

/* El texto blanco sobre #ff3131 solo cumple contraste como texto grande
 * (19px en negrita o más), por eso el botón usa ese tamaño. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0 1.75rem;
  border-radius: 999px;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); color: #fff; }
.btn-primary:active { transform: translateY(1px); }

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink-soft);
  color: #fff;
}

/* Arte decorativo: la ola roja se desvanece hacia la izquierda para que su borde
 * no se vea como un rectángulo pegado. */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  width: clamp(320px, 48vw, 720px);
  background:
    linear-gradient(90deg, var(--ink-soft) 0%, rgba(24, 24, 24, 0) 38%),
    url("/assets/ri-wave.jpg") right center / cover no-repeat;
  pointer-events: none;
}

.hero-inner {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.hero-content { max-width: 36rem; }

.hero .kicker { color: var(--red); }

.hero h1 {
  color: #fff;
  font-size: clamp(2.125rem, 1.25rem + 3.6vw, 3.375rem);
  font-weight: 800;
  line-height: 1.08;
}

.hero-lead {
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
}

/* En pantallas angostas el texto ocupa todo el ancho: la ola queda detrás, tenue. */
@media (max-width: 899px) {
  .hero::before {
    width: 90%;
    opacity: 0.4;
    background:
      linear-gradient(90deg, var(--ink-soft) 0%, rgba(24, 24, 24, 0) 45%),
      url("/assets/ri-wave.jpg") right top / cover no-repeat;
  }
}

/* ── Secciones ────────────────────────────────────────────────────────── */

.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section + .section { border-top: 1px solid var(--border); }

.section-head { max-width: 40rem; margin-bottom: 2rem; }

.section-title {
  font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.125rem);
  font-weight: 800;
}
.section-title::after,
.legal-body h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-top: 0.65rem;
  border-radius: 2px;
  background: var(--red);
}

.section-lead {
  margin-top: 1rem;
  color: var(--text-2);
  font-size: 1.0625rem;
}

/* ── Pilares ──────────────────────────────────────────────────────────── */

.pillars-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Línea gris con un tramo rojo al inicio, como el subrayado de .section-title. */
.pillar {
  position: relative;
  padding-top: 1.25rem;
  border-top: 2px solid var(--border);
}
.pillar::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: var(--red);
}

.pillar-num {
  display: block;
  color: var(--red-text);
  font-size: clamp(2.25rem, 2rem + 1vw, 2.75rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
}

.pillar h3 {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pillar p {
  margin-top: 0.625rem;
  color: var(--text-2);
  line-height: 1.65;
}

@media (min-width: 820px) {
  .pillars-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

/* ── Página 404 ───────────────────────────────────────────────────────── */

.notfound { padding-block: clamp(4rem, 12vw, 7rem); }
.notfound h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 2.75rem); font-weight: 800; }
.notfound p:not(.kicker) { margin-top: 1rem; color: var(--text-2); font-size: 1.0625rem; }
.notfound .btn { margin-top: 2rem; }

/* ── Documentos legales ───────────────────────────────────────────────── */

.legal { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3rem, 7vw, 5rem); }

.legal h1 {
  font-size: clamp(1.875rem, 1.35rem + 2.2vw, 2.625rem);
  font-weight: 800;
  line-height: 1.15;
}

.updated {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.toc {
  margin: 2rem 0 2.75rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.toc-title {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.toc ol, .toc ul { margin: 0; padding-left: 1.5rem; }
.toc li { break-inside: avoid; }
.toc li::marker { color: var(--red-text); font-weight: 700; }
.toc a {
  display: block;
  padding-block: 0.3rem;
  color: var(--text);
  text-decoration: none;
}
.toc a:hover { color: var(--red-text); text-decoration: underline; }
@media (min-width: 700px) {
  .toc ol, .toc ul { columns: 2; column-gap: 2.5rem; }
}

.legal-body { color: var(--text); line-height: 1.7; }
.legal-body [id] { scroll-margin-top: 1.5rem; }
.legal-body section + section { margin-top: 2.75rem; }

.legal-body h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  font-weight: 750;
  line-height: 1.25;
}
.legal-body h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.legal-body p,
.legal-body ul,
.legal-body ol,
.legal-body dl,
.legal-body address,
.legal-body blockquote { margin: 0 0 1rem; }
.legal-body section > :last-child,
.legal-body > :last-child { margin-bottom: 0; }

.legal-body ul, .legal-body ol { padding-left: 1.375rem; }
.legal-body li + li { margin-top: 0.4rem; }
.legal-body li > ul, .legal-body li > ol { margin: 0.4rem 0 0; }
.legal-body li::marker { color: var(--red-text); }
.legal-body strong { font-weight: 650; }
.legal-body address { font-style: normal; }
.legal-body a { overflow-wrap: anywhere; }
.legal-body dt { font-weight: 650; }
.legal-body dd { margin: 0 0 0.75rem; }

.legal-body table {
  width: 100%;
  margin: 1.25rem 0 1.5rem;
  border: 1px solid var(--border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.legal-body caption {
  padding-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: left;
}
.legal-body th,
.legal-body td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
}
.legal-body td,
.legal-body tbody th { border-top: 1px solid var(--border); }
.legal-body tbody th { font-weight: 650; }
.legal-body thead th,
.legal-body tbody:first-child > tr:first-child > th {
  border-top: 0;
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 650;
}
.legal-body tbody:first-child > tr:first-child > td { border-top: 0; }

/* En teléfono la tabla se desplaza dentro de su propia caja en vez de partir
 * palabras a la mitad o empujar la página hacia los lados. */
@media (max-width: 560px) {
  .legal-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.875rem;
  }
  .legal-body th, .legal-body td { min-width: 9rem; padding: 0.625rem 0.75rem; hyphens: auto; }
}

.callout {
  margin-top: 2.5rem;
  padding: 1.125rem 1.25rem;
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--red-tint);
  color: var(--text);
  line-height: 1.65;
}
.legal-body .callout { margin: 1.5rem 0; }
.callout p + p { margin-top: 0.75rem; }
.callout a { color: var(--red-text); }
.callout a:hover { color: var(--red-deep); }

/* ── Movimiento ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
