/* ── PAGE LOADER ── */
#page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: #fdfaf4;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
#page-loader.hide { opacity: 0; pointer-events: none; }
.loader-circle {
  width: 44px; height: 44px;
  border: 3px solid rgba(31,107,54,0.15);
  border-top-color: #1f6b36;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BACK TO TOP ── */
#back-to-top {
  position: fixed; bottom: 28px; right: 24px; z-index: 900;
  width: 46px; height: 46px; border-radius: 50%;
  background: #1f6b36; color: #fff;
  border: none; cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(31,107,54,0.4);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
}
#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top:hover { background: #0f3d1e; }

/* ── COOKIE NOTICE ── */
#cookie-notice {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9000;
  background: #1a2e1b; color: rgba(255,255,255,0.9);
  padding: 18px 8%; display: flex; align-items: center;
  justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.25);
  transform: translateY(100%); transition: transform 0.4s ease;
}
#cookie-notice.show { transform: translateY(0); }
#cookie-notice p { font-size: 0.85rem; line-height: 1.6; margin: 0; flex: 1; min-width: 200px; }
#cookie-notice a { color: #6abf27; text-decoration: underline; }
.cookie-btns { display: flex; gap: 0.8rem; flex-shrink: 0; }
.cookie-accept {
  background: #e8721a; color: #fff; border: none;
  padding: 10px 22px; border-radius: 50px;
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: opacity 0.2s;
}
.cookie-accept:hover { opacity: 0.88; }
.cookie-decline {
  background: transparent; color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 10px 22px; border-radius: 50px;
  font-weight: 600; font-size: 0.85rem; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

/* ── 404 ── */
.not-found-wrap {
  min-height: 70vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 60px 8%;
}
.not-found-wrap h1 { font-size: 6rem; color: #1f6b36; line-height: 1; margin-bottom: 16px; }
.not-found-wrap h2 { font-size: 1.8rem; color: #1a2e1b; margin-bottom: 12px; }
.not-found-wrap p { color: #3d5440; font-size: 1rem; line-height: 1.75; margin-bottom: 32px; max-width: 480px; }

/* ── FADE-IN ANIMATION ── */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── PRINT ── */
@media print {
  nav, #back-to-top, #cookie-notice, #page-loader, .footer-bottom { display: none !important; }
  body { background: #fff !important; font-size: 12pt; }
  section { padding: 20px 0 !important; page-break-inside: avoid; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
  h1, h2, h3 { page-break-after: avoid; }
  img { max-width: 100% !important; page-break-inside: avoid; }
}


/* ── PRINT — Gallery specific ── */
@media print {
  #lightbox, .filter-tabs, .video-grid,
  .add-photo-hint, #back-to-top { display: none !important; }
  .gallery-grid { columns: 2 !important; }
  .gallery-item .overlay { display: none !important; }
  .gallery-item img { border-radius: 8px; }
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  #cookie-notice { padding: 16px 6%; }
  .cookie-btns { width: 100%; }
  .cookie-accept, .cookie-decline { flex: 1; text-align: center; }
}

/* ── ACCESSIBILITY IMPROVEMENTS ── */

/* Skip to main content link for keyboard users */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: #1f6b36;
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 99999;
  transition: top 0.2s;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #FFF176;
}

/* Focus styles — visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #e8721a;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Ensure btn-outline-white has sufficient contrast on dark backgrounds */
.btn-outline-white {
  color: #fff !important;
  border-color: rgba(255,255,255,0.85) !important;
  font-weight: 700;
}
.btn-outline-white:hover {
  background: rgba(255,255,255,0.15) !important;
}

/* Improve text-light contrast — was too faint */
.text-light, .stat-label, .news-meta, .event-detail {
  color: #5a7060 !important;
}

/* Improve card text contrast */
.news-card-excerpt { color: #3d5440 !important; }
.footer-links a    { color: #3d5440 !important; }

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .fade-up { opacity: 1 !important; transform: none !important; }
}
