/* Gallery page — centered layout */

/* Hero — full-bleed photo edge to edge, centered copy */
body[data-page="gallery"] .page-hero--gallery {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: min(58vh, 640px);
  height: min(58vh, 640px);
  padding: 0;
  background-color: #1e1208;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

body[data-page="gallery"] .page-hero--gallery::before {
  background: linear-gradient(
    180deg,
    rgba(20, 10, 4, 0.42) 0%,
    rgba(20, 10, 4, 0.22) 45%,
    rgba(20, 10, 4, 0.22) 55%,
    rgba(20, 10, 4, 0.42) 100%
  );
}

body[data-page="gallery"] .page-hero--gallery .page-hero__layout {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(0, 683px) minmax(88px, 1fr);
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.25rem);
  width: 100%;
  max-width: none;
  min-height: min(75vh, 960px);
  margin: 0;
  padding: 0 clamp(0.75rem, 3vw, 2rem);
}

body[data-page="gallery"] .page-hero--gallery .page-hero__logo {
  align-self: center;
  justify-self: center;
}

body[data-page="gallery"] .page-hero--gallery .page-hero__logo .hero__logo-ring {
  width: min(140px, 15vw);
}

body[data-page="gallery"] .page-hero--gallery .page-hero__content,
body[data-page="gallery"] .page-hero--gallery .container {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 1.25rem;
  text-align: center;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  body[data-page="gallery"] .page-hero--gallery .page-hero__layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    padding-inline: 1rem;
  }

  body[data-page="gallery"] .page-hero--gallery .page-hero__content {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }
}

.gallery-page .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#gallery-root {
  width: 100%;
  max-width: var(--max-w);
}

.gallery-phases-panel {
  width: 100%;
  margin-bottom: 1.5rem;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.gallery-filters__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(139, 69, 19, 0.18);
  background: var(--color-white);
  color: var(--color-text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.gallery-filters__btn:hover {
  border-color: rgba(210, 105, 30, 0.45);
  color: var(--color-primary);
}

.gallery-filters__btn.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.gallery-filters__count {
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 99px;
  background: rgba(139, 69, 19, 0.12);
  color: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gallery-filters__btn.is-active .gallery-filters__count {
  background: rgba(255, 255, 255, 0.22);
}

.gallery-album-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gallery-phase-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-white);
  border: 1px dashed rgba(139, 69, 19, 0.2);
  border-radius: var(--radius);
}

.gallery-phase-empty p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* Album cards inside columns */
.gallery-album-card {
  background: var(--color-white);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 69, 19, 0.1);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(139, 69, 19, 0.06);
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.gallery-album-card:hover {
  box-shadow: 0 8px 24px rgba(139, 69, 19, 0.12);
}

.gallery-album-card--highlight {
  box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.35);
  transform: scale(1.01);
}

.gallery-album-card__hero {
  position: relative;
  display: block;
  height: clamp(160px, 28vw, 240px);
  overflow: hidden;
}

.gallery-album-card__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-album-card:hover .gallery-album-card__hero img {
  transform: scale(1.05);
}

.gallery-album-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(35, 22, 8, 0.65) 0%, transparent 60%);
  pointer-events: none;
}

.gallery-album-card__count {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  z-index: 1;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 99px;
}

.gallery-album-card__head {
  padding: 1.15rem 1.25rem 0.85rem;
  text-align: left;
}

.gallery-album-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.gallery-album-card__date {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.gallery-album-card__badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  background: rgba(139, 69, 19, 0.1);
  color: var(--color-primary);
}

.gallery-album-card__badge--recent {
  background: rgba(218, 165, 32, 0.2);
  color: #8a6508;
}

.gallery-album-card__head h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  line-height: 1.3;
}

.gallery-album-card__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.gallery-album-card__full-album {
  display: inline-flex;
  margin-top: 0.85rem;
  text-align: center;
  justify-content: center;
  width: 100%;
  max-width: 28rem;
  box-sizing: border-box;
}

.gallery-album-card__full-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 0.35rem 1.25rem 1.35rem;
  padding: 1rem 1.1rem;
  background: color-mix(in srgb, var(--color-accent, #c4a35a) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent, #c4a35a) 35%, transparent);
}

.gallery-album-card__full-footer .gallery-album-card__full-album {
  margin-top: 0;
}

.gallery-album-card__full-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  text-align: center;
  max-width: 36rem;
}

.gallery-album-card .gallery-event__albums {
  margin-top: 0.65rem;
  justify-content: flex-start;
}

.gallery-album-card .gallery-grid--photos {
  padding: 0 1.25rem 1.15rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  justify-content: stretch;
}

.gallery-album-card .gallery-photo {
  max-width: none;
}

.gallery-album-card .gallery-photo__thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.gallery-album-card .gallery-photo__thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-album-card .gallery-event__show-more {
  margin: 0 1rem 1rem;
  width: calc(100% - 2rem);
}

.gallery-member-banner {
  text-align: center;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1.1rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 69, 19, 0.1);
}

/* Legacy — kept for shared photo grid styles */
.gallery-toolbar {
  display: none;
}

.gallery-albums {
  width: 100%;
}

.gallery-event[hidden] {
  display: none;
}

.gallery-photo--hidden {
  display: none;
}

.gallery-event__show-more {
  display: block;
  margin: 0 auto;
}

.gallery-event__album-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
}

.gallery-grid--photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.gallery-photo {
  width: 100%;
}

.gallery-page__footer {
  width: 100%;
  max-width: var(--max-w);
  margin-top: 2rem;
}

.gallery-page__breadcrumb .container {
  display: flex;
  justify-content: center;
}

.gallery-page__breadcrumb ol {
  justify-content: center;
}

@media (max-width: 900px) {
  .gallery-album-card .gallery-grid--photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gallery-album-card .gallery-grid--photos {
    grid-template-columns: 1fr;
  }
}
