/*
Theme Name: Oculto MX
Theme URI: https://ocultomx.com
Author: Oculto MX
Description: Tema de noticias moderno, rápido y optimizado para SEO. Inspirado en portales como Infobae y El Debate. Diseño limpio blanco/rojo, barra de categorías horizontal táctil, compatible con Google AdSense y Core Web Vitals. Identidad Oculto MX.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
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: ocultomx
Tags: news, magazine, blog, custom-logo, custom-menu, featured-images, footer-widgets, theme-options, translation-ready, two-columns, right-sidebar, responsive-layout
*/

/* ========== VARIABLES ========== */
:root {
  --ox-red: #D60000;
  --ox-red-dark: #A80000;
  --ox-black: #111111;
  --ox-white: #FFFFFF;
  --ox-gray-50: #F7F7F8;
  --ox-gray-100: #EEEEF0;
  --ox-gray-200: #E2E2E5;
  --ox-gray-500: #6B6B70;
  --ox-gray-700: #3A3A3E;
  --ox-radius: 10px;
  --ox-shadow: 0 2px 10px rgba(0,0,0,0.06);
  --ox-shadow-hover: 0 8px 24px rgba(0,0,0,0.10);
  --ox-container: 1180px;
  --ox-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ox-font);
  line-height: 1.6;
  color: var(--ox-black);
  background: var(--ox-white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ox-red); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--ox-red-dark); }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; color: var(--ox-black); margin-bottom: .4em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.2rem; }
p { margin-bottom: 1em; }

/* ========== LAYOUT ========== */
.site-container {
  width: 100%;
  max-width: var(--ox-container);
  margin: 0 auto;
  padding: 0 16px;
}

/* ========== HEADER ========== */
.site-header {
  background: var(--ox-white);
  border-bottom: 1px solid var(--ox-gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 1;
}
.site-title a { color: var(--ox-black); }
.site-title a:hover { color: var(--ox-red); }
.site-description { display: none; }

.custom-logo-link img { max-height: 48px; width: auto; }

/* Secondary menu toggle (hamburger only for secondary) */
.secondary-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--ox-gray-200);
  border-radius: 8px;
  cursor: pointer;
  color: var(--ox-black);
  font-size: 1.25rem;
  flex-shrink: 0;
}
.secondary-toggle:hover { border-color: var(--ox-red); color: var(--ox-red); }

/* Secondary menu panel */
.secondary-menu-wrap {
  display: none;
  position: absolute;
  top: 100%;
  right: 16px;
  background: var(--ox-white);
  border: 1px solid var(--ox-gray-200);
  border-radius: var(--ox-radius);
  box-shadow: var(--ox-shadow-hover);
  min-width: 200px;
  padding: 8px 0;
  z-index: 1100;
}
.secondary-menu-wrap.is-open { display: block; }
.secondary-menu-wrap ul { margin: 0; padding: 0; }
.secondary-menu-wrap a {
  display: block;
  padding: 10px 18px;
  color: var(--ox-black);
  font-weight: 500;
  font-size: 0.95rem;
}
.secondary-menu-wrap a:hover {
  background: var(--ox-gray-50);
  color: var(--ox-red);
}

/* Categories bar – horizontal scroll on mobile */
.categories-bar {
  background: var(--ox-white);
  border-top: 1px solid var(--ox-gray-100);
  border-bottom: 2px solid var(--ox-red);
}
.categories-bar .site-container {
  padding-left: 0;
  padding-right: 0;
}
.categories-nav {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  padding: 0 8px;
}
.categories-nav::-webkit-scrollbar { display: none; }
.categories-nav ul {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0;
  padding: 0;
}
.categories-nav li { flex-shrink: 0; }
.categories-nav a {
  display: block;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ox-black);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.categories-nav a:hover,
.categories-nav .current-menu-item > a,
.categories-nav .current-menu-ancestor > a {
  color: var(--ox-red);
  border-bottom-color: var(--ox-red);
}

/* ========== ADS ========== */
.ad-zone {
  text-align: center;
  margin: 16px 0;
  overflow: hidden;
}
.ad-zone .widget {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.ad-zone--header {
  background: var(--ox-gray-50);
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px solid var(--ox-gray-100);
}
.ad-zone--below-header { margin: 12px 0 20px; }
.ad-zone--in-feed { margin: 20px 0; grid-column: 1 / -1; }
.ad-zone--after-post { margin: 28px 0; }

/* ========== MAIN ========== */
.site-main { padding: 24px 0 40px; }
.content-area {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .content-area { grid-template-columns: 1fr; }
}

/* Posts grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* Card */
.post-card {
  background: var(--ox-white);
  border-radius: var(--ox-radius);
  overflow: hidden;
  border: 1px solid var(--ox-gray-100);
  box-shadow: var(--ox-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ox-shadow-hover);
}
.post-thumbnail {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--ox-gray-100);
}
.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.post-card:hover .post-thumbnail img { transform: scale(1.04); }

.post-content {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-category {
  display: inline-block;
  background: var(--ox-red);
  color: #fff !important;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  align-self: flex-start;
  line-height: 1.3;
}
.post-title {
  font-size: 1.05rem;
  margin-bottom: 6px;
  font-weight: 700;
}
.post-title a { color: var(--ox-black); }
.post-title a:hover { color: var(--ox-red); }
.post-meta {
  font-size: 0.78rem;
  color: var(--ox-gray-500);
  margin-bottom: 8px;
}
.post-excerpt {
  font-size: 0.88rem;
  color: var(--ox-gray-700);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more {
  margin-top: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ox-red);
}

/* Featured (hero) post */
.featured-post {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  border: 1px solid var(--ox-gray-100);
  border-radius: var(--ox-radius);
  overflow: hidden;
  box-shadow: var(--ox-shadow);
  background: var(--ox-white);
  margin-bottom: 4px;
}
.featured-post .post-thumbnail {
  aspect-ratio: auto;
  min-height: 320px;
}
.featured-post .post-content {
  padding: 28px 24px;
  justify-content: center;
}
.featured-post .post-title { font-size: clamp(1.35rem, 2.5vw, 1.85rem); }
.featured-post .post-excerpt {
  -webkit-line-clamp: 4;
  font-size: 0.95rem;
}
@media (max-width: 700px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .post-thumbnail { min-height: 200px; }
}

/* Single post */
.single-post .entry-header { margin-bottom: 18px; }
.single-post .entry-title { margin-bottom: 10px; }
.single-post .entry-meta {
  color: var(--ox-gray-500);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.single-post .post-thumbnail {
  margin-bottom: 20px;
  border-radius: var(--ox-radius);
  overflow: hidden;
}
.single-post .entry-content {
  background: var(--ox-white);
  font-size: 1.05rem;
  line-height: 1.75;
}
.single-post .entry-content p { margin-bottom: 1.2em; }
.single-post .entry-content h2,
.single-post .entry-content h3 { margin-top: 1.6em; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget {
  background: var(--ox-gray-50);
  border: 1px solid var(--ox-gray-100);
  border-radius: var(--ox-radius);
  padding: 16px 18px;
}
.widget-title {
  font-size: 0.95rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ox-red);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.widget ul { margin: 0; }
.widget li {
  padding: 7px 0;
  border-bottom: 1px solid var(--ox-gray-100);
  font-size: 0.9rem;
}
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--ox-black); font-weight: 500; }
.widget a:hover { color: var(--ox-red); }

/* Search */
.search-form { display: flex; }
.search-form input[type="search"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--ox-gray-200);
  border-radius: 6px 0 0 6px;
  font-size: 0.9rem;
  outline: none;
  background: var(--ox-white);
}
.search-form input[type="search"]:focus { border-color: var(--ox-red); }
.search-form button {
  background: var(--ox-red);
  color: #fff;
  border: none;
  padding: 0 16px;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.search-form button:hover { background: var(--ox-red-dark); }

/* Footer */
.site-footer {
  background: var(--ox-black);
  color: #ccc;
  padding: 36px 0 18px;
  margin-top: 40px;
}
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
.footer-widgets .widget {
  background: transparent;
  border: none;
  padding: 0;
}
.footer-widgets .widget-title {
  color: #fff;
  border-bottom-color: var(--ox-red);
}
.footer-widgets a { color: #aaa; }
.footer-widgets a:hover { color: #fff; }
.site-info {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid #333;
  font-size: 0.82rem;
  color: #777;
}
.site-info a { color: #999; }

/* Pagination */
.pagination {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 13px;
  background: var(--ox-white);
  border: 1px solid var(--ox-gray-200);
  border-radius: 6px;
  color: var(--ox-black);
  font-weight: 600;
  font-size: 0.9rem;
}
.pagination a:hover,
.pagination .current {
  background: var(--ox-red);
  border-color: var(--ox-red);
  color: #fff;
}

/* Comments */
.comments-area {
  margin-top: 32px;
  padding: 24px;
  background: var(--ox-gray-50);
  border-radius: var(--ox-radius);
  border: 1px solid var(--ox-gray-100);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header-top { padding: 10px 0; }
  .site-title { font-size: 1.3rem; }
  .custom-logo-link img { max-height: 40px; }
  .categories-nav a { padding: 10px 14px; font-size: 0.85rem; }
  .single-post .entry-title { font-size: 1.5rem; }
}

/* Utility */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px; word-wrap: normal !important;
}

.no-sidebar .content-area { grid-template-columns: 1fr; }
