/* =============================================================
   AJK Welfare — Impact carousel + gallery grid
   Used by the project impact pages (embedded carousel) and the
   gallery page (grid + fullscreen lightbox carousel).
   ============================================================= */

/* -------------------------------------------------------------
   Project impact page: full-screen immersive carousel
   ------------------------------------------------------------- */
html.js .imp-page main{
  height:100vh;
  height:100dvh;
  display:flex;
  flex-direction:column;
  padding:84px 64px 96px;
}

.imp-carousel{
  position:relative;
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.imp-track{
  flex:1;
  min-height:0;
  display:flex;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-snap-type:x mandatory;
  scrollbar-width:none;
  -ms-overflow-style:none;
  border-radius:24px;
  outline:none;
}
.imp-track::-webkit-scrollbar{display:none}
.imp-track:focus-visible{outline:2px solid var(--brand);outline-offset:4px;border-radius:24px}

.imp-slide{
  flex:0 0 100%;
  scroll-snap-align:center;
  scroll-snap-stop:always;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:6px;
  margin:0;
}
.imp-slide img{
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
  object-fit:contain;
  border-radius:20px;
  box-shadow:0 24px 70px rgba(10,31,51,.18);
  background:#f4f6f8;
}

/* Prev / next */
.imp-nav{
  position:absolute;
  top:50%;
  z-index:5;
  width:52px;
  height:52px;
  margin-top:-26px;
  border:1px solid rgba(10,31,51,.12);
  border-radius:999px;
  background:rgba(255,255,255,.94);
  -webkit-backdrop-filter:saturate(180%) blur(12px);
  backdrop-filter:saturate(180%) blur(12px);
  box-shadow:0 8px 26px rgba(10,31,51,.16);
  color:var(--ink);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:background .2s,box-shadow .2s,opacity .2s;
}
.imp-nav:hover{background:#fff;box-shadow:0 10px 28px rgba(10,31,51,.22)}
.imp-nav:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.imp-nav svg{width:20px;height:20px}
.imp-prev{left:-18px}
.imp-next{right:-18px}
.imp-nav[disabled]{opacity:0;pointer-events:none}

/* Counter + progress */
.imp-meta{
  position:absolute;
  left:0;
  right:0;
  bottom:-64px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  z-index:5;
}
.imp-count{
  margin:0;
  font-size:13px;
  line-height:18px;
  font-weight:600;
  letter-spacing:-.01em;
  color:var(--ink);
  background:rgba(255,255,255,.92);
  border:1px solid rgba(10,31,51,.1);
  padding:7px 14px;
  border-radius:999px;
  box-shadow:0 4px 14px rgba(10,31,51,.1);
  white-space:nowrap;
}
.imp-count b{font-weight:700}
.imp-bar{
  width:min(300px,32vw);
  height:4px;
  border-radius:999px;
  background:rgba(10,31,51,.12);
  overflow:hidden;
}
.imp-bar-fill{
  display:block;
  height:100%;
  width:0;
  background:var(--brand);
  border-radius:999px;
  transition:width .25s ease;
}

/* Small hint that fades after the first interaction */
.imp-hint{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:12px;
  margin:0;
  z-index:5;
  font-size:12.5px;
  font-weight:500;
  color:#5b6b7b;
  background:rgba(255,255,255,.92);
  border:1px solid rgba(10,31,51,.08);
  padding:6px 14px;
  border-radius:999px;
  box-shadow:0 4px 14px rgba(10,31,51,.08);
  opacity:1;
  transition:opacity .5s ease;
  pointer-events:none;
  white-space:nowrap;
}
.imp-hint.is-hidden{opacity:0}

@media (max-width:760px){
  /* Full-bleed photos: no side margins, no rounded corners. The counter
     and progress bar sit at the top, under the fixed Back/Donate buttons,
     and the arrows move to the bottom over the photo. */
  html.js .imp-page main{padding:118px 0 28px}
  .imp-page .imp-slide{padding:0}
  .imp-page .imp-slide img{border-radius:0;box-shadow:none}
  .imp-page .imp-meta{top:-52px;bottom:auto}
  .imp-page .imp-bar{width:min(240px,52vw)}
  .imp-page .imp-hint{display:none}
  .imp-page .imp-nav{top:auto;bottom:14px;margin-top:0;width:46px;height:46px}
  .imp-page .imp-prev{left:14px}
  .imp-page .imp-next{right:14px}
}

/* -------------------------------------------------------------
   Gallery page: responsive grid of every project photo
   ------------------------------------------------------------- */
/* Override the old full-screen canvas layout for the new grid page:
   normal scrolling document with the standard sticky, opaque header
   (gallery.css styles the header as fixed + transparent for the canvas). */
html.js .gallery-page.imp-scroll{height:auto;overflow:auto;padding-top:0}
html.js .gallery-page.imp-scroll #main{display:block}
html.js .gallery-page.imp-scroll .site-header{
  position:sticky;
  top:0;
  left:auto;
  right:auto;
  background:rgba(255,255,255,.86);
  -webkit-backdrop-filter:saturate(180%) blur(16px);
  backdrop-filter:saturate(180%) blur(16px);
  border-bottom:1px solid transparent;
  box-shadow:none;
}
html.js .gallery-page.imp-scroll .site-header.is-scrolled{
  border-bottom-color:rgba(0,0,0,.07);
  box-shadow:0 8px 30px rgba(10,37,64,.06);
}

.imp-gal-hero{
  padding:56px 0 10px;
  text-align:center;
}
.imp-gal-hero p{
  margin:0 0 10px;
  font-size:13px;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--brand);
}
.imp-gal-hero h2{
  margin:0 0 14px;
  font-size:clamp(30px,4.4vw,46px);
  line-height:1.12;
  letter-spacing:-.025em;
  color:var(--ink);
  font-family:var(--font-display,inherit);
}
.imp-gal-hero p.imp-sub{
  margin:0 auto;
  max-width:560px;
  font-size:15.5px;
  line-height:1.6;
  color:#5b6b7b;
  text-transform:none;
  letter-spacing:0;
  font-weight:400;
}

.imp-gallery{
  max-width:1280px;
  margin:0 auto;
  padding:30px 20px 90px;
}
.imp-grid{columns:4 240px;column-gap:14px}
.imp-cell{
  display:block;
  width:100%;
  break-inside:avoid;
  margin:0 0 14px;
  padding:0;
  border:0;
  background:none;
  border-radius:16px;
  overflow:hidden;
  cursor:pointer;
  position:relative;
  -webkit-tap-highlight-color:transparent;
}
.imp-cell img{
  width:100%;
  height:auto;
  display:block;
  transition:transform .35s ease;
}
.imp-cell:hover img,.imp-cell:focus-visible img{transform:scale(1.035)}
.imp-cell:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.imp-cell-tag{
  position:absolute;
  left:10px;
  bottom:10px;
  font-size:11px;
  font-weight:600;
  line-height:1;
  padding:5px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.92);
  color:var(--ink);
  box-shadow:0 2px 10px rgba(10,31,51,.14);
  pointer-events:none;
}

/* -------------------------------------------------------------
   Lightbox: fullscreen carousel over the gallery grid
   ------------------------------------------------------------- */
.imp-lightbox{
  position:fixed;
  inset:0;
  z-index:300;
  background:rgba(10,25,41,.9);
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
  display:flex;
}
.imp-lightbox .imp-carousel{
  flex:1;
  margin:64px 64px 84px;
}
.imp-lightbox .imp-slide img{box-shadow:0 30px 90px rgba(0,0,0,.45)}
.imp-lightbox .imp-meta{bottom:-58px}
.imp-lightbox .imp-count{background:rgba(255,255,255,.95)}
.imp-lb-close{
  position:fixed;
  top:20px;
  right:20px;
  z-index:310;
  width:46px;
  height:46px;
  border:1px solid rgba(255,255,255,.25);
  border-radius:999px;
  background:rgba(255,255,255,.14);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:background .2s;
}
.imp-lb-close:hover{background:rgba(255,255,255,.26)}
.imp-lb-close svg{width:20px;height:20px}

@media (max-width:760px){
  .imp-lightbox .imp-carousel{margin:56px 8px 76px}
}

@media (prefers-reduced-motion:reduce){
  .imp-track{scroll-behavior:auto}
  .imp-cell img,.imp-bar-fill{transition:none}
}
