/* Gallery page */
body.page-gallery main {
  padding-top: 0;
  background: var(--ice);
}

body.page-gallery .site-header:not(.is-scrolled):not(.is-open) .topbar {
  border-bottom-color: rgba(232, 241, 244, 0.14);
}
body.page-gallery .site-header:not(.is-scrolled):not(.is-open) .topbar-meta a,
body.page-gallery .site-header:not(.is-scrolled):not(.is-open) .social-btn,
body.page-gallery .site-header:not(.is-scrolled):not(.is-open) .menu-toggle {
  color: var(--ice);
}
body.page-gallery .site-header:not(.is-scrolled):not(.is-open) .topbar-meta a:hover {
  color: var(--white);
}
body.page-gallery .site-header:not(.is-scrolled):not(.is-open) .nav a {
  color: var(--ice);
  background-image: linear-gradient(90deg, var(--peach) 0 50%, var(--ice) 50% 100%);
}
body.page-gallery .site-header:not(.is-scrolled):not(.is-open) .nav a:hover,
body.page-gallery .site-header:not(.is-scrolled):not(.is-open) .nav a.active {
  color: var(--peach);
}
body.page-gallery .site-header:not(.is-scrolled):not(.is-open) .brand strong {
  color: var(--white);
  background-image: linear-gradient(90deg, var(--peach) 0 50%, var(--white) 50% 100%);
}
body.page-gallery .site-header:not(.is-scrolled):not(.is-open) .brand small {
  color: var(--peach);
  background-image: linear-gradient(90deg, var(--peach) 0 50%, var(--white) 50% 100%);
  background-position: 0 0;
}

.gallery-hero {
  position: relative;
  margin-top: 0;
  --gallery-gradient-h: calc(var(--header) + var(--topbar) + clamp(320px, 42vh, 460px));
  min-height: var(--gallery-gradient-h);
  padding: calc(var(--header) + var(--topbar) + 28px) 0 clamp(56px, 7vw, 88px);
  color: var(--white);
  background:
    radial-gradient(ellipse 70% 55% at 88% 22%, rgba(192, 104, 80, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 60% 50% at 10% 78%, rgba(8, 136, 144, 0.24) 0%, transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy) 62%, #1a4a72 80%, var(--ice) 100%);
  overflow: hidden;
}
.gallery-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(30vw, 220px);
  background: linear-gradient(180deg, rgba(232, 241, 244, 0) 0%, var(--ice) 88%, var(--ice) 100%);
  pointer-events: none;
  z-index: 1;
}
.gallery-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.gallery-hero-bg::before {
  content: "";
  position: absolute;
  width: min(38vw, 380px);
  aspect-ratio: 1;
  left: clamp(-48px, -2vw, 0px);
  bottom: 10%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0 30px,
    rgba(232, 241, 244, 0.16) 30px 31.6px
  );
}
.gallery-hero-bg::after {
  content: "";
  position: absolute;
  width: min(42vw, 420px);
  aspect-ratio: 1;
  right: clamp(-40px, -2vw, 0px);
  top: calc(var(--header) + var(--topbar) + 24px);
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0 34px,
    rgba(248, 184, 168, 0.14) 34px 35.6px
  );
}
.gallery-hero-bg::before,
.gallery-hero-bg::after {
  opacity: 0;
  transform: scale(0.82);
  transform-origin: center center;
}
.gallery-hero.is-in .gallery-hero-bg::before,
.gallery-hero.is-in .gallery-hero-bg::after {
  animation: bgRingEnter 72s linear forwards;
}
.gallery-hero.is-in .gallery-hero-bg::after {
  animation-delay: 0.18s;
}
.gallery-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 44em;
}
.gallery-hero-copy {
  max-width: none;
}
.gallery-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--peach);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.gallery-eyebrow-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--peach);
}
.gallery-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--white);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.gallery-lede {
  margin: 0 0 22px;
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.65;
  color: rgba(232, 241, 244, 0.9);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: clamp(16px, 3vw, 28px);
  margin: 0 0 clamp(28px, 4vw, 36px);
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(0, 48, 96, 0.14);
  position: relative;
  z-index: 2;
}
.gallery-toolbar:focus-within {
  border-bottom-color: rgba(8, 136, 144, 0.45);
}
.gallery-search {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 15rem;
  min-width: 0;
  margin: 0;
}
.gallery-search svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--cerulean);
}
.gallery-search input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 0;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
}
.gallery-search input::placeholder {
  color: var(--cerulean);
}
.gallery-filter {
  display: flex;
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;
}
.gallery-select {
  position: relative;
}
.gallery-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}
.gallery-select-trigger:hover,
.gallery-select.is-open .gallery-select-trigger,
.gallery-select-trigger:focus-visible {
  outline: none;
  color: var(--cyan);
}
.gallery-select-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(14rem, 42vw);
}
.gallery-select-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--cerulean);
  transition: transform 0.25s var(--ease), color 0.2s ease;
}
.gallery-select.is-open .gallery-select-chevron {
  transform: rotate(180deg);
  color: var(--cyan);
}
.gallery-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  width: min(18rem, calc(100vw - 2.5rem));
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transform-origin: top right;
  transition:
    opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.32s;
}
.gallery-dropdown:not([hidden]) {
  visibility: visible;
  transition-delay: 0s;
}
.gallery-dropdown.is-visible {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}
.gallery-dropdown-panel {
  overflow: hidden;
  padding: 8px 0;
  border: 1px solid rgba(0, 48, 96, 0.14);
  border-radius: 0;
  background: var(--white);
  box-shadow:
    0 18px 44px rgba(0, 20, 40, 0.14),
    0 2px 8px rgba(0, 48, 96, 0.06);
}
.gallery-filter-list {
  margin: 0;
  padding: 0 16px;
  list-style: none;
  display: grid;
  gap: 2px;
}
.gallery-filter-option {
  display: block;
  width: 100%;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  background-image: linear-gradient(90deg, var(--cyan) 0 50%, var(--navy) 50% 100%);
  background-size: 200% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.85s var(--ease);
}
.gallery-filter-option:hover,
.gallery-filter-option:focus-visible {
  outline: none;
  background-position: 0 0;
}
.gallery-filter-option.is-selected {
  background-position: 0 0;
  font-weight: 600;
}
.gallery-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.gallery-empty {
  margin: 0 0 clamp(24px, 3vw, 32px);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--cerulean);
}

.gallery-hero.is-in .gallery-eyebrow {
  opacity: 1;
  transform: none;
  transition-delay: 0.08s;
}
.gallery-hero.is-in h1 {
  opacity: 1;
  transform: none;
  transition-delay: 0.16s;
}
.gallery-hero.is-in .gallery-lede {
  opacity: 1;
  transform: none;
  transition-delay: 0.24s;
}

.gallery-section {
  position: relative;
  z-index: 2;
  padding: clamp(8px, 1.5vw, 16px) 0 clamp(48px, 6vw, 72px);
  background: var(--ice);
  overflow: visible;
}
.gallery-section::before {
  content: "";
  position: absolute;
  left: clamp(-100px, -6vw, -12px);
  top: 6%;
  width: min(560px, 62vw);
  height: min(560px, 62vw);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0 36px,
    rgba(0, 48, 96, 0.12) 36px 37.8px
  );
}
.gallery-section::after {
  content: "";
  position: absolute;
  right: clamp(-80px, -5vw, -8px);
  top: 38%;
  width: min(400px, 46vw);
  height: min(400px, 46vw);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0 28px,
    rgba(8, 136, 144, 0.14) 28px 29.6px
  );
}
.gallery-section > .wrap {
  position: relative;
  z-index: 1;
}
.gallery-section .masonry {
  position: relative;
  gap: clamp(16px, 2.2vw, 22px);
}
.gallery-section .masonry::before {
  content: "";
  position: absolute;
  left: clamp(-60px, -4vw, 8px);
  top: 52%;
  width: min(480px, 54vw);
  height: min(480px, 54vw);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0 32px,
    rgba(0, 48, 96, 0.1) 32px 33.6px
  );
}
.gallery-section .masonry::after {
  content: "";
  position: absolute;
  right: clamp(-48px, -3vw, 12px);
  bottom: 4%;
  width: min(340px, 38vw);
  height: min(340px, 38vw);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0 24px,
    rgba(8, 136, 144, 0.13) 24px 25.4px
  );
}
.gallery-section::before,
.gallery-section::after,
.gallery-section .masonry::before,
.gallery-section .masonry::after,
.gallery-note-rings {
  opacity: 0;
  transform: scale(0.82);
  transform-origin: center center;
}
.gallery-section.is-in::before {
  animation: bgRingEnter 72s linear forwards;
}
.gallery-section.is-in::after {
  animation: bgRingEnter 72s linear 0.14s forwards;
}
.gallery-section.is-in .masonry::before {
  animation: bgRingEnter 72s linear 0.22s forwards;
}
.gallery-section.is-in .masonry::after {
  animation: bgRingEnter 72s linear 0.3s forwards;
}
.gallery-section.is-in .gallery-note-rings {
  animation: bgRingEnter 72s linear 0.18s forwards;
}
.gallery-section .g-item {
  border: 1px solid rgba(0, 48, 96, 0.08);
  background: var(--white);
  padding: 8px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.gallery-section .g-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 20, 40, 0.1);
}
.gallery-section .g-item img,
.gallery-section .g-item video {
  height: clamp(220px, 28vw, 280px);
}
.gallery-section .g-item.is-video { position: relative; }
.gallery-section .g-item.is-video::after {
  content: "▶";
  position: absolute;
  left: 50%;
  top: calc(clamp(220px, 28vw, 280px) / 2);
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 20, 40, 0.72);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
  color: #fff;
  font-size: 16px;
  line-height: 46px;
  text-align: center;
  padding-left: 3px;
  pointer-events: none;
}
.gallery-section .g-item.is-video figcaption { position: relative; }
.gallery-section .g-item figcaption {
  margin-top: 10px;
  padding: 0 4px 4px;
  font-size: 0.8rem;
  line-height: 1.45;
}
.gallery-note-panel {
  position: relative;
  margin-top: clamp(40px, 6vw, 64px);
  padding: clamp(32px, 4.5vw, 44px) clamp(24px, 4vw, 40px);
  border: none;
  border-radius: 0;
  background:
    radial-gradient(ellipse 70% 90% at 100% 40%, rgba(8, 136, 144, 0.08) 0%, transparent 58%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(192, 104, 80, 0.06) 0%, transparent 52%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(232, 241, 244, 0.72) 100%);
  box-shadow: 0 14px 40px rgba(0, 20, 40, 0.07);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.gallery-note-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(8, 136, 144, 0.22) 0%,
    rgba(0, 48, 96, 0.06) 45%,
    rgba(248, 184, 168, 0.18) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.gallery-section.is-in .gallery-note-panel {
  opacity: 1;
  transform: none;
}
.gallery-note-rings {
  position: absolute;
  width: min(280px, 38vw);
  aspect-ratio: 1;
  right: clamp(-40px, -3vw, 12px);
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  pointer-events: none;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0 28px,
    rgba(8, 136, 144, 0.1) 28px 29.6px
  );
}
.gallery-note-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 6px 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 0;
  box-shadow: 0 2px 10px rgba(0, 48, 96, 0.06);
}
.gallery-note-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--peach));
  flex-shrink: 0;
}
.gallery-note-title {
  position: relative;
  z-index: 1;
  margin: 0 0 16px;
  max-width: 22ch;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.gallery-note-body {
  position: relative;
  z-index: 1;
  max-width: 52em;
}
.gallery-note-body p {
  margin: 0 0 14px;
  font-size: clamp(0.98rem, 1.2vw, 1.06rem);
  line-height: 1.7;
  color: var(--ink);
  font-style: normal;
}
.gallery-note-body p:last-child {
  margin-bottom: 0;
}
.gallery-note-link-wrap {
  margin-top: 22px !important;
  padding-top: 0;
  border-top: none;
}
.gallery-note-link-wrap .gallery-note-cta {
  opacity: 1;
  transform: none;
  margin-top: 0;
}

@media (max-width: 980px) {
  body.page-gallery .gallery-hero > .wrap,
  body.page-gallery .gallery-section > .wrap {
    width: min(var(--max), calc(100% - 48px));
    box-sizing: border-box;
  }
  .gallery-hero {
    --gallery-gradient-h: calc(var(--header) + clamp(300px, 46vh, 420px));
    padding-top: calc(var(--header) + 24px);
    padding-bottom: 48px;
  }
  .gallery-hero-bg::before {
    width: min(72vw, 300px);
    left: -12px;
  }
  .gallery-hero-bg::after {
    width: min(76vw, 320px);
    right: -12px;
  }
  .gallery-section::before {
    width: min(88vw, 420px);
    height: min(88vw, 420px);
    left: -20px;
  }
  .gallery-section::after {
    width: min(70vw, 320px);
    height: min(70vw, 320px);
    right: -16px;
  }
  .gallery-toolbar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(24px, 4vw, 32px);
    padding: 0 0 14px;
    border: none;
    border-bottom: 1px solid rgba(0, 48, 96, 0.14);
  }
  .gallery-toolbar:focus-within {
    border-bottom-color: rgba(8, 136, 144, 0.45);
  }
  .gallery-search {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }
  .gallery-search svg {
    width: 16px;
    height: 16px;
  }
  .gallery-search input {
    padding: 6px 0;
    font-size: 0.9rem;
    min-width: 0;
  }
  .gallery-filter {
    flex: 0 0 auto;
    margin-left: 0;
    padding-left: 14px;
    border-left: 1px solid rgba(0, 48, 96, 0.12);
    position: static;
  }
  .gallery-select {
    position: static;
    width: auto;
  }
  .gallery-select-trigger {
    gap: 6px;
    padding: 6px 0;
    font-size: 0.88rem;
    white-space: nowrap;
  }
  .gallery-dropdown {
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    width: auto;
    transform-origin: top center;
  }
  .gallery-section .masonry::before {
    width: min(82vw, 380px);
    height: min(82vw, 380px);
    left: -12px;
  }
  .gallery-section .masonry::after {
    width: min(64vw, 280px);
    height: min(64vw, 280px);
    right: -10px;
  }
  .gallery-note-rings {
    width: min(220px, 52vw);
    right: -24px;
    opacity: 0.85;
  }
  .gallery-note-title {
    max-width: none;
  }
}

.family-gallery {
  margin: 8px 0 36px;
}
.family-gallery-head {
  max-width: 40em;
  margin-bottom: 18px;
}
.family-gallery-head h2 {
  margin: 8px 0 10px;
}
.family-gallery-head p {
  margin: 0;
}
.family-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.family-card {
  margin: 0;
  background: var(--white);
  border: 1px solid rgba(0, 48, 96, 0.08);
  padding: 8px;
}
.family-card img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.family-card figcaption {
  margin-top: 8px;
  padding: 0 4px 4px;
  font-size: 0.8rem;
  line-height: 1.45;
}

@media (max-width: 640px) {
  body.page-gallery .gallery-hero > .wrap,
  body.page-gallery .gallery-section > .wrap {
    width: min(var(--max), calc(100% - 48px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-eyebrow,
  .gallery-hero h1,
  .gallery-lede,
  .gallery-section .g-item,
  .gallery-note-panel {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
