/* Galleries: the Galleries page (/galleries.html), the static list (/galleries/) and each gallery page.
   Builds on styles.css tokens and classes (.wrap, .eyebrow, .filters, .gallery-card, dialog). */

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Draft preview banner */
.preview-banner{background:var(--gold);color:var(--green);text-align:center;padding:12px 20px;font-size:13px;font-weight:700;letter-spacing:.3px;border-bottom:2px solid #c99a2e}
.preview-banner span{font-weight:400;margin-left:6px}

/* Page heading additions */
.gallery-heading .eyebrow{text-transform:uppercase}
.gallery-heading h1{font-size:clamp(40px,6vw,64px);overflow-wrap:anywhere}
.gallery-meta{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px;margin-top:22px;font-size:12px;font-weight:700;letter-spacing:.5px;color:#5e6b58}
.gallery-meta span+span:before{content:'·';margin-right:18px;color:#a7ad9d}

/* Photo grid: justified rows. Each tile grows in proportion to its aspect ratio, so every row
   has one height and every photo keeps its shape. --w and --h come from the template. */
.photo-section{padding:10px 0 40px}
.photo-grid{--row:150px;display:flex;flex-wrap:wrap;gap:6px}
.photo-grid:after{content:'';flex:999 1 0}
.photo-tile{--w:3;--h:2;position:relative;display:block;flex:calc(var(--w) / var(--h)) 1 calc(var(--w) / var(--h) * var(--row));aspect-ratio:var(--w) / var(--h);min-width:0;max-width:100%;overflow:hidden;background:var(--paper) center/cover no-repeat;border-radius:2px}
.photo-tile img{width:100%;height:100%;object-fit:cover;transition:opacity .35s,transform .3s}
.photo-tile.is-waiting img{opacity:0}
.photo-tile:hover img{transform:scale(1.03)}
.photo-tile:focus-visible{outline-offset:3px;z-index:1}
@media(min-width:761px){.photo-grid{--row:220px;gap:8px}}
@media(min-width:1101px){.photo-grid{--row:250px}}

/* Section headings inside a gallery */
.gallery-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:20px;border-top:1px solid var(--line);padding-top:30px;margin-bottom:24px}
.gallery-section-head h2{font-size:32px}
.gallery-section-head p{margin:0;font-size:12px;font-weight:700;color:#6c7464}

/* Videos */
.video-section{padding:20px 0 40px}
.video-list{display:grid;grid-template-columns:1fr;gap:30px}
.video-card{margin:0}
.video-frame{background:#16271f center/cover no-repeat;border-radius:3px;overflow:hidden;display:flex;justify-content:center}
.video-frame video{display:block;width:100%;height:auto;max-height:75vh;background:transparent}
.video-card figcaption{display:flex;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid var(--line);font-size:14px}
.video-card figcaption small{font-size:11px;font-weight:700;letter-spacing:1px;color:#717664;white-space:nowrap}
@media(min-width:761px){.video-list{grid-template-columns:1fr 1fr}}

/* Privacy note and back link */
.gallery-privacy{background:#eee8d7;padding:22px 24px;border-radius:3px;font-size:14px;color:#4f5c4b;margin:10px 0 40px;text-align:center}
.gallery-privacy a{font-weight:700;text-decoration:underline;text-underline-offset:3px;user-select:all;-webkit-user-select:all}
.back-row{padding:0 0 70px}

/* Album cards (Galleries page, /galleries/ list, Related galleries) */
.album-grid{display:grid;grid-template-columns:1fr;gap:26px}
@media(min-width:620px){.album-grid{grid-template-columns:1fr 1fr}}
@media(min-width:1000px){.album-grid{grid-template-columns:repeat(3,1fr)}}
.album-card{display:block}
.album-cover{position:relative;display:block;aspect-ratio:4 / 3;overflow:hidden;background:var(--paper) center/cover no-repeat;border-radius:2px}
.album-cover img{width:100%;height:100%;object-fit:cover;transition:opacity .35s,transform .3s}
.album-cover.is-waiting img{opacity:0}
.album-card:hover .album-cover img{transform:scale(1.04)}
.album-cover.no-cover{display:flex;align-items:center;justify-content:center;background:#eee8d7;color:var(--red);font-size:46px}
.album-card .gallery-caption{padding:18px 0}
.album-card .gallery-caption strong{font-size:22px;line-height:1.2}
.album-count{display:block;font-size:12px;color:#66705f;margin-top:6px}
.video-badge{position:absolute;left:12px;top:12px;background:var(--green);color:var(--cream);font-size:10px;font-weight:700;letter-spacing:1.2px;padding:6px 10px;border-radius:2px;text-transform:uppercase}
.video-badge:before{content:'▶';margin-right:6px;font-size:9px}

/* Galleries page */
.galleries-section{padding:20px 0 85px}
.galleries-section .archive-top h2{font-size:32px}
/* One row of chips that scrolls sideways when there are many events, so it never changes height. */
.galleries-section .archive-top{gap:20px}
.event-filters{flex-wrap:nowrap;overflow-x:auto;max-width:100%;min-width:0;min-height:52px;scrollbar-width:thin}
.event-filters:empty{border-color:transparent}
.event-filters button{flex-shrink:0;white-space:nowrap}
.gallery-years.is-loading{min-height:100vh}
.gallery-year{margin-top:40px}
.gallery-year:first-child{margin-top:0}
.year-heading{display:flex;align-items:center;gap:20px;font-size:44px;color:var(--red);margin-bottom:26px}
.year-heading:after{content:'';flex:1;height:1px;background:var(--line)}
.galleries-status{font-size:13px;color:#66715e;min-height:22px;margin:0 0 18px}
.galleries-empty h2 em{color:var(--red)}
.noscript-note{background:#eee8d7;padding:18px 20px;font-size:14px;text-align:center;border-radius:3px}
.noscript-note a{font-weight:700;text-decoration:underline}
.galleries-list .gallery-year{margin-top:50px}
.album-list{list-style:none;margin:0;padding:0}

/* Photo viewer (dialog). Reuses the site's dialog look, wider for photos. */
.photo-viewer{width:min(1400px,96vw);max-width:none;max-height:96vh;padding:46px 16px 16px;overflow:hidden}
.photo-viewer[open]{display:flex;flex-direction:column}
.viewer-close{position:absolute;right:9px;top:5px;background:transparent;font-size:32px;line-height:1.2;width:38px;height:38px;border-radius:3px}
.photo-viewer button:focus-visible{outline-offset:-3px}
.viewer-stage{position:relative;margin:0;flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;touch-action:pan-y pinch-zoom}
.viewer-stage img{display:block;max-width:100%;max-height:none;object-fit:contain;background:var(--paper) center/cover no-repeat;margin:auto}
.viewer-nav{position:absolute;top:50%;transform:translateY(-50%);width:46px;height:46px;border-radius:50%;background:#fff9edd9;color:var(--green);font-size:30px;line-height:1;box-shadow:0 2px 10px #0003;display:flex;align-items:center;justify-content:center}
.viewer-nav:hover{background:var(--cream)}
.viewer-nav[disabled]{opacity:.35;cursor:default}
.viewer-prev{left:8px}
.viewer-next{right:8px}
.viewer-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-top:14px;flex-wrap:wrap}
.photo-viewer .viewer-bar p{margin:0;text-align:left;font-size:13px;flex:1 1 200px}
.viewer-count{font-size:11px;font-weight:700;letter-spacing:1px;color:#717664;white-space:nowrap}
.viewer-download{white-space:nowrap}
@media(max-width:760px){
  .photo-viewer{width:100vw;height:100vh;height:100dvh;max-height:none;border-radius:0;padding:48px 10px 14px}
  .viewer-nav{width:40px;height:40px;font-size:26px}
  .gallery-section-head h2{font-size:28px}
  .year-heading{font-size:36px}
}

@media(prefers-reduced-motion:reduce){
  .photo-tile:hover img,.album-card:hover .album-cover img{transform:none}
}
.galleries-empty .text-link{margin:20px 12px 0}
.galleries-section .archive-note a{text-decoration:underline;text-underline-offset:3px}
