/* Visibility must respect the admin Publish checkbox: hidden archive/nav stay hidden even when grid/layout styles set display. */
#past-events[hidden],nav a[href="#past-events"][hidden]{display:none!important}

/* APE-335: event archive + shared, attributed event photo gallery. */
.past-event-card{display:flex;flex-direction:column;gap:0}
.past-event-card .past-place{margin-bottom:10px}
.past-event-card p{margin:0 0 14px}
.past-event-images{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:12px 0 16px}
.past-event-images a{display:block;min-width:0;border-radius:9px;overflow:hidden}
.past-event-images a:focus-visible{outline:3px solid #2e713c;outline-offset:3px}
.past-event-images img{width:100%;aspect-ratio:1/1;object-fit:cover;display:block}
.past-event-title-link{color:inherit;text-decoration:none;border-radius:4px;cursor:pointer;transition:color .15s}
.past-event-title-link:hover{color:#28683d;text-decoration:none}
.past-event-title-link:focus-visible{outline:3px solid #2e713c;outline-offset:3px;color:#28683d;text-decoration:none}
.past-empty{grid-column:1/-1;color:#627067;margin:0 0 10px}
.gallery-attribution{display:block;margin-top:4px;color:#dceedd;font-weight:500;font-size:12px;line-height:1.4}
.gallery-attribution a{color:white;font-weight:800;text-decoration:underline;text-underline-offset:3px;position:relative;z-index:3}
.gallery-attribution a:focus-visible{outline:2px solid #fff;outline-offset:2px}
@media(max-width:900px){.past-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.past-grid{grid-template-columns:1fr}.past-event-images{gap:9px}.gallery-attribution{font-size:11px}}


/* APE-335: bottom-aligned compact photo row: 3 thumbnails + see-more tile.
   The tile expands additional photos in the same card without a navigation jump. */
.past-event-photo-footer{margin-top:auto;padding-top:12px}
.past-event-photo-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.past-photo-thumb{display:block;aspect-ratio:1/1;min-width:0;overflow:hidden;border-radius:8px;background:#e9efe6}
.past-photo-thumb img{display:block;width:100%;height:100%;object-fit:cover}
.past-photo-thumb:focus-visible,.past-photos-more:focus-visible{outline:3px solid #2e713c;outline-offset:2px}
.past-photos-more{
 display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
 aspect-ratio:1/1;width:100%;min-width:0;padding:5px;
 border:1px solid #9cbea1;border-radius:8px;background:#e8f2e5;color:#275f38;
 cursor:pointer;font-family:inherit;font-weight:800;font-size:11px;line-height:1.25;text-align:center
}
.past-photos-more:hover{background:#d7ebd1}
.past-photos-plus{font-size:21px;line-height:1;font-weight:800}
.past-event-album{margin-top:8px}
.past-event-album[hidden]{display:none!important}
@media(max-width:600px){
 .past-event-photo-grid{gap:6px}
 .past-photos-more{font-size:10px}
 .past-photos-plus{font-size:20px}
}

/* Photo thumbnails are the bottommost content when an event has images. */


/* Three rows initially (3x3 desktop / 2x3 tablet / 1x3 mobile).
   On demand, the archive itself scrolls instead of taking over the page. */
.past-grid:not(.is-expanded)>.past-card:nth-of-type(n+10){display:none}
.past-grid.is-expanded{max-height:min(74vh,900px);overflow-y:auto;overscroll-behavior:contain;padding:4px 10px 10px 4px;scrollbar-gutter:stable}
.past-archive-controls{display:flex;justify-content:center;margin-top:18px}
.past-archive-controls [hidden]{display:none!important}
.past-summary{font-size:14px;line-height:1.55;color:#5c685d}
.past-summary[hidden],.past-details-expanded[hidden]{display:none!important}
.past-details-expanded p{white-space:pre-line;overflow-wrap:anywhere}
.past-details-toggle{align-self:flex-start;margin:0 0 13px;padding:5px 0;border:0;background:none;color:#28683d;font-weight:800;font-size:13px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.past-details-toggle:focus-visible{outline:3px solid #2e713c;outline-offset:2px}
.past-event-card .past-photo-footer,.past-event-card .past-event-photo-footer{margin-top:auto}
@media(max-width:900px){
 .past-grid:not(.is-expanded)>.past-card:nth-of-type(n+7){display:none}
}
@media(max-width:600px){
 .past-grid:not(.is-expanded)>.past-card:nth-of-type(n+4){display:none}
 .past-grid.is-expanded{max-height:72vh;padding-right:7px}
}


/* APE-426 — Past Events thumbnails open the shared viewer (gallery-viewer.css). */
.past-photo-thumb{border:0;padding:0;cursor:pointer;font:inherit}
