/* Custom Design System & Utility Styles for ARDF */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&display=swap');

:root {
  --color-primary: #7a5900;
  --color-primary-container: #f8b700;
  --color-forest-teal: #064e3b;
  --color-deep-navy: #0f1c2d;
  --color-surface: #f8f9ff;
  --color-surface-container: #e6eeff;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem; /* sticky header offset for in-page anchors */
}

body {
  font-family: var(--font-body);
  background-color: var(--color-surface);
  color: var(--color-deep-navy);
  overflow-x: hidden;
  max-width: 100vw;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Mobile drawer open: lock background scroll without layout jump */
body.drawer-open {
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 1023px) {
  .mega-menu {
    display: none !important;
  }
}

/* Material Symbols Icon Sizing & Alignment */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  display: inline-block;
}

.material-symbols-outlined.fill-1 {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Custom Backdrop & Glassmorphism */
.glass-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(15, 28, 45, 0.08);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-dark {
  background: rgba(15, 28, 45, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Full-Width Desktop Mega Menu — flush to sticky header bottom */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  background-color: #ffffff;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.28);
  border-top: none;
  border-radius: 0;
  opacity: 0;
  visibility: hidden;
  transform: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 9999;
}

/* Seal any sub-pixel seam under the header with a white strip */
.mega-menu::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 4px;
  background: #ffffff;
  pointer-events: none;
}

/* Page dim + blur overlay while mega menu is open */
.mega-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 95;
}

body.mega-menu-open .mega-menu-backdrop,
body:has(header nav .group:hover > .mega-menu) .mega-menu-backdrop,
body:has(header nav .group:focus-within > .mega-menu) .mega-menu-backdrop,
body:has(.mega-menu.active-click) .mega-menu-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Seamless join between sticky header and open mega panel */
body.mega-menu-open header,
body:has(header nav .group:hover > .mega-menu) header,
body:has(header nav .group:focus-within > .mega-menu) header,
body:has(.mega-menu.active-click) header {
  border-bottom-color: transparent;
  box-shadow: none;
}

/* Hover bridge tucked under the header */
.mega-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
  pointer-events: auto;
}

.group:hover > .mega-menu,
.group:focus-within > .mega-menu,
.mega-menu.active-click {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Highlight only the nav link whose mega menu is open */
header nav .group:hover > .nav-mega-trigger,
header nav .group:focus-within > .nav-mega-trigger,
header nav .group:has(> .mega-menu.active-click) > .nav-mega-trigger,
body.mega-menu-open header nav .group:has(> .mega-menu.active-click) > .nav-mega-trigger {
  color: #d97706; /* brand-saffron */
}

header nav .group:hover > .nav-mega-trigger .material-symbols-outlined,
header nav .group:focus-within > .nav-mega-trigger .material-symbols-outlined,
header nav .group:has(> .mega-menu.active-click) > .nav-mega-trigger .material-symbols-outlined {
  transform: rotate(180deg);
}

/* 5 Pillars Bento Hover Styles */
.pillar-card {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.pillar-image {
  filter: brightness(0.92);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: cover;
  object-position: center;
}

.pillar-card:hover .pillar-image {
  filter: brightness(1.05);
  transform: scale(1.08);
}

.pillar-card:hover {
  box-shadow: 0 20px 40px -15px rgba(6, 78, 59, 0.25);
}

/* Tab Active Styles */
.tab-btn.active {
  background-color: #064e3b;
  color: #ffffff;
  border-color: #064e3b;
  box-shadow: 0 10px 25px -5px rgba(6, 78, 59, 0.3);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #7a5900;
}

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

/* Texture Grain Overlay */
.modern-weaver-grain {
  background-image: radial-gradient(rgba(122, 89, 0, 0.1) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Modal Animations */
.modal-overlay {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-content {
  transform: scale(1) translateY(0);
}

/* Subtle Shimmer for Stats */
@keyframes pulseGlow {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; transform: scale(1.02); }
}

.pulse-glow {
  animation: pulseGlow 4s infinite ease-in-out;
}

/* Accessibility: Respect Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print Stylesheet for Research Monographs & Reports */
@media print {
  header, footer, nav, #back-to-top, .mega-menu, .newsletter-banner, button {
    display: none !important;
  }
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }
  main {
    padding-top: 0 !important;
  }
  .bg-surface-container-low, .bg-slate-50, .bg-white {
    background-color: transparent !important;
  }
  .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl {
    box-shadow: none !important;
  }
  .border, .border-slate-200 {
    border-color: #cccccc !important;
  }
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
  }
}

