/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header */
header {
    background-image: url('/img/logo.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    text-align: center;
    padding: 80px 20px;
    position: relative;
}

header h1, header p {
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 15px;
}

header p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

/* Navegación */
nav {
    background-color: #333;
    padding: 0;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 15px 10px;
    display: block;
    transition: background-color 0.3s;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

nav ul li a:hover {
    background-color: #555;
}

/* Sección principal con texto envolvente */
.main-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.main-article {
    float: left;
    width: 45%;
    margin-right: 20px;
    margin-bottom: 20px;
}

.main-aside {
    overflow: hidden;
    padding: 0 20px;
}

/* Carrusel */
.carousel {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
/* Estilos para el carrusel dentro de artículos */
.article-carousel {
    position: relative;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.carousel-slides {
    position: relative;
    height: 400px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    margin: 0;
    text-align: center;
}

.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 50%;
}

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-prev:hover, .carousel-next:hover {
    background: rgba(0,0,0,0.8);
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.carousel-indicators .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
}

.carousel-indicators .indicator.active {
    background: white;
}

/* Estilos para carrusel simple */
.simple-carousel {
    position: relative;
    margin: 20px 0;
}


.simple-carousel .carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: none;
}

.simple-carousel .carousel-img.active {
    display: block;
}


.carousel-controls {
    text-align: center;
    margin-top: 10px;
}

.carousel-controls button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
}

/* Estilos para carrusel original */
.original-carousel {
    position: relative;
    margin: 20px 0;
}

.original-carousel .carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: none;
}

.original-carousel .carousel-img.active {
    display: block;
}

.carousel-controls-original {
    text-align: center;
    margin-top: 10px;
}

.carousel-controls-original button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
}

/* Sección de artículos */
.articles-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.dynamic-article {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
}

.dynamic-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.article-image {
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.dynamic-article:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: 20px;
}

.article-content h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
    color: #333;
}

.article-content p {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.5;
}

.read-more {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
    width: 100%;
}

.read-more:hover {
    background-color: #0056b3;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close:hover {
    background-color: #f0f0f0;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content img {
    height: 40px;
    vertical-align: middle;
    margin-right: 10px;
}

.footer-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

/* Fondo degradado para secciones y artículos */
.main-section,
.articles-section,
.dynamic-article {
    background: linear-gradient(135deg, #2d5a2d 0%, #3a6b3a 25%, #2d5a2d 50%, #3a6b3a 75%, #2d5a2d 100%);
    background-attachment: fixed;
    position: relative;
}

/* Efecto de fumigado ocre */
.main-section::before,
.articles-section::before,
.dynamic-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(204, 153, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(204, 153, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(204, 153, 0, 0.12) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Asegurar que el contenido esté por encima del fondo */
.main-section > *,
.articles-section > *,
.dynamic-article > * {
    position: relative;
    z-index: 1;
}

/* Mejorar legibilidad del texto */
.main-aside,
.article-content {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.main-aside h2,
.main-aside h4,
.main-aside p,
.main-aside strong,
.main-aside ul,
.article-content h3,
.article-content p {
    color: #333;
}

.video-container {
    max-width: 300px;
    margin: 20px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Media Queries para Responsividad */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .main-section {
        padding: 15px;
    }
    
    .slide img {
        height: 350px;
    }
    
    .carousel-btn {
        width: 45px;
        height: 45px;
        padding: 10px 14px;
    }
    
    .articles-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
}

/* Tablets pequeñas y móviles grandes (600px - 768px) */
@media (max-width: 768px) {
    header {
        padding: 60px 15px;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        min-width: auto;
    }
    
    .main-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-article {
        float: none;
        width: 100%;
        margin-right: 0;
    }
    
    .main-aside {
        padding: 20px 0 0 0;
    }
    
    .slide img {
        height: 300px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        padding: 8px 12px;
        font-size: 18px;
    }
    
    .articles-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
}

/* Móviles (480px - 600px) */
@media (max-width: 600px) {
    header {
        padding: 50px 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    nav ul li a {
        padding: 12px 8px;
    }
    
    .main-section {
        padding: 10px;
    }
    
    .slide img {
        height: 250px;
    }
    
    .carousel-btn {
        width: 35px;
        height: 35px;
        padding: 6px 10px;
        font-size: 16px;
    }
    
    .carousel-btn.prev {
        left: 10px;
    }
    
    .carousel-btn.next {
        right: 10px;
    }
    
    .carousel-indicators {
        bottom: 10px;
    }
    
    .articles-section {
        padding: 10px;
        gap: 12px;
    }
    
    .article-image {
        height: 180px;
    }
    
    .article-content {
        padding: 15px;
    }
    
    .article-content h3 {
        font-size: 1.2rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    header {
        padding: 40px 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .slide img {
        height: 200px;
    }
    
    .carousel-btn {
        width: 30px;
        height: 30px;
        padding: 5px 8px;
        font-size: 14px;
    }
    
    .article-image {
        height: 160px;
    }
    
    .article-content {
        padding: 12px;
    }
    
    .article-content h3 {
        font-size: 1.1rem;
    }
    
    .read-more {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 15px;
    }
    
    .close {
        top: 10px;
        right: 15px;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
}

/* Pantallas muy grandes (más de 1200px) */
@media (min-width: 1200px) {
    .main-section, .articles-section, .footer-content {
        max-width: 1400px;
    }
    
    .slide img {
        height: 500px;
    }
}