/*
Theme Name: Sorteo Live Theme
Theme URI: https://example.com/sorteo-live-theme
Description: Tema ligero, mobile-first y con modo oscuro para sitios de herramientas (pensado para el plugin Sorteo Live). Espacios de anuncios para AdSense y Adsterra en el Personalizador, ads.txt, selector de idioma y cero dependencias externas.
Version: 1.2.0
Requires at least: 5.8
Requires PHP: 7.4
Author: Sorteo Live
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sorteo-live-theme
Tags: one-column, custom-logo, custom-menu, dark-mode, accessibility-ready
*/

:root {
  --bg: #f4f5fb; --bg2: #ffffff; --txt: #161a33; --muted: #5d6287; --line: rgba(20,24,60,.1);
  --accent: #8b5cf6; --accent2: #22d3ee; --radius: 14px; --wrap: 1180px;
}
html[data-theme="dark"] { --bg: #0b0d17; --bg2: #121528; --txt: #eef0ff; --muted: #9aa0c3; --line: rgba(255,255,255,.09); }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
.slt-skip { position: absolute; left: -9999px; top: 0; }
.slt-skip:focus { left: 8px; top: 8px; z-index: 1000; background: var(--bg2); padding: 8px 12px; border-radius: 8px; }
.slt-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 14px; }

/* Cabecera */
.slt-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg2) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.slt-header .slt-wrap { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.slt-brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 19px; color: var(--txt); text-decoration: none; letter-spacing: -.02em; margin-right: auto; min-width: 0; }
.slt-brand img { max-height: 36px; width: auto; }
.slt-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slt-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.slt-nav a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--txt); text-decoration: none; font-weight: 600; font-size: 15px; }
.slt-nav a:hover, .slt-nav .current-menu-item > a { background: rgba(139,92,246,.14); }
.slt-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: transparent; color: var(--txt); border: 1px solid var(--line); font-size: 18px; cursor: pointer; }
.slt-menu-btn { display: none; }
.slt-ico-moon { display: none; }
html[data-theme="dark"] .slt-ico-sun { display: none; }
html[data-theme="dark"] .slt-ico-moon { display: block; }
.slt-langs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.slt-langs a, .slt-langs span { display: block; padding: 4px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 800; text-decoration: none; color: var(--muted); }
.slt-langs .is-current { background: var(--accent); color: #fff; }

/* Contenido */
.slt-main { padding: 14px 0 28px; min-height: 60vh; }
.slt-title { font-size: clamp(22px, 3.4vw, 32px); line-height: 1.2; margin: 6px 0 14px; letter-spacing: -.02em; }
.slt-content > *:first-child { margin-top: 0; }
.slt-content h2 { font-size: 1.3em; }
.slt-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.slt-list li { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.slt-list h2 { margin: 0 0 4px; font-size: 1.15em; }
.slt-list a { color: var(--txt); text-decoration: none; }
.slt-pager { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.slt-pager a, .slt-pager span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }

/* Anuncios */
.slt-ad { margin: 32px auto; text-align: center; max-width: var(--wrap); padding: 0 14px; overflow: hidden; }
.slt-ad:empty { display: none; }
.slt-ad[data-label]::before { content: attr(data-label); display: block; font: 600 11px/1.6 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; opacity: .55; margin-bottom: 4px; }
.slt-sticky-ad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--bg2); border-top: 1px solid var(--line); text-align: center; padding: 4px 36px 4px 4px; max-height: 120px; overflow: hidden; }
.slt-sticky-ad button { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--txt); cursor: pointer; line-height: 1; }
body.has-sticky-ad { padding-bottom: 110px; }

/* Pie */
.slt-footer { border-top: 1px solid var(--line); background: var(--bg2); padding: 18px 0; font-size: 14px; color: var(--muted); }
.slt-footer .slt-wrap { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.slt-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.slt-footer a { color: var(--muted); }

@media (max-width: 760px) {
  .slt-menu-btn { display: grid; }
  .slt-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg2); border-bottom: 1px solid var(--line); display: none; }
  .slt-nav.is-open { display: block; }
  .slt-nav ul { flex-direction: column; padding: 8px 14px 14px; }
  .slt-main { padding-top: 8px; }
  .slt-wrap { padding: 0 10px; }
}
@media (max-width: 420px) { .slt-langs a, .slt-langs span { padding: 4px 7px; } }

/* ===== Páginas de sorteo a pantalla completa: solo el título arriba y la app ocupa el resto ===== */
.slt-htitle { flex: 1 1 auto; min-width: 0; margin: 0; font-size: clamp(14px, 1.7vw, 19px); font-weight: 800; line-height: 1.2; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
body.slv-fullpage .slt-header .slt-wrap { max-width: none; min-height: 50px; padding: 0 14px; }
body.slv-fullpage .slt-brand { flex: 0 1 auto; max-width: 34%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body.slv-fullpage .slt-nav { flex: 0 0 auto; }
body.slv-fullpage .slt-main { padding: 0 0 28px; }
body.slv-fullpage .slt-main > .slt-wrap { max-width: none; padding: 0; }
body.slv-fullpage .slt-content > *:not(.sorteo-live) { max-width: var(--wrap); margin-left: auto; margin-right: auto; padding-left: 14px; padding-right: 14px; }
body.slv-fullpage .slt-content > .sorteo-live { margin-top: 0; }
body.slv-fullpage { overflow-x: clip; }
@media (max-width: 600px) {
  body.slv-fullpage .slt-brand { display: none; }
  body.slv-fullpage .slt-htitle { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 1.25; }
  body.slv-fullpage .slt-header .slt-wrap { min-height: 46px; padding: 0 8px; gap: 8px; }
}
