/* ================================================================
   Foresight Africa — Gallery Page Styles
   ================================================================ */

html { scroll-behavior: smooth; }

/* ── ANIMATIONS ── */
@keyframes fa-gallery-fadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fa-gallery-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fa-gallery .anim-fade-up { opacity: 0; }
.fa-gallery .anim-fade-in { opacity: 0; }

.fa-gallery .animated.anim-fade-up { animation: fa-gallery-fadeUp 0.65s cubic-bezier(.22,.68,0,1.2) forwards; }
.fa-gallery .animated.anim-fade-in { animation: fa-gallery-fadeIn 0.55s ease forwards; }

.fa-gallery .d1 { animation-delay: 0.05s !important; }
.fa-gallery .d2 { animation-delay: 0.15s !important; }
.fa-gallery .d3 { animation-delay: 0.25s !important; }

/* ── LAYOUT ── */
.fa-gallery .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── PAGE HERO ── */
.fa-gallery .page-hero {
  background: #0F0F0F;
  padding: 96px 0 88px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.fa-gallery .page-hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 380px; height: 380px;
  background: rgba(231,120,22,0.07);
  border-radius: 50%;
}
.fa-gallery .page-hero::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 260px; height: 260px;
  background: rgba(231,120,22,0.05);
  border-radius: 50%;
}
.fa-gallery .page-hero__eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #E77816;
  border: 1px solid rgba(231,120,22,0.4);
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  position: relative; z-index: 1;
}
.fa-gallery .page-hero__headline {
  font-size: clamp(30px, 4.5vw, 50px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 18px;
  position: relative; z-index: 1;
}
.fa-gallery .page-hero__sub {
  font-size: 17px;
  color: #A6ABB0;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.7;
  position: relative; z-index: 1;
}

/* ── MASONRY GALLERY ── */
.fa-gallery .gallery-section {
  padding: 88px 0 100px;
  background: #fff;
}
.fa-gallery .masonry {
  columns: 3;
  column-gap: 16px;
}
.fa-gallery .masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.fa-gallery .masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.45s ease;
}
.fa-gallery .masonry-item__overlay {
  position: absolute;
  inset: 0;
  background: rgba(231,120,22,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.fa-gallery .masonry-item__overlay svg {
  width: 44px;
  height: 44px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.fa-gallery .masonry-item:hover img {
  transform: scale(1.05);
}
.fa-gallery .masonry-item:hover .masonry-item__overlay {
  background: rgba(15,15,15,0.45);
}
.fa-gallery .masonry-item:hover .masonry-item__overlay svg {
  opacity: 1;
  transform: scale(1);
}

/* ── LIGHTBOX ── */
.fa-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.fa-lightbox.open {
  display: flex;
}
.fa-lightbox__img-wrap {
  position: relative;
  max-width: 900px;
  width: 100%;
  animation: fa-gallery-fadeIn 0.3s ease;
}
.fa-lightbox__img-wrap img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  max-height: 85vh;
  object-fit: contain;
}
.fa-lightbox__close {
  position: fixed;
  top: 20px; right: 24px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.fa-lightbox__close:hover { background: rgba(255,255,255,0.2); }
.fa-lightbox__close svg {
  width: 20px; height: 20px;
  stroke: #fff; fill: none;
  stroke-width: 2; stroke-linecap: round;
}
.fa-lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.fa-lightbox__nav:hover { background: rgba(231,120,22,0.5); }
.fa-lightbox__nav svg {
  width: 22px; height: 22px;
  stroke: #fff; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.fa-lightbox__prev { left: 16px; }
.fa-lightbox__next { right: 16px; }
.fa-lightbox__counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.08em;
  font-family: 'Segoe UI', Arial, sans-serif;
}

/* ── CTA ── */
.fa-gallery .cta-section {
  padding: 100px 0;
  background: #E77816;
  text-align: center;
}
.fa-gallery .cta-section__tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 16px;
}
.fa-gallery .cta-section__heading {
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 14px;
}
.fa-gallery .cta-section__sub {
  font-size: 17px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 40px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}
.fa-gallery .cta-section__btn {
  display: inline-block;
  background: #fff;
  color: #E77816;
  font-size: 15px;
  font-weight: 700;
  padding: 16px 40px;
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.15s, background 0.2s;
}
.fa-gallery .cta-section__btn:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .fa-gallery .masonry { columns: 2; }
}
@media (max-width: 560px) {
  .fa-gallery .container { padding: 0 16px; }
  .fa-gallery .masonry   { columns: 1; }
  .fa-lightbox__nav      { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fa-gallery .anim-fade-up,
  .fa-gallery .anim-fade-in {
    opacity: 1 !important; transform: none !important; animation: none !important;
  }
  .fa-gallery .masonry-item img,
  .fa-gallery .masonry-item__overlay,
  .fa-gallery .masonry-item__overlay svg { transition: none; }
}
