:root {
    --primary: #9B1F3D;
    --primary-deep: #6B0F28;
    --primary-bright: #E8486E;
    /* Guinda vivo + dorado más luminoso */
    --accent: #D4A84B;
    --accent-soft: #C5A059;
    --bg-light: #F8F9FA;
    --shadow: #5C0D24;
    --reveal-duration: 1.5s;
    --reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Títulos: guinda con brillo (degradado) */
.text-guinda-brillo {
    background: linear-gradient(
        168deg,
        #ffb8c9 0%,
        #f06d8c 12%,
        #e02d5a 28%,
        #b81e45 42%,
        #9B1F3D 52%,
        #c42855 65%,
        #7a1530 82%,
        #4a0a1c 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.45)) drop-shadow(0 2px 14px rgba(155, 31, 61, 0.35));
}

@media (prefers-reduced-motion: reduce) {
    .text-guinda-brillo {
        background: none;
        color: var(--primary);
        -webkit-text-fill-color: var(--primary);
        filter: none;
    }
}

html {
    background-color: var(--bg-light);
}

body {
    background-color: transparent;
    font-family: 'Montserrat', sans-serif;
    color: #333;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Entrada al scroll (IntersectionObserver + .active) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity var(--reveal-duration) var(--reveal-ease),
        transform var(--reveal-duration) var(--reveal-ease),
        filter var(--reveal-duration) var(--reveal-ease);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.invite-cover__scroll.reveal.invite-cover__scroll--delayed {
    transition-delay: 0.22s;
}

/* Galería Polaroid: entrada un poco más “fotográfica” */
.photo-pile > .photo-polaroid-slot > .photo-polaroid-reveal.reveal {
    transform: translateY(26px) scale(0.97);
    filter: blur(8px);
}

.photo-pile > .photo-polaroid-slot > .photo-polaroid-reveal.reveal.active {
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.photo-pile > .photo-polaroid-slot:nth-child(1) .photo-polaroid-reveal { transition-delay: 0ms; }
.photo-pile > .photo-polaroid-slot:nth-child(2) .photo-polaroid-reveal { transition-delay: 80ms; }
.photo-pile > .photo-polaroid-slot:nth-child(3) .photo-polaroid-reveal { transition-delay: 160ms; }
.photo-pile > .photo-polaroid-slot:nth-child(4) .photo-polaroid-reveal { transition-delay: 240ms; }
.photo-pile > .photo-polaroid-slot:nth-child(5) .photo-polaroid-reveal { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.active {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }

    .invite-cover__scroll.reveal.invite-cover__scroll--delayed {
        transition-delay: 0s;
    }

    .photo-pile > .photo-polaroid-slot > .photo-polaroid-reveal.reveal,
    .photo-pile > .photo-polaroid-slot > .photo-polaroid-reveal.reveal.active {
        filter: none;
        transform: none;
    }

    .photo-pile > .photo-polaroid-slot .photo-polaroid-reveal {
        transition-delay: 0ms !important;
    }
}

/* Fondo floral: contain evita escalar de más la imagen (menos “borroso” que cover en pantallas anchas) */
html::before {
    content: "";
    position: fixed;
    inset: 0;
    background-color: var(--bg-light);
    background-image: url("../img/fondo-flores.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    z-index: -1;
}

/* Hero: sólido + brillo suave y marco interior */
.hero-section.bg-fondos {
    background-color: var(--bg-light) !important;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(197, 160, 89, 0.18), transparent 55%),
        radial-gradient(ellipse 90% 60% at 100% 100%, rgba(155, 31, 61, 0.08), transparent 50%);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.hero-content {
    position: relative;
    padding: 2rem 1.25rem 1.5rem;
    border-radius: 28px;
    border: 1px solid rgba(197, 160, 89, 0.22);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 24px 60px rgba(155, 31, 61, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.04);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(248, 249, 250, 0.35) 100%);
}

.hero-name {
    letter-spacing: 0.02em;
}

.hero-subtitle {
    background: linear-gradient(185deg, #f5e6b8 0%, #e8c96a 35%, var(--accent) 55%, #a67c2a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5)) drop-shadow(0 1px 8px rgba(212, 168, 75, 0.25));
}

@media (prefers-reduced-motion: reduce) {
    .hero-subtitle {
        background: none;
        color: var(--accent-soft);
        -webkit-text-fill-color: var(--accent-soft);
        filter: none;
    }
}

.hero-kicker {
    font-weight: 600;
    letter-spacing: 0.42em;
}

.countdown-row .timer-box {
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(92, 13, 36, 0.1);
}

.countdown-row .timer-box > span:first-child {
    background: linear-gradient(180deg, #e8486e 0%, #9B1F3D 45%, #7a1530 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 0 rgba(255, 200, 210, 0.35));
}

@media (prefers-reduced-motion: reduce) {
    .countdown-row .timer-box > span:first-child {
        background: none;
        color: var(--primary);
        -webkit-text-fill-color: var(--primary);
        filter: none;
    }
}

/* Portada (5.jpeg + texto) */
.invite-cover {
    position: relative;
    min-height: 100dvh;
    min-height: 100vh;
    color: #fff;
    overflow: hidden;
}

.invite-cover__bg {
    position: absolute;
    inset: 0;
    background-image: url("../img/5.jpeg");
    background-position: center 20%;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.02);
}

.invite-cover__shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, transparent 28%, transparent 42%),
        linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.45) 72%, rgba(0, 0, 0, 0.92) 100%);
}

.invite-cover__inner {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0 1.25rem max(1.25rem, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

.invite-cover__content {
    text-align: center;
    padding-bottom: 0.5rem;
    max-width: 22rem;
}

.invite-cover__eyebrow {
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    letter-spacing: 0.42em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
    margin-bottom: 0.75rem;
}

.invite-cover__name {
    font-size: clamp(3.25rem, 12vw, 4.75rem);
    line-height: 1.05;
    font-weight: 700;
    color: #fff;
    text-shadow:
        0 2px 30px rgba(0, 0, 0, 0.35),
        0 4px 60px rgba(0, 0, 0, 0.25);
    margin: 0 0 0.85rem;
}

.invite-cover__date {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.7rem, 2.4vw, 0.8rem);
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.invite-cover__scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.25rem;
    padding: 0.5rem 1rem 0.25rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 10px;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    /* Solo color aquí: un `transition` corto en el mismo elemento pisa la animación .reveal */
    transition: color 0.2s ease;
}

/* Enlace “Descubre más”: combinar hover de color con la entrada .reveal */
.invite-cover__scroll.reveal {
    transition:
        opacity var(--reveal-duration) var(--reveal-ease),
        transform var(--reveal-duration) var(--reveal-ease),
        filter var(--reveal-duration) var(--reveal-ease),
        color 0.2s ease;
}

.invite-cover__scroll:hover {
    color: #fff;
}

.invite-cover__chevron {
    width: 28px;
    height: 28px;
    animation: cover-bounce 2.2s ease-in-out infinite;
}

@keyframes cover-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .invite-cover__chevron {
        animation: none;
    }
}

/* Resto de secciones: velo ligero sin blur (el blur hacía que todo el fondo se viera difuso) */
.bg-fondos {
    background-color: rgba(248, 249, 250, 0.94) !important;
}

.font-script {
    font-family: 'Dancing Script', cursive;
}

.font-serif {
    font-family: 'Cinzel', serif;
}

/* —— Secciones: ritmo visual tipo invitación —— */
.section-head {
    text-align: center;
}

.section-head--compact {
    margin-bottom: 0;
}

.section-eyebrow {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
    margin-bottom: 0.65rem;
}

.section-title {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin: 0 auto;
    text-transform: capitalize;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.section-title .text-guinda-brillo {
    display: inline-block;
}

.section-title::before,
.section-title::after {
    content: "";
    width: min(4rem, 12vw);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(197, 160, 89, 0.85));
    flex-shrink: 0;
}

.section-title::after {
    background: linear-gradient(90deg, rgba(197, 160, 89, 0.85), transparent);
}

.section-head--compact .section-title::before,
.section-head--compact .section-title::after {
    width: min(2.5rem, 10vw);
}

.section-title-line {
    height: 1px;
    width: 5rem;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.85;
}

.section-title-line--short {
    width: 3.5rem;
}

.section-title-line--light {
    background: linear-gradient(90deg, transparent, rgba(197, 160, 89, 0.7), transparent);
}

.section-ornament {
    display: block;
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.section-quote {
    background-image:
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm56-76c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 56c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-2-17c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm25 0c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm34-12c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-3-12c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-14 30c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM10 20c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm80 40c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-4-14c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM40 40c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23c5a059' fill-opacity='0.06' fill-rule='evenodd'/%3E%3C/svg%3E"),
        linear-gradient(180deg, rgba(255, 252, 248, 0.97) 0%, rgba(248, 249, 250, 0.94) 100%) !important;
    background-repeat: repeat, no-repeat;
    background-size: 100px 100px, auto;
}

.section-gallery {
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.96) 0%, rgba(255, 255, 255, 0.92) 45%, rgba(248, 249, 250, 0.96) 100%) !important;
}

.section-event {
    background: linear-gradient(180deg, rgba(252, 250, 247, 0.95) 0%, rgba(248, 249, 250, 0.94) 100%) !important;
}

.section-rsvp {
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.97) 0%, rgba(255, 252, 248, 0.95) 100%) !important;
}

.invite-card {
    position: relative;
    border-radius: 24px;
    border: 1px solid rgba(197, 160, 89, 0.28);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 253, 248, 0.88) 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 20px 50px rgba(155, 31, 61, 0.08),
        0 6px 16px rgba(0, 0, 0, 0.05);
}

.invite-card--quote {
    padding: 2.25rem 1.75rem 2rem;
}

.invite-card--event {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(252, 248, 242, 0.9) 100%);
    border-radius: 28px;
}

.invite-card--rsvp {
    text-align: center;
}

.section-feature {
    background: linear-gradient(145deg, #3d0303 0%, var(--primary) 38%, #5c0a0a 100%) !important;
}

.section-feature::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(197, 160, 89, 0.15), transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(0, 0, 0, 0.2), transparent 55%);
    pointer-events: none;
}

.section-divider {
    height: 48px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath fill='%23F8F9FA' d='M0 48V24c240 24 480 24 720 12s480-24 720-12v24H0z'/%3E%3Cpath fill='none' stroke='%23C5A059' stroke-opacity='0.25' stroke-width='1' d='M0 30c240 18 480 18 720 9s480-18 720-9'/%3E%3C/svg%3E");
}

.section-divider--flip {
    transform: scaleY(-1);
}

.section-divider--dark {
    height: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 40' preserveAspectRatio='none'%3E%3Cpath fill='%234A0404' d='M0 0v20c240-12 480-12 720-6s480 12 720 6V0H0z'/%3E%3C/svg%3E");
    transform: scaleY(-1);
}

.section-divider--from-dark {
    height: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 40' preserveAspectRatio='none'%3E%3Cpath fill='%234A0404' d='M0 40V20c240 12 480 12 720 6s480-12 720-6v20H0z'/%3E%3C/svg%3E");
}

/* Estilo del contador */
.timer-box {
    background: rgba(155, 31, 61, 0.06);
    border: 1px solid rgba(212, 168, 75, 0.35);
    min-width: 70px;
}

/* Reproductor de música (en HERO) */
.music-player {
    width: min(520px, 100%);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(197, 160, 89, 0.28);
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.10),
        0 2px 8px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.music-player__btn {
    height: 44px;
    width: 44px;
    border-radius: 14px;
    border: 0;
    cursor: pointer;
    background: var(--primary);
    color: white;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 25px rgba(155, 31, 61, 0.28);
    transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.music-player__btn:active {
    transform: scale(0.96);
}

.music-player__body {
    min-width: 0;
    text-align: left;
}

.music-player__title {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(92, 13, 36, 0.92);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-player__controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.music-player__seek {
    width: 100%;
    accent-color: var(--accent);
}

.music-player__time {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.55);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.music-player__volume {
    width: 92px;
    accent-color: var(--accent);
}

@media (max-width: 420px) {
    .music-player {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "btn body"
            "vol vol";
    }
    #music-toggle { grid-area: btn; }
    .music-player__body { grid-area: body; }
    .music-player__volume { grid-area: vol; width: 100%; }
    .music-player__controls { grid-template-columns: 1fr; }
}

/* Fondos con textura */
.bg-paper {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm56-76c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 56c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-2-17c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm25 0c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm34-12c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-3-12c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-14 30c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM10 20c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm80 40c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-4-14c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM40 40c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23c5a059' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Galería: montón tipo Polaroid */
.photo-pile {
    position: relative;
    width: 100%;
    max-width: 28rem;
    min-height: 22rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 640px) {
    .photo-pile {
        max-width: 36rem;
        min-height: 26rem;
    }
}

/* Slot = posición + rotación; la animación de entrada va en .photo-polaroid-reveal.reveal */
.photo-polaroid-reveal {
    display: block;
}

.photo-polaroid-slot {
    --rot: 0deg;
    position: absolute;
    margin: 0;
    padding: 0;
    transform: rotate(var(--rot));
    transform-origin: center center;
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        z-index 0s;
    z-index: 1;
}

.photo-polaroid-slot:hover {
    z-index: 25;
    transform: rotate(var(--rot)) translateY(-8px) scale(1.04);
}

.photo-polaroid-slot:focus-within {
    z-index: 30;
}

.photo-polaroid {
    margin: 0;
    padding: 0.45rem 0.45rem 1.35rem;
    width: min(38vw, 11.25rem);
    display: block;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    background: linear-gradient(165deg, #fdfbf7 0%, #ebe4d9 100%);
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.22),
        0 4px 10px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transition: box-shadow 0.28s ease;
    -webkit-tap-highlight-color: transparent;
}

.photo-polaroid:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.photo-polaroid-slot:hover .photo-polaroid {
    box-shadow:
        0 22px 48px rgba(0, 0, 0, 0.28),
        0 8px 16px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.photo-polaroid__inner {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    background: #c4bdb5;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.photo-polaroid__inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: contrast(1.04) saturate(0.92) sepia(0.12);
    transition: filter 0.25s ease;
}

.photo-polaroid-slot:hover .photo-polaroid__inner img {
    filter: contrast(1.06) saturate(1) sepia(0.08);
}

.photo-polaroid-slot.photo-polaroid--1 {
    --rot: -13deg;
    left: 4%;
    top: 6%;
    z-index: 4;
}

.photo-polaroid-slot.photo-polaroid--2 {
    --rot: 10deg;
    left: 48%;
    top: 0;
    z-index: 6;
}

.photo-polaroid-slot.photo-polaroid--3 {
    --rot: -7deg;
    left: 54%;
    top: 38%;
    z-index: 3;
}

.photo-polaroid-slot.photo-polaroid--4 {
    --rot: 12deg;
    left: 2%;
    top: 44%;
    z-index: 2;
}

.photo-polaroid-slot.photo-polaroid--5 {
    --rot: -4deg;
    left: 28%;
    top: 52%;
    z-index: 7;
}

@media (min-width: 640px) {
    .photo-polaroid {
        width: min(34vw, 12.5rem);
        padding: 0.5rem 0.5rem 1.5rem;
    }

    .photo-polaroid-slot.photo-polaroid--1 {
        left: 6%;
        top: 4%;
    }

    .photo-polaroid-slot.photo-polaroid--2 {
        left: 50%;
        top: -2%;
    }

    .photo-polaroid-slot.photo-polaroid--3 {
        left: 56%;
        top: 36%;
    }

    .photo-polaroid-slot.photo-polaroid--4 {
        left: 4%;
        top: 42%;
    }

    .photo-polaroid-slot.photo-polaroid--5 {
        left: 30%;
        top: 50%;
    }
}

/* Lightbox galería */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    box-sizing: border-box;
}

.lightbox.is-open {
    display: flex;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 10, 8, 0.9);
    cursor: pointer;
}

.lightbox__panel {
    position: relative;
    z-index: 1;
    max-width: min(100%, 56rem);
    max-height: 100%;
    animation: lightbox-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes lightbox-in {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox__img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: min(88vh, 900px);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.lightbox__close {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, background 0.15s ease;
    z-index: 2;
}

.lightbox__close:hover {
    background: #fff;
    transform: scale(1.05);
}

@media (min-width: 640px) {
    .lightbox__close {
        top: -12px;
        right: -12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox__panel {
        animation: none;
    }
}