/* ===================================================
   ⚙️ GLOBAL RESET & BASE CONFIG
=================================================== */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  font-family: "Space Grotesk", sans-serif;
  scroll-behavior: smooth;
  color: #1f2937;
  background-color: #fff;
  line-height: 1.6;
}

/* Prevent flicker on active tab buttons */
.active-btn {
  pointer-events: none;
}

/* ===================================================
   🎨 ROOT THEME VARIABLES
=================================================== */
:root {
  --blue: #1e3a8a;
  --blue-dark: #1e40af;
  --yellow: #facc15;
  --yellow-dark: #f59e0b;
  --border: rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.65);
}

/* ===================================================
   🦿 FOOTER SECTION
=================================================== */
footer {
  background: linear-gradient(to br, #ffffff, #fef9c3, #eff6ff);
  border-top: 1px solid #e5e7eb;
  position: relative;
}

footer h3::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: linear-gradient(to right, #1e3a8a, #facc15);
  margin-top: 6px;
}

footer a {
  transition: all 0.3s ease;
}

footer a:hover {
  color: var(--blue-dark);
  transform: translateX(3px);
}

/* ===================================================
   ⬆️ SCROLL-TO-TOP BUTTON
=================================================== */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: linear-gradient(135deg, #2563eb, #facc15);
  color: white;
  padding: 0.75rem;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 50;
}

.scroll-top:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.scroll-top.show {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   🌟 REFFTO GALLERY — PRODUCTION CSS
========================================================= */

.gallery-section {
  padding: 4rem 0;
  background: #f8fafc;
}

/* =========================================================
   📌 MASONRY GRID (CSS ONLY – SAFE)
========================================================= */

.gallery-grid {
  column-count: 3;
  column-gap: 1.5rem;
  width: 100%;
  padding-inline: 1rem;
  margin: 0 auto;
}

/* =========================================================
   🧱 GALLERY ITEM
========================================================= */

.gallery-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  break-inside: avoid-column;
  position: relative;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.35s ease;
}

/* Fade-in on scroll */
.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   🖼️ MEDIA FIT (IMAGES + VIDEOS)
========================================================= */

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* =========================================================
   ✨ ITEM OVERLAY — BOTTOM CAPTION BAR
========================================================= */

/* Mobile-first: ALWAYS visible */
.item-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;

  opacity: 1;
  transition: opacity 0.3s ease;

  background: linear-gradient(
    90deg,
    rgba(0, 86, 255, 0.65) 0%,
    rgba(127, 140, 141, 0.45) 50%,
    rgba(255, 204, 0, 0.6) 100%
  );
}

/* Caption text */
.item-caption {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Desktop only: show on hover */
@media (min-width: 1024px) {
  .item-overlay {
    opacity: 0;
  }

  .gallery-item:hover .item-overlay {
    opacity: 1;
  }
}

/* =========================================================
   🔍 MODAL (SAFE / UNCHANGED)
========================================================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 9999;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-image,
#modalVideo {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.modal-btn i {
  color: #111827;
  line-height: 1;
}

/* =========================================================
   📱 RESPONSIVE BREAKPOINTS
========================================================= */

/* Large tablets / laptops */
@media (max-width: 1200px) {
  .gallery-grid {
    column-count: 3;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .gallery-grid {
    column-count: 2;
    column-gap: 1rem;
  }
}

/* Phones */
@media (max-width: 640px) {
  .gallery-grid {
    column-count: 1;
    column-gap: 0;
  }
}
