/* ============================================================
   MoMo's Mix Up — Gallery page (filter chips + tiles + lightbox)
   Loaded only by /gallery.html, after site.css.
   Uses the tokens already defined in site.css:
   --berry --pink --cocoa --blush --max
   ============================================================ */

.visually-hidden{
  position:absolute;
  width:1px;height:1px;
  margin:-1px;padding:0;border:0;
  clip:rect(0 0 0 0);clip-path:inset(50%);
  overflow:hidden;white-space:nowrap;
}

/* --- Intro ------------------------------------------------ */
.gal-intro{padding-bottom:4px}
.gal-intro h1{max-width:900px}

/* --- Sticky filter chips ---------------------------------- */
.gal-filters{
  position:sticky;
  top:var(--gal-stick,0px);
  z-index:40;
  max-width:var(--max);
  margin:0 auto;
  padding:12px 22px 14px;
  background:linear-gradient(180deg,#fff6f1 74%,rgba(255,246,241,0));
}
.gal-chips{
  display:flex;
  gap:9px;
  overflow-x:auto;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
  padding-bottom:2px;
}
.gal-chips::-webkit-scrollbar{display:none}
.gal-chip{
  flex:0 0 auto;
  border-radius:999px;
  padding:11px 16px;
  min-height:44px;
  white-space:nowrap;
  cursor:pointer;
  font-family:inherit;
  font-weight:900;
  font-size:.9rem;
  line-height:1;
  color:var(--cocoa);
  background:rgba(255,255,255,.78);
  border:1px solid rgba(133,67,84,.18);
  transition:background-color .15s ease,color .15s ease,border-color .15s ease;
}
.gal-chip:hover{background:#fff;border-color:rgba(133,67,84,.32)}
.gal-chip[aria-pressed="true"]{
  background:var(--berry);
  border-color:var(--berry);
  color:#fff;
}
.gal-chip:focus-visible{outline:3px solid rgba(216,115,136,.4);outline-offset:3px}

/* --- Tile grid -------------------------------------------- */
.gal-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
  max-width:var(--max);
  margin:0 auto;
  padding:0 22px;
}
.gal-tile{
  display:flex;
  flex-direction:column;
  text-align:left;
  padding:0;
  border:0;
  background:#fff;
  border-radius:24px;
  overflow:hidden;
  cursor:pointer;
  font:inherit;
  color:inherit;
  box-shadow:0 18px 45px rgba(70,52,45,.1);
  transition:transform .2s ease,box-shadow .2s ease;
}
.gal-tile[hidden]{display:none}
.gal-tile picture{display:block}
.gal-tile img{
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  display:block;
  transition:transform .35s ease;
}
.gal-tile:hover{transform:translateY(-3px);box-shadow:0 24px 55px rgba(70,52,45,.16)}
.gal-tile:hover img{transform:scale(1.04)}
.gal-tile:focus-visible{outline:3px solid rgba(216,115,136,.45);outline-offset:3px}

/* Two-line clamp with reserved height is what keeps every tile
   the same height, so rows line up no matter the title length. */
.gal-cap{display:block;padding:12px 14px 15px}
.gal-cap span{
  display:block;
  color:var(--berry);
  font-weight:800;
  font-size:.72rem;
}
.gal-cap strong{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  margin-top:3px;
  font-size:.86rem;
  line-height:1.3;
  min-height:2.6em;
  letter-spacing:-.012em;
}

.gal-count{
  max-width:var(--max);
  margin:18px auto 0;
  padding:0 22px;
  text-align:center;
  font-size:.85rem;
  font-weight:800;
  color:rgba(70,52,45,.5);
}

@media(min-width:700px){
  .gal-grid{grid-template-columns:repeat(3,1fr);gap:16px}
  .gal-cap{padding:14px 16px 18px}
  .gal-cap span{font-size:.8rem}
  .gal-cap strong{font-size:.96rem}
}
@media(min-width:1000px){
  .gal-grid{grid-template-columns:repeat(4,1fr);gap:18px}
  .gal-tile{border-radius:30px}
  .gal-cap{padding:16px 18px 20px}
  .gal-cap span{font-size:.85rem}
  .gal-cap strong{font-size:1.02rem}
  .gal-filters{padding:14px 22px 16px}
  .gal-chip{padding:12px 18px;font-size:.92rem;min-height:46px}
}

@media(prefers-reduced-motion:reduce){
  .gal-tile,.gal-tile img{transition:none}
  .gal-tile:hover{transform:none}
  .gal-tile:hover img{transform:none}
}

/* --- Lightbox --------------------------------------------- */
.gal-lb[hidden]{display:none}
.gal-lb{
  position:fixed;
  inset:0;
  z-index:200;
  display:flex;
  flex-direction:column;
  align-items:center;
  background:rgba(35,25,22,.95);
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
}
.gal-lb-bar{
  width:100%;
  max-width:1100px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 18px;
  color:rgba(255,248,241,.7);
  font-weight:800;
  font-size:.85rem;
}
.gal-lb-close{
  border:0;
  background:rgba(255,255,255,.14);
  color:#fff;
  width:44px;height:44px;
  border-radius:50%;
  font-size:1.5rem;
  line-height:1;
  cursor:pointer;
}
.gal-lb-close:hover{background:rgba(255,255,255,.24)}
.gal-lb-stage{
  flex:1;
  min-height:0;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  padding:0 16px;
}
.gal-lb-stage img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  border-radius:18px;
  background:transparent;
}
.gal-lb-nav{
  display:none;
  flex:0 0 auto;
  width:56px;height:56px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.06);
  color:#fff8f1;
  font-size:1.3rem;
  cursor:pointer;
}
.gal-lb-nav:hover{background:rgba(255,255,255,.16)}
.gal-lb-nav-next{background:var(--berry);border-color:var(--berry)}
.gal-lb-nav-next:hover{background:#6d3745}
.gal-lb-meta{
  padding:16px 18px 0;
  color:#fff8f1;
  text-align:center;
}
.gal-lb-meta span{
  display:block;
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--blush);
}
.gal-lb-meta strong{display:block;margin-top:4px;font-size:1.05rem}
.gal-lb-pager{
  display:flex;
  gap:10px;
  width:100%;
  max-width:520px;
  padding:16px 16px calc(18px + env(safe-area-inset-bottom));
}
.gal-lb-btn{
  flex:1;
  min-height:48px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.22);
  background:transparent;
  color:#fff8f1;
  font-family:inherit;
  font-weight:900;
  font-size:.9rem;
  line-height:1;
  cursor:pointer;
}
.gal-lb-btn-solid{background:var(--berry);border-color:var(--berry);color:#fff}
.gal-lb-btn:hover{background:rgba(255,255,255,.14)}
.gal-lb-btn-solid:hover{background:#6d3745}
.gal-lb-close:focus-visible,
.gal-lb-nav:focus-visible,
.gal-lb-btn:focus-visible{outline:3px solid rgba(246,216,222,.6);outline-offset:3px}

@media(min-width:900px){
  .gal-lb-nav{display:block}
  .gal-lb-pager{display:none}
  .gal-lb-stage img{max-width:min(900px,100%)}
  .gal-lb-meta{padding-bottom:30px}
}

/* Stop the page behind the lightbox from scrolling */
body.gal-lb-open{overflow:hidden}
