/* School gallery and event albums. */
.gallery-page .gallery-hero {
  position: relative;
  overflow: hidden;
  padding: 30px 0 56px;
  color: var(--cream);
  background: radial-gradient(ellipse at 100% 0, rgba(242, 170, 43, .14), transparent 52%), var(--base-deep);
}
.gallery-hero::after {
  position: absolute;
  right: -100px;
  bottom: -220px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255, 248, 233, .09);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255, 248, 233, .025), 0 0 0 110px rgba(255, 248, 233, .025);
  content: "";
  pointer-events: none;
}
.gallery-hero .container { position: relative; z-index: 1; }
.gallery-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  color: #c1d3d5;
  font-size: .78rem;
}
.gallery-breadcrumb a:hover { color: var(--accent-bright); }
.gallery-breadcrumb [aria-current] { color: var(--cream); }
.gallery-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
.gallery-page .eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--maroon);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.gallery-hero .eyebrow { color: var(--accent-bright); }
.gallery-hero h1 {
  max-width: 900px;
  margin: 0 0 18px;
  color: var(--cream);
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(2.3rem, 4.4vw, 3.65rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.gallery-hero h1 em { color: var(--accent-bright); font-style: normal; }
.gallery-hero-copy > p { max-width: 680px; margin: 0; color: #cfdee0; line-height: 1.8; }
.gallery-section { padding: 65px 0 85px; }
.gallery-section-heading, .album-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 32px;
}
.gallery-page :is(.gallery-section-heading, .album-heading) h2 {
  margin: 0 0 12px;
  color: var(--base-deep);
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(1.6rem, 2.7vw, 2.15rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.03em;
}
.gallery-section-heading p, .album-heading p { max-width: 740px; margin: 0; color: var(--muted); }
.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.event-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e6e6dc;
  border-radius: 18px 18px 5px 18px;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(5, 43, 52, .045);
  transition: transform .25s ease, box-shadow .25s ease;
}
.event-card:hover { transform: translateY(-6px); box-shadow: 0 20px 42px rgba(5, 43, 52, .12); }
.event-card-link { display: flex; height: 100%; flex-direction: column; }
.event-card-image { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #f0ebdf; }
.event-card-image img { width: 100%; height: 100%; object-fit: contain; transition: filter .25s ease; }
.event-card:hover .event-card-image img { filter: saturate(1.08); }
.event-card-category {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 5px 10px;
  border-radius: 4px;
  color: var(--white);
  background: var(--maroon);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.event-card-body { display: flex; flex: 1; flex-direction: column; padding: 24px; }
.event-card-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: .7rem; }
.event-card-meta i { margin-right: 5px; color: var(--maroon); }
.event-card h3 {
  margin: 15px 0 12px;
  color: var(--base-deep);
  font-size: 1.27rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -.025em;
}
.event-card-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #eceee8;
  color: var(--maroon);
  font-size: .8rem;
  font-weight: 800;
}
.event-card-action i { transition: transform .2s ease; }
.event-card:hover .event-card-action i { transform: translateX(4px); }
.album-intro { padding: 38px 0 0; }
.gallery-back { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 30px; color: var(--maroon); font-size: .8rem; font-weight: 700; }
.gallery-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.album-heading { padding-bottom: 28px; border-bottom: 1px solid #e2e7df; }
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  margin: 0 auto;
  padding-bottom: 50px;
}
.album-photo { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 9px; border: 1px solid #e4e5dc; border-radius: 12px; background: var(--white); }
.album-image-link { position: relative; display: block; flex: 0 0 auto; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: #f3eee3; }
.album-image-link img { width: 100%; height: 100%; object-fit: contain; }
.album-image-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  color: var(--white);
  background: rgba(5, 43, 52, .9);
  font-size: .83rem;
  transition: background .2s ease;
}
.album-image-link:hover .album-image-hint { background: var(--maroon); }
.album-photo figcaption { display: flex; flex: 1; min-height: 64px; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 7px 5px; font-size: .73rem; }
.album-photo-label { min-width: 0; color: var(--base-deep); font-weight: 700; }
.album-photo figcaption > span:last-child { flex: 0 0 auto; color: var(--muted); }
.album-navigation { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding-block: 25px 50px; border-top: 1px solid #e2e7df; }
.album-navigation a { display: inline-flex; align-items: center; gap: 9px; color: var(--maroon); font-size: .82rem; font-weight: 700; }
.album-navigation a:hover { text-decoration: underline; text-underline-offset: 4px; }
.gallery-page :is(a, button):focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.event-card-link:focus-visible { outline-offset: -5px; border-radius: 18px; }
body.gallery-viewer-open { overflow: hidden; }
.image-viewer {
  width: min(1280px, calc(100vw - 40px));
  height: min(900px, calc(100dvh - 40px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid #49636b;
  border-radius: 14px;
  color: var(--white);
  background: #0b2027;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .45);
}
.image-viewer[open] { display: flex; flex-direction: column; }
.image-viewer::backdrop { background: rgba(2, 13, 18, .9); }
.image-viewer form { position: absolute; top: 15px; right: 15px; z-index: 2; margin: 0; }
.image-viewer button { display: grid; flex: 0 0 auto; width: 42px; height: 42px; padding: 0; place-items: center; border: 1px solid #4c6268; border-radius: 50%; color: var(--white); background: #203a42; cursor: pointer; }
.image-viewer button:hover { border-color: var(--accent-bright); color: var(--accent-bright); }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: 20px; min-height: 73px; padding: 15px 78px 15px 24px; border-bottom: 1px solid #29424a; }
.viewer-toolbar p { margin: 0; font-size: .87rem; font-weight: 600; }
.viewer-toolbar a { flex: 0 0 auto; color: var(--accent-bright); font-size: .75rem; text-decoration: underline; text-underline-offset: 4px; }
.viewer-stage { display: grid; flex: 1; min-height: 0; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 14px; padding: 20px; }
.viewer-stage img { width: 100%; height: 100%; min-height: 0; max-height: 100%; object-fit: contain; }
.viewer-stage button[hidden] { visibility: hidden; display: grid; }
.viewer-instructions { flex: 0 0 auto; margin: 0; padding: 3px 20px 17px; color: #b7c9cd; font-size: .72rem; text-align: center; }
@media (max-width: 950px) {
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
}
@media (max-width: 640px) {
  .gallery-page .gallery-hero { padding: 24px 0 38px; }
  .gallery-breadcrumb { margin-bottom: 25px; font-size: .72rem; gap: 8px; }
  .gallery-hero h1 { font-size: clamp(2rem, 8vw, 2.7rem); }
  .gallery-hero-copy > p { font-size: .9rem; }
  .gallery-section { padding: 40px 0 55px; }
  .gallery-section-heading, .album-heading { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 24px; }
  .gallery-section-heading p, .album-heading p { font-size: .9rem; }
  .event-grid, .album-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .event-card-body { padding: 22px; }
  .event-card h3 { font-size: 1.3rem; }
  .album-intro { padding-top: 26px; }
  .gallery-back { margin-bottom: 24px; }
  .album-grid { padding-bottom: 30px; }
  .album-navigation { gap: 20px; padding-block: 23px 40px; }
  .album-navigation a { font-size: .77rem; }
  .image-viewer { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .image-viewer form { top: 13px; right: 12px; }
  .viewer-toolbar { min-height: 86px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; padding: 13px 65px 13px 16px; }
  .viewer-toolbar p { font-size: .77rem; }
  .viewer-stage { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 5px; padding: 12px 6px; }
  .viewer-stage button { width: 34px; height: 40px; border-radius: 8px; }
  .viewer-instructions { padding-bottom: 20px; font-size: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  .event-card, .event-card-image img, .event-card-action i, .album-image-hint { transition: none; }
}
