/* ==========================================================================
   MUN Libya 2026 - Light Mode Diplomatic Stylesheet
   Design Standard: Harvard MUN & DSMUN Inspired Institutional Aesthetic
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Brand Fonts: DDA Custom OpenType Fonts
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'DDA';
  src: url('../assets/fonts/dda-bold.otf') format('opentype'),
       url('../assets/DDA%20Bold%20(1).otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DDA';
  src: url('../assets/fonts/dda-medium.otf') format('opentype'),
       url('../assets/DDA%20Medium%20(1).otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DDA';
  src: url('../assets/fonts/dda-medium.otf') format('opentype'),
       url('../assets/DDA%20Medium%20(1).otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Base Rules & Overflow Safety
   -------------------------------------------------------------------------- */
:root {
  --mun-blue: #0284C7;
  --mun-blue-light: #38BDF8;
  --mun-cyan: #29AAE1;
  --dda-orange: #E9551C;
  --dda-orange-hover: #D44710;
  --bg-page: #F8FAFC;
  --bg-surface: #FFFFFF;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --border-focus: #0284C7;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  background-color: var(--bg-page);
  color: var(--text-primary);
}

/* Arabic default typography with DDA brand font */
html[lang="ar"],
html[dir="rtl"] {
  font-family: 'DDA', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Arabic', sans-serif;
}

/* English typography */
html[lang="en"],
html[dir="ltr"] {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Ensure headings use DDA Bold for Arabic */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] .font-brand {
  font-family: 'DDA', 'Tajawal', sans-serif;
  font-weight: 700;
  letter-spacing: normal;
}

html[lang="en"] .font-brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   3. Light Mode Glassmorphism & Card Styles
   -------------------------------------------------------------------------- */
.light-nav {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid #E2E8F0;
}

.card-diplomatic {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-diplomatic:hover {
  border-color: #BAE6FD;
  box-shadow: 0 12px 30px -4px rgba(2, 132, 199, 0.12);
  transform: translateY(-2px);
}

.card-diplomatic-orange:hover {
  border-color: #FFEDD5;
  box-shadow: 0 12px 30px -4px rgba(233, 85, 28, 0.15);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   4. Buttons & CTAs
   -------------------------------------------------------------------------- */
.btn-primary-orange {
  background: linear-gradient(135deg, #E9551C 0%, #F16834 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(233, 85, 28, 0.25);
  transition: all 0.2s ease;
}

.btn-primary-orange:hover {
  background: linear-gradient(135deg, #D44710 0%, #E9551C 100%);
  box-shadow: 0 6px 20px rgba(233, 85, 28, 0.35);
  transform: translateY(-1px);
}

.btn-secondary-blue {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  color: #0284C7;
  transition: all 0.2s ease;
}

.btn-secondary-blue:hover {
  background: #E0F2FE;
  border-color: #0284C7;
  color: #0369A1;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   5. Countdown Box Display (Crisp Light Mode)
   -------------------------------------------------------------------------- */
.countdown-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 0.875rem;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
}

/* --------------------------------------------------------------------------
   6. AIRTIGHT MOBILE NAVIGATION (ZERO BLEED, RTL/LTR AUTO-SYNC)
   -------------------------------------------------------------------------- */
#mobileMenuWrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.3s ease;
}

#mobileMenuWrapper.is-open {
  visibility: visible;
  pointer-events: auto;
}

#mobileMenuBackdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mobileMenuWrapper.is-open #mobileMenuBackdrop {
  opacity: 1;
}

#mobileMenuDrawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 20rem;
  max-width: 85vw;
  height: 100%;
  background-color: #FFFFFF;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 10000;
}

/* RTL (Arabic): docked to right edge, slides from right */
html[dir="rtl"] #mobileMenuDrawer {
  right: 0;
  left: auto;
  transform: translateX(100%);
  border-left: 1px solid #E2E8F0;
}

/* LTR (English): docked to left edge, slides from left */
html[dir="ltr"] #mobileMenuDrawer {
  left: 0;
  right: auto;
  transform: translateX(-100%);
  border-right: 1px solid #E2E8F0;
}

/* Open state: slide to 0 on both RTL and LTR */
#mobileMenuWrapper.is-open #mobileMenuDrawer {
  transform: translateX(0) !important;
}

/* Strictly hide on desktop (1024px+) */
@media (min-width: 1024px) {
  #mobileMenuWrapper {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* --------------------------------------------------------------------------
   7. Directional RTL / LTR Helpers
   -------------------------------------------------------------------------- */
html[dir="rtl"] .flip-rtl {
  transform: scaleX(-1);
}

/* --------------------------------------------------------------------------
   8. Custom Light Scrollbar
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 7px;
}

::-webkit-scrollbar-track {
  background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #0284C7;
}

/* --------------------------------------------------------------------------
   9. Coming Soon Badge & Spotlight Backdrop Styling
   -------------------------------------------------------------------------- */
.badge-soon {
  font-size: 0.6rem;
  padding: 0.05rem 0.35rem;
  border-radius: 9999px;
  background-color: rgba(241, 245, 249, 0.95);
  color: #64748B;
  border: 1px solid rgba(203, 213, 225, 0.8);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  margin-inline-start: 0.2rem;
  line-height: 1.1;
  white-space: nowrap;
}

.badge-open {
  font-size: 0.6rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background-color: rgba(236, 253, 245, 0.95);
  color: #059669;
  border: 1px solid rgba(110, 231, 183, 0.8);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  margin-inline-start: 0.25rem;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-closed {
  font-size: 0.6rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background-color: rgba(254, 242, 242, 0.95);
  color: #dc2626;
  border: 1px solid rgba(252, 165, 165, 0.8);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  margin-inline-start: 0.25rem;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-nav-closed {
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}

.btn-nav-closed:hover {
  background: #1e293b;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.35);
  transform: translateY(-1px);
}

/* Hardware-accelerated ambient blurred spotlight backdrop */
.spotlight-blur-backdrop {
  filter: blur(28px);
  -webkit-filter: blur(28px);
  transform: translate3d(0, 0, 0) scale(1.06);
  will-change: transform, filter;
  contain: paint;
  opacity: 0.35;
  transition: opacity 0.5s ease;
}

/* --------------------------------------------------------------------------
   10. Performance & Rendering Optimization & Full-Bleed Hero
   -------------------------------------------------------------------------- */
.content-auto {
  content-visibility: auto;
  contain-intrinsic-size: 1px 700px;
}

/* Full-bleed Immersive Hero Showcase */
.hero-fullscreen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #020617;
}

.hero-bg-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  z-index: 0;
  transform: scale(1.02);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-overlay-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(2, 6, 23, 0.82) 0%,
    rgba(2, 6, 23, 0.70) 35%,
    rgba(2, 6, 23, 0.85) 75%,
    #F8FAFC 100%
  );
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}

.hero-ambient-glow {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at 50% 40%, rgba(2, 132, 199, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
}

.hero-countdown-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 1rem;
}

/* ==========================================================================
   WordPress Forminator Iframe Integration Styles
   ========================================================================== */
.form-iframe-wrapper {
  position: relative;
  width: 100%;
  background: #ffffff;
  overflow: hidden;
  box-sizing: border-box;
  padding: 1.75rem 1.25rem;
  border-radius: 0 0 1.5rem 1.5rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .form-iframe-wrapper {
    padding: 2.25rem 2.5rem;
  }
}

@media (min-width: 1024px) {
  .form-iframe-wrapper {
    padding: 2.75rem 3.5rem;
  }
}

.form-iframe {
  width: 100%;
  min-height: 2050px;
  height: 2100px;
  border: 0;
  display: block;
  margin-top: 0;
  transition: opacity 0.5s ease;
}

.iframe-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 20;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.iframe-loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 991px) {
  .form-iframe-wrapper {
    padding: 1.5rem 1rem;
  }
  .form-iframe {
    min-height: 2750px;
    height: 2800px;
  }
}

/* Guarantee navbar items and badges never wrap into multiple words/lines */
.desktop-nav-link {
  white-space: nowrap !important;
}

.badge-soon,
.badge-open,
.badge-closed {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}




/* Navbar Width Safety & Sleek Restrained Layout */
#mainNav {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  left: 0;
  right: 0;
}
#mainNav > div {
  max-width: 72rem !important; /* 1152px (max-w-6xl) - refined width that never overflows screen */
  width: 100% !important;
  box-sizing: border-box !important;
}
