/* ==========================================================================
   Gallery Page — La Habra Historical Museum
   Source of truth: Design/gallery-lightbox.html. Nav + footer live in
   site-chrome.css (shared with Contact/Legal/About); this file is the
   hero/highlight-strip/filter-chips/masonry/lightbox sections unique to
   Gallery. Scoped under .gallery-page so it can't collide with
   tokens.css/base.css's own globals. Enqueued only on template-gallery.php.
   ========================================================================== */

.gallery-page {
  --display: var(--font-display);
  --heritage: var(--font-heritage);
  --text: var(--font-text);
  font-family: var(--text);
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
}

.gallery-page ::selection { background: var(--sage); color: var(--cream); }
.gallery-page section { position: relative; }

/* ---------- placeholder photo utility ---------- */
.gallery-page .ph-photo { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--sage-tint), var(--harbor-tint)); display: flex; align-items: center; justify-content: center; }
.gallery-page .ph-photo::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(30, 36, 32, .05) 0 10px, transparent 10px 20px); }
.gallery-page .ph-photo span { position: relative; z-index: 1; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--deep-sage); text-align: center; padding: 0 16px; max-width: 85%; }
.gallery-page .ph-photo .cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 22px 16px 12px; background: linear-gradient(180deg, transparent, rgba(30, 36, 32, .72) 60%); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .03em; text-align: left; }
.gallery-page .ph-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; position: relative; z-index: 1; }

/* ---------- section shared ---------- */
.gallery-page .pad { padding: clamp(56px, 7.5vw, 100px) clamp(22px, 6vw, 72px); }
.gallery-page .bg-cream { background: var(--cream); }
.gallery-page .bg-tint { background: var(--sage-tint); }
.gallery-page .bg-deep { background: var(--deep-sage); color: var(--cream); }
.gallery-page .label { font-family: var(--text); font-weight: 700; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 14px; display: block; color: var(--deep-sage); }
.gallery-page .bg-deep .label { color: #C9DDB4; }
.gallery-page h1 { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 5.4vw, 58px); line-height: 1.06; letter-spacing: -.02em; margin-bottom: 16px; }
.gallery-page h1 em { font-family: var(--heritage); font-style: italic; font-weight: 400; color: var(--meadow); letter-spacing: 0; }
.gallery-page h2 { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 4vw, 46px); line-height: 1.08; letter-spacing: -.015em; margin-bottom: 16px; }
.gallery-page h2 em { font-family: var(--heritage); font-style: italic; font-weight: 400; }
.gallery-page .eyebrow { font-family: var(--heritage); font-style: italic; font-size: clamp(17px, 1.8vw, 20px); color: var(--harbor); margin-bottom: 12px; }
.gallery-page .bg-deep .eyebrow { color: #C9DDB4; }
.gallery-page .section-inner { max-width: 1150px; margin: 0 auto; }
.gallery-page .copy { font-size: 17.5px; line-height: 1.7; color: #3E4740; margin-bottom: 16px; }
.gallery-page .bg-deep .copy { color: #DCE8DC; }

/* ---------- stay connected / social row ---------- */
.gallery-page .notify-wrap { max-width: 640px; margin: 0 auto; text-align: center; }
.gallery-page .social-row { text-align: center; padding: 36px 16px 40px; }
.gallery-page .social-row .share { display: flex; gap: 14px; justify-content: center; margin-top: 16px; }
.gallery-page .social-row .share a { width: 44px; height: 44px; border-radius: 50%; background: var(--sage-tint); display: flex; align-items: center; justify-content: center; color: var(--deep-sage); transition: background .22s ease, color .22s ease, transform .22s ease; box-shadow: 0 8px 18px -12px rgba(30, 36, 32, .35); }
.gallery-page .social-row .share a:hover { background: var(--sage); color: var(--cream); transform: translateY(-3px); }
.gallery-page .social-row .share svg { width: 19px; height: 19px; }

/* ---------- gallery page ---------- */
.gallery-page .highlight-strip { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 18px; margin-top: 26px; }
.gallery-page .highlight-strip .ph-photo { height: 320px; border-radius: 4px; }
.gallery-page .highlight-strip a,
.gallery-page .highlight-strip button { display: block; text-decoration: none; color: inherit; border: none; background: none; padding: 0; cursor: pointer; font: inherit; text-align: left; width: 100%; }
@media (max-width: 820px) { .gallery-page .highlight-strip { grid-template-columns: 1fr 1fr; } .gallery-page .highlight-strip > :first-child { grid-column: 1/3; } }
@media (max-width: 560px) { .gallery-page .highlight-strip { grid-template-columns: 1fr; } .gallery-page .highlight-strip > :first-child { grid-column: auto; } .gallery-page .highlight-strip .ph-photo { height: 240px; } }

.gallery-page .filter-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 26px 0 6px; }
.gallery-page .chip { border: 1.5px solid rgba(30, 36, 32, .16); background: transparent; color: var(--ink); font-family: var(--text); font-weight: 700; font-size: 13.5px; letter-spacing: .02em; padding: 9px 18px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.gallery-page .chip:hover { border-color: var(--sage); }
.gallery-page .chip.is-active { background: var(--sage); border-color: var(--sage); color: #fff; }

.gallery-page .masonry { column-count: 3; column-gap: 18px; margin-top: 24px; }
.gallery-page .masonry .tile { display: block; width: 100%; border: none; background: none; padding: 0; margin: 0 0 18px; break-inside: avoid; cursor: pointer; font: inherit; text-align: left; transition: opacity .35s ease, transform .35s ease; }
.gallery-page .masonry .tile.is-hidden { display: none; }
.gallery-page .masonry .tile:hover { transform: translateY(-4px); }
.gallery-page .masonry .tile .ph-photo { border-radius: 4px; }
.gallery-page .masonry .tile:nth-child(6n+1) .ph-photo { height: 300px; }
.gallery-page .masonry .tile:nth-child(6n+2) .ph-photo { height: 220px; }
.gallery-page .masonry .tile:nth-child(6n+3) .ph-photo { height: 260px; }
.gallery-page .masonry .tile:nth-child(6n+4) .ph-photo { height: 340px; }
.gallery-page .masonry .tile:nth-child(6n+5) .ph-photo { height: 230px; }
.gallery-page .masonry .tile:nth-child(6n+6) .ph-photo { height: 280px; }
@media (max-width: 900px) { .gallery-page .masonry { column-count: 2; } }
@media (max-width: 560px) { .gallery-page .masonry { column-count: 1; } }

.gallery-page .archive-note { text-align: center; margin-top: 30px; font-size: 15px; color: #5a6a5a; }

/* ---------- lightbox ---------- */
.gallery-page .lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: clamp(16px, 4vw, 48px); }
.gallery-page .lightbox.is-open { display: flex; }
.gallery-page .lightbox-scrim { position: absolute; inset: 0; background: rgba(20, 26, 18, .88); opacity: 0; transition: opacity .3s ease; }
.gallery-page .lightbox.is-open .lightbox-scrim { opacity: 1; }
.gallery-page .lightbox-body { position: relative; z-index: 2; max-width: min(1000px, 92vw); max-height: 88vh; display: flex; flex-direction: column; background: var(--cream); border-radius: 6px; overflow: hidden; transform: scale(.94); opacity: 0; transition: transform .32s cubic-bezier(.2, .8, .2, 1), opacity .32s ease; }
.gallery-page .lightbox.is-open .lightbox-body { transform: scale(1); opacity: 1; }
.gallery-page .lightbox-frame { position: relative; background: #0f130f; display: flex; align-items: center; justify-content: center; max-height: 66vh; }
.gallery-page .lightbox-frame img { max-width: 100%; max-height: 66vh; width: auto; height: auto; object-fit: contain; display: block; }
.gallery-page .lightbox-caption { padding: 18px 26px 22px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.gallery-page .lightbox-caption h3 { font-family: var(--display); font-weight: 700; font-size: 20px; margin-bottom: 6px; }
.gallery-page .lightbox-caption p { font-size: 15px; color: #4a5650; line-height: 1.55; }
.gallery-page .lightbox-tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--deep-sage); margin-bottom: 8px; }
.gallery-page .lightbox-credit { margin-top: 10px; font-size: 12.5px; color: #8a8574; font-style: italic; }
.gallery-page .lightbox-close, .gallery-page .lightbox-nav { position: absolute; background: rgba(241, 236, 221, .94); border: none; border-radius: 999px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); transition: background .2s, transform .2s; }
.gallery-page .lightbox-close:hover, .gallery-page .lightbox-nav:hover { background: #fff; transform: scale(1.06); }
.gallery-page .lightbox-close { top: 14px; right: 14px; z-index: 3; }
.gallery-page .lightbox-nav { top: 50%; transform: translateY(-50%); z-index: 3; }
.gallery-page .lightbox-nav.prev { left: 14px; }
.gallery-page .lightbox-nav.next { right: 14px; }
.gallery-page .lightbox-nav svg, .gallery-page .lightbox-close svg { width: 20px; height: 20px; }
/* Anchored inside .lightbox-frame (bottom-left of the actual image), not a
   viewport-relative calc() off .lightbox-body — the original approach
   assumed the image always fills the frame's full 66vh, so on a shorter
   (e.g. landscape) image or a short mobile viewport the badge landed on
   top of the caption below instead of on the photo. */
.gallery-page .lightbox-count { position: absolute; left: 14px; bottom: 14px; z-index: 3; background: rgba(30, 36, 32, .55); color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; padding: 5px 12px; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) { .gallery-page .lightbox-body, .gallery-page .lightbox-scrim { transition: none; } }
@media (max-width: 640px) { .gallery-page .lightbox-nav { width: 38px; height: 38px; } .gallery-page .lightbox-close { width: 38px; height: 38px; } }
