/* --- Estilo general --- */
body {
    background: #0d0d0d;
    font-family: 'Georgia', serif; /* base elegante */
    color: #ffd700;
    font-family: "Georgia", serif;
    margin: 0;
    padding: 0;
}

.content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem;
}

/* --- Izquierda (galería + carta) --- */
.izq {
    flex: 1 1 50%;
    max-width: 50%;
}

/* --- Galería en cruz --- */
.galeria {
    display: grid;
    grid-template-columns: repeat(3, 160px); /* un poco más pequeño para permitir solapado */
    grid-template-rows: repeat(3, 160px);
    gap: 0.5rem; /* reducimos la separación */
    justify-content: center;
    align-items: center;
    position: relative;
}

.galeria img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 4px solid #ffd700;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.35);
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s ease;
    position: relative;
}

/* --- Posiciones en cruz con solapado --- */
.galeria img:nth-child(1) {
    grid-area: 1 / 1;
    transform: rotate(-8deg);
    margin-right: -20px; /* se mete un poco hacia el centro */
    z-index: 2;
}

.galeria img:nth-child(2) {
    grid-area: 1 / 3;
    transform: rotate(6deg);
    margin-left: -20px;
    z-index: 2;
}

.galeria img:nth-child(3) {
    grid-area: 2 / 2;
    transform: rotate(0deg) scale(1.15);
    z-index: 3; /* la central siempre encima */
}

.galeria img:nth-child(4) {
    grid-area: 3 / 1;
    transform: rotate(7deg);
    margin-right: -25px;
    z-index: 1;
}

.galeria img:nth-child(5) {
    grid-area: 3 / 3;
    transform: rotate(-5deg);
    margin-left: -25px;
    z-index: 1;
}


/* --- Carta debajo de la galería --- */
.carta {
    margin-top: 2rem;
    border: 2px solid #ffd700;
    padding: 1.2rem;
    border-radius: 15px;
    color: #fffbe6;
    font-size: 0.8rem; /* más pequeño */
    text-align: center;
    line-height: 1.5;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

p2{
    color: #ffd700;
}

/* --- Derecha (caja de flores) --- */
.der {
    flex: 1 1 50%;
    max-width: 50%;
    display: flex;
    justify-content: center;
    align-items: center; /* <--- centrado vertical */
}

/* Fondo con partículas */
#particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1; /* detrás de todo */
    background: #0d0d0d;
}

/* Animación de flotación general */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
    50% { transform: translateY(var(--moveY, -12px)) rotate(var(--rot, 0deg)); }
}

.galeria img {
    animation: float var(--time, 6s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

/* Imagen 1 */
.galeria img:nth-child(1) {
    --rot: -8deg;
    --moveY: -14px;
    --time: 7s;
    --delay: 0s;
}

/* Imagen 2 */
.galeria img:nth-child(2) {
    --rot: 6deg;
    --moveY: -10px;
    --time: 5s;
    --delay: 1.2s;
}

/* Imagen 3 (central) */
.galeria img:nth-child(3) {
    --rot: 0deg;
    --moveY: -18px;
    --time: 8s;
    --delay: 0.6s;
    scale: 1.15; /* sigue siendo la destacada */
}

/* Imagen 4 */
.galeria img:nth-child(4) {
    --rot: 7deg;
    --moveY: -12px;
    --time: 6s;
    --delay: 2s;
}

/* Imagen 5 */
.galeria img:nth-child(5) {
    --rot: -5deg;
    --moveY: -9px;
    --time: 7.5s;
    --delay: 1s;
}


.caja-flores {
    max-width: 100%;   /* define límite real */
    width: 200%;        /* se adapta al contenedor */
    aspect-ratio: 1/1;  /* mantiene cuadrado */
    border: 2px solid #ffd700;
    border-radius: 10px;
    cursor: pointer;
    color: #ffd700;
    overflow: hidden;   /* elimina lo que se desborda dentro */
}

/* --- Modal de imagen ampliada --- */
.img-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.img-modal img {
    max-width: 90%;
    max-height: 80%;
    border: 4px solid #ffd700;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.4);
    animation: zoomIn 0.4s ease;
}

.img-modal.active {
    opacity: 1;
    pointer-events: auto;
}

@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- Responsive (pantallas pequeñas) --- */
@media (max-width: 420px) {
    .content {
        flex-direction: column;
        align-items: center;
    }

    .izq, .der {
        max-width: 100%;
        flex: 1 1 100%;
    }

    .galeria {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem;
    }

    .galeria img {
        width: 160px;
        height: 160px;
        transform-origin: center; /* mantiene efecto colgado */
    }

    .caja-flores {
        width: 900px;
    }
}

/* --- Animaciones de entrada --- */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-80px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(80px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Aplicación a las secciones --- */
.izq {
    animation: fadeInLeft 1s ease-out forwards;
}

.carta {
    animation: fadeInUp 1.3s ease-out forwards;
}

