/**
 * MOD Mallorca — Legal pages
 * Tokens: aligned to Guille's mod.css (--mod-cyan #00e5ff, --mod-gold #c9a84c,
 *         --mod-gold-light #e8c96a, --mod-white #f0ede8, body bg #04141b)
 */

:root {
  --l-s2: 8px;  --l-s3: 12px; --l-s4: 16px; --l-s5: 20px;
  --l-s6: 24px; --l-s8: 32px; --l-s10: 40px; --l-s12: 48px; --l-s16: 64px;
  --l-r: 14px;
}

/* ── HERO ──────────────────────────────────────────────────── */
.legal-hero {
  /* Sin fondo ni filete propios (20-09-2026): se ve el agua de la portada
     de forma continua, sin la banda tintada que marcaba el cambio. */
  background: none;
  border-bottom: 0;
  padding: var(--l-s16) var(--l-s8) var(--l-s10);
  text-align: center;
}
.legal-hero__tag {
  display: inline-block;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: #00e5ff;
  border: 1px solid rgba(0,229,255,0.35); border-radius: 999px;
  padding: var(--l-s2) var(--l-s4); margin-bottom: var(--l-s5);
}
.legal-hero__tag--gold {
  color: #e8c96a;
  border-color: rgba(232,201,106,0.35);
}
.legal-hero__title {
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.06em; color: #f0ede8; line-height: 1.1; margin-bottom: var(--l-s4);
}
.legal-hero__subtitle { font-size: 0.9rem; color: rgba(255,255,255,0.45); }

/* ── CONTENT WRAPPER ───────────────────────────────────────── */
.legal-wrap { max-width: 1000px; margin: 0 auto; padding: var(--l-s12) var(--l-s8) var(--l-s16); }

/* ── ÍNDICE (reglamento) ───────────────────────────────────────
   Lista numerada y navegable de las 11 secciones — solo en escritorio
   (en móvil se oculta: con el scroll directo del reglamento no aporta y
   11 enlaces no caben con comodidad en una columna estrecha). Ver
   mod_reglamento_toc() en page-reglamento.php. */
.legal-toc { display: none; }
@media (min-width: 900px) {
  .legal-toc {
    display: block;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--l-r);
    padding: var(--l-s6) var(--l-s8);
    margin: var(--l-s6) 0 var(--l-s10);
  }
}
.legal-toc__heading {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.28em;
  text-transform: uppercase; color: #c9a84c; margin-bottom: var(--l-s4);
}
.legal-toc__list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 var(--l-s8);
  list-style: none; padding: 0; margin: 0;
}
.legal-toc__list li { margin: 0; }
.legal-toc__list a {
  display: flex; align-items: baseline; gap: var(--l-s3);
  padding: var(--l-s2) 0; color: rgba(255,255,255,0.72);
  text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color .15s ease;
}
.legal-toc__list li:last-child a { border-bottom: none; }
.legal-toc__list a:hover,
.legal-toc__list a:focus-visible { color: #00e5ff; }
.legal-toc__num {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  color: #00e5ff; min-width: 1.6em;
}
.legal-toc__title { font-size: 0.85rem; }

/* ── ÍNDICE FLOTANTE / HAMBURGUESA (solo page-reglamento.php) ──────
   Mientras el .legal-toc está en su posición normal dentro del flujo
   se comporta como arriba (bloque de 2 columnas). En cuanto el usuario
   hace scroll y deja de estar visible, el JS inline al final de
   page-reglamento.php le añade la clase .legal-toc--floating (lo
   convierte, sin clonarlo, en un panel fijo colapsado) y muestra el
   botón .legal-toc-toggle (creado por ese mismo script) pegado al
   lateral izquierdo. Ambas piezas son exclusivas de esa plantilla — no
   afectan a privacidad/aviso-legal/terminos/cookies, que comparten este
   fichero pero nunca imprimen un .legal-toc.
   20-09-2026: el modo flotante/hamburguesa funciona TAMBIÉN en móvil
   (<900px). Ahí el índice sigue oculto en su sitio del flujo (display:none
   de arriba), pero en cuanto el centinela sale de pantalla el JS le pone
   .legal-toc--floating (que fuerza display:block) y aparece el botón. Al
   flotar, el JS mueve el nodo a <body>: dentro de .legal-intro-card
   (backdrop-filter) un position:fixed se posicionaba respecto a la tarjeta. */
.legal-toc-toggle {
  display: none;
  position: fixed;
  left: 12px;
  top: 50%;
  z-index: 45;
  width: 46px; height: 46px;
  align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(4,20,27,0.92);
  box-shadow: 0 8px 22px rgba(0,0,0,0.4);
  cursor: pointer;
  padding: 0;
  transform: translateY(-50%);
  transition: border-color .15s ease, opacity .18s ease;
}
.legal-toc-toggle__bar,
.legal-toc-toggle__bar::before,
.legal-toc-toggle__bar::after {
  content: ''; display: block;
  width: 18px; height: 2px; border-radius: 2px;
  background: #f0ede8;
  transition: transform .2s ease, opacity .2s ease, top .2s ease;
}
.legal-toc-toggle__bar { position: relative; }
.legal-toc-toggle__bar::before { position: absolute; top: -6px; left: 0; }
.legal-toc-toggle__bar::after { position: absolute; top: 6px; left: 0; }
.legal-toc-toggle[aria-expanded="true"] .legal-toc-toggle__bar { background: transparent; }
.legal-toc-toggle[aria-expanded="true"] .legal-toc-toggle__bar::before { top: 0; transform: rotate(45deg); }
.legal-toc-toggle[aria-expanded="true"] .legal-toc-toggle__bar::after { top: 0; transform: rotate(-45deg); }
.legal-toc-toggle:hover,
.legal-toc-toggle:focus-visible { border-color: rgba(0,229,255,0.45); }

.legal-toc-toggle.is-visible { display: flex; }

.legal-toc--floating {
  display: block; /* también <900px, donde el índice en flujo va oculto */
  position: fixed;
  left: 70px; /* a la derecha del botón hamburguesa/cruz (left: 12px), que así no pisa el texto */
  top: 50%;
  z-index: 44;
  width: min(320px, calc(100vw - 82px));
  max-height: 72vh;
  overflow-y: auto;
  scrollbar-width: none; /* sigue haciendo scroll con la rueda/gesto */
  margin: 0;
  padding: var(--l-s6) var(--l-s8);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--l-r);
  /* Fondo opaco: al ir junto a la columna de texto, el panel no puede
     dejar ver el reglamento a través */
  background: rgba(4, 20, 27, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(calc(-50% + 62px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  box-shadow: 0 16px 36px rgba(0,0,0,0.5);
}
.legal-toc--floating::-webkit-scrollbar { display: none; }
.legal-toc--floating.is-open {
  opacity: 1;
  pointer-events: auto;
}
.legal-toc--floating .legal-toc__list { grid-template-columns: 1fr; }

/* ── SECTIONS ──────────────────────────────────────────────── */
.legal-section {
  scroll-margin-top: var(--nav-h, 94px);
  margin-bottom: var(--l-s12);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: var(--l-s10);
}
.legal-section:last-child { border-bottom: none; }
.legal-section__num {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: #00e5ff; margin-bottom: var(--l-s3);
}
.legal-section__title {
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  letter-spacing: 0.05em; color: #f0ede8; margin-bottom: var(--l-s5);
}
.legal-section p { font-size: 0.9rem; color: rgba(255,255,255,0.72); margin-bottom: var(--l-s4); }
.legal-section ul,
.legal-section ol { font-size: 0.9rem; color: rgba(255,255,255,0.72); padding-left: var(--l-s6); margin-bottom: var(--l-s4); }
/* El preflight de Tailwind pone list-style:none en todo ul/ol del tema, así
   que sin esto los <li> quedan sin ninguna grafía delante pese al
   padding-left reservado arriba. Se reinstaura el marcador y se colorea solo
   el punto (no el texto) en el azul corporativo (--mod-cyan). */
.legal-section ul { list-style: disc; }
.legal-section ol { list-style: decimal; }
.legal-section li { margin-bottom: var(--l-s2); }
.legal-section li::marker { color: #00e5ff; }
.legal-section strong { color: rgba(255,255,255,0.92); }
.legal-section a { color: #00e5ff; text-decoration: underline; word-break: break-word; }
.legal-section a:hover { color: #00b8cc; }
/* Los enlaces <a> que además son botones (.mod-btn, p. ej. "Descargar PDF"
   o las autorizaciones de sección 09) NO deben heredar el estilo de enlace
   de texto de arriba (cian subrayado): ".legal-section a" tiene más
   especificidad que ".mod-btn-gold" sola (mod.css), así que sin esto el
   texto del botón queda en cian e ilegible sobre el fondo dorado. Se
   restauran aquí los mismos colores que usan esos botones en el resto del
   sitio (mod.css) para que se vean idénticos aunque técnicamente sean <a>. */
.legal-section a.mod-btn,
.legal-section a.mod-btn:hover { text-decoration: none; }
.legal-section a.mod-btn-gold,
.legal-section a.mod-btn-gold:hover { color: var(--mod-black); }
.legal-section a.mod-btn-red,
.legal-section a.mod-btn-red:hover { color: var(--mod-white); }
.legal-section a.mod-btn-ghost,
.legal-section a.mod-btn-ghost:hover { color: var(--mod-white); }
.legal-section h3 { font-size: 0.95rem; color: #f0ede8; margin: var(--l-s5) 0 var(--l-s3); letter-spacing: 0.04em; }

/* ── REGLAMENTO — escala tipográfica propia (más grande, más compacta) ──
   Sólo se aplica dentro de .legal-wrap--reglamento (page-reglamento.php),
   nunca al resto de páginas legales (privacidad/aviso-legal/terminos/
   cookies), que siguen usando los tamaños/line-height por defecto de
   arriba. Ver .claude/skills/publicar/prompt-reglamento-mod.md §0. */
.legal-wrap--reglamento {
  --l-title-size: clamp(1.4rem, 3vw, 1.9rem);
  --l-sub-size: 1.05rem;
  --l-body-size: 1rem;
  --l-title-lh: 1.05;
  --l-sub-lh: 1.25;
  --l-body-lh: 1.45;
}
.legal-wrap--reglamento .legal-section__title { font-size: var(--l-title-size); line-height: var(--l-title-lh); }
.legal-wrap--reglamento .legal-section h3 { font-size: var(--l-sub-size); line-height: var(--l-sub-lh); color: #e8c96a; }
.legal-wrap--reglamento .legal-section p,
.legal-wrap--reglamento .legal-section ul,
.legal-wrap--reglamento .legal-section ol { font-size: var(--l-body-size); line-height: var(--l-body-lh); }

/* ── INSCRIPCIONES — título de sección con suelo más alto en móvil ──
   Sólo se aplica dentro de .legal-wrap--inscripciones (page-inscripciones.php).
   El clamp() por defecto de .legal-section__title (1.2rem, 2.5vw, 1.6rem) se
   queda pegado a su mínimo en móvil, porque a esos anchos 2.5vw da un valor
   menor que 1.2rem — el resultado se ve más pequeño de lo previsto y no crece
   nada hasta pantallas bastante anchas. Aquí se sube ese suelo. */
.legal-wrap--inscripciones .legal-section__title {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.1;
}

/* Botones dentro de esta página: los CTA son frases completas ("Descargar
   plantilla de participantes (Excel)", "Ver reglamento completo"), no las
   2-3 palabras cortas habituales de .mod-btn — con su mayúsculas + tracking
   de 0.1em (pensado para esas etiquetas cortas) el texto largo se vuelve
   difícil de leer y se aprieta al partirse en dos líneas. Aquí se desactiva
   para que se lea en formato de frase normal. */
.legal-wrap--inscripciones .mod-btn {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.85rem;
  line-height: 1.35;
  white-space: normal;
  text-align: center;
}

/* ── INFO CARD ─────────────────────────────────────────────── */
.info-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--l-r);
  padding: var(--l-s6); margin: var(--l-s5) 0;
  font-size: 0.88rem; color: rgba(255,255,255,0.7); line-height: 1.8;
}
.info-card > strong {
  color: #e8c96a; display: block; margin-bottom: var(--l-s3);
  font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.info-card p { margin-bottom: 4px; font-size: 0.88rem; color: rgba(255,255,255,0.7); }
.info-card p strong { color: rgba(255,255,255,0.92); display: inline; text-transform: none; letter-spacing: normal; font-size: inherit; }

/* ── HIGHLIGHT BOX ─────────────────────────────────────────── */
.highlight-box {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.22);
  border-radius: var(--l-r); padding: var(--l-s5) var(--l-s6); margin: var(--l-s5) 0;
}
.highlight-box p { font-size: 0.88rem; color: rgba(255,255,255,0.7); margin-bottom: 0; }
.highlight-box strong { color: #e8c96a; }

/* ── BANNER BOX ────────────────────────────────────────────── */
.banner-box {
  background: rgba(0,229,255,0.07);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: var(--l-r); padding: var(--l-s5) var(--l-s6); margin: var(--l-s5) 0;
}
.banner-box p { font-size: 0.88rem; color: rgba(255,255,255,0.7); margin-bottom: 0; }

/* ── COOKIE TABLES (.cookie-table-wrap/table.ct) y TABLAS GENÉRICAS (.table-wrap/table.rt) ── */
.cookie-table-wrap,
.table-wrap {
  overflow-x: auto; margin: var(--l-s5) 0;
  border-radius: var(--l-r); border: 1px solid rgba(255,255,255,0.08);
}
table.ct, table.rt { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 0.82rem; }
@media (min-width: 640px) {
  /* Below this width the table must shrink to fit the viewport with no
     horizontal scroll; from here up we restore the original comfortable
     minimum width so desktop/tablet layout is unchanged. */
  table.ct, table.rt { min-width: 560px; table-layout: auto; }
}
table.ct th, table.rt th {
  background: rgba(0,229,255,0.1); color: #00e5ff;
  text-align: left; padding: var(--l-s3) var(--l-s4); font-weight: 600;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 1px solid rgba(0,229,255,0.2);
}
table.ct td, table.rt td {
  padding: var(--l-s3) var(--l-s4); border-bottom: 1px solid rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.65); vertical-align: top;
  overflow-wrap: break-word; word-break: break-word;
}
table.ct tr:last-child td, table.rt tr:last-child td { border-bottom: none; }
table.ct td:first-child { font-family: monospace; font-size: 0.8rem; color: #e8c96a; white-space: nowrap; }
table.rt td strong, table.rt th strong { color: rgba(255,255,255,0.92); }
.badge-type { display: inline-block; font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.05em; }
.badge-type--tecnica  { background: rgba(0,229,255,0.15); color: #00e5ff; }
.badge-type--analitica { background: rgba(201,168,76,0.15); color: #e8c96a; }
.badge-type--marketing { background: rgba(231,76,60,0.15); color: #f1948a; }


/* ── CATEGORY GRID (terminos) ──────────────────────────────── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--l-s4); margin: var(--l-s5) 0; }
.cat-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); border-radius: var(--l-r); padding: var(--l-s5); }
.cat-card__name { font-family: "Bebas Neue", "Impact", sans-serif; font-size: 1rem; letter-spacing: 0.08em; color: #00e5ff; margin-bottom: var(--l-s2); }
.cat-card__desc { font-size: 0.8rem; color: rgba(255,255,255,0.55); line-height: 1.5; }

/* ── MINI FOOTER ───────────────────────────────────────────── */
.footer-legal {
  background: rgba(0,0,0,0.35);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: var(--l-s8); text-align: center;
}
.footer-legal__copy { font-size: 0.78rem; color: rgba(255,255,255,0.3); margin-bottom: var(--l-s3); }
.footer-legal__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--l-s3) var(--l-s6); }
.footer-legal__links a { font-size: 0.78rem; color: rgba(255,255,255,0.4); text-decoration: none; transition: color 0.2s; }
.footer-legal__links a:hover,
.footer-legal__links a[aria-current="page"] { color: #00e5ff; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .legal-hero { padding: var(--l-s10) var(--l-s4) var(--l-s8); }
  .legal-wrap  { padding: var(--l-s8)  var(--l-s4) var(--l-s12); }
}
@media (max-width: 480px) {
  /* Give dense tables (4-column premios/penalizaciones) a little more
     breathing room per cell so wrapped text stays legible without ever
     needing horizontal scroll on narrow phones. */
  table.ct, table.rt { font-size: 0.76rem; }
  table.ct th, table.rt th,
  table.ct td, table.rt td { padding: var(--l-s2) var(--l-s3); }
}

/* ── INTRO + ÍNDICE EN UN SOLO BLOQUE (page-reglamento.php) ─────────
   .legal-intro-card envuelve el highlight-box de la intro (texto + botón
   PDF) y el .legal-toc: una única tarjeta con un filete entre ambos, en
   vez de dos tarjetas apiladas. Cuando el índice pasa a flotante
   (.legal-toc--floating, position: fixed) recupera su propia tarjeta. */
.legal-intro-card {
  /* Fondo oscuro casi opaco (no el 3% de blanco de las demás tarjetas):
     translúcido dejaba ver el degradado/brillo del fondo y el bloque se veía
     de dos tonos, a petición del cliente tiene que ser homogéneo. */
  background: rgba(4, 20, 27, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--l-r);
  margin: var(--l-s6) 0 var(--l-s10);
}
.legal-intro-card .highlight-box {
  background: none; border: 0; border-radius: 0;
  margin: 0; padding: var(--l-s6) var(--l-s8);
}
/* En la intro, la negrita va del mismo color que el texto (sin el dorado
   genérico de .highlight-box strong), a petición del cliente. */
.legal-intro-card .highlight-box strong { color: inherit; }
@media (min-width: 900px) {
  .legal-intro-card .legal-toc:not(.legal-toc--floating) {
    background: none; border: 0; border-radius: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 0;
  }
  /* (Los estilos del panel flotante viven arriba, en .legal-toc--floating,
     fuera de este @media: desde 20-09-2026 también aplican en móvil.) */
}
/* ── REGLAMENTO EN TARJETAS (solo .legal-wrap--reglamento) ────────
   Cada sección es una tarjeta con su número grande en dorado como
   marca de agua arriba a la derecha; el índice flotante resalta la
   sección que se está leyendo (.is-current, scrollspy en el script
   inline de page-reglamento.php). */
.legal-wrap--reglamento .legal-section {
  position: relative;
  background: rgba(4, 20, 27, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--l-r);
  padding: var(--l-s8);
  margin-bottom: var(--l-s6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.legal-wrap--reglamento .legal-section:last-child { border-bottom: 1px solid rgba(255,255,255,0.08); }
.legal-wrap--reglamento .legal-section__num {
  position: absolute;
  top: var(--l-s4);
  right: var(--l-s6);
  margin: 0;
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: rgba(201, 168, 76, 0.28);
  pointer-events: none;
}
.legal-wrap--reglamento .legal-section__title { padding-right: 4.5rem; }
@media (max-width: 640px) {
  .legal-wrap--reglamento .legal-section { padding: var(--l-s6) var(--l-s5); }
  .legal-wrap--reglamento .legal-section__num { top: var(--l-s3); right: var(--l-s4); font-size: 2.2rem; }
  .legal-wrap--reglamento .legal-section__title { padding-right: 3rem; }
}
.legal-toc__list a.is-current { color: #ffffff; }
.legal-toc__list a.is-current .legal-toc__num { color: #c9a84c; }