/*
Theme Name: ODSAD Elementor
Theme URI: https://odsad.org/
Description: Complete, production-ready WordPress theme for ODSAD (Organization for Developing Services and Agriculture Development), engineered specifically for Elementor and Elementor Pro with visual editing capabilities, authentic Afghan typography (Fraunces & Plus Jakarta Sans), and responsive layouts.
Author: ODSAD Engineering Team
Author URI: https://odsad.org/
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: odsad-elementor
Tags: elementor, custom-background, custom-logo, custom-menu, featured-images, full-width-template, theme-options, translation-ready
*/

/* -------------------------------------------------------------
 * 1. Global CSS Design Tokens & Color Palette
 * ----------------------------------------------------------- */
:root {
  --forest: #1e4738;
  --forest-dark: #132e24;
  --forest-light: #285844;
  --forest-glow: rgba(30, 71, 56, 0.15);
  
  --coral: #c86f55;
  --coral-dark: #a9563e;
  --coral-light: #e08b73;
  --coral-glow: rgba(200, 111, 85, 0.18);
  
  --gold: #d4a359;
  --gold-soft: #f2e3c6;
  --gold-glow: rgba(212, 163, 89, 0.25);
  
  --cream: #fbf8f2;
  --paper: #ffffff;
  --paper-2: #f6f1e7;
  
  --ink: #2c3531;
  --ink-soft: #576560;
  --ink-light: #82928c;
  --line: #e3dbcc;
  --line-dark: #2a4e40;
  
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  --shadow-sm: 0 4px 12px rgba(19, 46, 36, 0.05);
  --shadow-md: 0 10px 30px rgba(19, 46, 36, 0.08);
  --shadow-lg: 0 20px 45px rgba(19, 46, 36, 0.12);
  --shadow-glow: 0 0 35px rgba(212, 163, 89, 0.3);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* -------------------------------------------------------------
 * 2. Baseline Reset & Typography
 * ----------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--forest-dark);
  line-height: 1.2;
  margin-top: 0;
  font-weight: 700;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); letter-spacing: -0.015em; }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.8rem); }
h4 { font-size: clamp(1.1rem, 1.6vw, 1.35rem); }

p {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

a {
  color: var(--forest);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--coral);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* -------------------------------------------------------------
 * 3. Elementor Container & Widget Compatibility
 * ----------------------------------------------------------- */
.elementor-section.elementor-section-boxed > .elementor-container,
.e-con.e-con-boxed > .e-con-inner {
  max-width: 1240px;
}

.e-con {
  --e-con-padding: 0px;
}

/* Global Button Styles */
.elementor-button,
.button,
button.button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.button-forest {
  background: var(--forest);
  color: var(--cream) !important;
  border-color: var(--forest);
  box-shadow: 0 4px 15px var(--forest-glow);
}
.button-forest:hover {
  background: var(--forest-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(19, 46, 36, 0.25);
  color: var(--cream) !important;
}

.button-coral {
  background: var(--coral);
  color: #ffffff !important;
  border-color: var(--coral);
  box-shadow: 0 4px 15px var(--coral-glow);
}
.button-coral:hover {
  background: var(--coral-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 111, 85, 0.35);
  color: #ffffff !important;
}

.button-outline {
  background: transparent;
  color: var(--forest) !important;
  border-color: var(--forest);
}
.button-outline:hover {
  background: var(--forest);
  color: var(--cream) !important;
  transform: translateY(-2px);
}

.button-gold {
  background: var(--gold);
  color: var(--forest-dark) !important;
  font-weight: 700;
  border-color: var(--gold);
}
.button-gold:hover {
  background: #c39247;
  transform: translateY(-2px);
}

/* -------------------------------------------------------------
 * 4. Blinking "Donate Now" Animations
 * ----------------------------------------------------------- */
@keyframes donateBlinkGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(212, 163, 89, 0.4), 0 0 16px rgba(200, 111, 85, 0.3);
    border-color: var(--gold);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 18px rgba(212, 163, 89, 0.85), 0 0 28px rgba(200, 111, 85, 0.6);
    border-color: #ffd875;
    transform: scale(1.03);
  }
}

@keyframes donatePulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.donate-btn-blinking {
  background: linear-gradient(135deg, #c86f55 0%, #b35b42 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid var(--gold) !important;
  animation: donateBlinkGlow 2.2s infinite ease-in-out !important;
  position: relative;
  font-weight: 700 !important;
}

.donate-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #ffd875;
  border-radius: 50%;
  display: inline-block;
  animation: donatePulse 1.4s infinite ease-in-out;
}

/* Top announcement notice bar donate badge */
.top-notice-donate-blink {
  background: rgba(212, 163, 89, 0.25);
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  animation: donateBlinkGlow 2.2s infinite ease-in-out;
  cursor: pointer;
}

/* -------------------------------------------------------------
 * 5. News Marquee Ticker
 * ----------------------------------------------------------- */
@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.news-marquee-strip {
  background: var(--forest-dark);
  border-top: 1px solid rgba(246, 241, 231, 0.12);
  border-bottom: 1px solid rgba(246, 241, 231, 0.12);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  overflow: hidden;
  position: relative;
  z-index: 5;
}

.marquee-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--coral);
  color: #ffffff;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.marquee-pulse {
  width: 6px;
  height: 6px;
  background-color: #ffffff;
  border-radius: 50%;
  animation: donatePulse 1.2s infinite;
}

.marquee-viewport {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  width: max-content;
  animation: marqueeScroll 38s linear infinite;
}

.news-marquee-strip:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: rgba(246, 241, 231, 0.92);
  padding: 0 1.5rem;
  font-size: 0.88rem;
  text-decoration: none;
}
.marquee-item:hover {
  color: var(--gold);
}

.marquee-tag {
  background: rgba(212, 163, 89, 0.2);
  color: var(--gold);
  border: 1px solid rgba(212, 163, 89, 0.4);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.marquee-sep {
  color: var(--coral);
  margin-left: 1.5rem;
  font-size: 0.65rem;
}

/* -------------------------------------------------------------
 * 6. Bento Trust Section & Institutional Cards
 * ----------------------------------------------------------- */
.bento-trust-section {
  padding: 4.5rem 1.5rem;
  background: var(--cream);
}

.bento-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.5rem;
  max-width: 1240px;
  margin: 0 auto;
}

.bento-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(30, 71, 56, 0.3);
}

.bento-card.featured-spotlight {
  grid-row: span 2;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-top: 4px solid var(--forest);
}

.bento-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--coral);
  margin-bottom: 0.6rem;
  display: block;
}

.bento-stat-num {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  line-height: 1;
  color: var(--forest);
  margin-bottom: 0.4rem;
  font-weight: 700;
}

/* -------------------------------------------------------------
 * 7. Editorial Field Notes Slider
 * ----------------------------------------------------------- */
.editorial-slide-section {
  background: var(--forest-dark);
  color: var(--cream);
  padding: 4rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.editorial-slide-shell {
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
}

.editorial-media-layer {
  position: absolute;
  top: 0;
  right: 0;
  width: 65%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.editorial-slide-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.editorial-slide-bg.active {
  opacity: 0.35;
}

.editorial-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--forest-dark) 20%, rgba(19, 46, 36, 0.75) 60%, transparent 100%);
}

.editorial-content-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.editorial-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 700;
  display: block;
  margin-bottom: 0.4rem;
}

.editorial-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
}

.editorial-headline {
  color: #ffffff;
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
  line-height: 1.25;
  margin-bottom: 1rem;
}

.editorial-timeline {
  display: flex;
  gap: 0.5rem;
  margin-top: 2.5rem;
  position: relative;
  z-index: 2;
}

.editorial-timeline-segment {
  height: 4px;
  flex: 1;
  background: rgba(246, 241, 231, 0.2);
  border-radius: 2px;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s;
}

.editorial-timeline-segment.active {
  background: var(--gold);
}

/* -------------------------------------------------------------
 * 8. Status Badges, Modals & Forms
 * ----------------------------------------------------------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-active {
  background: rgba(40, 88, 68, 0.12);
  color: var(--forest);
  border: 1px solid rgba(40, 88, 68, 0.25);
}

.status-completed {
  background: rgba(200, 111, 85, 0.12);
  color: var(--coral);
  border: 1px solid rgba(200, 111, 85, 0.25);
}

/* Modal Popup Window */
.odsad-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(19, 46, 36, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.odsad-modal-overlay.open {
  display: flex;
  opacity: 1;
}

.odsad-modal-container {
  background: var(--paper);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  position: relative;
  padding: 2.5rem;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.odsad-modal-overlay.open .odsad-modal-container {
  transform: scale(1);
}

.odsad-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  transition: all var(--transition-fast);
}

.odsad-modal-close:hover {
  background: var(--coral);
  color: #ffffff;
  border-color: var(--coral);
}

/* -------------------------------------------------------------
 * 9. Responsive Breakpoints
 * ----------------------------------------------------------- */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: 1fr 1fr;
  }
  .bento-card.featured-spotlight {
    grid-row: auto;
    grid-column: span 2;
  }
  .editorial-content-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .editorial-media-layer {
    width: 100%;
    opacity: 0.2;
  }
}

@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-card.featured-spotlight {
    grid-column: auto;
  }
  .odsad-modal-container {
    padding: 1.5rem;
  }
}
