/* 1. VARIABLES Y REINICIO */
:root {
    --color-primario: #164375; /* Un azul profundo y elegante */
    --color-texto: #333333;
    --color-fondo: #ffffff;
    /* Nuevas tipografías solicitadas por la ONG */
    --fuente-titulos: 'Times New Roman', Times, serif; 
    --fuente-textos: 'Raleway', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Scroll suave al hacer clic en los enlaces del menú y corrección del offset */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 130px; /* <--- MAGIA: Esto frena el ancla antes de que la cabecera tape el título */
}

body {
    font-family: var(--fuente-textos);
    color: var(--color-texto);
    background-color: var(--color-fondo);
    line-height: 1.6;
}

/* 2. ESPACIADOS LIMPIOS (Estilo Apple) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Mucho aire entre secciones */
.section-padding {
    padding-top: 100px;
    padding-bottom: 60px;
}

.section-padding-bottom {
    padding-bottom: 100px;
}

.section-title {
    font-family: var(--fuente-titulos);
    color: var(--color-primario);
    font-size: 2.8rem;
    margin-bottom: 50px;
}

.text-center {
    text-align: center;
}

/* 3. CABECERA Y MENÚ */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); /* Efecto vidrio esmerilado Apple */
    border-bottom: 1px solid #f0f0f0;
    padding: 20px 0;
    position: sticky; 
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo más grande */
.logo img {
    height: 85px; 
    display: block;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: #555;
    font-size: 0.95rem;
    font-weight: 600; /* Raleway luce muy bien en bold para el menú */
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--color-primario);
}

/* Botón Hamburguesa Oculto en PC */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 200;
}

.menu-toggle .bar {
    width: 25px;
    height: 2px;
    background-color: var(--color-primario);
    margin: 4px 0;
    transition: 0.3s;
}

/* 4. GRILLAS Y FOTOS */
.grid-6 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.grid-6 img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-text {
    margin-top: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-text h1 {
    font-family: var(--fuente-titulos);
    color: var(--color-primario);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 15px;
}

.hero-text h2 {
    font-family: var(--fuente-titulos);
    color: var(--color-primario);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 30px;
}

.hero-parrafo {
    font-size: 1.1rem;
    color: #666;
}

/* Grilla general de 3 */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.grid-3 img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

/* Contenedor de miniaturas de YT para los 18 videos */
.video-thumb-container {
    position: relative;
    cursor: pointer;
}

/* Botón Play falso superpuesto en las miniaturas */
.video-thumb-container::after {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0px 0px 15px rgba(0,0,0,0.5);
    pointer-events: none;
    transition: color 0.3s;
}

.video-thumb-container:hover::after {
    color: white;
}

.hover-zoom {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.hover-zoom:hover {
    transform: scale(1.03);
    opacity: 0.9;
}

/* 5. CÓMO DONAR Y ONG */
.donar-content {
    display: flex;
    gap: 60px;
    align-items: center;
}

.video-container {
    width: 55%;
}

.video-container video {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.datos-bancarios {
    width: 45%;
    font-size: 1.1rem;
    color: #555;
}

.ong-text-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    text-align: left;
    margin-bottom: 50px;
    font-size: 1.1rem;
    color: #555;
}

.ong-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-outline {
    display: inline-block;
    padding: 12px 30px;
    border: 1.5px solid var(--color-primario);
    color: var(--color-primario);
    text-decoration: none;
    font-family: var(--fuente-textos); /* Aseguramos tipografía */
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
    border-radius: 40px;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background-color: var(--color-primario);
    color: white;
}

/* 6. CONTACTO */
.flex-contacto {
    display: flex;
    gap: 60px;
    align-items: center;
}

.mapa {
    width: 60%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.datos-contacto {
    width: 40%;
    text-align: left;
    font-size: 1.1rem;
    color: #555;
}

.datos-contacto p {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px; 
}

.datos-contacto svg {
    color: var(--color-primario);
}

/* 7. FOOTER Y BOTÓN SCROLL */
footer {
    background-color: var(--color-primario);
    color: white;
    padding: 25px 0;
    font-size: 0.9rem;
}

.flex-footer {
    display: flex;
    justify-content: space-between;
}

.flex-footer a {
    color: white;
    text-decoration: underline;
}

/* Botón flotante a la DERECHA */
#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px; /* <--- Cambiamos "left" por "right" aquí */
    background-color: var(--color-primario);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 99;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#scrollTopBtn:hover {
    transform: translateY(-5px);
}

#scrollTopBtn.visible {
    opacity: 1;
    pointer-events: auto;
}

/* 8. LIGHTBOX CON FADE IN/OUT SUAVE */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#lightbox.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img, .lightbox-content iframe {
    width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 50px;
    font-family: var(--fuente-textos); /* Cruz con fuente fina */
    font-weight: 300;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.close-lightbox:hover {
    transform: scale(1.1);
}

/* 9. MÓVIL RESPONSIVE Y MENÚ FULLSCREEN */
@media (max-width: 992px) {
    .menu-toggle { display: flex; }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%; 
        width: 100%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transition: 0.5s ease;
        z-index: 150;
    }

    .nav-menu.active {
        left: 0; 
    }

    .nav-menu a {
        font-size: 1.8rem;
    }

    .menu-toggle.active .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    .grid-6 { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .grid-3 { grid-template-columns: 1fr; gap: 20px;}
    .donar-content { flex-direction: column; gap: 30px; }
    .video-container, .datos-bancarios { width: 100%; }
    .ong-text-columns { grid-template-columns: 1fr; gap: 30px; }
    .ong-buttons { flex-direction: column; }
    .flex-contacto { flex-direction: column; gap: 40px; }
    .mapa, .datos-contacto { width: 100%; }
    .flex-footer { flex-direction: column; text-align: center; gap: 15px; }
    
    .hero-text h1 { font-size: 2.5rem; }
    .section-title { font-size: 2.2rem; margin-bottom: 30px; }
}