/* ==========================================================================
   AIDM TRUST - AUTHENTIC MASJID CAMPAIGN & PAYMENT SYSTEM STYLESHEET
   Design Language: Apple × Architectural Digest × Awwwards (Official AIDM Data)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand Color System */
  --bg-offwhite: #F7F5F2;
  --bg-surface: #FFFFFF;
  --bg-card: #EFECE6;
  --bg-dark: #111315;
  
  --text-main: #111315;
  --text-muted: #4B5563;
  --text-subtle: #6B7280;
  
  --accent-green: #27452C;
  --accent-green-hover: #1E3722;
  --accent-gold: #D97706;
  --border-light: rgba(17, 19, 21, 0.10);
  --border-dark: rgba(255, 255, 255, 0.10);
  
  /* Component Radius System */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Elevation & Shadow System */
  --shadow-2xs: 0 1px 3px rgba(17, 19, 21, 0.04);
  --shadow-sm: 0 2px 8px rgba(17, 19, 21, 0.06);
  --shadow-md: 0 6px 20px rgba(17, 19, 21, 0.08);
  --shadow-lg: 0 12px 32px rgba(17, 19, 21, 0.12);
  --shadow-xl: 0 20px 48px rgba(17, 19, 21, 0.16);

  /* Typography & Easing Tokens */
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 200ms var(--ease-cinematic);
  --transition-base: 350ms var(--ease-cinematic);
  --transition-slow: 600ms var(--ease-cinematic);
}

html {
  scroll-behavior: auto !important;
  font-family: var(--font-sans);
  background-color: var(--bg-offwhite);
  color: var(--text-main);
  color-scheme: light;
}

/* Lenis Smooth Scroll Base */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-offwhite);
}
::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 3px;
}

/* Film Grain Overlay */
.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography Utility */
.font-editorial {
  font-family: var(--font-serif);
}

/* PINNED WRAPPER & STICKY VIEWPORT */
#hero-pinned-wrapper {
  position: relative;
  min-height: 180vh;
  width: 100%;
}

#hero-sticky-container {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  margin: 0;
  padding: 0;
}

/* ARCHED-TOP CENTERPIECE CONTAINER */
.arched-photo-container {
  position: relative;
  width: 100%;
  max-width: 290px;
  height: 380px;
  border-top-left-radius: 145px;
  border-top-right-radius: 145px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  overflow: hidden;
  background: #EFECE6;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
  will-change: width, height, border-radius;
  z-index: 20;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .arched-photo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 330px;
    height: 470px;
    max-width: none;
    max-height: none;
    border-top-left-radius: 165px;
    border-top-right-radius: 165px;
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0px;
    margin: 0;
  }
}

/* High-Definition Centerpiece Photograph */
.arched-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  transform: scale(1.0);
  will-change: transform, object-position;
}

/* FULLSCREEN OVERLAY CONTENT */
#dive-overlay-content {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(17, 19, 21, 0.4) 0%, rgba(17, 19, 21, 0.85) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#narrative-film-bridge {
  will-change: opacity;
}

.overlay-stagger-block {
  opacity: 0;
  transform: translateY(24px);
  will-change: transform, opacity;
}

/* DONOR AVATAR STACK */
.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack-item {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  border: 2px solid #F7F5F2;
  margin-left: -10px;
  object-fit: cover;
}

.avatar-stack-item:first-child {
  margin-left: 0;
}

/* ==========================================================================
   IMPROVED EDITORIAL NAVIGATION BAR & LINKS (.nav-link-editorial)
   ========================================================================== */
.nav-editorial {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(247, 245, 242, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  transform: translate3d(0, 0, 0);
  will-change: transform;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), background-color 400ms ease, box-shadow 400ms ease;
  backface-visibility: hidden;
  z-index: 100;
}

.nav-editorial.nav-hidden {
  transform: translate3d(0, -100%, 0) !important;
}

.nav-editorial.nav-scrolled {
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 4px 20px rgba(17, 19, 21, 0.06) !important;
}

.nav-link-editorial {
  position: relative;
  color: #4B5563;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0;
  transition: color 400ms var(--ease-cinematic);
  text-decoration: none !important;
}

.nav-link-editorial::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0%;
  height: 1.5px;
  background-color: var(--accent-green);
  transition: width 400ms var(--ease-cinematic), left 400ms var(--ease-cinematic);
  border-radius: 1px;
}

.nav-link-editorial:hover {
  color: #111315;
}

.nav-link-editorial:hover::after,
.nav-link-editorial.active::after {
  width: 100%;
  left: 0%;
}

.nav-link-editorial.active {
  color: #111315;
  font-weight: 600;
}

/* ==========================================================================
   AWWWARDS-GRADE CINEMATIC BUTTON INTERACTION SYSTEM
   ========================================================================== */

/* 1. PRIMARY CINEMATIC BUTTON (.btn-awwwards-primary) */
.btn-awwwards-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-green);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.85rem 1.75rem;
  border-radius: 12px;
  border: 1px solid var(--accent-green);
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  transition: border-color 600ms var(--ease-cinematic), background-color 600ms var(--ease-cinematic), box-shadow 600ms var(--ease-cinematic), transform 600ms var(--ease-cinematic);
  box-shadow: 0 4px 14px rgba(39, 69, 44, 0.18);
  text-decoration: none !important;
}

.btn-awwwards-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
  transform: skewX(-20deg);
  transition: transform 800ms var(--ease-cinematic);
  pointer-events: none;
  z-index: 1;
}

.btn-awwwards-primary .btn-content {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 500ms var(--ease-cinematic);
}

.btn-awwwards-primary .btn-arrow {
  display: inline-block;
  font-family: monospace;
  font-size: 0.875rem;
  transition: transform 500ms var(--ease-cinematic), color 500ms var(--ease-cinematic);
}

.btn-awwwards-primary:hover {
  background-color: var(--accent-green-hover) !important;
  border-color: var(--accent-green-hover) !important;
  box-shadow: 0 8px 24px rgba(30, 55, 34, 0.32);
  transform: translateY(-2px);
}

.btn-awwwards-primary:hover::before {
  transform: translateX(200%) skewX(-20deg);
}

.btn-awwwards-primary:hover .btn-content {
  transform: translateX(2px);
}

.btn-awwwards-primary:hover .btn-arrow {
  transform: translate(6px, -2px) rotate(-45deg);
  color: #FDE68A;
}

/* 2. SECONDARY EDITORIAL BUTTON (.btn-awwwards-secondary) */
.btn-awwwards-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  transition: border-color 500ms var(--ease-cinematic), background-color 500ms var(--ease-cinematic), color 500ms var(--ease-cinematic), transform 500ms var(--ease-cinematic);
  text-decoration: none !important;
}

.btn-awwwards-secondary .btn-arrow {
  display: inline-block;
  font-family: monospace;
  font-size: 0.8125rem;
  transition: transform 500ms var(--ease-cinematic), color 500ms var(--ease-cinematic);
}

.btn-awwwards-secondary:hover {
  border-color: var(--text-main);
  background-color: rgba(17, 19, 21, 0.05);
  color: var(--text-main);
  transform: translateY(-1px);
}

.btn-awwwards-secondary:hover .btn-arrow {
  transform: translateX(6px);
  color: var(--accent-green);
}

/* 3. HEADER COMPACT BUTTON (.btn-awwwards-header) */
.btn-awwwards-header {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--accent-green);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.55rem 1.25rem;
  border-radius: 9999px;
  border: 1px solid var(--accent-green);
  cursor: pointer;
  transition: all 500ms var(--ease-cinematic);
  box-shadow: 0 2px 8px rgba(39, 69, 44, 0.15);
}

.btn-awwwards-header:hover {
  background-color: var(--accent-green-hover);
  border-color: var(--accent-green-hover);
  box-shadow: 0 4px 14px rgba(30, 55, 34, 0.25);
  transform: translateY(-1px);
}

.btn-awwwards-header .btn-arrow {
  display: inline-block;
  font-family: monospace;
  font-size: 0.75rem;
  transition: transform 500ms var(--ease-cinematic), color 500ms var(--ease-cinematic);
}

.btn-awwwards-header:hover .btn-arrow {
  transform: translateX(4px);
  color: #FDE68A;
}

/* ==========================================================================
   AUTHENTIC AIDM GALLERY, STATUTORY DISCLOSURES & PAYMENT TAB STYLES
   ========================================================================== */

/* Gallery Thumbnails */
.gallery-thumb-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 400ms var(--ease-cinematic);
}

.gallery-thumb-card.active,
.gallery-thumb-card:hover {
  border-color: var(--accent-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(39, 69, 44, 0.15);
}

/* Statutory Disclosures Table & Grid */
.statutory-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 400ms var(--ease-cinematic);
}

.statutory-card:hover {
  border-color: var(--accent-green);
  box-shadow: 0 8px 24px rgba(17, 19, 21, 0.06);
}

/* Payment Method Tabs */
.pay-tab-btn {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 300ms var(--ease-cinematic);
  cursor: pointer;
}

.pay-tab-btn.active {
  background: var(--bg-surface);
  color: var(--accent-green);
  border-color: var(--border-light);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(17, 19, 21, 0.04);
}

/* Marquee Ticker */
@keyframes editorialTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-editorial-ticker {
  display: inline-flex;
  animation: editorialTicker 48s linear infinite;
}
.animate-editorial-ticker:hover {
  animation-play-state: paused;
}

/* ==========================================================================
   ANDROID & MOBILE SCROLL PERFORMANCE & TOUCH OPTIMIZATIONS
   ========================================================================== */

/* Remove tap highlight box & tune touch handling on mobile devices */
*, ::before, ::after {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Focus Visible Accessibility Ring System */
:focus-visible {
  outline: 2px solid var(--accent-green) !important;
  outline-offset: 3px !important;
}

/* Force hardware accelerated momentum smooth scrolling on scroll containers */
.overflow-y-auto, 
.overflow-auto, 
.modal-pay-panel, 
#donationModal > div, 
#pdfBookletModal > div {
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
}

/* Android Soft-Keyboard modal height & layout protection */
@media (max-width: 768px) {
  #donationModal > div {
    max-height: 85vh !important;
  }
}

/* Hardware GPU Acceleration layers for buttery smooth 60fps/120fps animations */
.arched-photo-img,
.btn-awwwards-primary,
.btn-awwwards-secondary,
.btn-awwwards-header,
.honor-card,
.statutory-card {
  transform: translateZ(0);
  backface-visibility: hidden;
}

#hero,
#hero-pinned-wrapper,
.hero-pinned-section {
  position: relative;
  width: 100%;
}

@media (min-width: 1024px) {
  #hero,
  #hero-pinned-wrapper,
  .hero-pinned-section {
    min-height: 300vh !important;
  }
}

/* ==========================================================================
   RESPONSIVE MOBILE BREAKPOINTS (< 1024px) - ELIMINATE ALL OVERLAPS
   ========================================================================== */
@media (max-width: 1023px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  footer {
    padding-bottom: 5.5rem !important;
  }

  .hero-pinned-section,
  #hero,
  #hero-pinned-wrapper {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  #hero-sticky-container {
    display: none !important;
  }

  #hero-center-col {
    position: relative !important;
    width: 100% !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    display: flex !important;
    justify-content: center !important;
  }

  .arched-photo-container {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 290px !important;
    height: 380px !important;
    border-top-left-radius: 145px !important;
    border-top-right-radius: 145px !important;
    border-bottom-left-radius: 20px !important;
    border-bottom-right-radius: 20px !important;
    box-shadow: 0 12px 32px rgba(17, 19, 21, 0.12) !important;
  }

  #hero-left-col,
  #hero-right-col {
    opacity: 1 !important;
    transform: none !important;
    width: 100% !important;
  }

  /* Mobile Typography & Spacing Optimization */
  #hero-left-col h1 {
    font-size: 2.65rem !important;
    line-height: 1.04 !important;
  }

  .arched-photo-container {
    box-shadow: 0 16px 40px rgba(17, 19, 21, 0.15) !important;
  }

  #dive-overlay-content,
  #scroll-hint-overlay {
    display: none !important;
  }

  /* Mobile Touch Target Safety & Section Rhythm */
  button, 
  .btn-awwwards-primary,
  .btn-awwwards-secondary,
  .btn-awwwards-header,
  .pay-tab-btn, 
  .modal-pay-tab {
    min-height: 44px;
  }

  section {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }

  #donationModal > div,
  #pdfBookletModal > div {
    max-height: 92vh !important;
  }
}

@media (max-width: 639px) {
  #hero-left-col .btn-awwwards-primary,
  #hero-left-col .btn-awwwards-secondary {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px !important;
  }

  #donationModal > div,
  #pdfBookletModal > div {
    padding: 1.25rem !important;
  }
}

@media (max-width: 320px) {
  .arched-photo-container {
    max-width: 240px !important;
    height: 320px !important;
  }
}

/* ==========================================================================
   APPLE x STRIPE x LINEAR GRADE MOBILE INTERACTION REFINE (< 1024px)
   ========================================================================== */
@media (max-width: 1023px) {
  #main-nav-header {
    background: rgba(247, 245, 242, 0.94) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
  }

  #main-nav-header .btn-awwwards-header {
    padding: 0.5rem 0.85rem !important;
    font-size: 0.75rem !important;
    border-radius: 9999px !important;
    min-height: 40px !important;
  }

  #mobile-menu-toggle {
    width: 2.5rem !important;
    height: 2.5rem !important;
    border-radius: 9999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: 0 1px 3px rgba(17, 19, 21, 0.08) !important;
  }

  .pkg-card:active,
  .gallery-thumb-card:active,
  .honor-card:active,
  .statutory-card:active {
    transform: scale(0.98);
    transition: transform 150ms ease;
  }
}

@media (max-width: 639px) {
  #main-nav-header {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
  }

  #main-nav-header img {
    height: 2.1rem !important;
  }

  #main-nav-header .btn-awwwards-header {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.7rem !important;
  }
}

/* Hide Scrollbar Utility */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}