/*
Theme Name: Zonalut
Theme URI: https://zonalut.com/
Author: Zonalut
Description: Tema de noticias y guías de videojuegos para Zonalut. Basado en el diseño del tema Veloz (ADX Group, GPLv2+): tarjetas en 3 columnas, modo oscuro, traductor, zonas preparadas para AdSense.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zonalut
*/

/* ---------- Colores (claro / oscuro). Acento, ancho y letra: Personalizar. ---------- */
:root {
  --bg: #ffffff;
  --soft: #f2f3f5;
  --text: #1b1d20;
  --muted: #62666c;
  --border: #e5e7eb;
  --accent: #d32f2f;
  --accent-text: #ffffff;
  --max: 1180px;
  --read: 820px;
  --wide: 1100px;
  --fs: 18px;
  --cols: 3;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121315;
  --soft: #1f2124;
  --text: #e8eaed;
  --muted: #a0a4a9;
  --border: #2c2f33;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* touch-action: el doble toque ya no amplia la pagina en Safari/iPhone
   (el gesto de pellizcar para ampliar sigue funcionando, por accesibilidad). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
/* Safari amplia la pagina al tocar un campo con letra menor de 16px: en movil
   todos los campos de texto van a 16px. */
@media (max-width: 860px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea { font-size: 16px !important; }
}
body {
  margin: 0; background: var(--bg); color: var(--text); overflow-x: clip;
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-wrap: break-word;
}
img, video { max-width: 100%; height: auto; }
iframe { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.5em 0 .5em; }
h1 { font-size: clamp(27px, 4.6vw, 38px); margin-top: 0; }
h2 { font-size: clamp(22px, 3.4vw, 28px); }
h3 { font-size: 21px; }
h4 { font-size: 18px; }
[hidden] { display: none !important; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; z-index: 999; top: 8px; left: 8px;
  padding: 10px 16px; background: var(--bg); color: var(--text);
}
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Cabecera ---------- */
/* Cabecera: se queda arriba de la pagina (por defecto), fija o "inteligente"
   segun Personalizar > Cabecera. */
.site-header {
  position: relative; z-index: 50;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.header-sticky .site-header, .header-smart .site-header { position: sticky; top: 0; }
.header-smart .site-header { transition: transform .25s ease; }
.header-hidden .site-header { transform: translateY(-100%); }
/* Con la barra de administracion, solo la cabecera fija se baja 32px
   (en la estatica, "top" la desplazaba encima del contenido). */
.admin-bar.header-sticky .site-header, .admin-bar.header-smart .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar.header-sticky .site-header, .admin-bar.header-smart .site-header { top: 0; } }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 62px; }
.site-title { margin: 0; font-size: 22px; font-weight: 800; line-height: 1; }
.site-title a { color: var(--text); text-decoration: none; }
/* Logotipo de texto (cuando no hay imagen): inicial en recuadro + nombre. */
.brand-text { min-width: 0; }
.brand-text a { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; }
.brand-mark {
  display: grid; place-items: center; flex: 0 0 auto; width: 1.55em; height: 1.55em;
  border-radius: .38em; background: var(--accent); color: var(--accent-text);
  font-size: 1em; font-weight: 800; line-height: 1; letter-spacing: 0;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 18%);
}
.brand-name {
  font-weight: 800; letter-spacing: -.025em; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-title.brand-text { font-size: 23px; }
@media (max-width: 480px) { .site-title.brand-text { font-size: 20px; } }
.custom-logo { display: block; max-height: 46px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; gap: 2px; }
.main-nav li { position: relative; }
.main-nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none;
}
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-cat > a { color: var(--accent); }
/* Flecha en los elementos con submenu (se abre al pasar el raton). */
.main-nav li:has(> ul) > a { display: flex; align-items: center; gap: 6px; }
.main-nav li:has(> ul) > a::after {
  content: ""; width: 7px; height: 7px; margin-top: -4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
  transition: transform .2s;
}
.main-nav li:has(> ul):hover > a::after { transform: rotate(225deg); margin-top: 3px; }
.main-nav ul ul li:has(> ul) > a::after { transform: rotate(-45deg); margin: 0 0 0 auto; }
/* Submenus (menus, paginas y categorias hijas) */
.main-nav ul ul {
  display: none; position: absolute; top: 100%; left: 0; z-index: 5; min-width: 220px;
  padding: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}
.main-nav ul ul ul { top: -7px; left: 100%; }
.main-nav li:hover > ul, .main-nav li:focus-within > ul { display: block; animation: veloz-in .15s ease-out; }
/* Puente invisible: el submenu no se cierra al bajar el raton. */
.main-nav > ul > li > ul::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
@keyframes veloz-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.main-nav ul ul a { font-weight: 500; }
.sub-toggle { display: none; }

.header-actions { display: flex; gap: 8px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto;
  border: 0; border-radius: 50%; background: var(--soft); color: var(--text); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }
.menu-toggle .i-close, .menu-toggle[aria-expanded="true"] .i-open { display: none; }
.menu-toggle[aria-expanded="true"] .i-close { display: block; }
.header-search { display: none; padding: 0 16px 12px; }
.header-search.is-open { display: block; }

/* Herramientas: modo oscuro + idioma */
.nav-tools { display: flex; align-items: center; gap: 8px; }
.tool-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 8px;
  border: 0; border-radius: 99px; background: var(--soft); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.tool-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.tool-label { display: none; }
.i-sun, .t-light { display: none; }
:root[data-theme="dark"] .i-sun, :root[data-theme="dark"] .t-light { display: inline; }
:root[data-theme="dark"] .i-moon, :root[data-theme="dark"] .t-dark { display: none; }
/* Selector de idioma con banderas y buscador */
.lang-dd { position: relative; order: -1; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.lang-btn:hover { background: var(--soft); }
.lang-btn .flag { width: 20px; height: 15px; }
.flag { display: block; width: 24px; height: 18px; flex: 0 0 auto; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgb(0 0 0 / 8%); }
.lang-btn .chev { width: 14px; height: 14px; color: var(--muted); transition: transform .2s; }
.lang-dd.is-open .chev { transform: rotate(180deg); }
.lang-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: 270px;
  padding: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 16%);
}
.lang-search {
  width: 100%; margin-bottom: 6px; padding: 9px 12px; font: inherit; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--soft); color: var(--text);
}
.lang-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.lang-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text);
  font: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.lang-list button:hover, .lang-list button:focus-visible { background: var(--soft); }
.lang-list small { margin-left: auto; color: var(--muted); font-size: 12px; }
.lang-list [aria-selected="true"] button { background: var(--soft); font-weight: 700; }
.lang-empty { margin: 8px; color: var(--muted); font-size: 14px; }

/* Google Translate: ocultar su barra y su resaltado. */
.skiptranslate iframe, .goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame,
.VIpgJd-ZVi9od-ORHb-OEVmcd, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf, .VIpgJd-yAWNEb-L7lbkb { display: none !important; }
body { top: 0 !important; position: static !important; }
.goog-text-highlight, font[style] { background: none !important; box-shadow: none !important; }

/* ---------- Busqueda ---------- */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
  flex: 1; min-width: 0; padding: 10px 14px; font: inherit; font-size: 16px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--soft); color: var(--text);
}
.btn, .search-form button, .comment-form input[type="submit"] {
  display: inline-block; padding: 10px 18px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}

/* ---------- Estructura ---------- */
.site-main { padding: 26px 0 40px; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--muted); }

/* Cabecera de categoria / busqueda (plana) */
.archive-head { margin: 0 0 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.archive-kicker {
  display: block; margin-bottom: 4px; color: var(--accent);
  font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.archive-head h1 { margin: 0 0 6px; }
.archive-desc { color: var(--muted); font-size: 16px; }
.archive-desc p { margin: 0 0 8px; }
.archive-count { color: var(--muted); font-size: 14px; }
.subcats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.subcats a {
  padding: 5px 12px; border-radius: 99px; background: var(--soft);
  color: var(--text); font-size: 14px; font-weight: 600;
}
.cat-chips {
  display: flex; gap: 8px; margin: 0 0 24px; padding-bottom: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.cat-chips::-webkit-scrollbar { display: none; }

/* Presentacion de la portada (Personalizar > Presentación de la portada) */
.home-intro { max-width: 720px; margin: 0 0 24px; }
.home-intro:first-child { margin-top: 12px; }
.home-intro.w-medium { max-width: var(--read); }
.home-intro.w-full { max-width: none; }
.home-intro.is-center { margin-left: auto; margin-right: auto; text-align: center; }
.home-intro.at-after_posts { margin-top: 32px; margin-bottom: 0; }
.home-intro-title { margin: 0 0 8px; font-size: clamp(24px, 4vw, 32px); }
.home-intro-text { color: var(--muted); font-size: 16px; line-height: 1.6; }
.home-intro-extra { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.home-intro-text p, .home-intro-extra p { margin: 0 0 8px; }
.home-intro-text p:last-child, .home-intro-extra p:last-child { margin-bottom: 0; }
.cat-chips a {
  flex: 0 0 auto; padding: 7px 15px; border-radius: 99px; background: var(--soft);
  color: var(--text); font-size: 14px; font-weight: 700; white-space: nowrap; text-decoration: none;
}
.cat-chips a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }

/* ---------- Tarjetas: imagen, categoria, titulo, extracto, leer mas ---------- */
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 34px 26px; }
.card { display: flex; flex-direction: column; }
.card-thumb { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 10px; background: var(--soft); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { display: flex; flex-direction: column; flex: 1; padding-top: 12px; }
.card-cat, .entry-cat {
  align-self: flex-start; display: inline-block; padding: 4px 0; color: var(--accent);
  font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.card-title { margin: 6px 0 8px; font-size: 20px; line-height: 1.3; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { margin: 0 0 10px; color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.card-more { margin-top: auto; font-weight: 700; font-size: 15px; }
.grid > .code-block, .grid > .google-auto-placed, .grid > ins.adsbygoogle { grid-column: 1 / -1; }
/* Portada "primera grande" y "lista grande" (Personalizar > Portada y tarjetas) */
.layout-featured .card:first-child, .layout-list .card {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 40px; align-items: center;
}
.layout-featured .card:first-child .card-body, .layout-list .card .card-body { padding-top: 0; }
.layout-featured .card:first-child .card-title { font-size: clamp(24px, 2.6vw, 34px); }
.layout-list .card-title { font-size: clamp(22px, 2.2vw, 28px); }
.layout-featured .card:first-child .card-excerpt, .layout-list .card-excerpt { font-size: 17px; }
.layout-list { grid-template-columns: 1fr; gap: 44px; }
/* Estilo "recuadro" (opcional en Personalizar) */
.cards-boxed .card { background: var(--soft); border-radius: 12px; overflow: hidden; }
.cards-boxed .card-thumb { border-radius: 0; }
.cards-boxed .card-body { padding: 14px 16px 18px; }

/* Paginacion */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers {
  min-width: 42px; padding: 8px 12px; border-radius: 10px; text-align: center;
  background: var(--soft); color: var(--text); font-weight: 600;
}
.pagination .current { background: var(--accent); color: var(--accent-text); }

/* ---------- Articulo (plano) ---------- */
/* Titulo e imagen ocupan el ancho grande; el texto, el ancho de lectura. */
.article { max-width: var(--wide); margin: 0 auto; }
.article > :not(.entry-header):not(.featured):not(.related):not(.post-hero) { max-width: var(--read); margin-left: auto; margin-right: auto; }
.entry-header { max-width: 900px; margin: 0 auto 24px; text-align: center; }
.entry-header .entry-cat { display: inline-block; margin-bottom: 10px; }
.entry-header h1 { margin: 0; font-size: clamp(28px, 4.8vw, 46px); line-height: 1.18; }
.entry-meta { justify-content: center; margin-top: 12px; color: var(--muted); font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; }
.featured { margin: 0 0 32px; }
.featured img { display: block; width: 100%; max-height: 80vh; object-fit: cover; border-radius: 12px; }
.page .entry-header { text-align: left; max-width: var(--read); }
/* Cabecera del articulo como la portada: imagen izquierda, texto derecha. */
.post-hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 40px; align-items: center; margin: 0 0 36px;
}
.post-hero .featured { margin: 0; }
.post-hero .featured img { max-height: none; aspect-ratio: 3 / 2; }
.post-hero .entry-header { max-width: none; margin: 0; text-align: left; }
.post-hero .entry-header h1 { font-size: clamp(26px, 3vw, 40px); }
.post-hero .entry-meta { justify-content: flex-start; }
.entry-excerpt { margin: 14px 0 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
/* Titulo y, debajo, la imagen al mismo ancho que el texto (sin recortar ni deformar). */
.post-stacked .entry-header, .post-stacked .featured { max-width: var(--read); margin-left: auto; margin-right: auto; }
.post-stacked .entry-header { text-align: left; margin-bottom: 20px; }
.post-stacked .entry-header h1 { font-size: clamp(27px, 4.2vw, 40px); }
.post-stacked .entry-meta { justify-content: flex-start; }
.post-stacked .featured { margin-bottom: 28px; }
.post-stacked .featured img { width: 100%; height: auto; max-height: none; aspect-ratio: auto; object-fit: initial; border-radius: 10px; }
@media (max-width: 760px) {
  .post-hero { display: block; }
  .post-hero .featured { margin-bottom: 18px; }
}
.entry-content { font-size: var(--fs); line-height: 1.75; min-width: 0; overflow-wrap: anywhere; }
/* Nada del articulo puede salirse de la pantalla. */
.entry-content img, .entry-content video, .entry-content embed, .entry-content object,
.entry-content figure, .entry-content .wp-block-image, .entry-content .wp-block-embed,
.entry-content pre, .entry-content .wp-caption { max-width: 100%; }
.entry-content .wp-block-embed iframe, .entry-content > p iframe, .entry-content figure iframe { max-width: 100%; }
.entry-content img, .entry-content video { height: auto; }
.entry-content iframe[src*="youtube"], .entry-content iframe[src*="vimeo"] { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.entry-content pre { overflow-x: auto; white-space: pre-wrap; }
.entry-content :is(img, figure, .wp-caption, table)[style*="width"] { max-width: 100% !important; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p, .entry-content ul, .entry-content ol { margin: 0 0 1.15em; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote {
  margin: 1.5em 0; padding: 12px 18px; border-left: 3px solid var(--border); color: var(--muted);
}
/* Tablas: si no caben, se deslizan de lado dentro de su caja (la pagina no se deforma). */
.table-wrap, .entry-content .wp-block-table {
  width: 100%; max-width: 100%; margin: 0 0 1.4em; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.table-wrap table, .entry-content .wp-block-table table { margin: 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .9em; overflow-wrap: normal; }
.entry-content th, .entry-content td { padding: 9px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; min-width: 90px; }
.entry-content table[style], .entry-content table[width] { width: 100% !important; }
.entry-content th { background: var(--soft); }
.entry-content figure { margin: 1.5em 0; }
.entry-content img { border-radius: 8px; }
.entry-content figcaption { color: var(--muted); font-size: 14px; text-align: center; }
.page-links { margin-top: 20px; font-weight: 700; }

/* ---------- Indice de contenidos ---------- */
.toc { margin: 1.6em 0; font-size: 16px; line-height: 1.5; }
.toc details { background: var(--soft); border-radius: 12px; border: 1px solid var(--border); }
.toc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; cursor: pointer; list-style: none; font-weight: 800; font-size: 17px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc-title { display: flex; align-items: center; gap: 10px; }
.toc-title::before {
  content: ""; width: 18px; height: 14px; flex: 0 0 auto;
  background: linear-gradient(var(--accent) 0 0) 0 0 / 100% 2px no-repeat,
              linear-gradient(var(--accent) 0 0) 0 50% / 70% 2px no-repeat,
              linear-gradient(var(--accent) 0 0) 0 100% / 85% 2px no-repeat;
}
.toc-icon {
  width: 9px; height: 9px; margin-right: 4px; flex: 0 0 auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
.toc details[open] .toc-icon { transform: rotate(225deg) translateY(-3px); }
.toc-list, .toc-list ol { list-style: none; margin: 0; padding: 0; }
.toc-list { padding: 0 18px 16px; counter-reset: toc; }
.toc-list ol { padding-left: 22px; counter-reset: toc-sub; }
.toc-list li { margin: 0; padding: 6px 0; border-top: 1px solid var(--border); }
.toc-list ol li { border-top: 0; padding: 4px 0; }
.toc-list a { color: var(--text); text-decoration: none; font-weight: 600; }
.toc-list ol a { font-weight: 500; color: var(--muted); }
.toc-list a:hover { color: var(--accent); }
.toc-numbered .toc-list > li { counter-increment: toc; }
.toc-numbered .toc-list > li > a::before { content: counter(toc) ". "; color: var(--accent); font-weight: 800; }
.toc-numbered .toc-list ol > li { counter-increment: toc-sub; }
.toc-numbered .toc-list ol > li > a::before { content: counter(toc) "." counter(toc-sub) " "; color: var(--accent); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .toc-icon { transition: none; } }
.entry-content [id] { scroll-margin-top: 20px; }
.header-sticky .entry-content [id], .header-smart .entry-content [id] { scroll-margin-top: 84px; }
.subpages { margin: 24px 0 0; padding: 16px 0 0 20px; border-top: 1px solid var(--border); }
.subpages li { margin-bottom: 6px; }

.author-box {
  display: flex; gap: 16px; align-items: center; margin-top: 30px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.author-box img { border-radius: 50%; flex: 0 0 auto; }
.author-box strong { display: block; font-size: 17px; }
.author-box p { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
.post-nav a {
  display: block; padding: 14px 16px; border-radius: 10px;
  background: var(--soft); color: var(--text); font-weight: 600; font-size: 15px; line-height: 1.4;
}
.post-nav span { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.post-nav .next { text-align: right; }

.related { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--border); }
.related > h2 { margin: 0 0 20px; }
.related .card-title { margin: 0; font-size: 17px; }

/* Comentarios */
.comments { max-width: var(--read); margin: 40px auto 0; padding-top: 24px; border-top: 1px solid var(--border); }
.comment-list { list-style: none; margin: 0 0 20px; padding: 0; }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-meta { font-size: 13px; color: var(--muted); }
/* Formularios (comentarios, contacto: Contact Form 7, WPForms, Formidable,
   Fluent Forms, Ninja Forms, bloques...) con el diseno del tema. */
.entry-content form, .comment-form { max-width: 100%; }
.entry-content label, .comment-form label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.entry-content form p, .entry-content form .wpforms-field, .entry-content form .ff-el-group,
.entry-content form .frm_form_field, .entry-content form .nf-field-container { margin: 0 0 16px; }
.entry-content input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.entry-content select, .entry-content textarea,
.comment-form input:not([type="submit"]):not([type="checkbox"]), .comment-form textarea {
  display: block; width: 100% !important; max-width: 100% !important; box-sizing: border-box;
  padding: 11px 13px; font: inherit; font-size: 16px; line-height: 1.4;
  border: 1px solid var(--border); border-radius: 10px; background: var(--soft); color: var(--text);
}
.entry-content textarea, .comment-form textarea { min-height: 150px; resize: vertical; }
.entry-content input:focus, .entry-content select:focus, .entry-content textarea:focus,
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.entry-content input[type="submit"], .entry-content button[type="submit"], .entry-content .wpcf7-submit,
.entry-content .wpforms-submit, .entry-content .frm_button_submit, .entry-content .ff-btn-submit {
  display: inline-block; width: auto; padding: 12px 22px; border: 0; border-radius: 10px;
  background: var(--accent) !important; color: var(--accent-text) !important;
  font: inherit; font-weight: 700; cursor: pointer;
}
.entry-content input[type="checkbox"], .entry-content input[type="radio"] { width: auto; margin-right: 6px; accent-color: var(--accent); }
.entry-content .wpcf7-form-control-wrap { display: block; }
.entry-content .wpcf7-not-valid-tip, .entry-content .wpforms-error { color: #d32f2f; font-size: 14px; }
.entry-content .wpcf7-response-output { margin: 16px 0 0 !important; padding: 10px 14px !important; border-radius: 10px; }
.entry-content .wpcf7-spinner { vertical-align: middle; }

/* ---------- Widgets ---------- */
.widget-area { margin: 26px 0; }
.widget { margin-bottom: 22px; }
.widget-title { margin: 0 0 12px; font-size: 18px; }
.widget ul { margin: 0; padding-left: 18px; }

/* ---------- Anuncios (AdSense, Ad Manager, Ad Inserter) ----------
   El tema NO toca el tamano de los anuncios: AdSense calcula el ancho y el alto
   de cada anuncio (los adaptables a pantalla completa en movil incluso se salen
   del margen a proposito). Estas reglas deshacen cualquier ajuste general. */
ins.adsbygoogle { display: block; overflow: visible; }
ins.adsbygoogle, ins.adsbygoogle *, .google-auto-placed, .google-auto-placed *,
[id^="aswift_"], [id^="google_ads_iframe"], [id^="div-gpt-ad"], [id^="div-gpt-ad"] * {
  max-width: none !important; border-radius: 0 !important;
}
/* Distancia de seguridad: los anuncios quedan separados de botones, enlaces,
   menus, imagenes y titulos para evitar clics accidentales (politica de
   colocacion de anuncios de Google). 32 px arriba y abajo; 28 px en movil. */
.code-block, .google-auto-placed, .entry-content > ins.adsbygoogle, .ai-viewport-1, .ai-viewport-2, .ai-viewport-3 {
  clear: both; display: block; margin: 32px auto !important; padding: 0; text-align: center; overflow: visible;
}
.code-block > * { margin-left: auto; margin-right: auto; }
/* Hueco reservado para los anuncios adaptables mientras cargan (con WP Rocket
   "Retrasar JS" llegan despues): asi el texto no salta cuando aparecen (CLS).
   Los anuncios de tamano fijo ya traen su alto; los vacios se recogen. */
ins.adsbygoogle:not([style*="height"]):not([data-ad-status="unfilled"]):not([data-ad-format="fluid"]) { min-height: 280px; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
@media (min-width: 768px) { ins.adsbygoogle:not([style*="height"]):not([data-ad-status="unfilled"]):not([data-ad-format="fluid"]) { min-height: 250px; } }
/* Nunca pegados a la cabecera, la imagen principal, el titulo o los botones de navegacion. */
.site-header + .site-main .wrap > .code-block:first-child { margin-top: 24px !important; }
:is(.featured, .post-hero, .entry-header, .toc, .post-nav, .pagination, .card-more, .comment-form, .search-form) + :is(.code-block, .google-auto-placed) { margin-top: 40px !important; }
:is(.code-block, .google-auto-placed) + :is(.post-nav, .pagination, .toc, .featured, .comment-respond, .related, .author-box) { margin-top: 40px !important; }
@media (max-width: 600px) {
  .code-block, .google-auto-placed, .entry-content > ins.adsbygoogle { margin-top: 28px !important; margin-bottom: 28px !important; }
}

/* ---------- Pie (columnas de widgets) ---------- */
.site-footer { margin-top: 30px; background: #15171a; color: #b8bcc2; font-size: 15px; }
.site-footer a { color: #e8eaed; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 30px; padding-top: 38px; padding-bottom: 30px;
}
.footer-col .custom-logo { max-height: 52px; margin-bottom: 12px; }
.footer-name { margin: 0 0 10px; font-size: 24px; font-weight: 800; }
.footer-name a { color: #fff; text-decoration: none; }
.footer-desc { margin: 0; line-height: 1.6; }
.footer-col h2, .footer-col .widget-title {
  margin: 0 0 12px; color: #fff; font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col ul ul { margin-top: 8px; padding-left: 14px; }
.footer-col > * + * { margin-top: 18px; }
.footer-col .widget { margin-bottom: 0; min-width: 0; }
/* Widgets de bloques dentro del pie: que nunca se salgan ni deformen la columna. */
.footer-col .widget :is(img, video, figure, input, select, textarea, table, iframe:not([id^="aswift_"]):not([id^="google_ads_iframe"])) { max-width: 100%; }
.footer-col img { height: auto; border-radius: 6px; }
.footer-col .wp-block-heading, .footer-col .widget h2, .footer-col .widget h3 {
  margin: 0 0 12px; color: #fff; font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
}
.footer-col p { margin: 0 0 10px; line-height: 1.6; }
.footer-col .wp-block-search__inside-wrapper { display: flex; gap: 6px; }
.footer-col input[type="search"], .footer-col input[type="email"], .footer-col input[type="text"] {
  min-width: 0; flex: 1; padding: 9px 12px; border: 1px solid #33363b; border-radius: 8px;
  background: #1f2226; color: #e8eaed; font: inherit; font-size: 15px;
}
.footer-col button, .footer-col .wp-block-search__button {
  padding: 9px 14px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 700; cursor: pointer;
}
.footer-col .wp-block-social-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; }
.footer-bottom { border-top: 1px solid #2a2d31; font-size: 14px; text-align: center; }
.footer-bottom p { margin: 0; padding: 16px 0; }

/* ---------- 404 / vacio ---------- */
.empty { max-width: var(--read); margin: 0 auto; padding: 30px 0; text-align: center; }

/* ---------- WordPress ---------- */
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(min(var(--cols), 2), minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  /* Movil: arriba solo logo, buscador y menu. */
  .menu-toggle { display: grid; }
  .header-actions { margin-left: auto; }
  /* El menu se abre hacia abajo DENTRO de la pagina: empuja el contenido
     (anuncios incluidos) en vez de taparlo. */
  .header-inner { flex-wrap: wrap; }
  .main-nav {
    display: none; position: static; order: 3; flex: 0 0 calc(100% + 32px);
    margin: 0 -16px; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-top: 1px solid var(--border);
  }
  .menu-open .site-header { position: relative; }
  .main-nav.is-open { display: flex; }
  /* Idioma y modo oscuro: pequenos, en una fila al final del menu. */
  .nav-tools {
    order: 2; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 4px 16px 16px;
  }
  .tool-btn { height: 34px; padding: 0 12px; }
  .tool-label { display: inline; }
  .lang-btn { height: 34px; padding: 0 10px; background: var(--soft); border-radius: 99px; }
  .lang-dd.is-open { flex: 1 1 100%; }
  .lang-dd.is-open .lang-btn { width: 100%; }
  .lang-dd.is-open .lang-btn .chev { margin-left: auto; }
  .lang-panel { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
  .lang-list { max-height: 240px; }
  .main-nav > ul { flex-direction: column; padding: 6px 16px 14px; }
  .main-nav > ul li { display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--border); }
  .main-nav > ul li > a { flex: 1; padding: 13px 4px; font-size: 16px; border-radius: 0; }
  .main-nav li:has(> ul) > a::after, .main-nav ul ul li:has(> ul) > a::after { content: none; }
  .main-nav li:hover > ul { animation: none; }
  .main-nav ul ul {
    display: none; position: static; width: 100%; min-width: 0; padding: 0 0 8px 16px;
    border: 0; border-radius: 0; box-shadow: none; background: transparent;
  }
  .main-nav ul ul li { border-bottom: 0; }
  .main-nav ul ul a { padding: 9px 4px; font-size: 15px; }
  .main-nav li:hover > ul, .main-nav li:focus-within > ul { display: none; }
  .main-nav li.sub-open > ul { display: block; }
  .sub-toggle {
    display: grid; place-items: center; width: 40px; height: 40px;
    border: 0; border-radius: 8px; background: var(--soft); color: var(--text); cursor: pointer;
  }
  .sub-toggle svg { width: 16px; height: 16px; transition: transform .2s; }
  .sub-open > .sub-toggle svg { transform: rotate(180deg); }
}
@media (max-width: 760px) {
  .layout-featured .card:first-child, .layout-list .card { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
  .layout-featured .card:first-child .card-body, .layout-list .card .card-body { padding-top: 12px; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; gap: 30px; }
  .post-centered .featured { margin-left: -16px; margin-right: -16px; }
  .post-centered .featured img { border-radius: 0; }
  .entry-header { text-align: left; }
  .entry-meta { justify-content: flex-start; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .author-box { flex-direction: column; text-align: center; }
  .footer-grid { gap: 24px; }
}
@media (prefers-reduced-motion: reduce) { .sub-toggle svg { transition: none; } }
