/*
 * Event photos: the swipeable strip at the top of the event page (templates/event.html)
 * and the thumbnails on the admin photo page (templates/admin/event-photos.html).
 * Pure CSS scroll-snap, no JavaScript. Colors and rounding come from the variables in theme.css.
 */

/* Strip: a horizontal scroll area inside the card. Only it scrolls, never the page. */
.event-photos {
    display: flex;
    gap: .5rem;
    min-width: 0;
    margin: 0;
    padding: .5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: .5rem;
    -webkit-overflow-scrolling: touch;
    background: var(--paper-alt, #f3ede0);
    border-top-left-radius: var(--bs-card-inner-border-radius);   /* matches the card corners */
    border-top-right-radius: var(--bs-card-inner-border-radius);
}
.event-photos:focus-visible { outline: 3px solid var(--accent-dark, #a9823a); outline-offset: -3px; }

/* Fixed height and 4:3 box, so the page does not jump while images load.
   Max 88% wide, so the next photo peeks in and shows that the strip can be swiped. */
.event-photo {
    position: relative;
    flex: 0 0 auto;
    height: clamp(12rem, 56vw, 24rem);
    aspect-ratio: 4 / 3;
    max-width: 88%;
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-sm, .8rem);
    background: var(--line, #ebe3d3);
    scroll-snap-align: start;
}
.event-photo:only-child { width: 100%; max-width: 100%; aspect-ratio: auto; }
.event-photo img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.event-photo figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.5rem .75rem .5rem;
    color: #fff;
    font-size: .9rem;
    line-height: 1.3;
    background: linear-gradient(transparent, rgba(0, 0, 0, .62));
}

/* "See all photos" link to the external album */
.photo-album-link {
    --bs-btn-color: var(--brand-dark, #133e45);
    --bs-btn-bg: var(--brand-soft, #e4efee);
    --bs-btn-border-color: var(--brand-soft, #e4efee);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand, #1d5a64);
    --bs-btn-hover-border-color: var(--brand, #1d5a64);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-dark, #133e45);
    --bs-btn-active-border-color: var(--brand-dark, #133e45);
}

/* Admin photo page */
.admin-photo-thumb {
    width: 160px;
    height: 120px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: var(--radius-sm, .8rem);
    background: var(--line, #ebe3d3);
}
