/* ==========================================================================
   Gonen Hope and Relief Foundation — Additional Features Stylesheet
   Layer 2: Page loader, WhatsApp float, reading progress, ripple, toast,
   cookie consent, custom scrollbar, lazy loading, enhanced responsiveness.
   ========================================================================== */

/* ---------- 1. Holographic Page Loader ---------- */
.page-loader {
  position: fixed;
  inset: 0;
  background: #0a1628;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Holographic ring */
.holo-ring {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #ff006e,
    #fb5607,
    #ffbe0b,
    #8338ec,
    #3a86ff,
    #06ffa5,
    #ff006e
  );
  animation: holo-rotate 2.4s linear infinite, holo-pulse 2s ease-in-out infinite;
  box-shadow:
    0 0 40px rgba(131, 56, 236, 0.5),
    0 0 80px rgba(58, 134, 255, 0.3),
    inset 0 0 30px rgba(255, 255, 255, 0.2);
  filter: blur(0.3px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.holo-ring::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(240,248,255,0.92) 100%);
  backdrop-filter: blur(10px);
  z-index: 1;
}
/* The actual logo image inside the ring */
.holo-logo {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  animation: holo-logo-breathe 2s ease-in-out infinite;
}
@keyframes holo-logo-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes holo-rotate {
  to { transform: rotate(360deg); }
}
@keyframes holo-pulse {
  0%, 100% { transform: scale(1); filter: blur(0.3px) hue-rotate(0deg); }
  50% { transform: scale(1.06); filter: blur(0.3px) hue-rotate(60deg); }
}

.loader-text {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-align: center;
  position: relative;
}
.loader-text .holo-text {
  background: linear-gradient(
    90deg,
    #ff006e, #fb5607, #ffbe0b, #8338ec, #3a86ff, #06ffa5, #ff006e
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: holo-shimmer 3s linear infinite;
}
@keyframes holo-shimmer {
  to { background-position: 200% center; }
}

.loader-dots {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.loader-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06ffa5, #3a86ff);
  animation: loader-bounce 1.2s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: 0.15s; background: linear-gradient(135deg, #ffbe0b, #fb5607); }
.loader-dots span:nth-child(3) { animation-delay: 0.3s; background: linear-gradient(135deg, #8338ec, #ff006e); }
@keyframes loader-bounce {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---------- 2. Reading Progress Bar ---------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--orange) 0%, var(--orange-light) 50%, #06ffa5 100%);
  z-index: 1100;
  transition: width 0.1s ease;
  box-shadow: 0 0 12px rgba(230, 126, 34, 0.6);
}

/* ---------- 3. WhatsApp Floating Button ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 90px;
  left: 28px;
  width: 56px;
  height: 56px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  z-index: 900;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  transition: all 0.3s ease;
  animation: whatsapp-pulse 2.5s ease-in-out infinite;
}
.whatsapp-float:hover {
  transform: scale(1.1) rotate(8deg);
  background: #1da851;
}
.whatsapp-float .tooltip {
  position: absolute;
  left: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--dark);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}
.whatsapp-float:hover .tooltip {
  opacity: 1;
  visibility: visible;
  left: 76px;
}
.whatsapp-float .tooltip::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--dark);
}
@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.5); }
  50% { box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45), 0 0 0 14px rgba(37, 211, 102, 0); }
}

/* ---------- 4. Ripple Effect on Buttons ---------- */
.btn, .nav-donate, .filter-btn, .amount-option, .slider-arrow {
  position: relative;
  overflow: hidden;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple-effect 0.6s ease-out;
  pointer-events: none;
}
@keyframes ripple-effect {
  to { transform: scale(4); opacity: 0; }
}

/* ---------- 5. Toast Notifications ---------- */
.toast-container {
  position: fixed;
  top: 100px;
  right: 24px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: calc(100% - 48px);
}
.toast {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  padding: 16px 22px 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  border-left: 4px solid var(--blue);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}
.toast.show { transform: translateX(0); }
.toast.success { border-left-color: #16a34a; }
.toast.error { border-left-color: #dc2626; }
.toast.info { border-left-color: var(--blue); }
.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  color: #fff;
}
.toast.success .toast-icon { background: #16a34a; }
.toast.error .toast-icon { background: #dc2626; }
.toast.info .toast-icon { background: var(--blue); }
.toast-body { flex: 1; }
.toast-title {
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.toast-msg {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.toast-close {
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 4px;
  background: none;
}
.toast-close:hover { color: var(--dark); }

/* ---------- 6. Cookie Consent Banner ---------- */
.cookie-consent {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  padding: 22px 26px;
  z-index: 1400;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  transform: translateY(150%);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--gray-border);
}
.cookie-consent.show { transform: translateY(0); }
.cookie-icon {
  width: 44px;
  height: 44px;
  background: var(--orange-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.cookie-text { flex: 1; min-width: 200px; }
.cookie-text strong {
  display: block;
  font-family: 'Playfair Display', serif;
  color: var(--dark);
  font-size: 1rem;
  margin-bottom: 2px;
}
.cookie-text p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }
.cookie-text a { color: var(--blue); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-actions .btn { padding: 9px 18px; font-size: 0.85rem; }

/* ---------- 7. Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--gray-bg);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-light) 100%);
  border-radius: 6px;
  border: 2px solid var(--gray-bg);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-light) 100%);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--blue) var(--gray-bg);
}

/* ---------- 8. Smooth Page Transitions ---------- */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--blue);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
}
.page-transition.active { transform: translateY(0); }

/* ---------- 9. Image Lazy Loading ---------- */
img[data-src] {
  opacity: 0;
  transition: opacity 0.5s ease;
}
img.loaded { opacity: 1; }
.lazy-placeholder {
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: lazy-shimmer 1.5s linear infinite;
}
@keyframes lazy-shimmer {
  to { background-position-x: -200%; }
}

/* ---------- 10. Updated Logo Styles ---------- */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-img {
  height: 50px;
  width: auto;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.site-header.scrolled .logo-img { height: 42px; }
.footer-about .logo-img { height: 60px; filter: brightness(0) invert(1); }
/* On dark footer, make the logo white via invert filter (since logo is dark text on transparent bg) */

/* Keep logo-mark as fallback */
.logo-mark {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #00a86b 0%, #00805a 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(0, 168, 107, 0.3);
  position: relative;
}
.logo-mark::after {
  content: '';
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  background: #dc2626;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ---------- 11. Enhanced Card Hover Effects ---------- */
.program-card, .news-card, .team-card, .value-card {
  position: relative;
  overflow: hidden;
}
.program-card::before, .news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--orange) 0%, var(--blue) 100%);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s ease;
  z-index: 5;
}
.program-card:hover::before, .news-card:hover::before {
  transform: scaleY(1);
}

/* ---------- 12. Animated Gradient Hero Overlay ---------- */
.hero-slide::before {
  background: linear-gradient(135deg, rgba(22, 63, 99, 0.85) 0%, rgba(22, 63, 99, 0.55) 40%, rgba(0, 168, 107, 0.4) 100%) !important;
  animation: hero-gradient-shift 8s ease-in-out infinite alternate;
}
@keyframes hero-gradient-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ---------- 13. Section Dividers ---------- */
.section-divider {
  height: 80px;
  background: linear-gradient(180deg, transparent 0%, var(--gray-bg) 100%);
  margin-top: -80px;
  position: relative;
  z-index: 1;
}

/* ---------- 14. Accessibility Focus ---------- */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--blue);
  color: #fff;
  padding: 10px 20px;
  z-index: 2000;
  transition: top 0.3s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- 15. RESPONSIVE FIXES (Critical) ---------- */

/* Make sure all grid layouts collapse properly at intermediate breakpoints */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .programs-grid, .news-grid, .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .values-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-menu > li > a { padding: 10px 12px; font-size: 0.9rem; }
}

@media (max-width: 992px) {
  :root { --header-h: 70px; }

  /* Programs grid: 2 columns on tablet */
  .programs-list-section .programs-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .donate-options {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  /* Allow grid children to shrink below content's intrinsic width */
  .donate-options > * { min-width: 0; }
  .donate-options > div:last-child { order: -1; }

  .contact-grid { grid-template-columns: 1fr; }
  .volunteer-grid { grid-template-columns: 1fr; gap: 36px; }
  .volunteer-grid > div:first-child { order: -1; }

  .about-preview { grid-template-columns: 1fr; gap: 50px; }
  .about-preview .about-content { order: -1; }

  .our-story { grid-template-columns: 1fr; gap: 40px; }
  .our-story .story-content { order: -1; }

  .mv-grid { grid-template-columns: 1fr; }

  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .impact-item { flex-direction: row; }
}

@media (max-width: 768px) {
  .section { padding: 50px 0; }
  .container { padding: 0 18px; }

  /* Mobile nav uses slide-in panel */
  .nav-menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    gap: 4px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    height: calc(100vh - var(--header-h));
  }
  .nav-menu.open { transform: translateX(0); }
  .nav-menu > li > a { padding: 14px 16px; font-size: 1rem; }
  .nav-menu > li > a.active::after { display: none; }

  .has-dropdown .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding: 0 0 0 20px;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .has-dropdown.open .dropdown { max-height: 500px; padding-top: 6px; }
  .has-dropdown .dropdown li a { padding: 9px 14px; font-size: 0.88rem; }

  .hamburger { display: flex; }
  .nav-cta-group .nav-donate { display: none; }

  .hero {
    min-height: 540px;
    height: 85vh;
  }
  .hero h1 { font-size: 1.9rem; line-height: 1.2; }
  .hero p { font-size: 1rem; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; }
  .slider-arrow { display: none; }
  .slider-dots { bottom: 22px; }
  .slider-dot { width: 10px; height: 10px; }
  .slider-dot.active { width: 28px; }

  .page-header { padding: 130px 0 60px; }
  .page-header h1 { font-size: 1.9rem; }

  .programs-grid, .testimonials-grid, .news-grid, .team-grid, .values-grid {
    grid-template-columns: 1fr !important;
  }
  /* Ensure programs page (programs-list-section) also collapses on mobile */
  .programs-list-section .programs-grid {
    grid-template-columns: 1fr !important;
    gap: 22px;
  }
  .program-card { max-width: 100%; }
  .program-img { aspect-ratio: 16 / 10; }
  .program-body { padding: 20px 18px 22px; }
  .program-body h3 { font-size: 1.2rem; }
  .program-body p { font-size: 0.9rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 18px 12px 22px;
  }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-last-child(-n+2) { border-bottom: none; }
  .stat-number { font-size: 2rem; }
  .stat-icon { width: 54px; height: 54px; font-size: 1.3rem; }

  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 10px; }
  .footer-bottom-links { flex-wrap: wrap; justify-content: center; }

  .form-row { grid-template-columns: 1fr; gap: 14px; }
  .donate-form, .contact-form { padding: 26px 20px; }
  .contact-info-card { padding: 28px 22px; }

  .volunteer-grid { gap: 30px; }
  .about-features { grid-template-columns: 1fr; }

  .cta-banner {
    background-attachment: scroll;
    padding: 50px 0;
    text-align: center;
  }
  .cta-banner p { font-size: 1rem; }

  /* Holographic loader responsive */
  .holo-ring { width: 110px; height: 110px; }
  .holo-logo { width: 60px; height: 60px; }
  .loader-text { font-size: 1rem; }

  /* Toast responsive */
  .toast-container { top: 80px; right: 12px; left: 12px; }
  .toast { min-width: 0; max-width: 100%; }

  /* Cookie consent mobile */
  .cookie-consent {
    left: 12px; right: 12px;
    padding: 18px;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }

  /* Buttons full width on mobile in forms */
  .whatsapp-float { width: 50px; height: 50px; bottom: 80px; left: 18px; font-size: 1.4rem; }
  .whatsapp-float .tooltip { display: none; }

  /* Testimonials grid reset */
  .testimonials-grid { grid-template-columns: 1fr; }

  /* News filters wrap nicely */
  .news-filters {
    gap: 8px;
    margin-bottom: 30px;
  }
  .filter-btn { padding: 8px 16px; font-size: 0.82rem; }

  /* Pagination mobile */
  .pagination a { width: 38px; height: 38px; font-size: 0.85rem; }

  /* About images stack */
  .about-images .img-float { display: none; }
  .about-images .experience-badge { left: 10px; top: 10px; padding: 12px 16px; }
  .about-images .experience-badge strong { font-size: 1.5rem; }

  /* Story images stack */
  .story-images { grid-template-columns: 1fr 1fr; gap: 10px; }
  .story-images img:nth-child(1) { grid-row: span 1; aspect-ratio: 16/10; }
  .story-images img:nth-child(2), .story-images img:nth-child(3) { aspect-ratio: 16/10; }

  /* Impact list - smaller text on mobile */
  .impact-amount { width: 70px; font-size: 1.1rem; }
  .impact-desc { font-size: 0.88rem; }

  /* Program/news card text adjustments */
  .program-body, .news-body { padding: 20px 18px; }
  .program-body h3, .news-body h3 { font-size: 1.15rem; }

  /* Back to top */
  .back-to-top { width: 44px; height: 44px; bottom: 22px; right: 18px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section { padding: 40px 0; }
  .hero h1 { font-size: 1.6rem; }
  .hero-tagline { font-size: 0.75rem; padding: 6px 14px; }
  .section-title { font-size: 1.5rem; }
  .section-subtitle { font-size: 0.92rem; margin-bottom: 30px; }

  .stats-grid { grid-template-columns: 1fr; }
  .stat-item { border-bottom: 1px solid rgba(255, 255, 255, 0.12); padding: 16px; }
  .stat-item:last-child { border-bottom: none; }

  .amount-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .amount-option { padding: 14px 6px; font-size: 1rem; }
  .amount-option small { font-size: 0.65rem; }

  /* Tiny-screen form fixes — prevent overflow caused by intrinsic content */
  .donate-form { padding: 22px 14px; }
  .donate-form h3 { font-size: 1.25rem; }
  .donate-form .form-sub { font-size: 0.85rem; margin-bottom: 18px; }
  .amount-grid { grid-template-columns: 1fr 1fr; min-width: 0; }
  .amount-option { min-width: 0; overflow: hidden; word-break: break-word; }
  .frequency-toggle button { padding: 10px 6px; font-size: 0.85rem; }
  .custom-amount { padding: 0 12px; }
  .impact-list { padding: 22px 16px; }
  .impact-amount { width: 60px; font-size: 1rem; }
  .impact-desc { font-size: 0.82rem; }

  .story-images { grid-template-columns: 1fr; }

  .btn { padding: 11px 20px; font-size: 0.85rem; }
  .btn-lg { padding: 13px 24px; font-size: 0.92rem; }

  .logo-img { height: 40px; }
  .site-header.scrolled .logo-img { height: 36px; }

  .page-header h1 { font-size: 1.6rem; }
  .breadcrumb { font-size: 0.85rem; }

  /* Hide experience badge on tiny screens */
  .about-images .experience-badge { display: none; }

  .news-meta { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- Extra-tiny screens (320px and below) ---------- */
@media (max-width: 359px) {
  .container { padding: 0 12px; }
  .donate-form { padding: 18px 10px; }
  .contact-form { padding: 18px 12px; }
  .amount-grid { grid-template-columns: 1fr; gap: 6px; }
  .amount-option { padding: 12px 6px; font-size: 0.95rem; }
  .form-row { gap: 10px; }
  .impact-list { padding: 18px 12px; }
  .impact-item { flex-direction: column; gap: 4px; align-items: flex-start; }
  .impact-amount { width: auto; font-size: 1.1rem; }
  .impact-desc { font-size: 0.78rem; }
  .hero h1 { font-size: 1.4rem; }
  .section-title { font-size: 1.35rem; }
  .btn { padding: 10px 16px; font-size: 0.82rem; }
}

/* ---------- 16. Print Styles ---------- */
@media print {
  .site-header, .site-footer, .whatsapp-float, .back-to-top,
  .reading-progress, .page-loader, .cookie-consent, .toast-container,
  .hero-cta, .cta-banner { display: none !important; }
  body { color: #000; background: #fff; }
  .section { padding: 20px 0; }
  a { color: #000; text-decoration: underline; }
}

/* ---------- 17. Reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .page-loader { display: none; }
}

/* ---------- 18. Gallery Page ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  background: var(--gray-bg);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(30, 90, 138, 0.18);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img { transform: scale(1.1); }

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 63, 99, 0.92) 0%, rgba(22, 63, 99, 0.4) 40%, transparent 70%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #fff;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }

.gallery-cat {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  align-self: flex-start;
}

.gallery-caption {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
}

.gallery-item.hide { display: none; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 32, 0.96);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: 40px 20px;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lightbox.open .lightbox-content { transform: scale(1); }

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-caption {
  color: #fff;
  text-align: center;
  font-size: 0.95rem;
  max-width: 600px;
  line-height: 1.5;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--orange);
  transform: scale(1.1);
}

.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.1); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.1); }

/* Gallery responsive */
@media (max-width: 1100px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .lightbox { padding: 20px 10px; }
  .lightbox-close, .lightbox-prev, .lightbox-next { width: 44px; height: 44px; font-size: 1rem; }
  .lightbox-close { top: 14px; right: 14px; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .gallery-caption { font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery-overlay { opacity: 1; }  /* Always show overlay on mobile (no hover) */
  .gallery-overlay { background: linear-gradient(to top, rgba(22, 63, 99, 0.85) 0%, transparent 50%); }
  .gallery-cat { font-size: 0.62rem; padding: 3px 8px; }
  .gallery-caption { font-size: 0.72rem; }
}

@media (max-width: 359px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
