/* ============================================================
   MOUNTAIN TOP — GALLERY PAGE
   Dark cinematic aesthetic matching the scroll experience
   Masonry layout via CSS columns
============================================================ */

/* ── PAGE CHROME ─────────────────────────────────────────── */
body.page-template-gallery-page {
  background: #080508 !important;
  color: #f5edd8;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto !important; /* override scroll page's hidden */
}

/* Show GP header area but reset it */
body.page-template-gallery-page #masthead,
body.page-template-gallery-page .site-header {
  display: none !important;
}

body.page-template-gallery-page .site-footer,
body.page-template-gallery-page .site-info {
  display: none !important;
}

body.page-template-gallery-page .site-content,
body.page-template-gallery-page .content-area,
body.page-template-gallery-page .site-main,
body.page-template-gallery-page article,
body.page-template-gallery-page .inside-article,
body.page-template-gallery-page .entry-content,
body.page-template-gallery-page .grid-container,
body.page-template-gallery-page #page {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

body.page-template-gallery-page .page-header,
body.page-template-gallery-page .entry-header {
  display: none !important;
}

/* ── WRAP ────────────────────────────────────────────────── */
.gallery-page-wrap {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(100,45,10,0.3) 0%, transparent 55%),
    linear-gradient(to bottom, #100808 0%, #0a0505 40%, #080408 100%);
  display: flex;
  flex-direction: column;
}

/* ── HEADER ──────────────────────────────────────────────── */
.gallery-page-header {
  padding: 2rem clamp(1.5rem, 5vw, 5rem) 0;
  position: relative;
}

.gallery-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Cinzel Decorative', 'Palatino Linotype', serif;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(200,134,10,0.7);
  text-decoration: none;
  transition: color 0.2s;
  margin-bottom: 2.5rem;
  display: block;
}
.gallery-back-link:hover { color: #c8860a; }
.gallery-back-arrow { font-size: 0.9rem; }

.gallery-page-title-wrap {
  text-align: center;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(200,134,10,0.15);
  margin-bottom: 2.5rem;
}

.gallery-page-emblem {
  width: 60px;
  height: auto;
  margin: 0 auto 1.2rem;
  opacity: 0.75;
  filter: drop-shadow(0 0 20px rgba(200,134,10,0.4));
}

.gallery-page-school {
  font-family: 'Cinzel Decorative', Palatino, serif;
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #c8860a;
  margin: 0 0 0.5rem;
}

.gallery-page-title {
  font-family: 'Ma Shan Zheng', 'STFangsong', Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 400;
  color: #f5edd8;
  margin: 0 0 0.6rem;
  line-height: 1.1;
}

.gallery-page-sub {
  font-family: 'Cinzel Decorative', Palatino, serif;
  font-size: clamp(0.55rem, 1vw, 0.7rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #c8860a;
}

/* ── MAIN CONTENT AREA ───────────────────────────────────── */
.gallery-page-main {
  flex: 1;
  padding: 0 clamp(1rem, 4vw, 4rem) 3rem;
}

.gallery-page-content {
  /* Gutenberg outputs the gallery block here */
}

/* ── GUTENBERG GALLERY BLOCK → MASONRY ───────────────────── */

/* Target the WP gallery block figure grid */
.gallery-page-content .wp-block-gallery {
  display: block !important;        /* override flex/grid */
  columns: 3 280px;                 /* masonry: 3 cols, min 280px each */
  column-gap: 8px;
  margin: 0 !important;
  padding: 0 !important;
}

/* Each image item */
.gallery-page-content .wp-block-gallery .wp-block-image,
.gallery-page-content .wp-block-gallery figure {
  display: block !important;
  width: 100% !important;
  break-inside: avoid;             /* don't split an image across columns */
  margin: 0 0 8px !important;
  padding: 0 !important;
  overflow: hidden;
  position: relative;
}

/* The actual img */
.gallery-page-content .wp-block-gallery img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: brightness(0.92) saturate(0.9);
}

/* Hover — brighten and slight zoom */
.gallery-page-content .wp-block-gallery figure:hover img {
  transform: scale(1.03);
  filter: brightness(1.05) saturate(1.1);
}

/* Gold border on hover */
.gallery-page-content .wp-block-gallery figure::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(200,134,10,0);
  transition: border-color 0.3s ease;
  pointer-events: none;
}
.gallery-page-content .wp-block-gallery figure:hover::after {
  border-color: rgba(200,134,10,0.4);
}

/* Hide WP caption chrome we don't need */
.gallery-page-content .wp-block-gallery figcaption {
  display: none;
}

/* ── ALSO HANDLE: native WP [gallery] shortcode ──────────── */
.gallery-page-content .gallery {
  display: block !important;
  columns: 3 280px;
  column-gap: 8px;
  margin: 0 !important;
}
.gallery-page-content .gallery-item {
  display: block !important;
  width: 100% !important;
  break-inside: avoid;
  margin: 0 0 8px !important;
  overflow: hidden;
}
.gallery-page-content .gallery-item img {
  width: 100% !important;
  height: auto !important;
  display: block;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: brightness(0.92) saturate(0.9);
}
.gallery-page-content .gallery-item:hover img {
  transform: scale(1.03);
  filter: brightness(1.05) saturate(1.1);
}

/* ── FOOTER CTA ──────────────────────────────────────────── */
.gallery-page-footer {
  text-align: center;
  padding: 3rem 2rem 4rem;
  border-top: 1px solid rgba(200,134,10,0.15);
}

.gallery-cta-btn {
  display: inline-block;
  font-family: 'Cinzel', Palatino, serif;
  font-size: clamp(0.75rem, 1vw, 0.9rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: #1a1210;
  background: #c8860a;
  padding: 1em 2.5em;
  transition: all 0.3s ease;
}
.gallery-cta-btn:hover {
  background: #f5c842;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(200,134,10,0.4);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .gallery-page-content .wp-block-gallery,
  .gallery-page-content .gallery {
    columns: 2 200px;
  }
}

@media (max-width: 480px) {
  .gallery-page-content .wp-block-gallery,
  .gallery-page-content .gallery {
    columns: 1;
  }

  .gallery-page-title { font-size: 2rem; }
  .gallery-page-header { padding: 1.5rem 1.2rem 0; }
  .gallery-page-main   { padding: 0 1.2rem 2rem; }
}