/* --- 1. VARIABLES Y BASES --- */
:root {
    --musgo: #1e291e;
    --dorado: #c5a059;
    --crema: #fdfbf7;
    --blanco: #ffffff;
    --sombra: rgba(30, 41, 30, 0.08);
    --transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Montserrat', sans-serif; 
    background-color: var(--crema); 
    color: var(--musgo); 
    line-height: 1.6; 
    overflow-x: hidden;
}

h1, h2, h3, .logo { font-family: 'Cormorant Garamond', serif; }

/* --- 2. NAVEGACIÓN Y CABECERAS --- */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 5%; background: var(--blanco);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 15px var(--sombra);
}

.logo { font-size: 1.8rem; font-weight: bold; color: var(--musgo); text-decoration: none; }

/* Hero genérico (Index) */
.hero {
    height: 45vh; background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1));
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: white; text-align: center; padding: 20px;
}
.hero h1 { font-size: clamp(2.2rem, 7vw, 4.5rem); margin-bottom: 10px; }

/* --- AJUSTE DEL TEXTO EN EL BANNER --- */
.article-hero {
    display: flex;
    align-items: center; /* Centra verticalmente el texto */
    justify-content: center;
    padding: 20px; /* Margen de seguridad para que no toque los bordes */
    box-sizing: border-box;
}

.hero-content {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    z-index: 2;
    padding: 0 5%;
    background-color: #706a5f47;
    color: #ffff;
}

.hero-content h1 {
    font-family: 'Cormorant Garamond', serif;
    /* Reducimos un poco el tamaño máximo para que quepa mejor */
    font-size: clamp(2rem, 5vw, 3.5rem); 
    margin: 0 auto;
    line-height: 1.2;
    word-wrap: break-word; /* Rompe palabras largas si es necesario */
    overflow-wrap: break-word;
}
.hero-tag { text-transform: uppercase; letter-spacing: 4px; font-size: 0.8rem; color: var(--dorado); font-weight: 700; margin-bottom: 15px; display: block; }

/* accesos rápidos*/
.accesos-rapidos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: -40px auto 40px; /* El margen negativo hace que "pise" el slider como el efecto que hablábamos */
    padding: 0 20px;
    position: relative;
    z-index: 100;
}

.acceso-item {
    background: white;
    padding: 35px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-top: 4px solid #a68b44; /* El dorado de tu logo */
    transition: 0.3s;
}

.acceso-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.acceso-item h3 {
    font-family: 'Cormorant Garamond', serif;
    color: #3e4a36; /* El verde musgo de tu logo */
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.acceso-item p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.btn-texto {
    font-weight: 700;
    font-size: 0.75rem;
    color: #a68b44;
    text-decoration: none;
    letter-spacing: 1px;
}

/* Adaptación para móviles */
@media (max-width: 768px) {
    .accesos-rapidos {
        grid-template-columns: 1fr;
        margin-top: 20px; /* En móvil mejor que no pise el slider */
    }
}


/* --- 3. COMPONENTES DEL INDEX (GRID Y FILTROS) --- */
.filter-container {
    display: flex; justify-content: center; gap: 12px;
    padding: 35px 5%; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.filter-btn {
    padding: 10px 22px; border-radius: 40px; border: 1px solid var(--musgo);
    text-decoration: none; color: var(--musgo); font-size: 0.75rem; font-weight: 700;
    transition: 0.3s; text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0;
}
.filter-btn.active, .filter-btn:hover { background: var(--musgo); color: white; }

.news-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px; padding: 0 5% 80px; max-width: 1300px; margin: 0 auto;
}

.card {
    background: var(--blanco); border-radius: 20px; overflow: hidden;
    box-shadow: 0 12px 30px var(--sombra); transition: var(--transition);
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
}
.card:hover { transform: translateY(-8px); box-shadow: 0 25px 50px rgba(0,0,0,0.1); }

.card-img-wrap { width: 100%; height: 230px; overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.card:hover .card-img { transform: scale(1.08); }

.card-content { padding: 30px; flex-grow: 1; display: flex; flex-direction: column; }
.card-tag {font-weight: 800; color: var(--dorado); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; }
.card h3 { font-size: 1.75rem; margin-bottom: 15px; color: var(--musgo); line-height: 1.1; }

/* Ajuste para que el texto del editor no rompa la tarjeta */
.card p { 
    font-size: 0.95rem; color: #555; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;  
    overflow: hidden; height: 5.1em;
}
/* Estilo general para noticias SIN FOTO */
.card.no-photo {
    background-color: #fdfaf3; /* Un crema clarito muy elegante */
    border: 2px solid var(--musgo); /* El verde que ya usas */
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 350px; /* Para que no se quede muy pequeña */
}

/* El icono que sale arriba cuando no hay foto */
.card-icon-decor {
    text-align: center;
    padding-top: 40px;
    font-size: 2.5rem;
    color: var(--dorado);
    opacity: 0.5;
}

/* Ajuste del contenido cuando no hay foto */
.card.no-photo .card-content {
    text-align: center;
    padding: 30px;
}

.card.no-photo .card-tag {
    background: none;
    color: var(--musgo);
    font-size: 1.5rem; /* Título un poco más grande para llenar el hueco */
    border-bottom: 2px solid var(--dorado);
    padding-bottom: 5px;
}

.card.no-photo p {
    font-style: italic;
    color: #555;
    margin-top: 15px;
}

/* Animación extra al pasar el ratón */
.card.no-photo:hover {
    background-color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(62, 74, 54, 0.1);
}
.card-footer { margin-top: auto; padding-top: 15px; border-top: 1px solid #f0f0f0; font-weight: 700; font-size: 0.75rem; color: var(--dorado); }

/* --- 4. CONTENIDO DE LA NOTICIA --- */
.main-content {
    max-width: 900px; margin: -60px auto 100px;
    background: var(--blanco); padding: 60px;
    border-radius: 40px; box-shadow: 0 40px 80px rgba(0,0,0,0.06);
    position: relative;
}

.article-text { font-size: 1.15rem; color: #333; margin-bottom: 50px; line-height: 1.8; text-align: justify; }

/* Capitular (La primera letra elegante) */
.article-text > p:first-of-type::first-letter {
    font-family: 'Cormorant Garamond', serif; float: left;
    font-size: 4.5rem; line-height: 0.8; padding-top: 8px;
    padding-right: 12px; color: var(--dorado);
}

/* Estilos para etiquetas que vienen del editor */
.article-text b, .article-text strong { color: var(--musgo); font-weight: 700; }
.article-text u { text-decoration: none; border-bottom: 2px solid var(--dorado); }

/* Recursos y Galería */
.section-title { font-family: 'Cormorant Garamond', serif; font-size: 2rem; border-bottom: 1px solid #eee; padding-bottom: 15px; margin: 50px 0 25px; }

.resource-card {
    display: flex; align-items: center; gap: 20px; padding: 20px;
    background: #f9fbf9; border-radius: 15px; text-decoration: none; color: var(--musgo);
    margin-bottom: 15px; transition: 0.3s ease; border: 1px solid transparent;
}
.resource-card:hover { transform: translateX(10px); background: white; border-color: var(--dorado); box-shadow: 0 10px 20px rgba(0,0,0,0.03); }
.resource-card i { font-size: 1.8rem; color: var(--dorado); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.gallery-grid img { width: 100%; height: 180px; object-fit: cover; border-radius: 15px; cursor: pointer; transition: 0.4s; }
.gallery-grid img:hover { filter: brightness(0.8); }

/* Botón Volver */
.nav-back { position: fixed; top: 30px; left: 30px; z-index: 100; }
.btn-circle {
    background: rgba(255,255,255,0.2); backdrop-filter: blur(10px);
    color: white; width: 50px; height: 50px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; border: 1px solid rgba(255,255,255,0.3); transition: 0.3s;
}
.btn-circle:hover { background: var(--dorado); }

/* --- ESTILO PARA EL MENÚ EN ESCRITORIO --- */
.nav-links {
    display: flex;       /* Los pone uno al lado del otro */
    list-style: none;    /* Quita los puntos de la lista */
    gap: 25px;           /* Espacio entre botones */
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--musgo);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--dorado);
}

.menu-toggle {
    display: none; /* Escondido en PC, solo se ve en móvil */
}
/* --- 5. RESPONSIVE --- */
@media (max-width: 768px) {
    .main-content { padding: 30px; margin-top: -40px; border-radius: 25px; width: 92%; }
    .article-hero { height: 50vh; background-attachment: scroll; }
    .filter-container { justify-content: flex-start; }
    .hero { height: 35vh; }
    .nav-back { top: 15px; left: 15px; }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; color: var(--musgo); cursor: pointer; }

    .nav-links {
        display: none; /* Escondido por defecto */
        flex-direction: column;
        position: absolute;
        top: 70px; /* Ajusta según la altura de tu navbar */
        left: 0;
        width: 100%;
        background: var(--blanco);
        padding: 20px;
        box-shadow: 0 10px 15px var(--sombra);
        z-index: 999;
    }

    /* ¡ESTA LÍNEA ES LA CLAVE! */
    .nav-links.active {
        display: flex !important; /* Cuando JS pone 'active', se muestra */
    }
    
    .nav-links li { margin: 10px 0; text-align: center; }
}