@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Contenedores principales */
.responsabilidad-social-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    margin: 40px 0;
    padding: 0 20px;
    height: 500px;
}

.proyecto-card {
    cursor: pointer;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Background image que hace zoom */
.proyecto-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
    z-index: 0;
}

/* Layout específico para cada card */
.proyecto-card[data-modal="reforestacion"] {
    grid-row: 1 / 3; /* Ocupa las 2 filas */
}

.proyecto-card[data-modal="reforestacion"]::after {
    background-image: url('https://incabound.com/wp-content/uploads/2025/09/Proyecto-de-Reforestacion.webp');
}

.proyecto-card[data-modal="comunidades"] {
    grid-row: 1;
}

.proyecto-card[data-modal="comunidades"]::after {
    background-image: url('https://incabound.com/wp-content/uploads/2025/09/Apoyo-a-Comunidades.webp');
}

.proyecto-card[data-modal="recreacion"] {
    grid-row: 2;
}

.proyecto-card[data-modal="recreacion"]::after {
    background-image: url('https://incabound.com/wp-content/uploads/2025/09/Proyecto-de-Recreacion.webp');
}

/* Overlay con fondo oscuro */
.proyecto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    z-index: 1;
}

.proyecto-card:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

/* Zoom del background y crecimiento muy sutil del contenedor */
.proyecto-card:hover::after {
    transform: scale(1.01);
}

.proyecto-card:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    z-index: 2;
}

.card-overlay h3 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1.2;
}

/* Ajuste de tamaño de texto para el card grande */
.proyecto-card[data-modal="reforestacion"] .card-overlay h3 {
    font-size: 1.6rem;
}

/* Estilos del Modal */
.modal-historias {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: rgba(0, 0, 0, 0.7) !important;;
    margin: 0;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
    border-radius: 15px;
    width: 900px;
    height: 450px;
    overflow: hidden;
    animation: slideInModal 0.4s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@keyframes slideInModal {
    from { 
        transform: translate(-50%, -50%) scale(0.9); 
        opacity: 0; 
    }
    to { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    z-index: 10;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(0,0,0,0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    height: 100%;
}

.modal-left {
    display: flex;
    flex-direction: column;
}

.media-container {
    background: #ffffff40;
    border: 2px solid white;
    border-radius: 10px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.media-container:hover {
    background: #ffffff45;
}

.play-button {
    font-size: 3rem;
    color: white;
    transition: all 0.3s ease;
}

.media-container:hover .play-button {
    transform: scale(1.1);
}

.media-description {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    line-height: 1.3;
    max-height: 40px;
}

.modal-right {
    display: flex;
    flex-direction: column;
}

.modal-title {
    margin: 0 0 20px 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem !important;
    font-weight: 600;
    color: white;
    justify-content:center;
}

.description-box {
    background: transparent;
    border-radius: 10px;
    border:2px solid white; 
    padding: 20px;
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    align-items: center;
}

.description-box p {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    line-height: 1.4;
    color: white;
    font-weight: 500;
}

.counters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
}

.counter-item {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border: 2px solid white;
    padding: 12px 8px;
    text-align: center;
    color: white;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 75px;
}

.counter-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.counter-icon-img {
    width: 20px;
    height: 20px;
    margin-bottom: 6px;
    filter: brightness(0) invert(1);
}

.counter-number {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.counter-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

/* Responsive */
@media (max-width: 950px) {
    .modal-content {
        width: 95%;
        height: 80vh;
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .responsabilidad-social-container {
        grid-template-columns: 1fr;
        grid-template-rows: 300px 200px 200px;
        gap: 15px;
        padding: 0 15px;
        height: auto;
    }
    
    /* Resetear grid para móvil */
    .proyecto-card[data-modal="reforestacion"] {
        grid-row: 1;
    }
    
    .proyecto-card[data-modal="comunidades"] {
        grid-row: 2;
    }
    
    .proyecto-card[data-modal="recreacion"] {
        grid-row: 3;
    }
    
    .card-overlay h3 {
        font-size: 1.2rem;
    }
    
    .proyecto-card[data-modal="reforestacion"] .card-overlay h3 {
        font-size: 1.4rem;
    }
    
    .modal-content {
        width: 95%;
        height: 85vh;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .counters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .modal-title {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .counter-item {
        min-height: 65px;
        padding: 10px 6px;
    }
    
    .counter-number {
        font-size: 0.8rem;
    }
    
    .counter-label {
        font-size: 0.55rem;
    }
    
    .description-box p {
        font-size: 0.8rem;
    }
    
    .media-description {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .responsabilidad-social-container {
        height: auto;
        grid-template-rows: 250px 180px 180px;
    }
    
    .card-overlay h3 {
        font-size: 1.1rem;
    }
    
    .proyecto-card[data-modal="reforestacion"] .card-overlay h3 {
        font-size: 1.3rem;
    }
    
    .modal-content {
        width: 98%;
        height: 90vh;
    }
    
    .modal-body {
        padding: 15px;
        gap: 15px;
    }
    
    .modal-title {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .close-modal {
        font-size: 1.2rem;
        width: 25px;
        height: 25px;
        top: 10px;
        right: 10px;
        padding-bottom:4px !important;
    }
    
    .counters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .counter-item {
        min-height: 60px;
        padding: 8px 4px;
    }
    
    .counter-number {
        font-size: 0.75rem;
    }
    
    .counter-label {
        font-size: 0.5rem;
    }
    
    .description-box {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .description-box p {
        font-size: 0.75rem;
    }
    
    .media-description {
        font-size: 0.7rem;
    }
    
    .counter-icon-img {
        width: 18px;
        height: 18px;
    }
}

/* Prevenir scroll del body cuando modal está abierto */
body.modal-open {
    overflow: hidden;
}