/*
Theme Name: REVISTAGALA
Theme URI: https://revistagala.com
Author: KrodiK Studios
Author URI: https://diarios.krodik.com
Description: Tema de WordPress estilo revista para RevistaGala.com. Diseño editorial limpio con UI 100% en español. Block Theme con bloques dinámicos y personalizados.
Version: 3.0.0
Requires at least: 6.4
Tested up to: 6.4
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: revistagala
Tags: news, magazine, editorial, responsive, spanish, translation-ready, full-site-editing, block-theme
*/

/* ===================================
   General Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

a {
    color: #0066CC;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #004999;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===================================
   Site Header - Black Header with Logo + Menu
   =================================== */
.site-header-black {
    background: #000 !important;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo .wp-block-site-logo {
    margin: 0;
}

.header-logo .wp-block-site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.header-logo .wp-block-site-title a {
    color: #fff;
    text-decoration: none;
}

/* Navigation in header */
.site-header-black .wp-block-navigation {
    margin: 0;
}

.site-header-black .wp-block-navigation__container {
    gap: 2rem !important;
}

.site-header-black .wp-block-navigation-item a {
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.site-header-black .wp-block-navigation-item a:hover {
    color: #c9a961;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-logo .wp-block-site-title {
        font-size: 1.25rem;
    }
}

/* ===================================
   Ad Spaces
   =================================== */
.revistagala-ad-space {
    margin-bottom: 2rem;
    text-align: center;
}

.revistagala-ad-space--300x250 {
    width: 300px;
    height: 250px;
    margin-left: auto;
    margin-right: auto;
}

.revistagala-ad-placeholder {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: #888;
    font-weight: 600;
}

/* Inline ad space (within content) */
.revistagala-ad-space--inline {
    margin: 1.5rem 0;
}

/* ===================================
   Category Page Layout
   =================================== */
.category-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Content + Sidebar Wrapper */
.category-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 3rem;
    margin-top: 2rem;
}

.category-main-content {
    min-width: 0;
}

/* Sidebar */
.category-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

@media (max-width: 1024px) {
    .category-content-wrapper {
        grid-template-columns: 1fr;
    }

    .category-sidebar {
        position: relative;
        top: 0;
    }
}

.category-header {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 3rem;
    border-bottom: 2px solid #e5e5e5;
}

.category-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

/* Hide "Categoría:" prefix */
.category-header .wp-block-query-title::before {
    content: none !important;
}

.category-header .wp-block-query-title .archive-title-before {
    display: none;
}

.category-header .wp-block-term-description {
    font-size: 1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

/* Featured Post (Big News) */
.category-featured-post {
    margin-bottom: 4rem;
    display: block !important;
}

.category-featured-post > li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-featured-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 8px;
}

.category-featured-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 1.5rem 0 1rem;
}

.category-featured-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.category-featured-title a:hover {
    color: #c9a961;
}

/* Posts Grid (Two Columns) */
.category-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.category-grid-item {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 1.5rem;
}

.category-grid-image {
    display: block;
    margin-bottom: 1rem;
}

.category-grid-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

.category-grid-title {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.category-grid-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.category-grid-title a:hover {
    color: #c9a961;
}

.category-grid-date {
    display: block;
    font-size: 0.875rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.category-grid-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Category Pagination */
.category-pagination {
    text-align: center;
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 2px solid #e5e5e5;
}

.category-pagination a,
.category-pagination .current {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.category-pagination a:hover {
    background: #c9a961;
    color: #fff;
    border-color: #c9a961;
}

.category-pagination .current {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

/* Pagination */
.wp-block-query-pagination {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e5e5;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.wp-block-query-pagination a:hover {
    background: #c9a961;
    color: #fff;
    border-color: #c9a961;
}

.wp-block-query-pagination .current {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .category-featured-image img {
        height: 300px;
    }

    .category-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ===================================
   Single Post Layout
   =================================== */
.single-post-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Content + Sidebar Wrapper */
.single-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 3rem;
    margin-top: 2rem;
}

.single-main-content {
    min-width: 0;
}

/* Article Title */
.single-post-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

/* Article Meta */
.single-post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
    color: #666;
    font-size: 0.9rem;
}

.single-post-meta .post-author-avatar img {
    border-radius: 50%;
}

.single-post-meta .meta-separator {
    color: #ccc;
}

/* Featured Image */
.single-featured-image {
    margin-bottom: 2rem;
}

.single-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Post Content */
.single-post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 2rem;
}

.single-post-content p {
    margin-bottom: 1.5rem;
}

.single-post-content h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.single-post-content h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Tags */
.single-post-tags {
    margin: 2rem 0;
}

.single-post-tags a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #666;
    text-decoration: none;
}

.single-post-tags a:hover {
    background: #c9a961;
    color: #fff;
}

/* Post Navigation */
.post-navigation {
    margin: 2rem 0;
}

.post-navigation a {
    color: #1a1a1a;
    font-weight: 600;
}

.post-navigation a:hover {
    color: #c9a961;
}

/* Single Sidebar */
.single-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.single-sidebar .sidebar-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #1a1a1a;
}

/* Más Leído Items */
.mas-leido-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.mas-leido-item:last-of-type {
    border-bottom: none;
}

.mas-leido-image {
    display: block;
    margin-bottom: 0.75rem;
    width: 100%;
}

.mas-leido-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.mas-leido-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.mas-leido-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.mas-leido-title a:hover {
    color: #c9a961;
}

.mas-leido-date {
    display: block;
    font-size: 0.875rem;
    color: #888;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .single-content-wrapper {
        grid-template-columns: 1fr;
    }

    .single-sidebar {
        position: relative;
        top: 0;
    }
}

/* ===================================
   404 Page Layout
   =================================== */
.error-404-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.error-404-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.error-404-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
}

.error-404-header p {
    font-size: 1.125rem;
    color: #666;
    margin-bottom: 2rem;
}

/* 404 Categories Grid */
.error-404-categories__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #1a1a1a;
}

.error-404-category-section {
    margin-bottom: 3rem;
}

.error-404-category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.error-404-category-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.error-404-category-title a:hover {
    color: #c9a961;
}

.error-404-posts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.error-404-post-item {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1rem;
    transition: box-shadow 0.3s;
}

.error-404-post-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.error-404-post-image {
    display: block;
    margin-bottom: 1rem;
}

.error-404-post-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

.error-404-post-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.error-404-post-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.error-404-post-title a:hover {
    color: #c9a961;
}

.error-404-post-date {
    display: block;
    font-size: 0.875rem;
    color: #888;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .error-404-posts-row {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Global Content Width
   =================================== */
main:not(.revistagala-homepage) {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===================================
   Site Content
   =================================== */
.site-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.content-area article {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #E5E5E5;
}

.entry-header {
    margin-bottom: 1rem;
}

.entry-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.entry-title a {
    color: #000;
}

.entry-title a:hover {
    color: #0066CC;
}

.entry-meta {
    font-size: 0.875rem;
    color: #666;
}

.entry-thumbnail {
    margin-bottom: 1.5rem;
}

.entry-content {
    margin-bottom: 1rem;
    color: #333;
    line-height: 1.7;
}

.read-more {
    display: inline-block;
    font-weight: 600;
    color: #0066CC;
}

/* ===================================
   Pagination
   =================================== */
.pagination {
    margin-top: 3rem;
    text-align: center;
}

.page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid #E5E5E5;
    color: #333;
}

.page-numbers.current {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* ===================================
   Site Footer
   =================================== */
.site-footer {
    background: #1a1a1a;
    border-top: 2px solid #000;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.site-footer p {
    color: #fff;
    margin-bottom: 0.5rem;
}

.site-footer a {
    color: #c9a961;
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    color: #d4b777;
    text-decoration: underline;
}

/* ===================================
   No Posts
   =================================== */
.no-posts {
    text-align: center;
    padding: 4rem 2rem;
}

.no-posts h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.no-posts p {
    font-size: 1.125rem;
    color: #666;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    .primary-menu {
        flex-direction: column;
        gap: 1rem;
    }
    
    .entry-title {
        font-size: 1.5rem;
    }
    
    .site-content {
        padding: 1.5rem 1rem;
    }
}

/* ===================================
   Accessibility
   =================================== */
a:focus,
button:focus {
    outline: 2px solid #0066CC;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
