/* Public albums and their native top-layer viewer. No account/admin selectors. */
.public-gallery-page {
    --gallery-ink:var(--club-navy);
    --gallery-muted:#546978;
    --gallery-line:var(--line);
    --gallery-blue:var(--club-blue);
}
.public-gallery-page .public-gallery-heading { max-width:none; }
.public-gallery-page .public-gallery-heading>p:last-child { max-width:44ch; }
.public-gallery-page .public-gallery-albums { display:grid; gap:32px; }
.public-gallery-page .gallery-section { min-width:0; margin:0; }
.public-gallery-page .gallery-album-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; padding-bottom:20px; border-bottom:1px solid var(--gallery-line); }
.public-gallery-page .gallery-album-heading>div { min-width:0; }
.public-gallery-page .gallery-album-heading .eyebrow { margin:0 0 10px; }
.public-gallery-page .gallery-album-heading h2 { max-width:30ch; margin:0; font-size:clamp(25px,3vw,38px); line-height:1.17; letter-spacing:-.025em; color:var(--gallery-ink); overflow-wrap:anywhere; }
.public-gallery-page .gallery-album-count { flex-shrink:0; color:var(--gallery-muted); font-size:14px; padding-bottom:3px; }
.public-gallery-page .gallery-description { margin:0 0 24px; padding-block:12px; border-bottom:1px solid var(--gallery-line); }
.public-gallery-page .gallery-description summary { display:flex; align-items:center; justify-content:space-between; gap:20px; min-height:44px; padding:8px 0; list-style:none; color:var(--gallery-ink); font-size:15px; cursor:pointer; }
.public-gallery-page .gallery-description summary::-webkit-details-marker { display:none; }
.public-gallery-page .gallery-description summary svg { width:20px; height:20px; flex-shrink:0; }
.public-gallery-page .gallery-description[open] summary svg { transform:rotate(45deg); }
.public-gallery-page .gallery-description .plaintext { max-width:78ch; margin:12px 0 8px; font-size:16px; line-height:1.8; overflow-wrap:anywhere; }
.public-gallery-page .gallery-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-auto-rows:auto; grid-template-rows:none; gap:28px 24px; margin-top:24px; }
.public-gallery-page .gallery-grid .gallery-photo { display:block; grid-column:auto; grid-row:auto; margin:0; overflow:visible; border-radius:0; background:transparent; min-width:0; }
.public-gallery-page .gallery-photo a { display:block; height:auto; border-radius:10px; }
.public-gallery-page .gallery-photo__image { position:relative; display:block; aspect-ratio:4/3; overflow:hidden; border-radius:10px; background:#e2e8e9; }
.public-gallery-page .gallery-photo img { display:block; width:100%; height:100%; object-fit:cover; transition:transform .3s ease; }
.public-gallery-page .gallery-photo__expand { position:absolute; right:14px; bottom:14px; display:flex; align-items:center; justify-content:center; width:42px; height:42px; border:1px solid #ffffff6b; border-radius:50%; background:#f9fbf6ed; color:var(--gallery-ink); box-shadow:0 4px 16px #17334a18; }
.public-gallery-page .gallery-photo__expand svg { width:20px; height:20px; }
.public-gallery-page .gallery-photo a:hover img { transform:scale(1.035); }
.public-gallery-page .gallery-photo a:focus-visible { outline:3px solid var(--gallery-blue); outline-offset:5px; }
.public-gallery-page .gallery-grid figcaption { position:static; max-height:none; overflow:visible; margin:0; padding:13px 0 0; border-radius:0; background:transparent; color:var(--gallery-ink); font-size:15px; line-height:1.65; overflow-wrap:anywhere; }
.public-gallery-page .gallery-album-empty { display:flex; align-items:flex-start; gap:12px; margin:20px 0 0; padding:18px 20px; background:var(--club-blue-soft); border-radius:8px; color:var(--gallery-muted); line-height:1.65; }
.public-gallery-page .gallery-album-empty svg { width:22px; height:22px; margin-top:2px; flex-shrink:0; }
.public-gallery-page .gallery-next { display:flex; justify-content:space-between; align-items:center; gap:28px; margin-top:32px; padding:28px; border:1px solid var(--gallery-line); border-top:3px solid var(--club-pink); border-radius:10px; background:linear-gradient(108deg,var(--club-blue-soft),var(--club-pink-soft)); }
.public-gallery-page .gallery-next .eyebrow { margin:0 0 12px; }
.public-gallery-page .gallery-next h2 { margin:0 0 12px; color:var(--gallery-ink); font-size:clamp(25px,3vw,34px); line-height:1.2; }
.public-gallery-page .gallery-next p:last-child { margin:0; max-width:45ch; color:var(--gallery-muted); line-height:1.7; }
.public-gallery-page .gallery-next__actions { display:flex; flex-direction:column; align-items:flex-start; gap:14px; flex-shrink:0; }
.public-gallery-page .gallery-next__actions .text-link { min-height:44px; display:inline-flex; align-items:center; }

.gallery-viewer {
    position:fixed; inset:0; width:min(1120px,calc(100vw - 64px)); max-width:none;
    max-height:calc(100dvh - 48px); margin:auto; padding:0; overflow-x:hidden; overflow-y:auto;
    border:1px solid #d9e0e2; border-radius:16px; background:#F9FAFF; color:var(--club-navy);
    box-shadow:0 32px 100px #061b3566; overscroll-behavior:contain;
}
.gallery-viewer:not([open]) { display:none; }
.gallery-viewer[open] { display:block; }
.gallery-viewer::backdrop { background:#11283ee0; backdrop-filter:blur(6px); }
.gallery-viewer .gallery-viewer__header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin:0; padding:22px 24px 18px; border-bottom:1px solid #d9e0e2; }
.gallery-viewer .gallery-viewer__header>div { min-width:0; }
.gallery-viewer .eyebrow { margin:0 0 7px; font-size:10px; line-height:1.5; letter-spacing:.13em; color:#546978; }
.gallery-viewer .gallery-viewer__header h2 { margin:0; max-width:65ch; font-size:19px; line-height:1.4; letter-spacing:-.015em; overflow-wrap:anywhere; }
.gallery-viewer button { display:inline-flex; align-items:center; justify-content:center; gap:10px; min-width:44px; min-height:44px; margin:0; padding:10px 15px; border:1px solid #cbd7dc; border-radius:7px; background:#fff; color:#17334a; font:inherit; font-size:14px; line-height:1.4; cursor:pointer; }
.gallery-viewer button:hover { background:var(--club-blue-soft); border-color:var(--club-blue); }
.gallery-viewer button:focus-visible { outline:3px solid var(--club-pink-deep); outline-offset:3px; }
.gallery-viewer button svg { width:20px; height:20px; flex-shrink:0; }
.gallery-viewer .gallery-viewer__close { flex-shrink:0; padding:10px; }
.gallery-viewer .gallery-viewer__figure { display:block; min-width:0; margin:0; }
.gallery-viewer .gallery-viewer__stage { display:flex; align-items:center; justify-content:center; min-height:180px; padding:20px; background:var(--club-blue-soft); }
.gallery-viewer .gallery-viewer__stage img { display:block; width:100%; height:auto; max-height:57dvh; min-height:0; object-fit:contain; }
.gallery-viewer .gallery-viewer__caption { position:static; max-height:none; overflow:visible; margin:0; padding:20px 24px 4px; color:#17334a; background:transparent; font-size:16px; line-height:1.7; overflow-wrap:anywhere; white-space:pre-line; }
.gallery-viewer .gallery-viewer__footer { display:flex; justify-content:space-between; align-items:center; gap:16px; margin:0; padding:18px 24px 22px; }
.gallery-viewer .gallery-viewer__position { margin:0; font-size:14px; line-height:1.6; color:#546978; }
.gallery-viewer .gallery-viewer__navigation { display:flex; gap:10px; }
.gallery-viewer .gallery-viewer__navigation[hidden] { display:none; }
@media (max-width:1000px) {
    .public-gallery-page .gallery-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .public-gallery-page .gallery-next { align-items:flex-start; flex-direction:column; }
    .public-gallery-page .gallery-next__actions { flex-direction:row; flex-wrap:wrap; align-items:center; gap:16px 24px; flex-shrink:1; }
}
@media (max-width:600px) {
    .public-gallery-page .public-gallery-heading { margin-bottom:20px; }
    .public-gallery-page .public-gallery-albums { gap:28px; }
    .public-gallery-page .gallery-album-heading { align-items:flex-start; flex-direction:column; gap:12px; }
    .public-gallery-page .gallery-grid { grid-template-columns:minmax(0,1fr); gap:26px; }
    .public-gallery-page .gallery-photo__image { aspect-ratio:4/3; }
    .public-gallery-page .gallery-photo__expand { right:12px; bottom:12px; }
    .public-gallery-page .gallery-next { margin-top:40px; padding:24px; }
    .public-gallery-page .gallery-next__actions { align-items:flex-start; flex-direction:column; width:100%; }
    .public-gallery-page .gallery-next__actions .button { width:100%; justify-content:space-between; }
    .gallery-viewer { width:100vw; height:100dvh; max-height:100dvh; margin:0; border:0; border-radius:0; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
    .gallery-viewer .gallery-viewer__header { padding:18px 16px; gap:12px; }
    .gallery-viewer .gallery-viewer__header h2 { font-size:16px; }
    .gallery-viewer .gallery-viewer__stage { min-height:220px; padding:12px; }
    .gallery-viewer .gallery-viewer__stage img { max-height:52dvh; }
    .gallery-viewer .gallery-viewer__caption { padding:20px 16px 0; }
    .gallery-viewer .gallery-viewer__footer { flex-wrap:wrap; padding:20px 16px; }
    .gallery-viewer .gallery-viewer__navigation { margin-left:auto; }
    .gallery-viewer .gallery-viewer__navigation button { padding:10px; }
    .gallery-viewer .gallery-viewer__navigation button span { display:none; }
}
@media (prefers-reduced-motion:reduce) {
    .public-gallery-page .gallery-photo img { transition:none; }
}

.public-gallery-albums > [data-live-ignore] { display:grid; gap:32px; min-width:0; }
.gallery-album-heading h2 a { color:inherit; text-decoration:none; }
.gallery-album-heading h2 a:hover { text-decoration:underline; text-underline-offset:.2em; }
.gallery-album-more { margin:24px 0 0; }

/* Reach the photographs sooner without hiding album context or share actions. */
@media (min-width: 768px) {
    .public-gallery-page .public-gallery-heading>p:last-child { max-width: 72ch; }
    .public-gallery-page .gallery-album-heading { padding-bottom: 12px; gap: 16px; align-items: center; }
    .public-gallery-page .gallery-album-heading .eyebrow { margin-bottom: 4px; }
    .public-gallery-page .gallery-album-heading h2 { font-size: 28px; }
    .public-gallery-page .gallery-description { margin-bottom: 12px; padding-block: 2px; }
    .public-gallery-page .gallery-grid { gap: 20px; margin-top: 16px; }
    .public-gallery-page .public-surface>.public-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 0 0 20px; padding: 0 0 16px; border-top: 0; }
    .public-gallery-page .public-share__label { margin: 0; }
    .public-gallery-page .public-share__manual,.public-gallery-page .public-share__status { flex-basis: 100%; margin: 0; }
}
