
:root {
    --verde: #008183;
    --naranja: #f39200;
    --verde-oscuro: #004d4f;
    --fondo: #f4f7f6;
    --blanco: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Montserrat', sans-serif; background: var(--fondo); display: flex; }

/* SIDEBAR - ESPACIADO MEJORADO */
/* Modifica la sidebar para que no sea fija en móviles */
.sidebar {
    width: 280px; 
    height: 100vh; 
    background: var(--verde);
    color: white; 
    position: fixed; 
    display: flex; 
    flex-direction: column;
    justify-content: space-between; 
    padding: 3.5rem 2rem;
    z-index: 1000; /* Asegura que esté por encima */
}

.sidebar-brand { margin-bottom: 4rem; }
.logo-circle {
    width: 50px; height: 50px; background: var(--naranja);
    border-radius: 10px; display: flex; align-items: center; justify-content: center; 
    margin-bottom: 1.5rem; font-weight: bold; font-size: 1.2rem;
}




.sidebar h2 { font-size: 1.5rem; }
.sidebar h2 span { color: var(--naranja); font-weight: bold; text-transform: lowercase; }

.sidebar nav ul { list-style: none; }
.sidebar nav ul li { margin-bottom: 2.5rem; } /* Más espacio entre opciones */
.sidebar nav ul li a { color: white; text-decoration: none; font-weight: 300; transition: 0.3s; opacity: 0.9; }
.sidebar nav ul li a:hover { color: var(--naranja); opacity: 1; padding-left: 10px; }

.sidebar-logos { border-top: 1px solid rgba(255,255,255,0.2); padding-top: 2rem; }
.logo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 1.2rem; }
.logo-box { background: rgba(255,255,255,0.1); padding: 10px; border-radius: 6px; font-size: 0.7rem; text-align: center; font-weight: bold; }

/* MAIN CONTENT */
/* Modifica el main-content para que el margen sea flexible */
.main-content { 
    margin-left: 280px; 
    padding: 4rem; 
    width: calc(100% - 280px); 
    min-height: 100vh;
}


.hero-section {
    background: white; padding: 3rem; border-radius: 25px;
    margin-bottom: 4rem; border-left: 10px solid var(--naranja);
}
.hero-section h1 { font-size: 2.5rem; color: var(--verde-oscuro); margin-bottom: 1rem; }
.hero-section h1 span { color: var(--verde); }

/* CARDS - ESPACIADO MEJORADO */
.referentes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 3rem; }
.card { background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 25px rgba(0,0,0,0.05); transition: 0.4s; }
.card:hover { transform: translateY(-10px); }
.card-img { height: 220px; background-size: contain; background-position: center; background-repeat: no-repeat; border-bottom: 5px solid var(--verde); }

/* 1. Hacemos el contenedor de la imagen más alto */
.card-img { 
    height: 700px; /* Antes tenías 220px. Al poner 350px se hace mucho más larga */
    background-size: contain; 
    background-position: center; 
    background-repeat: no-repeat;
    background-color: #ffffff; /* Fondo blanco para que la imagen destaque */
    border-bottom: 5px solid var(--verde); 
}

/* 2. Ajustamos la tarjeta para que no tenga una altura fija y crezca bien */
.card { 
    background: white; 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); 
    transition: 0.4s;
    display: flex;
    flex-direction: column; /* Alinea imagen y texto en vertical */
}

.card-content { padding: 2rem; }
.tag { font-size: 0.7rem; color: var(--verde); font-weight: 700; text-transform: uppercase; }
.card-content h2 { margin-top: 1rem; margin-bottom: 1.5rem; font-size: 1.5rem; color: var(--verde-oscuro); }
.card-content p { font-size: 0.95rem; color: #555; line-height: 1.6; margin-bottom: 2.5rem; min-height: 50px; }

.btn-more {
    background: var(--naranja); color: white; border: none; padding: 15px;
    width: 100%; border-radius: 12px; cursor: pointer; font-weight: bold; transition: 0.3s;
}
.btn-more:hover { background: var(--verde-oscuro); transform: scale(1.02); }

/* MODAL CORREGIDO */
.modal {
    display: none; position: fixed; z-index: 9999; left: 0; top: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
    justify-content: center; align-items: center;
}
.modal-content {
    background: white; padding: 3.5rem; border-radius: 25px;
    width: 90%; max-width: 600px; border-top: 12px solid var(--naranja); position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.close { position: absolute; right: 25px; top: 15px; font-size: 40px; cursor: pointer; color: #ddd; }
.close:hover { color: var(--naranja); }
.subtitle { color: var(--verde); font-weight: bold; margin-bottom: 20px; text-transform: uppercase; font-size: 0.85rem; }


/* --- RESPONSIVE DESIGN --- */

@media (max-width: 992px) {
    body {
        flex-direction: column; /* Apila sidebar arriba y contenido abajo */
    }

    .sidebar {
        width: 100%;
        height: auto; /* Ya no ocupa toda la pantalla de alto */
        position: relative; /* Se mueve con el scroll */
        padding: 2rem;
    }

    .sidebar-brand {
        margin-bottom: 2rem;
        text-align: center;
    }

    .sidebar nav ul {
        display: flex;
        justify-content: space-around; /* Menú horizontal en móvil */
        flex-wrap: wrap;
        gap: 10px;
    }

    .sidebar nav ul li {
        margin-bottom: 0;
    }

    .main-content {
        margin-left: 0; /* Eliminamos el hueco de la izquierda */
        width: 100%;
        padding: 2rem 1rem;
    }

    .hero-section {
        padding: 1.5rem;
        border-left-width: 5px; /* Línea más fina en móvil */
    }

    .hero-section h1 {
        font-size: 1.8rem; /* Texto más pequeño para que no se corte */
    }

    .referentes-grid {
        gap: 1.5rem; /* Menos espacio entre tarjetas */
        grid-template-columns: 1fr; /* Una tarjeta por fila en móvil */
    }

    .card-img {
        height: 250px; /* Reducimos la altura de la imagen en móvil */
    }
}