/*
Theme Name: Gamenews
Theme URI: https://gamenews.es
Author: Gamenews
Description: Tema ligero y propio para gamenews.es. Diseño tipo revista, modo oscuro por defecto, sin constructores ni jQuery.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: gamenews
*/

/* ---------- Tokens ---------- */
:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --border: #2a2a2a;
  --text: #d6d2ca;
  --heading: #f2efe9;
  --muted: #8f8b83;
  --accent: #ff206e;       /* rosa Gamenews */
  --accent-ink: #ffffff;
  --link: #ff5c93;
  --accent-2: #41ead4;     /* turquesa */
  --highlight: #fdd247;    /* amarillo */
  --radius: 10px;
  --maxw: 1240px;
  --gap: 24px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-head: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f5f4f2;
  --surface-2: #ebe9e6;
  --border: #e2dfda;
  --text: #2b2a28;
  --heading: #0c0f0a;
  --muted: #6b6760;
  --link: #d6104f;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); }
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--heading); line-height: 1.2; margin: 0 0 .5em; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; background: var(--accent); color: #fff; padding: 8px 14px; clip: auto; width: auto; height: auto; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- Cabecera ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; font-size: 13px; color: var(--muted); }
.topbar-date { text-transform: capitalize; }
.tools { display: flex; gap: 6px; }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--text); width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-sun { display: none; }
:root[data-theme="light"] .ico-sun { display: block; }
:root[data-theme="light"] .ico-moon { display: none; }

.brand { text-align: center; padding-top: 10px; padding-bottom: 18px; }
.brand a { display: inline-block; }
.brand img { height: 64px; width: auto; display: block; }
/* Logo propio con variante oscura (negro → claro, el rosa se conserva exacto). */
.brand .logo-dark { display: none; }
:root:not([data-theme="light"]) .brand .logo-dark { display: block; }
:root:not([data-theme="light"]) .brand .logo-light.has-dark { display: none; }
.brand-text { font: 800 34px/1 var(--font-head); color: var(--heading); }
.brand-text span { color: var(--accent); }
.tagline { margin: 4px 0 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.primary-nav { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 50; }
.primary-nav .container { display: flex; align-items: center; justify-content: center; }
/* ---------- Detalles gaming (sutiles) ---------- */
/* Línea neón bajo el menú */
.primary-nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--highlight), var(--accent)); background-size: 300% 100%; opacity: .9; animation: gn-neon 14s linear infinite; pointer-events: none; }
@keyframes gn-neon { to { background-position: -300% 0; } }
/* Etiquetas con esquinas cortadas, estilo interfaz de juego */
.badge { border-radius: 0; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px)); padding: 5px 10px; }
/* Brillo neón al pasar sobre las tarjetas */
.card--overlay, .card .thumb { transition: box-shadow .25s; }
.card--overlay:hover, .card:not(.card--overlay):hover .thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 24px -6px rgba(255, 32, 110, .6); }
:root[data-theme="light"] .card--overlay:hover, :root[data-theme="light"] .card:not(.card--overlay):hover .thumb { box-shadow: 0 0 0 1px var(--accent), 0 6px 20px -8px rgba(214, 16, 79, .45); }
/* Barra de progreso de lectura (entradas) */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-2)); pointer-events: none; }

.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.menu li { position: relative; }
.menu a { display: block; padding: 14px 14px; color: var(--heading); font: 700 13px/1 var(--font-head); text-transform: uppercase; letter-spacing: .05em; }
.menu a:hover, .menu .current-menu-item > a, .menu .current-menu-ancestor > a { color: var(--accent); text-decoration: none; }
.menu .sub-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 220px; list-style: none; margin: 0; padding: 6px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); z-index: 60; }
.menu li:hover > .sub-menu, .menu li:focus-within > .sub-menu { display: block; }
.menu .sub-menu a { padding: 10px 16px; text-transform: none; font-weight: 600; letter-spacing: 0; }
.menu-toggle { display: none; margin: 8px 0; }

.search-panel { display: none; border-bottom: 1px solid var(--border); background: var(--surface); padding: 14px 0; }
.search-panel.open { display: block; }
.search-form { display: flex; gap: 8px; }
.search-form input[type=search] { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px 14px; font: inherit; }
.btn, .search-form button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 10px 18px; font-weight: 700; }
.btn:hover { text-decoration: none; filter: brightness(1.1); }

/* ---------- Publicidad (AdSense) ---------- */
.ad-slot { margin: 24px auto; text-align: center; overflow: hidden; }
.ad-slot .ad-label { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad-slot--header { min-height: 110px; max-width: 970px; }
.ad-slot--inline { min-height: 110px; }
.ad-slot--sidebar { min-height: 270px; }
.ad-slot--single { min-height: 280px; }
.ad-slot--content1, .ad-slot--content2 { min-height: 280px; margin: 28px auto; clear: both; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; } /* sin anuncio: no dejar hueco vacío */
.ad-slot.is-placeholder { border: 1px dashed var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }

/* ---------- Tarjetas ---------- */
.badge { display: inline-block; background: var(--accent); color: var(--accent-ink); font: 700 11px/1 var(--font-head); text-transform: uppercase; letter-spacing: .06em; padding: 5px 8px; border-radius: 4px; }
.badge:hover { text-decoration: none; filter: brightness(1.1); }
.meta { font-size: 12.5px; color: var(--muted); }
.thumb { display: block; position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius); aspect-ratio: 16/10; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.thumb:hover img { transform: scale(1.04); }
.thumb--empty { background: linear-gradient(135deg, var(--surface-2), var(--surface)); }

.card .thumb { margin-bottom: 12px; }
.card .badge { position: absolute; left: 10px; top: 10px; z-index: 2; }
.card-title { font-size: 18px; margin: 0 0 6px; }
.card-title a { color: var(--heading); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { font-size: 14.5px; color: var(--muted); margin: 6px 0 0; }

.card--overlay { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); min-height: 200px; }
.card--overlay .thumb { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; margin: 0; height: 100%; }
.card--overlay::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.35) 50%, rgba(0,0,0,0) 80%); pointer-events: none; }
.card--overlay .card-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; z-index: 3; }
.card--overlay .badge { position: static; margin-bottom: 8px; }
.card--overlay .card-title a { color: #fff; }
.card--overlay .meta { color: #cfcbc3; }
.card--overlay.is-big { min-height: 420px; }
.card--overlay.is-big .card-title { font-size: 30px; }
.card--overlay.is-small { min-height: 180px; }
.card--overlay.is-small .card-title { font-size: 15px; }
.card--overlay.is-small .card-body { padding: 12px; }

.card--list { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.card--list:last-child { border-bottom: 0; }
.card--list .thumb { margin: 0; aspect-ratio: 1; border-radius: 8px; }
.card--list .card-title { font-size: 15px; margin: 0 0 4px; }
.card--list .badge { display: none; }
.list-cat { font: 700 11px/1 var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 4px; display: block; }

/* ---------- Secciones ---------- */
.section { margin: 36px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--border); margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 20px; text-transform: uppercase; letter-spacing: .04em; padding-bottom: 8px; border-bottom: 3px solid var(--accent); margin-bottom: -2px; }
.section-head a { font-size: 13px; font-weight: 700; }

.hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); margin-top: 24px; }
.hero-main { display: grid; gap: var(--gap); align-content: start; }
.hero-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.panel > h2, .panel .widget-title { font-size: 16px; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 3px solid var(--accent); display: inline-block; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; }
/* Portada: separar el bloque principal + sidebar del hero (antes la sidebar quedaba pegada). */
.hero ~ .cols { margin-top: 36px; }
/* En entradas y páginas la sidebar alinea con el título, sin quedar pegada al menú. */
body.single .cols > .sidebar, body.page:not(.home) .cols > .sidebar { margin-top: 28px; }
.hero ~ .cols > div > .section:first-child { margin-top: 0; }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.latest { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.latest .card--overlay.is-big { min-height: 100%; }
.latest-side { padding-top: 6px; padding-bottom: 6px; }
.card { position: relative; }

.sidebar .panel, .sidebar .widget { margin-bottom: var(--gap); }
.sidebar .widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.sidebar li:last-child { border-bottom: 0; }
.sticky-side { position: sticky; top: 64px; }

/* ---------- Entrada ---------- */
.entry-header { margin: 28px 0 18px; }
.entry-header h1 { font-size: clamp(28px, 4vw, 42px); margin: 10px 0; }
.entry-meta { font-size: 13.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.entry-thumb { margin: 0 0 22px; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { width: 100%; display: block; }
.entry-content { font-size: 17.5px; line-height: 1.75; }
.entry-content > * { max-width: 100%; }
.entry-content h2 { font-size: 28px; margin-top: 1.6em; }
.entry-content h3 { font-size: 22px; margin-top: 1.4em; }
.entry-content img { border-radius: 8px; }
.entry-content blockquote { margin: 1.5em 0; padding: 4px 20px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; }
.entry-content table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 8px 12px; }
.entry-content pre { background: var(--surface); padding: 14px; border-radius: 8px; overflow-x: auto; }
.alignwide, .alignfull { max-width: 100%; }
.tags { margin: 28px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; font-size: 13px; color: var(--text); }
.tags a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin: 32px 0; }
.post-nav a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--heading); font-weight: 600; }
.post-nav .next { text-align: right; }
.post-nav small { display: block; color: var(--muted); font-weight: 400; margin-bottom: 4px; }

.archive-head { margin: 28px 0 8px; }
.archive-head h1 { font-size: 32px; }
.archive-head p { color: var(--muted); max-width: 70ch; }

.pagination { margin: 36px 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }

/* ---------- Pie ---------- */
.site-footer { margin-top: 56px; border-top: 3px solid var(--accent); background: var(--surface); padding: 32px 0 20px; font-size: 14px; }
.footer-top { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-menu a { color: var(--text); }
.footer-menu a:hover { color: var(--accent); }
.copyright { margin-top: 20px; color: var(--muted); font-size: 13px; }
.notfound { text-align: center; padding: 80px 0; }
.notfound h1 { font-size: 80px; color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero, .cols { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .sticky-side { position: static; }
}
@media (max-width: 782px) {
  .menu-toggle { display: inline-flex; }
  .primary-nav .container { flex-wrap: wrap; justify-content: space-between; }
  .menu { display: none; width: 100%; flex-direction: column; padding-bottom: 10px; }
  .menu.open { display: flex; }
  .menu .sub-menu { display: block; position: static; border: 0; background: transparent; padding-left: 14px; }
  .hero-row, .grid-3, .grid-2, .latest { grid-template-columns: 1fr; }
  .latest .card--overlay.is-big { min-height: 300px; }
  .card--overlay.is-big { min-height: 300px; }
  .card--overlay.is-big .card-title { font-size: 24px; }
  .grid-4 { grid-template-columns: 1fr; }
  .brand img { height: 48px; }
  .post-nav { grid-template-columns: 1fr; }
  .entry-content { font-size: 17px; }
}
/* ---------- Formularios (Contact Form 7 y similares) ---------- */
.entry-content input[type=text], .entry-content input[type=email], .entry-content input[type=tel], .entry-content input[type=url], .entry-content select, .entry-content textarea { width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px 12px; font: inherit; }
.entry-content input:focus, .entry-content textarea:focus, .entry-content select:focus, .search-form input:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgba(255, 32, 110, .25); }
.entry-content input[type=submit], .entry-content button[type=submit], .wp-block-button__link { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 11px 22px; font-weight: 700; cursor: pointer; }
.entry-content input[type=submit]:hover { filter: brightness(1.1); }
.wpcf7 label { display: block; margin-bottom: 14px; font-weight: 600; }
.wpcf7-not-valid-tip { color: var(--accent); font-size: 13px; font-weight: 400; }
.wpcf7-response-output { border: 1px solid var(--border) !important; border-radius: 8px; padding: 10px 14px !important; }

@media (prefers-reduced-motion: reduce) { .primary-nav::after { animation: none; } * { transition: none !important; scroll-behavior: auto !important; } }
