/* ─── Public photo gallery (org-gallery.html + league-gallery.html) ─────────
 * Rendered by js/gallery-page-core.js. Accent = --highlight-color, shapes =
 * --brand-radius-*. Class names avoid the -card/-panel/-badge/-chip/-pill
 * suffixes styles.css themes globally; buttons carry :not(#_).
 */

.gp-shell {
  --gp-accent: var(--highlight-color, var(--button-primary-bg, #8b5cf6));
  --gp-line: var(--surface-border, rgba(255,255,255,.1));
  --gp-surface: var(--surface-1, rgba(255,255,255,.05));
  --gp-radius: var(--brand-radius-lg, 18px);
  --gp-row: 240px;
  width: 100%;
  box-sizing: border-box;
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px 18px 72px;
  position: relative;
  z-index: 1;
  color: var(--text);
}
@media (max-width: 720px) { .gp-shell { --gp-row: 150px; padding-top: 12px; } }

/* Spinner-only until ready, like the schedule and announcements pages. */
.gp-loading { display: flex; align-items: center; justify-content: center; min-height: 50vh; }
.gp-loading .loading-spinner { margin: 0; border-color: rgba(255,255,255,.14); border-top-color: var(--gp-accent); }
.gp-shell.is-loading #galleryHero { display: none !important; }
.gp-shell.is-ready > * { animation: gp-in .35s ease both; }
@keyframes gp-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .gp-shell.is-ready > * { animation: none; } }
.gp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The page heading keeps its .gallery-heading hooks; tighten it for this layout. */
.gp-shell .gallery-heading { padding: 8px 0 18px; margin: 0; }
.gp-shell .gallery-heading h1 { font-size: clamp(1.45rem, 3.2vw, 1.9rem); letter-spacing: -0.02em; }
.gp-shell .gallery-stat i { color: var(--gp-accent); }

/* ---- Albums -------------------------------------------------------------- */
.gp-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
@media (max-width: 620px) { .gp-albums { grid-template-columns: 1fr; gap: 14px; } }
.gp-album {
  position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3;
  border-radius: var(--gp-radius); background: rgba(0,0,0,.3); color: #fff; text-decoration: none;
  border: 1px solid var(--gp-line); isolation: isolate;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.gp-album:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -20px rgba(0,0,0,.7); border-color: color-mix(in srgb, var(--gp-accent) 45%, var(--gp-line)); }
.gp-album:focus-visible { outline: 3px solid var(--gp-accent); outline-offset: 3px; }
.gp-album__cover { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; color: rgba(255,255,255,.4); }
.gp-album__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.gp-album:hover .gp-album__cover img { transform: scale(1.05); }
.gp-album__cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.25) 45%, transparent 70%); }
.gp-album__text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 3px; padding: 18px 18px 16px; }
.gp-album__name { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.gp-album__meta { font-size: .82rem; font-weight: 650; color: rgba(255,255,255,.8); }
.gp-album__desc { font-size: .84rem; color: rgba(255,255,255,.78); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Album page ---------------------------------------------------------- */
.gp-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-weight: 700; font-size: .9rem; color: var(--text); text-decoration: none; }
.gp-back:hover { color: var(--gp-accent); }
.gp-albumhead { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 16px; }
.gp-albumhead h2 { margin: 0; font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.gp-albumhead p { margin: 0; color: var(--muted); font-size: .9rem; flex: 1 1 auto; }
.gp-sharebtn:not(#_) {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; min-height: 0; width: auto; cursor: pointer;
  border: 1px solid var(--gp-line) !important; border-radius: var(--brand-radius-pill, 999px) !important;
  background: var(--gp-surface) !important; box-shadow: none !important; transform: none !important;
  color: var(--text) !important; font: inherit; font-size: .84rem; font-weight: 700;
}
.gp-sharebtn:not(#_):hover { border-color: color-mix(in srgb, var(--gp-accent) 55%, var(--gp-line)) !important; }

/* Justified rows: each tile grows by its aspect ratio, so rows stay even and
   photos keep their shape; stored width/height reserve space before load. */
.gp-justified { display: flex; flex-wrap: wrap; gap: 8px; }
.gp-justified::after { content: ""; flex-grow: 999999; }
.gp-tile { position: relative; display: block; overflow: hidden; border-radius: 12px; background: rgba(255,255,255,.05); min-width: 0; }
.gp-tile::before { content: ""; display: block; padding-top: calc(100% / var(--ar, 1.333)); }
.gp-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, filter .2s ease; }
.gp-tile:hover img { transform: scale(1.04); }
.gp-tile:focus-visible { outline: 3px solid var(--gp-accent); outline-offset: 2px; }
.gp-tile__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; font-size: .78rem; font-weight: 650; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.72)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s ease; }
.gp-tile:hover .gp-tile__cap, .gp-tile:focus-visible .gp-tile__cap { opacity: 1; }
@media (hover: none) { .gp-tile__cap { opacity: 1; } }
@media (max-width: 720px) { .gp-justified { gap: 4px; } .gp-tile { border-radius: 6px; } }

/* ---- Empty --------------------------------------------------------------- */
.gp-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 56px 20px; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); background: var(--gp-surface); color: var(--muted); }
.gp-empty h2 { margin: 6px 0 0; font-size: 1.15rem; color: var(--text); }
.gp-empty p { margin: 0; max-width: 420px; line-height: 1.5; }
.gp-empty__icon { width: 56px; height: 56px; display: grid; place-items: center; font-size: 1.6rem; border-radius: 18px; background: color-mix(in srgb, var(--gp-accent) 14%, transparent); color: var(--gp-accent); }

/* ---- Viewer -------------------------------------------------------------- */
html.gp-lock, html.gp-lock body { overflow: hidden; }
.gp-viewer {
  --gp-accent: var(--highlight-color, #8b5cf6);
  position: fixed; inset: 0; z-index: 10050; display: none;
  grid-template-columns: 64px minmax(0, 1fr) 64px; grid-template-rows: auto minmax(0, 1fr);
  background: rgba(5, 6, 9, .96); color: #fff; touch-action: pan-y;
}
.gp-viewer.is-open { display: grid; animation: gp-in .18s ease; }
.gp-viewer__top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px 18px; }
.gp-viewer__count { font-size: .86rem; font-weight: 700; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; }
.gp-viewer__actions { display: flex; gap: 4px; }
.gp-vbtn:not(#_) {
  width: 44px; height: 44px; min-height: 0; padding: 0; display: inline-grid; place-items: center; cursor: pointer;
  border: 0 !important; border-radius: 50% !important; background: rgba(255,255,255,.08) !important; box-shadow: none !important; transform: none !important;
  color: #fff !important; font-size: 1.25rem; text-decoration: none;
}
.gp-vbtn:not(#_):hover:not(:disabled) { background: rgba(255,255,255,.18) !important; }
.gp-vbtn:not(#_):disabled { opacity: .25; cursor: default; }
.gp-vbtn:not(#_):focus-visible { outline: 2px solid var(--gp-accent); outline-offset: 2px; }
.gp-viewer__nav { align-self: center; justify-self: center; }
.gp-viewer__nav--prev { grid-column: 1; grid-row: 2; }
.gp-viewer__nav--next { grid-column: 3; grid-row: 2; }
.gp-viewer__stage { grid-column: 2; grid-row: 2; margin: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 0 0 18px; }
.gp-viewer__stage img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none; filter: blur(0); transition: filter .25s ease; }
.gp-viewer__stage img:not(.is-ready) { filter: blur(1.5px); }
.gp-viewer__stage figcaption { max-width: 720px; text-align: center; display: flex; flex-direction: column; gap: 3px; font-size: .92rem; line-height: 1.45; color: rgba(255,255,255,.82); padding: 0 16px; }
.gp-viewer__stage figcaption strong { color: #fff; font-size: 1rem; }
@media (max-width: 720px) {
  .gp-viewer { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .gp-viewer__nav { display: none !important; }
  .gp-viewer__stage img { max-height: calc(100vh - 170px); border-radius: 0; }
}
