/*
Theme Name: RPZ Blog Theme
Theme URI: https://retroplayzone.com/blog/
Author: RetroPlayZone
Author URI: https://retroplayzone.com/
Description: Tema editorial ligero y accesible para el blog SEO de RetroPlayZone. Diseño "Retro Commerce" con paridad visual con la tienda (rojo/blanco, Montserrat, Gutenberg, Rank Math). Sin constructor visual externo.
Version: 0.4.1
Requires at least: 6.5
Requires PHP: 8.2
License: Proprietary
Text Domain: rpz-blog
Domain Path: /languages
Tags: blog, custom-colors, custom-menu, featured-images, translation-ready, accessibility-ready
*/

/* ============================================================================
   1. DESIGN TOKENS  (derivados de 0. Assets/Maquetacion — "Retro Commerce")
   ========================================================================== */
:root {
  --rpz-primary:        #b7000c;
  --rpz-primary-bright: #e60012;
  --rpz-primary-hover:  #930007;
  --rpz-on-primary:     #ffffff;

  --rpz-surface:            #ffffff;
  --rpz-surface-low:        #f6f3f2;
  --rpz-surface-container:  #f0eded;
  --rpz-surface-high:       #eae8e7;
  --rpz-surface-highest:    #e4e2e1;

  --rpz-on-surface:         #1b1c1c;
  --rpz-on-surface-variant: #5f3f3b;
  --rpz-muted:              #857371;

  --rpz-outline:         #946e69;
  --rpz-outline-variant: #e9bcb6;

  --rpz-secondary:  #006874;
  --rpz-tertiary:   #a66200;

  --rpz-font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --rpz-radius-sm: 4px;
  --rpz-radius:    8px;
  --rpz-radius-lg: 12px;

  --rpz-container: 1200px;
  --rpz-gutter: 20px;
  --rpz-page-x: 24px;
  --rpz-section-y: 40px;

  --rpz-shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --rpz-shadow-md: 0 4px 12px rgba(0,0,0,.08);
}

/* ============================================================================
   2. RESET / BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--rpz-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--rpz-on-surface);
  background: var(--rpz-surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.rpz-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--rpz-primary); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--rpz-radius) 0; font-weight: 700;
}
.rpz-skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--rpz-primary); outline-offset: 2px; }
.rpz-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ============================================================================
   3. LAYOUT
   ========================================================================== */
.rpz-container { width: 100%; max-width: var(--rpz-container); margin-inline: auto; padding-inline: var(--rpz-page-x); }
.rpz-main { padding-block: var(--rpz-section-y); }
.rpz-main > * + * { margin-top: 64px; }
.rpz-icon { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ============================================================================
   4. HEADER / NAV
   ========================================================================== */
.rpz-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rpz-outline-variant); box-shadow: var(--rpz-shadow-sm); }
.rpz-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.rpz-brand { font-weight: 900; font-size: 26px; letter-spacing: -.03em; color: var(--rpz-primary); white-space: nowrap; }
.rpz-brand:hover { opacity: .85; }
.rpz-brand img { max-height: 40px; width: auto; }
.rpz-nav { display: none; gap: 26px; align-items: center; }
.rpz-nav a { color: var(--rpz-on-surface-variant); font-weight: 600; padding-bottom: 3px; transition: color .2s; }
.rpz-nav a:hover { color: var(--rpz-primary); }
.rpz-nav .current-menu-item > a, .rpz-nav a[aria-current] { color: var(--rpz-primary); font-weight: 700; border-bottom: 2px solid var(--rpz-primary); }
.rpz-header__actions { display: flex; align-items: center; gap: 16px; }
.rpz-iconbtn { background: none; border: 0; color: var(--rpz-on-surface-variant); padding: 6px; line-height: 0; border-radius: var(--rpz-radius-sm); transition: color .2s, transform .1s; }
.rpz-iconbtn:hover { color: var(--rpz-primary); }
.rpz-iconbtn:active { transform: scale(.94); }
.rpz-nav-toggle { display: inline-flex; }
@media (min-width: 900px) { .rpz-nav { display: flex; } .rpz-nav-toggle { display: none; } }
.rpz-mobile-nav { display: none; border-top: 1px solid var(--rpz-outline-variant); background: var(--rpz-surface); padding: 8px var(--rpz-page-x) 16px; }
.rpz-mobile-nav.is-open { display: block; }
.rpz-mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.rpz-mobile-nav a { display: block; padding: 12px 4px; font-weight: 600; color: var(--rpz-on-surface); border-bottom: 1px solid var(--rpz-surface-high); }
.rpz-mobile-nav a:hover { color: var(--rpz-primary); }
.rpz-mobile-nav a[aria-current] { color: var(--rpz-primary); }
/* Panel de búsqueda desplegable (se abre desde el icono de la lupa) */
.rpz-search-panel { display: none; border-top: 1px solid var(--rpz-outline-variant); background: var(--rpz-surface); padding: 16px 0; }
.rpz-search-panel.is-open { display: block; }
.rpz-search-panel .rpz-searchform { max-width: 100%; margin-inline: auto; }

/* Separación vertical entre las secciones de la portada (fix: el título de una
   sección no debe quedar pegado al bloque anterior). */
.rpz-container > section + section { margin-top: 56px; }

/* ============================================================================
   5. BOTONES / BADGES / CHIPS
   ========================================================================== */
.rpz-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border: 0; border-radius: var(--rpz-radius); background: var(--rpz-primary); color: var(--rpz-on-primary); font-weight: 700; font-size: 15px; line-height: 1; box-shadow: var(--rpz-shadow-sm); transition: background .2s, transform .1s, box-shadow .2s; }
.rpz-btn:hover { background: var(--rpz-primary-hover); box-shadow: var(--rpz-shadow-md); }
.rpz-btn:active { transform: scale(.97); }
.rpz-btn--sm { padding: 10px 18px; font-size: 14px; }
.rpz-btn--outline { background: var(--rpz-surface); color: var(--rpz-primary); border: 1px solid var(--rpz-primary); box-shadow: none; }
.rpz-btn--outline:hover { background: var(--rpz-primary); color: #fff; }
.rpz-btn--ghost { background: none; color: var(--rpz-on-surface-variant); box-shadow: none; padding: 8px 14px; }
.rpz-badge { display: inline-block; padding: 4px 10px; border-radius: var(--rpz-radius-sm); background: var(--rpz-primary); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1; }
.rpz-badge--teal { background: var(--rpz-secondary); }
.rpz-badge--orange { background: var(--rpz-tertiary); }
.rpz-badge--outline { background: color-mix(in srgb, var(--rpz-primary) 8%, transparent); color: var(--rpz-primary); border: 1px solid var(--rpz-primary); }
.rpz-cat { color: var(--rpz-primary); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.rpz-meta { color: var(--rpz-on-surface-variant); font-size: 14px; }

/* ============================================================================
   6. SECTION HEADS
   ========================================================================== */
.rpz-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--rpz-outline-variant); }
.rpz-section-head h2 { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 30px; }
.rpz-section-head h2::before { content: ""; width: 6px; height: 30px; background: var(--rpz-primary); border-radius: var(--rpz-radius-sm); flex: none; }
.rpz-viewall { display: inline-flex; align-items: center; gap: 4px; color: var(--rpz-primary); font-weight: 700; font-size: 14px; letter-spacing: .03em; white-space: nowrap; }
.rpz-viewall:hover { color: var(--rpz-primary-hover); }

/* ============================================================================
   7. HERO
   ========================================================================== */
.rpz-hero { border: 1px solid var(--rpz-outline-variant); border-radius: var(--rpz-radius-lg); overflow: hidden; box-shadow: var(--rpz-shadow-md); transition: border-color .3s; position: relative; }
.rpz-hero:hover { border-color: var(--rpz-primary); }
.rpz-hero__grid { display: flex; flex-direction: column; }
.rpz-hero__media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--rpz-surface-high); }
.rpz-hero__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s; }
.rpz-hero:hover .rpz-hero__media img { transform: scale(1.05); }
.rpz-hero__body { padding: 32px 24px; display: flex; flex-direction: column; justify-content: center; gap: 16px; align-items: flex-start; background: var(--rpz-surface); }
.rpz-hero__body h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.rpz-hero__body p { color: var(--rpz-on-surface-variant); font-size: 18px; margin: 0; }
.rpz-hero__link { position: absolute; inset: 0; z-index: 1; }
.rpz-hero__body .rpz-btn { position: relative; z-index: 2; }
@media (min-width: 768px) {
  .rpz-hero__grid { flex-direction: row; align-items: stretch; }
  .rpz-hero__media { width: 50%; aspect-ratio: auto; }
  .rpz-hero__body { width: 50%; padding: 48px; }
}

/* ============================================================================
   8. GRIDS + CARDS
   ========================================================================== */
.rpz-grid { display: grid; gap: var(--rpz-gutter); grid-template-columns: 1fr; }
@media (min-width: 640px) { .rpz-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .rpz-grid--4 { grid-template-columns: repeat(4, 1fr); } .rpz-grid--3 { grid-template-columns: repeat(3, 1fr); } }

.rpz-card { display: flex; flex-direction: column; background: var(--rpz-surface); border: 1px solid var(--rpz-outline-variant); border-radius: var(--rpz-radius-lg); overflow: hidden; box-shadow: var(--rpz-shadow-sm); transition: border-color .25s, box-shadow .25s, transform .25s; position: relative; }
.rpz-card:hover { border-color: var(--rpz-primary); box-shadow: var(--rpz-shadow-md); transform: translateY(-2px); }
.rpz-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--rpz-surface-high); }
.rpz-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.rpz-card:hover .rpz-card__media img { transform: scale(1.05); }
.rpz-card__body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.rpz-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rpz-card__title { font-size: 20px; font-weight: 700; line-height: 1.25; margin: 0; }
.rpz-card:hover .rpz-card__title { color: var(--rpz-primary); }
.rpz-card__excerpt { color: var(--rpz-on-surface-variant); font-size: 15px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rpz-card__link { position: absolute; inset: 0; z-index: 1; }
@media (min-width: 1024px) {
  .rpz-card--wide { grid-column: span 2; flex-direction: row; }
  .rpz-card--wide .rpz-card__media { width: 45%; aspect-ratio: auto; }
  .rpz-card--wide .rpz-card__body { width: 55%; justify-content: center; }
}

.rpz-guidecard { position: relative; border-radius: var(--rpz-radius-lg); overflow: hidden; min-height: 300px; box-shadow: var(--rpz-shadow-sm); border: 1px solid var(--rpz-outline-variant); }
.rpz-guidecard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.rpz-guidecard:hover img { transform: scale(1.05); }
.rpz-guidecard__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,.15) 55%, transparent); }
.rpz-guidecard__badge { position: absolute; top: 16px; left: 16px; z-index: 2; }
.rpz-guidecard__body { position: absolute; bottom: 0; left: 0; right: 0; z-index: 2; padding: 20px; }
.rpz-guidecard__body .rpz-meta { color: rgba(255,255,255,.75); display: block; margin-bottom: 4px; }
.rpz-guidecard__body h3 { color: #fff; font-size: 20px; margin: 0; }
.rpz-guidecard__link { position: absolute; inset: 0; z-index: 3; }

/* ============================================================================
   9. CTA A LA TIENDA (banda)
   ========================================================================== */
.rpz-cta-band { background: color-mix(in srgb, var(--rpz-primary) 8%, #fff); border-top: 1px solid var(--rpz-outline-variant); border-bottom: 1px solid var(--rpz-outline-variant); padding: 56px 0; text-align: center; margin-top: 64px; }
.rpz-cta-band h2 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; margin: 0 0 12px; }
.rpz-cta-band p { color: var(--rpz-on-surface-variant); font-size: 18px; max-width: 640px; margin: 0 auto 28px; }

/* ============================================================================
   10. ARTÍCULO (single) + SIDEBAR
   ========================================================================== */
.rpz-breadcrumb { font-size: 14px; color: var(--rpz-on-surface-variant); margin-bottom: 24px; }
.rpz-breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; }
.rpz-breadcrumb a:hover { color: var(--rpz-primary); }
.rpz-breadcrumb [aria-current] { color: var(--rpz-primary); font-weight: 700; }
.rpz-breadcrumb svg { width: 16px; height: 16px; opacity: .6; }

.rpz-article-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 1024px) { .rpz-article-grid { grid-template-columns: 8fr 4fr; } }
.rpz-article__head h1 { font-size: clamp(28px, 4.5vw, 36px); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: 12px 0; }
.rpz-article__byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--rpz-on-surface-variant); font-size: 14px; }
.rpz-article__hero { border: 1px solid var(--rpz-outline-variant); border-radius: var(--rpz-radius-lg); overflow: hidden; margin: 24px 0 32px; }
.rpz-article__hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.rpz-prose { font-size: 18px; line-height: 1.7; color: var(--rpz-on-surface); }
.rpz-prose > * + * { margin-top: 24px; }
.rpz-prose .rpz-lead { font-size: 20px; font-weight: 500; color: var(--rpz-on-surface-variant); }
.rpz-prose h2 { font-size: 26px; margin: 40px 0 0; }
.rpz-prose h3 { font-size: 21px; margin: 32px 0 0; }
.rpz-prose a { color: var(--rpz-primary); text-decoration: underline; text-underline-offset: 2px; }
.rpz-prose a:hover { color: var(--rpz-primary-hover); }
.rpz-prose ul, .rpz-prose ol { padding-left: 1.4em; }
.rpz-prose li { margin: 8px 0; }
.rpz-prose img, .rpz-prose figure { border-radius: var(--rpz-radius); }
.rpz-prose figure { margin: 24px 0; }
.rpz-prose figcaption { font-size: 14px; color: var(--rpz-muted); text-align: center; margin-top: 8px; }
.rpz-prose blockquote { margin: 24px 0; padding: 8px 20px; border-left: 4px solid var(--rpz-primary); color: var(--rpz-on-surface-variant); font-style: italic; }
.rpz-prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.rpz-prose th, .rpz-prose td { border: 1px solid var(--rpz-outline-variant); padding: 10px 12px; text-align: left; }
.rpz-prose th { background: var(--rpz-surface-low); }
.rpz-callout { background: var(--rpz-surface-low); border: 1px solid var(--rpz-outline-variant); border-radius: var(--rpz-radius-lg); padding: 24px; }
.rpz-callout h3 { color: var(--rpz-primary); margin-top: 0; }

.rpz-article__cta { margin: 32px 0; }
.rpz-share { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rpz-outline-variant); display: flex; align-items: center; gap: 16px; }
.rpz-share a { color: var(--rpz-primary); }
.rpz-share a:hover { color: var(--rpz-on-surface); }

.rpz-sidebar { display: flex; flex-direction: column; gap: 28px; }
.rpz-widget { background: var(--rpz-surface-low); border: 1px solid var(--rpz-outline-variant); border-radius: var(--rpz-radius-lg); padding: 24px; }
.rpz-widget__title { font-size: 20px; margin: 0 0 8px; }
.rpz-widget__rule { width: 40px; height: 4px; background: var(--rpz-primary); border-radius: 2px; margin-bottom: 20px; }
.rpz-minicard { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--rpz-outline-variant); border-radius: var(--rpz-radius); background: var(--rpz-surface); transition: border-color .2s; }
.rpz-minicard:hover { border-color: var(--rpz-primary); }
.rpz-minicard + .rpz-minicard { margin-top: 16px; }
.rpz-minicard img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--rpz-radius-sm); flex: none; }
.rpz-minicard h3 { font-size: 15px; font-weight: 700; margin: 4px 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rpz-minicard:hover h3 { color: var(--rpz-primary); }
.rpz-widget--promo { background: var(--rpz-surface); border: 2px solid var(--rpz-primary); text-align: center; }
.rpz-widget--promo h2 { color: var(--rpz-primary); margin-top: 0; }
.rpz-widget--promo p { color: var(--rpz-on-surface-variant); font-size: 15px; }

/* ============================================================================
   11. BLOQUES DE PRODUCTO (Fase 2 — rpz-blog-tools)
   ========================================================================== */
.rpz-product { border: 1px solid var(--rpz-outline-variant); border-radius: var(--rpz-radius-lg); overflow: hidden; background: var(--rpz-surface); box-shadow: var(--rpz-shadow-sm); }
.rpz-product__media { aspect-ratio: 1; background: var(--rpz-surface-high); }
.rpz-product__media img { width: 100%; height: 100%; object-fit: contain; }
.rpz-product__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.rpz-product__name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.rpz-product__price { font-size: 18px; font-weight: 800; color: var(--rpz-primary); }
.rpz-product__avail { font-size: 13px; font-weight: 700; }
.rpz-product__avail--in { color: #1a7f37; }
.rpz-product__avail--out { color: var(--rpz-muted); }
.rpz-product__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--rpz-gutter); }

/* ============================================================================
   12. FOOTER
   ========================================================================== */
.rpz-footer { border-top: 4px solid var(--rpz-primary); background: var(--rpz-surface-low); margin-top: 0; }
.rpz-footer__grid { display: grid; grid-template-columns: 1fr; gap: var(--rpz-gutter); padding-block: var(--rpz-section-y); }
.rpz-footer__brand h2 { color: var(--rpz-primary); font-weight: 800; margin: 0 0 12px; font-size: 22px; }
.rpz-footer__brand p { color: var(--rpz-on-surface-variant); font-size: 14px; max-width: 34ch; }
.rpz-footer__links { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-start; }
.rpz-footer__links a { color: var(--rpz-on-surface-variant); font-size: 14px; }
.rpz-footer__links a:hover { color: var(--rpz-primary); text-decoration: underline; }
.rpz-footer__bottom { background: var(--rpz-surface-highest); text-align: center; padding: 16px; font-size: 14px; color: var(--rpz-on-surface-variant); }
@media (min-width: 768px) { .rpz-footer__grid { grid-template-columns: 1fr 3fr; } .rpz-footer__links { justify-content: flex-end; } }

/* ============================================================================
   13. LISTADOS / PAGINACIÓN / 404 / BUSCADOR
   ========================================================================== */
.rpz-archive-head { margin-bottom: 32px; }
.rpz-archive-head h1 { font-size: clamp(28px,4vw,36px); font-weight: 800; margin: 0 0 8px; }
.rpz-archive-head h1::after { content: ""; display: block; width: 56px; height: 4px; background: var(--rpz-primary); border-radius: 2px; margin-top: 12px; }
.rpz-archive-head p { color: var(--rpz-on-surface-variant); max-width: 60ch; }
.rpz-pagination { margin-top: 48px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.rpz-pagination .page-numbers { display: inline-flex; min-width: 40px; height: 40px; padding: 0 12px; align-items: center; justify-content: center; border: 1px solid var(--rpz-outline-variant); border-radius: var(--rpz-radius); font-weight: 700; color: var(--rpz-on-surface-variant); }
.rpz-pagination .page-numbers.current { background: var(--rpz-primary); color: #fff; border-color: var(--rpz-primary); }
.rpz-pagination a.page-numbers:hover { border-color: var(--rpz-primary); color: var(--rpz-primary); }
.rpz-searchform { display: flex; gap: 8px; max-width: 520px; }
.rpz-searchform input[type="search"] { flex: 1; padding: 12px 16px; border: 1px solid var(--rpz-outline-variant); border-radius: var(--rpz-radius); font-size: 16px; background: var(--rpz-surface); color: var(--rpz-on-surface); }
.rpz-searchform input[type="search"]:focus { outline: none; border-color: var(--rpz-primary); }
.rpz-empty { text-align: center; padding: 48px 0; }
.rpz-empty__code { font-size: clamp(48px, 10vw, 96px); color: var(--rpz-primary); margin: 0; font-weight: 900; line-height: 1; }
