/*
Theme Name: Masterbluray Theme v5
Theme URI: http://www.masterbluray.com
Author: AAD
Author URI: http://www.masterbluray.com
Description: Tema moderno para catálogo de películas estilo plataforma streaming.
Version: 5.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: Masterbluray Theme
*/

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   1. VARIABLES — toda la identidad visual vive aquí.
   Cambiar el diseño en el futuro = cambiar estos valores.
   ========================================================================== */
:root {
    /* Fondo */
    --bg-base:        #0b0b0d;
    --bg-elevated:    #161618;
    --bg-card:        #1a1a1d;
    --bg-card-hover:  #232327;
    --bg-input:       #1f1f22;

    /* Acento principal (antes verde, ahora rojo cinematográfico) */
    --accent:         #e63946;
    --accent-hover:   #ff4d5e;
    --accent-dark:    #9c1f29;
    --accent-soft:    rgba(230, 57, 70, 0.45);
    --accent-glow:    rgba(230, 57, 70, 0.65);

    /* Etiquetas (se mantienen distintas al acento para que destaquen sobre el poster) */
    --label-featured: #ffd700;
    --label-new:      #ff6a3d;

    /* Texto */
    --text-primary:   #f5f5f7;
    --text-secondary: #b3b3bb;
    --text-muted:     #74747c;

    /* Bordes / superficies */
    --border-subtle:  rgba(255, 255, 255, 0.08);
    --shadow-soft:     0 4px 18px rgba(0, 0, 0, 0.45);

    /* Tipografía */
    --font-display: 'Bebas Neue', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.25s ease;
}

a:hover {
    color: var(--accent-hover);
}

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

body.admin-bar .site-header.sticky-header {
    top: 32px;
}

@media screen and (max-width: 781px) {
    body.admin-bar .site-header.sticky-header {
        top: 46px;
    }
}

/* ==========================================================================
   3. LAYOUT GENERAL
   ========================================================================== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.catalog-sidebar-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    max-width: 1280px;
    margin: 40px auto;
    padding: 0 20px;
}

.main-content {
    flex: 1 1 700px;
    min-width: 300px;
}

@media (max-width: 991px) {
    .catalog-sidebar-wrapper { flex-wrap: wrap; }
    .widget-area { width: 100%; margin-top: 10px; flex: none; }
    .main-content { max-width: 100%; }
}

/* ==========================================================================
   4. HEADER
   ========================================================================== */
.site-header,
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background-color: rgba(11, 11, 13, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.site-logo-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.9rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.site-logo-text a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo-text img {
    height: 42px;
    width: auto;
}

.site-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 1px;
    color: var(--text-primary);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .site-name { display: none; }
}

.site-nav {
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
}

.site-nav ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.25s ease;
}

.site-nav ul li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.site-nav ul li a:hover {
    color: var(--text-primary);
}

.site-nav ul li a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Buscador */
.site-search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.site-search-form input[type="search"] {
    padding: 9px 14px 9px 36px;
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 180px;
    font-family: var(--font-body);
    transition: width 0.3s ease, border-color 0.3s ease;
}

.site-search-form input[type="search"]::placeholder {
    color: var(--text-muted);
}

.site-search-form input[type="search"]:focus {
    outline: none;
    width: 230px;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.site-search-form button {
    position: absolute;
    left: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .site-nav ul {
        display: none;
        flex-direction: column;
        background-color: var(--bg-elevated);
        position: absolute;
        top: 55px;
        right: 0;
        width: 200px;
        border: 1px solid var(--border-subtle);
        border-radius: 8px;
        padding: 10px 20px;
        z-index: 9999;
    }
    .site-nav ul.active { display: flex; }
    .menu-toggle { display: block; }
    .site-search-form input[type="search"] { width: 130px; }
    .site-search-form input[type="search"]:focus { width: 170px; }
}

/* ==========================================================================
   5. TÍTULOS DE SECCIÓN
   ========================================================================== */
.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0.5px;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 12px;
    color: var(--text-primary);
}

.section-title-icon {
    width: 24px;
    height: 24px;
    fill: var(--accent);
    flex-shrink: 0;
    vertical-align: -4px;
    margin-right: 4px;
}

/* ==========================================================================
   6. CARRUSEL DESTACADOS
   ========================================================================== */
.featured-carousel-section {
    margin: 40px auto 0;
    max-width: 1280px;
    position: relative;
    width: 100%;
}

.carousel-container {
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease;
}

.carousel-card {
    min-width: 280px;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.carousel-card:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
    z-index: 2;
}

.carousel-card-link {
    color: inherit;
    text-decoration: none;
    display: block;
    position: relative;
}

.carousel-poster {
    height: 420px;
    overflow: hidden;
    position: relative;
}

.carousel-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.carousel-card:hover .carousel-poster img {
    transform: scale(1.05);
    filter: brightness(0.85);
}

.carousel-info {
    padding: 14px 16px;
}

.carousel-info h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.label-featured {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: var(--label-featured);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 3;
}

.label-featured svg { width: 12px; height: 12px; fill: #000; flex-shrink: 0; }

.carousel-btn {
    position: absolute;
    top: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.3rem;
    transform: translateY(-50%);
    transition: background-color 0.25s ease, border-color 0.25s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: var(--accent);
    border-color: var(--accent);
}

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

/* ==========================================================================
   7. CATÁLOGO / GRID DE PELÍCULAS
   ========================================================================== */
.movies-grid-section {
    margin: 10px auto 50px;
    max-width: 1280px;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
}

@media (max-width: 991px) {
    .movies-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .movies-grid { grid-template-columns: 1fr; }
}

.movie-card {
    position: relative;
    background-color: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px);
    animation: fadeInUp 0.5s forwards;
}

.movie-card:nth-child(1) { animation-delay: 0.05s; }
.movie-card:nth-child(2) { animation-delay: 0.1s; }
.movie-card:nth-child(3) { animation-delay: 0.15s; }
.movie-card:nth-child(4) { animation-delay: 0.2s; }
.movie-card:nth-child(5) { animation-delay: 0.25s; }
.movie-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.movie-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
    z-index: 2;
}

.movie-poster {
    position: relative;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transition: filter 0.35s ease;
}

.movie-card:hover .movie-poster img {
    filter: brightness(0.55);
}

.movie-info {
    padding: 16px 18px;
}

.movie-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.movie-year {
    font-size: 0.95rem;
    color: var(--accent);
    margin-top: 4px;
}

.label-new {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--label-new);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}

.label-new svg { width: 12px; height: 12px; fill: #fff; flex-shrink: 0; }

.movie-hover-excerpt {
    display: none;
    position: absolute;
    inset: 0;
    top: auto;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.95) 65%);
    color: var(--text-secondary);
    padding: 50px 16px 18px;
    font-size: 0.85rem;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.movie-card:hover .movie-hover-excerpt {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   8. PAGINACIÓN
   ========================================================================== */
.pagination-wrapper {
    text-align: center;
    margin-top: 40px;
}

.pagination-wrapper ul {
    list-style: none;
    padding: 0;
    display: inline-flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination-wrapper li { display: inline-block; }

.pagination-wrapper li a,
.pagination-wrapper li span {
    color: var(--text-secondary);
    padding: 10px 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-wrapper li a:hover {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination-wrapper li .current {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
    cursor: default;
}

.pagination-wrapper li .dots {
    cursor: default;
    color: var(--text-muted);
    background: transparent;
    border-color: transparent;
}

/* ==========================================================================
   9. SIDEBAR / WIDGETS
   ========================================================================== */
.widget-area {
    flex: 0 0 300px;
    background: transparent;
    flex-shrink: 0;
    max-height: 85vh;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-base);
}

.widget-area::-webkit-scrollbar { width: 6px; }
.widget-area::-webkit-scrollbar-track { background: var(--bg-base); border-radius: 10px; }
.widget-area::-webkit-scrollbar-thumb { background-color: var(--accent); border-radius: 10px; }

.widget-area .widget,
.widget-area section.widget,
.widget-area .mwidget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.widget-area .widget-title,
.widget-area .widgetitulo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.widget-area .widget-title svg,
.widget-area .widgetitulo svg {
    width: 20px;
    height: 20px;
    fill: var(--accent);
    flex-shrink: 0;
}

.widget-area a { color: var(--text-secondary); text-decoration: none; transition: color 0.25s ease; }
.widget-area a:hover { color: var(--accent); }

.widget-area .mwidget { text-align: center; }
.widget-area .mwidget img { border-radius: 8px; }
.widget-area .mwidget a { display: block; margin-bottom: 0; }

/* Botón CTA del sidebar (antes verde con onmouseover inline) */
.cta-banner-link { text-decoration: none; display: block; }

.cta-button {
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px var(--accent-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px var(--accent-glow);
}

.cta-button:active { transform: translateY(0); }

.cta-button-icon { width: 22px; height: 22px; fill: #fff; flex-shrink: 0; }
.cta-button-arrow { width: 18px; height: 18px; fill: #fff; margin-left: auto; flex-shrink: 0; opacity: 0.85; }

.cta-button-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.cta-button-label {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-button-title { font-size: 0.95rem; font-weight: 900; text-transform: uppercase; }

/* Widget de estadísticas */
.widget_site_stats .stats-row {
    display: flex;
    gap: 14px;
}

.widget_site_stats .stat-block {
    flex: 1;
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
}

.widget_site_stats .stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
}

.widget_site_stats .stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--text-secondary);
}

.stats-list li { margin-bottom: 8px; }
.stats-list strong { color: var(--text-primary); }

.widget-subtitle {
    margin: 20px 0 12px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Listas: populares / recientes */
.widget_popular_movies ul,
.widget_recent_entries ul,
.popular-movies-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget_popular_movies ul li,
.widget_recent_entries ul li,
.popular-movies-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget_popular_movies ul li a,
.widget_recent_entries ul li a,
.popular-movies-list li a {
    color: var(--text-secondary);
    text-decoration: none;
    flex: 1;
    transition: color 0.25s ease;
}

.widget_popular_movies ul li a:hover,
.widget_recent_entries ul li a:hover,
.popular-movies-list li a:hover {
    color: var(--accent);
}

.widget-thumb {
    width: 46px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.widget-thumb-placeholder {
    width: 46px;
    height: 64px;
    background: var(--bg-elevated);
    border-radius: 6px;
    flex-shrink: 0;
}

.widget-view-count {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Banners de imagen (sitio amigo, internacional, medios de pago) */
.widget-banner-title {
    color: var(--text-primary) !important;
}

.widget-banner-title.is-muted svg { fill: var(--text-secondary); }

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
.site-footer {
    background: var(--bg-elevated);
    color: var(--text-muted);
    padding: 50px 20px 30px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 20px;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
}

.footer-section { flex: 1; min-width: 200px; }

.footer-section h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    margin: 0 0 10px;
}

.footer-section h4 {
    color: var(--text-primary);
    font-size: 1.05rem;
    margin: 0 0 14px;
}

.footer-section p { line-height: 1.6; }

.social-links {
    margin-top: 16px;
    display: flex;
    gap: 14px;
}

.social-link {
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: background-color 0.25s ease, color 0.25s ease;
}

.social-link svg { fill: currentColor; }

.social-link:hover {
    background-color: var(--accent);
    color: #fff;
}

.footer-links { list-style: none; padding: 0; margin: 0; }

.footer-links li { margin-bottom: 10px; }

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.25s ease;
}

.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    text-align: center;
    margin-top: 36px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 20px;
    font-size: 0.85rem;
}

.footer-bottom p { margin: 4px 0; }

/* ==========================================================================
   11. ENTRADA INDIVIDUAL / PÁGINA
   ========================================================================== */
.single-article,
.page-article {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 40px;
}

.single-article h1,
.page-title {
    font-family: var(--font-display);
    margin-top: 0;
    font-size: 2.4rem;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.post-meta {
    color: var(--text-muted);
    margin-bottom: 22px;
    font-size: 0.9rem;
}

.post-meta a { color: var(--accent); }

.post-content-styled {
    line-height: 1.7;
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.page-thumbnail { margin-bottom: 24px; }
.page-thumbnail img { border-radius: 10px; width: 100%; height: auto; }

.post-navigation {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.post-navigation a { color: var(--accent); font-weight: 600; }

.page-links { margin-top: 20px; color: var(--text-secondary); }

/* Bloques de contenido con estilos forzados desde el editor */
.post-content-styled [style] {
    background-color: #000 !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-primary) !important;
    padding: 16px !important;
    border-radius: 8px !important;
    font-family: monospace !important;
    margin-bottom: 20px !important;
}

.post-content-styled [style] p strong { color: var(--accent) !important; }

/* ==========================================================================
   12. COMENTARIOS
   ========================================================================== */
.comments-area {
    max-width: 800px;
    margin: 40px auto 0;
    color: var(--text-secondary);
}

.comments-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.comment-list { list-style: none; padding: 0; }

.no-comments { color: var(--text-muted); }

.comment-reply-title { color: var(--text-primary); }

.comment-form p { margin-bottom: 16px; }

.comment-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: 8px;
    font-family: var(--font-body);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-form .submit {
    background-color: var(--accent);
    color: #fff;
    padding: 11px 26px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.comment-form .submit:hover { background-color: var(--accent-hover); }
