/*
Theme Name: RetroForge
Theme URI: https://example.com
Author: Tu Nombre
Author URI: https://example.com
Description: Tema oscuro y profesional para blogs de emuladores, hackroms de Pokémon, PkHex y herramientas retro. Responsive, con buscador desplegable y widget automático de últimos vídeos de YouTube.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
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: retroforge
*/

/* =========================================
   1. VARIABLES / RESET
========================================= */
:root{
  --bg: #0a0a0f;
  --bg-elevated: #121319;
  --bg-elevated-2: #191b24;
  --text: #ffffff;
  --text-muted: #a9adc1;
  --accent: #00d4ff;
  --accent-2: #17e6c4;
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #17e6c4 100%);
  --border: rgba(255,255,255,0.08);
  --radius: 14px;
  --header-h: 72px;
  --maxw: 1240px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; height: auto; display: block; }
a{ color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover{ color: var(--accent-2); }
ul{ list-style: none; margin: 0; padding: 0; }
h1,h2,h3,h4{ line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
.screen-reader-text{ position:absolute; left:-9999px; }

/* =========================================
   2. HEADER
========================================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 24px;
}
.branding .logo{ display:flex; align-items:center; }
.logo-text{
  font-size: 1.35rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.main-nav{ flex: 1; display: flex; justify-content: center; }
.nav-menu{ display: flex; gap: 8px; }
.nav-menu li a{
  color: var(--text);
  font-weight: 600;
  font-size: .95rem;
  padding: 10px 14px;
  border-radius: 8px;
  position: relative;
}
.nav-menu li a:hover{ color: var(--accent); background: rgba(0,212,255,0.08); }
.nav-menu li.current-menu-item > a{ color: var(--accent-2); }

.header-actions{ display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.icon-btn{
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: all .2s ease;
}
.icon-btn:hover{ border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px rgba(0,212,255,0.12); }
.icon-btn.active{ color: var(--accent-2); border-color: var(--accent-2); }
#menu-toggle{ display: none; }

/* Search dropdown */
.search-dropdown{
  max-height: 0;
  overflow: hidden;
  border-bottom: 1px solid transparent;
  transition: max-height .25s ease, border-color .25s ease;
  background: var(--bg-elevated);
}
.search-dropdown.open{ max-height: 120px; border-color: var(--border); }
.search-dropdown-inner{ max-width: var(--maxw); margin: 0 auto; padding: 18px 24px; }
.search-form{ display: flex; gap: 10px; }
.search-field{
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: .95rem;
}
.search-field:focus{ outline: none; border-color: var(--accent); }
.search-submit{
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: var(--accent-gradient);
  color: #05070a;
  font-weight: 700;
  cursor: pointer;
}

/* =========================================
   3. LAYOUT / CONTENT
========================================= */
.site-main{ max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 60px; }
.content-inner{ display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }

.category-strip{ display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.category-chip{
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
}
.category-chip:hover{ border-color: var(--accent-2); color: var(--accent-2); }
.category-chip span{ color: var(--text-muted); margin-left: 4px; }

/* Post grid / cards */
.post-grid{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.post-card{
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.post-card:hover{ transform: translateY(-4px); border-color: rgba(0,212,255,0.35); }
.post-card-thumb{ position: relative; display: block; aspect-ratio: 16/9; background: var(--bg-elevated-2); overflow: hidden; }
.post-card-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.post-card-thumb-placeholder{ width: 100%; height: 100%; background: linear-gradient(135deg, var(--bg-elevated-2), var(--bg)); }
.post-card-cat{
  position: absolute; top: 12px; left: 12px;
  background: var(--accent-gradient); color: #05070a;
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; letter-spacing: .04em;
}
.post-card-body{ padding: 18px 20px 22px; }
.post-card-title{ font-size: 1.1rem; margin: 0 0 8px; }
.post-card-title a{ color: var(--text); }
.post-card-title a:hover{ color: var(--accent); }
.post-card-meta{ color: var(--text-muted); font-size: .8rem; margin-bottom: 10px; }
.post-card-excerpt{ color: var(--text-muted); font-size: .9rem; }

.pagination{ margin-top: 36px; display: flex; gap: 8px; justify-content: center; }
.pagination .page-numbers{
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  color: var(--text); background: var(--bg-elevated);
}
.pagination .page-numbers.current{ background: var(--accent-gradient); color: #05070a; border-color: transparent; }

/* Single post / page */
.single-header{ margin-bottom: 24px; }
.single-header h1{ font-size: 2rem; margin: 10px 0; }
.single-thumb{ border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; }
.single-content{ font-size: 1.02rem; color: #e6e7ef; }
.single-content h2, .single-content h3{ margin-top: 2em; }
.single-content pre, .single-content code{
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 8px; color: var(--accent-2);
}
.single-content pre{ padding: 16px; overflow-x: auto; }
.single-content a{ text-decoration: underline; }
.single-content img{ border-radius: var(--radius); }
.tags a{ display:inline-block; margin: 4px 6px 0 0; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: .8rem; }

.archive-header{ margin-bottom: 28px; }
.archive-header h1{ font-size: 1.8rem; }
.archive-desc{ color: var(--text-muted); }

/* =========================================
   4. SIDEBAR / WIDGETS
========================================= */
.sidebar .widget{
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.widget-title{ font-size: 1rem; margin: 0 0 14px; color: var(--accent-2); }
.sidebar ul li{ padding: 6px 0; border-bottom: 1px dashed var(--border); }
.sidebar ul li:last-child{ border-bottom: none; }
.sidebar ul li a{ color: var(--text); }
.sidebar ul li a:hover{ color: var(--accent); }

.yt-video-list{ display: flex; flex-direction: column; gap: 12px; }
.yt-video-item{ display: flex; gap: 10px; align-items: center; }
.yt-video-item img{ width: 90px; border-radius: 8px; flex-shrink: 0; aspect-ratio: 16/9; object-fit: cover; }
.yt-video-item span{ font-size: .85rem; color: var(--text); font-weight: 600; }
.yt-video-item:hover span{ color: var(--accent); }
.yt-channel-link{ display: block; margin-top: 14px; font-weight: 700; font-size: .85rem; }
.yt-empty{ color: var(--text-muted); font-size: .85rem; }

.discord-widget p{ color: var(--text-muted); font-size: .88rem; }
.discord-btn{
  display: inline-block; margin-top: 8px; padding: 10px 18px;
  border-radius: 10px; background: var(--accent-gradient); color: #05070a; font-weight: 700;
}

/* =========================================
   5. FOOTER
========================================= */
.site-footer{ border-top: 1px solid var(--border); background: var(--bg-elevated); }
.footer-inner{
  max-width: var(--maxw); margin: 0 auto; padding: 40px 24px;
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center;
}
.footer-brand p{ color: var(--text-muted); font-size: .85rem; margin: 4px 0 0; }
.footer-menu{ display: flex; gap: 18px; flex-wrap: wrap; }
.footer-menu a{ color: var(--text-muted); font-size: .85rem; }
.footer-menu a:hover{ color: var(--accent); }
.footer-social{ display: flex; gap: 14px; }
.footer-social a{ font-weight: 700; font-size: .85rem; }
.footer-bottom{ text-align: center; padding: 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .78rem; }

/* =========================================
   6. RESPONSIVE
========================================= */
@media (max-width: 960px){
  .content-inner{ grid-template-columns: 1fr; }
  .post-grid{ grid-template-columns: 1fr; }

  #menu-toggle{ display: flex; }
  .main-nav{
    position: absolute;
    top: var(--header-h);
    right: 0;
    width: min(320px, 88vw);
    max-height: 0;
    overflow: hidden;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 0 var(--radius);
    transition: max-height .25s ease;
    justify-content: flex-start;
  }
  .main-nav.open{ max-height: 480px; }
  .nav-menu{ flex-direction: column; gap: 2px; padding: 10px; width: 100%; }
  .nav-menu li a{ display: block; padding: 12px 14px; }

  .search-dropdown-inner{ padding: 14px 16px; }
}

@media (max-width: 520px){
  .header-inner{ padding: 0 16px; }
  .logo-text{ font-size: 1.15rem; }
}

/* Comentarios */
.comments-area{ margin-top: 48px; }
.comments-title{ font-size: 1.3rem; margin-bottom: 20px; }

.comment-list{ list-style: none; margin: 0 0 30px; padding: 0; }
.comment-list .children{ list-style: none; margin: 16px 0 0 24px; padding: 0; }
.comment-list article{
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.comment-author{ display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-author .avatar{ border-radius: 50%; display: block; }
.comment-author .fn{ font-weight: 700; font-style: normal; color: var(--text); }
.comment-metadata{ font-size: .78rem; color: var(--text-muted); margin-bottom: 10px; }
.comment-metadata a{ color: var(--text-muted); }
.comment-content p{ color: #e6e7ef; margin: 0 0 8px; }
.reply a{ font-size: .78rem; font-weight: 700; }
.no-comments{ color: var(--text-muted); }

.comment-respond{
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.comment-reply-title{ font-size: 1.1rem; margin: 0 0 6px; }
.comment-notes, .logged-in-as{ color: var(--text-muted); font-size: .85rem; margin-bottom: 16px; }
.logged-in-as a{ color: var(--accent); }
.comment-form p{ margin: 0 0 16px; }
.comment-form label{ display: block; margin-bottom: 6px; font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea{
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: .95rem;
}
.comment-form input:focus, .comment-form textarea:focus{ outline: none; border-color: var(--accent); }
.comment-form textarea{ min-height: 140px; resize: vertical; }
.comment-form-cookies-consent{ display: flex; align-items: center; gap: 8px; }
.comment-form-cookies-consent label{ margin: 0; }
.form-submit{ margin-top: 4px; }
.form-submit .submit{
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  background: var(--accent-gradient);
  color: #05070a;
  font-weight: 700;
  cursor: pointer;
}
.form-submit .submit:hover{ opacity: .9; }