/*
Theme Name: Revista AdSense Lite
Theme URI: https://cosasquenosabiasde.com
Author: David
Author URI: https://cosasquenosabiasde.com
Description: Tema minimalista y rápido para revistas digitales de tendencias/curiosidades monetizadas con Google AdSense. Incluye 7 zonas de anuncios dedicadas (cabecera, artículo arriba/medio/abajo, in-feed entre publicaciones, sidebar y footer) gestionadas por widgets, para tener control total sobre dónde aparece cada anuncio en vez de dejarlo en manos de los Anuncios automáticos de Google.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: revista-adsense
*/

/* ---------- Reset básico ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
}

:root {
  --accent: #000000;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --bg: #ffffff;
  --bg-alt: #f7f7f5;
  --border: #e6e6e3;
  --radius: 8px;
  --vivid-pink: #ec1e79;
  --vivid-turquoise: #00c2b8;
  --vivid-yellow: #ffd400;
  --vivid-violet: #7c3aed;
}

/* El cursor personalizado solo se activa si el JS confirma soporte (ver cursor.js) */
html.ra-custom-cursor, html.ra-custom-cursor a, html.ra-custom-cursor button { cursor: none; }

/* ---------- Layout base ---------- */
.site-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-branding .site-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}
.custom-logo { max-height: 50px; width: auto; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  margin: 0 6px;
}

.primary-nav ul { display: flex; gap: 22px; flex-wrap: wrap; }
.primary-nav a {
  position: relative;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 3px;
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0;
  height: 2px;
  background: var(--vivid-pink);
  transition: width .2s ease;
}
.primary-nav a:hover { color: var(--vivid-pink); }
.primary-nav a:hover::after { width: 100%; }
.primary-nav li.menu-item-has-children { position: relative; }
.primary-nav li.menu-item-has-children > ul {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 180px;
  z-index: 20;
}
.primary-nav li.menu-item-has-children:hover > ul,
.primary-nav li.menu-item-has-children:focus-within > ul { display: block; }
.primary-nav li.menu-item-has-children > ul li { padding: 4px 6px; }

/* ---------- Zonas de anuncio (multicolor) ---------- */
.ad-zone {
  margin: 28px auto;
  max-width: 468px;
  text-align: center;
  overflow: hidden;
  background: var(--vivid-pink);
  border-radius: 10px;
  padding: 18px 18px 16px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ad-zone:hover { transform: scale(1.015); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.ad-zone > * { max-width: 100%; }
.ad-zone::after {
  content: "ANUNCIO";
  display: block;
  margin-top: 14px;
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--ad-text, #fff);
}

/* Cada zona recibe un color propio para que la portada no se vea monocroma */
.ad-zone-wrap--zona-cabecera .ad-zone         { background: var(--vivid-pink); --ad-text: #fff; }
.ad-zone-wrap--zona-contenido-arriba .ad-zone { background: var(--vivid-turquoise); --ad-text: #003330; }
.ad-zone-wrap--zona-contenido-medio .ad-zone  { background: var(--vivid-yellow); --ad-text: #1a1a1a; }
.ad-zone-wrap--zona-contenido-abajo .ad-zone  { background: var(--vivid-violet); --ad-text: #fff; }
.ad-zone-wrap--zona-footer .ad-zone           { background: var(--vivid-violet); --ad-text: #fff; }

.infeed-ad-wrap { grid-column: 1 / -1; }
.infeed-ad-wrap .ad-zone { max-width: 468px; margin-left: auto; margin-right: auto; }
.infeed-ad-wrap:nth-of-type(4n+1) .ad-zone { background: var(--vivid-pink); --ad-text: #fff; }
.infeed-ad-wrap:nth-of-type(4n+2) .ad-zone { background: var(--vivid-turquoise); --ad-text: #003330; }
.infeed-ad-wrap:nth-of-type(4n+3) .ad-zone { background: var(--vivid-yellow); --ad-text: #1a1a1a; }
.infeed-ad-wrap:nth-of-type(4n+4) .ad-zone { background: var(--vivid-violet); --ad-text: #fff; }

@media (max-width: 480px) {
  .ad-zone::after { font-size: 1.4rem; }
}

/* ---------- Contenido / grid ---------- */
.content-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 28px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.posts-grid-wrap { min-width: 0; }
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.archive-title {
  font-size: 1.6rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

/* ---------- Banner superior de portada ---------- */
.home-banner { display: block; margin-bottom: 26px; }
.home-banner-img {
  width: 100%;
  aspect-ratio: 21 / 6;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  margin-bottom: 26px;
}
.home-banner .home-banner-img { margin-bottom: 0; }

@media (max-width: 680px) {
  .home-banner-img { aspect-ratio: 16 / 9; }
}

/* ---------- Portada: cuadrícula de categorías ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.category-tile {
  position: relative;
  display: block;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--vivid-pink);
  background-size: cover;
  background-position: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.category-tile:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 10px 28px rgba(0,0,0,.22); }
.category-grid a.category-tile:nth-child(4n+1) { background-color: var(--vivid-pink); box-shadow: 0 0 0 0 var(--vivid-pink); }
.category-grid a.category-tile:nth-child(4n+2) { background-color: var(--vivid-turquoise); }
.category-grid a.category-tile:nth-child(4n+3) { background-color: var(--vivid-yellow); }
.category-grid a.category-tile:nth-child(4n+4) { background-color: var(--vivid-violet); }
.category-grid a.category-tile:nth-child(4n+1):hover { box-shadow: 0 0 0 3px var(--vivid-pink), 0 10px 28px rgba(0,0,0,.22); }
.category-grid a.category-tile:nth-child(4n+2):hover { box-shadow: 0 0 0 3px var(--vivid-turquoise), 0 10px 28px rgba(0,0,0,.22); }
.category-grid a.category-tile:nth-child(4n+3):hover { box-shadow: 0 0 0 3px var(--vivid-yellow), 0 10px 28px rgba(0,0,0,.22); }
.category-grid a.category-tile:nth-child(4n+4):hover { box-shadow: 0 0 0 3px var(--vivid-violet), 0 10px 28px rgba(0,0,0,.22); }
.category-tile-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 18px;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  transition: padding-bottom .2s ease;
}
.category-tile:hover .category-tile-label { padding-bottom: 22px; }

.category-tile--banner {
  grid-column: 1 / -1;
  aspect-ratio: 21 / 6;
}
.category-tile--banner .category-tile-label {
  font-size: 1.6rem;
  padding: 26px 30px;
}
@media (max-width: 680px) {
  .category-tile--banner { aspect-ratio: 16 / 9; }
  .category-tile--banner .category-tile-label { font-size: 1.15rem; padding: 16px 18px; }
}

@media (max-width: 680px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .category-tile-label { font-size: .95rem; padding: 12px 14px; }
}

/* ---------- Secciones de portada (por categoría) ---------- */
.home-section { margin-bottom: 42px; }
.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}
.home-section-head h2 { font-size: 1.3rem; }
.home-section-more {
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  transition: color .15s ease;
}
.home-section-more:hover { color: var(--vivid-pink); }
.posts-grid--home { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .posts-grid--home { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .posts-grid--home { grid-template-columns: 1fr; }
  .home-section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---------- Tarjetas de post ---------- */
.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease;
}
.post-card:hover { box-shadow: 0 8px 26px rgba(0,0,0,.14); transform: translateY(-4px); border-color: var(--vivid-pink); }
.post-card-thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-alt); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 14px 16px 16px; }
.post-card-cat {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  margin-bottom: 6px;
}
.post-card-title { font-size: 1.02rem; font-weight: 700; margin-bottom: 6px; }
.post-card-excerpt { font-size: .88rem; color: var(--muted); margin: 0 0 8px; }
.post-card-date { font-size: .75rem; color: var(--muted); }

/* ---------- Artículo individual ---------- */
.single-post { min-width: 0; }
.single-header { margin-bottom: 18px; }
.single-header h1 { font-size: 1.85rem; font-weight: 800; margin-top: 8px; }
.single-meta { font-size: .85rem; color: var(--muted); }
.single-thumb { border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.single-content {
  font-size: 1.08rem;
  line-height: 1.75;
  max-width: 72ch;
}
.single-content p { margin: 0 0 1.2em; }
.single-content h2 { font-size: 1.35rem; margin-top: 1.6em; }
.single-content h3 { font-size: 1.15rem; margin-top: 1.4em; }
.single-content img { border-radius: var(--radius); margin: 1em 0; }
.single-tags { margin-top: 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.single-tags a {
  font-size: .78rem;
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--muted);
}

/* ---------- Comentarios ---------- */
.comments-area { margin-top: 36px; max-width: 72ch; }
.comment-list { margin-top: 16px; }

/* ---------- Búsqueda ---------- */
.search-form { display: flex; gap: 8px; }
.search-field {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.search-submit {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.search-submit:hover { background: var(--vivid-pink); transform: scale(1.04); }

/* ---------- 404 ---------- */
.error-404 { text-align: center; padding: 60px 20px; }

/* ---------- Paginación ---------- */
.pagination, .nav-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 32px 0;
  grid-column: 1 / -1;
}
.pagination a, .pagination span, .nav-links a, .nav-links span {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .85rem;
}
.pagination .current, .nav-links .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { padding: 20px; text-align: center; font-size: .82rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .content-layout { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 0; padding-top: 10px; }
  .primary-nav li { border-top: 1px solid var(--border); }
  .primary-nav a { display: block; padding: 10px 4px; }
  .header-inner { flex-wrap: wrap; }
  .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .post-card-body { padding: 10px 12px 12px; }
  .post-card-title { font-size: .88rem; }
  .post-card-excerpt { display: none; }
  .single-header h1 { font-size: 1.5rem; }
}

/* ---------- Cursor personalizado + estela ---------- */
.ra-cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: transform;
  opacity: .85;
}
.ra-cursor-dot--main {
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
  opacity: 1;
}

/* Ondas al hacer clic */
.ra-click-ripple {
  position: fixed;
  top: 0; left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  border: 2px solid currentColor;
  animation: ra-ripple .5s ease-out forwards;
}
@keyframes ra-ripple {
  from { width: 16px; height: 16px; opacity: .9; }
  to { width: 70px; height: 70px; opacity: 0; }
}
