/*
Theme Name: CEMPE Blog
Theme URI: https://tudominio.com
Author: CEMPE
Author URI: https://tudominio.com
Description: Tema personalizado moderno para blog escolar CEMPE. Diseño limpio con página de inicio tipo blog que muestra resúmenes de actividades escolares con imágenes destacadas.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cempe-blog
*/

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores CEMPE - Azul claro institucional */
    --primary-color: #4fc3f7;        /* Azul claro principal */
    --secondary-color: #29b6f6;      /* Azul medio */
    --accent-color: #0277bd;         /* Azul oscuro para contraste */
    --accent-light: #81d4fa;         /* Azul muy claro */
    --text-color: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --bg-color: #ffffff;
    --bg-light: #f5f5f5;            /* Fondo gris neutro */
    --bg-blue-light: #e3f2fd;       /* Azul muy claro solo para acentos */
    --bg-dark: #1565c0;
    --border-color: #e0e0e0;        /* Borde gris neutro */
    --shadow: 0 4px 6px -1px rgba(79, 195, 247, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(79, 195, 247, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(79, 195, 247, 0.2);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
    font-size: 16px;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1.5rem 0;
}

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

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.site-title:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.02);
}

.site-title a {
    color: white;
    text-decoration: none;
}

.site-title a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.site-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.25rem;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.main-navigation a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.main-navigation a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

/* Contenedor principal */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--accent-light);
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid de posts */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.post-card {
    background: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-top-color: var(--secondary-color);
    border-color: var(--primary-color);
}

.post-thumbnail {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: var(--bg-light);
}

.post-thumbnail-link {
    display: block;
    overflow: hidden;
}

.post-thumbnail-link:hover .post-thumbnail {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.post-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-meta {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    flex-grow: 1;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-top: auto;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--primary-color);
}

.read-more:hover {
    color: white;
    background: var(--primary-color);
    text-decoration: none;
    transform: translateX(5px);
}

/* Página de post individual */
.single-post-header {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.single-post-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.2;
}

.single-post-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-light);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.single-post-featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.post-content-area {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    line-height: 1.8;
}

.post-content-area h2,
.post-content-area h3,
.post-content-area h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.post-content-area h2 {
    font-size: 2rem;
}

.post-content-area h3 {
    font-size: 1.5rem;
}

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

.post-content-area img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
}

.post-content-area a {
    color: var(--primary-color);
    text-decoration: none;
}

.post-content-area a:hover {
    text-decoration: underline;
}

.post-content-area ul,
.post-content-area ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.post-content-area li {
    margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
    background: var(--bg-dark);
    color: #ffffff;
    padding: 3rem 2rem;
    margin-top: 4rem;
    border-top: 4px solid var(--primary-color);
}

.footer-content {
    margin-bottom: 2rem;
}

.footer-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: var(--transition);
    min-width: 0;
    overflow: hidden;
}

.footer-info-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.footer-info-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border-radius: 50%;
    color: white;
}

.footer-info-content {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.footer-info-content h4 {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-info-content a,
.footer-info-content p {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    line-height: 1.6;
    display: block;
    transition: var(--transition);
}

.footer-info-content a:hover {
    color: white;
    text-decoration: underline;
}

.footer-info-content p {
    margin: 0;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

@media (max-width: 768px) {
    .footer-info-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-info-item {
        padding: 1.25rem;
    }
    
    .footer-info-content a,
    .footer-info-content p {
        white-space: normal;
        word-break: break-all;
    }
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-content {
    margin-bottom: 2rem;
}

.footer-content p {
    opacity: 0.8;
    line-height: 1.8;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Navegación de posts */
.post-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-previous,
.nav-next {
    flex: 1;
    min-width: 200px;
}

.nav-previous a,
.nav-next a {
    display: block;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.nav-previous a:hover,
.nav-next a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.nav-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.nav-previous a:hover .nav-label,
.nav-next a:hover .nav-label {
    color: rgba(255, 255, 255, 0.8);
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .main-navigation ul {
        justify-content: center;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

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

    .site-main {
        padding: 2rem 1rem;
    }

    .single-post-title {
        font-size: 1.75rem;
    }

    .post-navigation {
        flex-direction: column;
    }
}

/* Utilidades */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Estilos para el editor de WordPress */
.wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.wp-block-gallery {
    margin: 2rem 0;
}

/* Carrusel de Imágenes */
.image-collage-carousel {
    position: relative;
    margin: 3rem 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
    position: relative;
}

.carousel-image-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

.carousel-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.carousel-image-wrapper:hover .carousel-image {
    transform: scale(1.02);
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-image-wrapper:hover .carousel-overlay {
    opacity: 1;
}

.carousel-view-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    box-shadow: var(--shadow-lg);
}

.carousel-view-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* Controles del carrusel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: white;
    box-shadow: var(--shadow);
}

.carousel-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-lg);
}

.carousel-prev {
    left: 1rem;
}

.carousel-next {
    right: 1rem;
}

/* Indicadores de puntos */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot:hover,
.carousel-dot.active {
    background: white;
    transform: scale(1.2);
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 90vw;
    height: 90vw;
    max-width: 90vh;
    max-height: 90vh;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 70px 100px;
    box-sizing: border-box;
}

.lightbox-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: lightboxFadeIn 0.3s ease;
    display: block;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: scale(1.1);
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
}

.lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-title {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    max-width: calc(100vw - 140px);
    text-align: center;
    z-index: 10001;
}

/* Responsive del carrusel */
@media (max-width: 768px) {
    .carousel-container {
        max-width: 100%;
    }
    
    .carousel-image-wrapper {
        height: 400px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-prev {
        left: 0.5rem;
    }
    
    .carousel-next {
        right: 0.5rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-content {
        width: 85vw;
        height: 85vw;
        max-width: 85vh;
        max-height: 85vh;
        padding: 60px 50px 80px;
    }
    
    .lightbox-title {
        max-width: calc(85vw - 100px);
        bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .carousel-image-wrapper {
        height: 300px;
    }
    
    .carousel-view-btn {
        width: 50px;
        height: 50px;
    }
    
    .lightbox-content {
        width: 90vw;
        height: 90vw;
        max-width: 90vh;
        max-height: 90vh;
        padding: 50px 40px 70px;
    }
    
    .lightbox-title {
        max-width: calc(90vw - 80px);
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
    
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 35px;
        height: 35px;
    }
}

/* Estilos para videos embebidos (YouTube, Vimeo, etc.) */
.post-content-area iframe,
.wp-block-embed iframe,
iframe[src*="youtube"],
iframe[src*="youtu.be"],
iframe[src*="vimeo"] {
    width: 100%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 16 / 9;
    display: block;
    margin: 2rem auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: none;
}

/* Contenedor para videos embebidos (si se usa el wrapper) */
.embed-container {
    margin: 2rem auto;
    max-width: 800px;
    width: 100%;
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 para mantener proporción */
    height: 0;
    overflow: hidden;
}

.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: none;
}

/* Bloque de embed de WordPress */
.wp-block-embed {
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
}

.wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive para videos */
@media (max-width: 768px) {
    .post-content-area iframe,
    .wp-block-embed iframe,
    iframe[src*="youtube"],
    iframe[src*="youtu.be"],
    iframe[src*="vimeo"] {
        max-width: 100%;
    }
    
    .embed-container,
    .wp-block-embed {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .post-content-area iframe,
    .wp-block-embed iframe,
    iframe[src*="youtube"],
    iframe[src*="youtu.be"],
    iframe[src*="vimeo"] {
        max-width: 100%;
    }
}

