/* =========================================================================
   FUN — Inspiration Gallery: archive (masonry) + single event
   /wp-content/themes/<child>/assets/css/fun-gallery.css
   Loads after fun-entertainment.css (tokens, buttons, wrap, empty/loading).
   ====================================================================== */

/* -------------------------------------------------------------------------
   FILTER PILLS
   ---------------------------------------------------------------------- */
.fun-galfilters{
  display:flex; align-items:center; gap:8px;
  margin-bottom:35px;
  flex-wrap:nowrap;              /* was wrap */
  overflow-x:auto;
  scroll-behavior:smooth;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
  padding-bottom:4px;           /* room for the scrollbar so it doesn't cover pills */
}
.fun-pill{ flex:0 0 auto; }
.fun-galfilters__group{ display:contents; flex:0 0 auto; }

.fun-galfilters::-webkit-scrollbar{ height:6px; }
.fun-galfilters::-webkit-scrollbar-thumb{ background:var(--fun-blue-tint-2); border-radius:999px; }
.fun-galfilters{ position:relative; -webkit-mask-image:linear-gradient(90deg,#000 92%,transparent); mask-image:linear-gradient(90deg,#000 92%,transparent); }

.fun-pill {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 16px !important;
    border-radius: 5px !important;
    background: #ededed !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #000 !important;
    cursor: pointer;
    transition: all .16s var(--ease);
}
.fun-pill:hover{ border-color:var(--fun-blue-mid); }
.fun-pill.is-active{ border: 2px solid var(--fun-blue); color:#fff; }
.fun-pill:disabled{ opacity:.55; cursor:not-allowed; }

/* -------------------------------------------------------------------------
   MASONRY GRID  (CSS columns — true masonry look, no JS)
   ---------------------------------------------------------------------- */
.fun-masonry{
  column-count:3;
  column-gap:20px;
}
@media (max-width:960px){ .fun-masonry{ column-count:2; } }
@media (max-width:560px){ .fun-masonry{ column-count:1; } }

.fun-galcard{
  break-inside:avoid;
  margin:0 0 20px;
}

.fun-galcard__link{
  position:relative; display:block;
  border-radius:14px; overflow:hidden;
  background:var(--fun-blue-deep);
  text-decoration:none;
  transition:transform .22s var(--ease), box-shadow .22s var(--ease);
}
.fun-galcard__link:hover{
  transform:translateY(-3px);
}

.fun-galcard__img,
.fun-galcard__ph{
  width:100%; display:block;
}
.fun-galcard__ph{
  aspect-ratio:4/3;
  background:linear-gradient(150deg, var(--fun-blue) 0%, var(--fun-blue-deep) 100%);
}
.fun-galcard__img{ transition:transform .4s var(--ease); }
.fun-galcard__link:hover .fun-galcard__img{ transform:scale(1.04); }

/* gradient for legibility */
.fun-galcard__link::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(180deg,
    rgba(6,26,50,0) 45%, rgba(6,26,50,.28) 62%, rgba(6,26,50,.82) 100%);
}

.fun-galcard__video{
  position:absolute; top:14px; left:14px; z-index:2;
  width:38px; height:38px; border-radius:50%;
  display:grid; place-items:center;
  background:rgba(255,255,255,.9); color:var(--fun-blue-deep);
}
.fun-galcard__video svg{ width:18px; height:18px; margin-left:2px; }

.fun-galcard__body{
  position:absolute; left:0; right:56px; bottom:0; z-index:2;
  padding:18px 20px 20px; color:#fff;
}
.fun-galcard__title{
  display:block;
  text-align: left;
  font-size:26px; font-weight:600; line-height:1.15; letter-spacing:-.2px;
  text-shadow:0 1px 12px rgba(0,0,0,.4);
}
.fun-galcard__type{
  display:block; margin-top:5px;
  text-align: left;
  font-size:12.5px; font-weight:400; letter-spacing:-.1px;
  color:rgba(255,255,255,.82); text-transform:capitalize;
}

.fun-galcard__plus{
  position:absolute; right:16px; bottom:18px; z-index:3;
  width:38px; height:38px; border-radius:50%;
  display:grid; place-items:center;
  background:rgba(255,255,255,.92); color:var(--fun-blue-deep);
  transition:background-color .2s var(--ease), transform .3s var(--ease);
}
.fun-galcard__plus svg{ width:16px; height:16px; }
.fun-galcard__link:hover .fun-galcard__plus{
  background:var(--fun-orange); color:#fff; transform:rotate(90deg);
}

/* keep the load-more/empty inside the normal (non-column) flow */
.fun-results{ position:relative; }
.fun-gallery .fun-empty{ margin-top:8px; }

/* =========================================================================
   LIGHTBOX + DETAILS PANEL
   ====================================================================== */
.fun-lb{
  position:fixed; inset:0; z-index:200;
  opacity:0; transition:opacity .26s var(--ease);
}
.fun-lb.is-open{ opacity:1; }

.fun-lb__backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.97); }

.fun-lb__frame{
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  padding:56px 20px 20px;
}

.fun-lb__close{
  position:absolute; top:16px; right:20px; z-index:5;
  width:44px; height:44px; border-radius:50%;
  color:#fff !important;
  font-size:26px; line-height:1; cursor:pointer;
  background-color: unset !important;
  transition:background-color .18s var(--ease);
}
.fun-lb__close:hover{ background:rgba(255,255,255,.24); }

/* stage */
.fun-lb__stage{
  position:relative; flex:1 1 auto;
  display:flex; align-items:center; justify-content:center;
  min-height:0; overflow:hidden;
}
.fun-lb__img{
  max-width:100%; max-height:100%;
  object-fit:contain;
  transition:opacity .2s var(--ease);
}
.fun-lb__img.is-loading{ opacity:.3; }

.fun-lb__spinner{ position:absolute; inset:0; display:grid; place-items:center; }

.fun-lb__bar .fun-btn{width: 180px !important; font-size: 16px !important;}

/* nav arrows */
.fun-lb__nav{
  position:absolute; top:50%; transform:translateY(-50%);
  width:50px; height:50px;
  background: unset !important; color:#fff !important; cursor:pointer;
  display:grid !important; place-items:center;
  transition:background-color .18s var(--ease);
}
.fun-lb__nav:hover{ background:rgba(255,255,255,.28); }
.fun-lb__nav svg{ width:45px; height:45px; }
.fun-lb__nav--prev{ left:8px; }
.fun-lb__nav--next{ right:8px; }

/* bar (counter + Details) */
.fun-lb__bar{
  position:absolute; left:0; right:0; bottom:0; z-index:3;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:16px 20px;
  background:linear-gradient(180deg, rgba(6,18,34,0), rgba(6,18,34,.75));
}
.fun-lb__counter{ color:rgba(255,255,255,.85); font-size:14px; font-weight:600; }

/* details panel — slides up OVER the lower part of the stage */
.fun-lb__panel{
  position:absolute; left:0; right:0; bottom:0; z-index:4;
  max-height:72%;
  display:flex; flex-direction:column;
  background:#fff;
  border-radius:18px 18px 0 0;
  transform:translateY(100%);
  transition:transform .34s var(--ease);
  box-shadow:0 -12px 40px rgba(0,0,0,.3);
}
.fun-lb__panel.is-open{ transform:translateY(0); }

.fun-lb__panel-handle{
  flex:0 0 auto; padding:12px 0 6px;
  background:none; border:0; cursor:pointer; width:100%;
}
.fun-lb__panel-handle span{
  display:block; width:44px; height:5px; margin:0 auto;
  background:var(--line); border-radius:999px;
}
.fun-lb__panel-handle:hover span{ background:var(--fun-blue-mid); }

.fun-lb__panel-body{ overflow-y:auto; padding:32px 60px 30px; }

.fun-lb__title{ margin:0 0 6px; font-size:38px; letter-spacing:-.3px; color:#000; }
.fun-lb__meta{ margin:0 0 14px; font-size:14px; font-weight:600; color:var(--muted); }
.fun-lb__tags{ display:flex; flex-wrap:wrap; gap:7px; margin-bottom:16px; }
.fun-lb__tags span{
  padding:4px 11px; border-radius:999px;
  background:var(--fun-blue-tint); color:var(--fun-blue);
  font-size:12px; font-weight:600;
}
.fun-lb__story,
.fun-lb__caption{ font-size:15px; line-height:1.65; color:var(--ink); margin:0 0 18px; }
.fun-lb__story p{ margin:0 0 12px; }
.fun-lb__panel-body h3{ margin:18px 0 10px; font-size:14px; letter-spacing:.5px; text-transform:capitalize; font-family: "Poppins", Sans-serif !important; color:#000; }
.fun-lb__services{ display:flex; flex-wrap:wrap; gap:9px; margin:0 0 20px; padding:0; list-style:none; }
.fun-lb__services li{
  display:inline-flex; align-items:center; gap:7px;
  padding:8px 14px; border-radius:999px;
  background:var(--fun-blue-tint); color:var(--fun-blue-deep);
  font-size:13.5px; font-weight:600;
}
.fun-lb__services li::before{ content:""; width:6px; height:6px; border-radius:50%; background:var(--fun-orange); }
.fun-lb__actions{ display:flex; flex-wrap:wrap; gap:10px; justify-content: end !important; }
.fun-lb__error{ color:var(--muted); font-size:15px; }

/* thumbnails */
.fun-lb__thumbs{
  flex:0 0 auto;
  display:flex; gap:8px;
  padding-top:16px;
  overflow-x:auto;
  scroll-behavior:smooth;
  scrollbar-width:thin;              /* Firefox */
  -webkit-overflow-scrolling:touch;  /* iOS momentum */
  justify-content:flex-start;        /* was center — left-align so scroll works */
}
.fun-lb__thumb {
    flex: 0 0 180px;
    height: 140px;
}
.fun-lb__thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.fun-lb__thumb:hover{ opacity:.85; }
.fun-lb__thumb.is-active{ opacity:1; border-color:#fff; }

.fun-lb__thumbs::-webkit-scrollbar{ height:6px; }
.fun-lb__thumbs::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.3); border-radius:999px; }


@media (max-width:640px){
  .fun-lb__frame{ padding:52px 8px 8px; }
  .fun-lb__nav{ width:42px; height:42px; }
  .fun-lb__panel{ max-height:80%; }
  .fun-lb__panel-body{ padding:8px 20px 24px; }
  .fun-lb__thumbs{ display:none; }
  .fun-lb__actions .fun-btn{ flex:1 1 0; }
}

@media (prefers-reduced-motion:reduce){
  .fun-lb,.fun-lb__panel,.fun-lb__img{ transition:none !important; }
}
