/* Événements : cartes de date, mosaïque photo et visionneuse */

/* ---------- Bloc date (calendrier) ---------- */
.event-date {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 92px; padding: 14px 10px; border-radius: 1.5rem;
    color: #031827; background: linear-gradient(160deg, #a5f3fc, #67e8f9);
    box-shadow: 0 12px 30px rgba(6, 182, 212, .35); line-height: 1;
}
.event-date__weekday { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.event-date__day { margin: 6px 0 4px; font-size: 44px; font-weight: 900; letter-spacing: -.04em; }
.event-date__month { font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.event-date--dark { color: white; background: linear-gradient(160deg, #0e7490, #031827); box-shadow: 0 12px 30px rgba(3, 24, 39, .35); }

/* ---------- Compte à rebours ---------- */
.event-countdown { display: flex; gap: 10px; }
.event-countdown > div {
    min-width: 64px; padding: 10px 8px; border-radius: 1rem; text-align: center;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12);
}
.event-countdown strong { display: block; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.event-countdown span { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }

.event-pulse { position: relative; display: inline-flex; width: 10px; height: 10px; }
.event-pulse::before, .event-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #22d3ee; }
.event-pulse::before { animation: event-pulse 1.8s ease-out infinite; }
@keyframes event-pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(2.8); opacity: 0; } }

/* ---------- Aperçu galerie (cartes souvenirs) ---------- */
.memory-preview { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; height: 280px; }
.memory-preview > * { overflow: hidden; border-radius: 1rem; background: #e0f2fe; }
.memory-preview > :first-child { grid-row: 1 / 3; }
.memory-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.memory-card:hover .memory-preview img { transform: scale(1.06); }
.memory-preview--single { grid-template-columns: 1fr; }
.memory-preview--single > :first-child { grid-row: 1 / 3; }
.memory-preview__more {
    position: relative;
}
.memory-preview__more::after {
    content: attr(data-more); position: absolute; inset: 0; display: grid; place-items: center;
    color: white; background: rgba(3, 24, 39, .55); font-size: 22px; font-weight: 900;
}

/* Frise des années */
.memory-year { position: relative; padding-left: 0; }
@media (min-width: 1024px) {
    .memory-year { display: grid; grid-template-columns: 140px 1fr; gap: 40px; }
    .memory-year__label { position: sticky; top: 120px; align-self: start; }
}
.memory-year__label span {
    font-size: 64px; font-weight: 900; letter-spacing: -.05em; line-height: 1;
    background: linear-gradient(180deg, #0e7490, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Mosaïque de la galerie ---------- */
.event-gallery {
    display: grid; gap: 10px;
    grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; grid-auto-flow: dense;
}
@media (min-width: 768px) { .event-gallery { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 210px; gap: 14px; } }
@media (min-width: 1280px) { .event-gallery { grid-template-columns: repeat(4, 1fr); } }
.event-gallery__item {
    position: relative; overflow: hidden; padding: 0; border: 0; border-radius: 1.25rem;
    background: #e0f2fe; cursor: zoom-in; text-align: left;
}
.event-gallery__item--portrait { grid-row: span 2; }
.event-gallery__item--wide { grid-column: span 2; grid-row: span 2; }
.event-gallery__item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .7s cubic-bezier(.16, 1, .3, 1), filter .4s ease;
}
.event-gallery__item:hover img, .event-gallery__item:focus-visible img { transform: scale(1.07); filter: saturate(1.1); }
.event-gallery__item:focus-visible { outline: 4px solid #67e8f9; outline-offset: 3px; }
.event-gallery__caption {
    position: absolute; inset: auto 0 0; padding: 40px 16px 14px;
    color: white; font-size: 14px; font-weight: 600; line-height: 1.4;
    background: linear-gradient(180deg, transparent, rgba(3, 24, 39, .85));
    transform: translateY(12px); opacity: 0; transition: .35s ease;
}
.event-gallery__item:hover .event-gallery__caption, .event-gallery__item:focus-visible .event-gallery__caption { transform: none; opacity: 1; }
@media (hover: none) { .event-gallery__caption { transform: none; opacity: 1; } }
.event-gallery__zoom {
    position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center;
    border-radius: 50%; color: #031827; background: rgba(255, 255, 255, .9); opacity: 0; transition: .3s ease;
}
.event-gallery__item:hover .event-gallery__zoom { opacity: 1; }

/* ---------- Visionneuse plein écran ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
    color: white; background: rgba(2, 10, 18, .96); backdrop-filter: blur(10px);
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.lightbox__counter { font-weight: 800; letter-spacing: .1em; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.lightbox__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 70px; touch-action: pan-y; }
.lightbox__image {
    max-width: 100%; max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px);
    width: auto; height: auto; object-fit: contain; border-radius: 1rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5); transition: opacity .25s ease, transform .25s ease;
}
.lightbox__image.is-loading { opacity: 0; transform: scale(.98); }
.lightbox__button {
    display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%;
    color: white; background: rgba(255, 255, 255, .1); font-size: 20px; cursor: pointer; transition: background .2s ease;
}
.lightbox__button:hover, .lightbox__button:focus-visible { background: #0891b2; outline: none; }
.lightbox__prev, .lightbox__next { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 12px; }
.lightbox__next { right: 12px; }
.lightbox__caption { max-width: 760px; margin: 0 auto; padding: 18px 24px 28px; text-align: center; font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, .9); }
.lightbox__caption:empty { padding-bottom: 12px; }
@media (max-width: 640px) {
    .lightbox__stage { padding: 0 8px; }
    .lightbox__prev, .lightbox__next { top: auto; bottom: -64px; transform: none; }
    .lightbox__prev { left: 20px; }
    .lightbox__next { right: 20px; }
    .lightbox__caption { padding-bottom: 80px; font-size: 15px; }
}
body.lightbox-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .event-pulse::before { animation: none; }
    .event-gallery__item img, .memory-preview img, .lightbox__image { transition: none; }
}
