/* =========================================
   MATERIAL DIDÁCTICO DE DIVULGACIÓN
   ========================================= */

.material-seccion {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.material-seccion-titulo {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 700;
    color: #1a2634;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.material-seccion-titulo .icono {
    font-size: 28px;
    color: #007AB4;
}

.material-seccion-titulo .icono i {
    color: #007AB4;
}

/* =========================================
   GRID DE 4 IMÁGENES
   ========================================= */

.material-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.material-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    aspect-ratio: 3/4;
    background: #f0f4f8;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.material-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 122, 180, 0.2);
}

.material-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.material-item:hover img {
    transform: scale(1.05);
}

/* =========================================
   OVERLAY - APARECE AL HOVER
   ========================================= */

.material-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 122, 180, 0.85) 0%, rgba(0, 50, 80, 0.9) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 15px;
    text-align: center;
    gap: 8px;
}

.material-item:hover .material-overlay {
    opacity: 1;
}

.material-icono {
    font-size: 2.5rem;
    color: #ffd700;
}

.material-texto {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(14px, 1.1vw, 18px);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 992px) {
    .material-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .material-seccion {
        padding: 0 15px;
    }

    .material-seccion-titulo {
        font-size: 1.4rem;
    }

    .material-icono {
        font-size: 2rem;
    }

    .material-texto {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .material-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .material-seccion {
        padding: 0 12px;
    }

    .material-seccion-titulo {
        font-size: 1.2rem;
    }

    .material-item {
        aspect-ratio: 3/4;
    }

    .material-icono {
        font-size: 1.6rem;
    }

    .material-texto {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .material-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .material-seccion {
        padding: 0 10px;
    }

    .material-seccion-titulo {
        font-size: 1rem;
        gap: 8px;
    }

    .material-seccion-titulo .icono {
        font-size: 20px;
    }

    .material-item {
        aspect-ratio: 3/4;
        border-radius: 8px;
    }

    .material-icono {
        font-size: 1.4rem;
    }

    .material-texto {
        font-size: 11px;
    }

    .material-overlay {
        padding: 10px;
    }
}

@media (max-width: 360px) {
    .material-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .material-item {
        aspect-ratio: 3/4;
        border-radius: 6px;
    }

    .material-icono {
        font-size: 1.2rem;
    }

    .material-texto {
        font-size: 10px;
    }
}
/* =========================================
   LIGHTBOX - MATERIAL DIDÁCTICO
   ========================================= */

.lightbox-material {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: lightboxFadeIn 0.4s ease;
}

.lightbox-material.active {
    display: flex;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-material-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-material-close {
    position: absolute;
    top: -50px;
    right: -10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 1.4rem;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-material-close:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    transform: rotate(90deg);
}

.lightbox-material-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    animation: lightboxZoomIn 0.4s ease;
}

@keyframes lightboxZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-material-info {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin-top: 15px;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

/* =========================================
   RESPONSIVE - LIGHTBOX
   ========================================= */

@media (max-width: 768px) {
    .lightbox-material-content {
        max-width: 95%;
        max-height: 95%;
    }

    .lightbox-material-close {
        top: -45px;
        right: 0;
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .lightbox-material-content img {
        max-height: 70vh;
        border-radius: 8px;
    }

    .lightbox-material-info {
        font-size: 13px;
        padding: 6px 14px;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .lightbox-material-close {
        top: -40px;
        right: 0;
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .lightbox-material-content img {
        max-height: 65vh;
        border-radius: 6px;
    }

    .lightbox-material-info {
        font-size: 11px;
        padding: 4px 12px;
        margin-top: 8px;
    }
}
/* =========================================
   LIGHTBOX - DETALLE DE PEZ
   ========================================= */

.lightbox-material-imagen {
    width: 100%;
    max-height: 55vh;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.lightbox-material-imagen img {
    width: 100%;
    height: auto;
    max-height: 55vh;
    object-fit: contain;
    border-radius: 12px 12px 0 0;
}

.lightbox-material-detalle {
    width: 100%;
    max-width: 800px;
    padding: 20px 25px 25px 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 12px 12px;
    margin-top: 0;
}

.pez-detalle {
    font-family: 'Montserrat', sans-serif;
}

.pez-detalle-nombre {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.pez-cientifico {
    font-size: 20px;
    font-weight: 700;
    color: #007AB4;
}

.pez-comun {
    font-size: 16px;
    font-weight: 600;
    color: #1a2634;
}

.pez-detalle-taxonomia {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #4a5568;
    padding: 8px 0;
    border-top: 1px solid #eef2f6;
    border-bottom: 1px solid #eef2f6;
    margin-bottom: 10px;
}

.pez-detalle-taxonomia strong {
    color: #1a2634;
}

.pez-detalle-historia strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #007AB4;
    margin-bottom: 6px;
}

.pez-detalle-historia p {
    font-size: 14px;
    line-height: 1.8;
    color: #2d3748;
    margin: 0;
}
.caja-imagen {
  width: 300px;        /* Ancho fijo que quieras para el inicio */
  height: 300px;       /* Alto fijo (si lo pones igual al ancho, será un cuadrado perfecto) */
  background-color: #f0f0f0; /* Opcional: color de fondo para rellenar los espacios vacíos */
  display: flex;       /* Para centrar la imagen si es necesario */
  justify-content: center;
  align-items: center;
}

.caja-imagen img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* <--- ESTA ES LA CLAVE */
}

/* =========================================
   RESPONSIVE - LIGHTBOX DETALLE
   ========================================= */

@media (max-width: 768px) {
    .lightbox-material-detalle {
        padding: 16px 18px 20px 18px;
    }

    .pez-cientifico {
        font-size: 17px;
    }

    .pez-comun {
        font-size: 14px;
    }

    .pez-detalle-taxonomia {
        font-size: 13px;
        gap: 15px;
    }

    .pez-detalle-historia p {
        font-size: 13px;
        line-height: 1.7;
    }

    .lightbox-material-imagen {
        max-height: 40vh;
    }

    .lightbox-material-imagen img {
        max-height: 40vh;
    }
}

@media (max-width: 480px) {
    .lightbox-material-detalle {
        padding: 14px 14px 16px 14px;
    }

    .pez-cientifico {
        font-size: 15px;
    }

    .pez-comun {
        font-size: 13px;
    }

    .pez-detalle-taxonomia {
        font-size: 12px;
        gap: 10px;
        flex-direction: column;
        gap: 4px;
    }

    .pez-detalle-historia p {
        font-size: 12px;
        line-height: 1.6;
    }

    .lightbox-material-imagen {
        max-height: 35vh;
    }

    .lightbox-material-imagen img {
        max-height: 35vh;
    }
}