/* =========================================
   1. Font Definitions (Al Jazeera Arabic)
   ========================================= */

@font-face {
  font-family: "AlJazeera";
  src: url("../fonts/aljazeera-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "AlJazeera";
  src: url("../fonts/aljazeera-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "AlJazeera";
  src: url("../fonts/aljazeera-light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  /* --- COLOR PALETTE --- */
  /* Main Brand Purple */
  --primary: #522583;

  /* Stage Colors */
  --cubs-yellow: #f9d242; /* Jarameez */
  --scouts-green: #78a756; /* Kashaf */
  --advanced-orange: #f26522; /* Advanced (Moutaqadem) - NEW ORANGE */
  --rovers-red: #ba3642; /* Jawala */

  /* Accents */
  --text-dark: #232323;
  --text-light: #777;
  --bg-gray: #f9f9f9;
  --white: #ffffff;

  /* Shapes */
  --radius-pill: 50px;
  --radius-card: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================================
   2. Global Typography
   ========================================= */

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* FORCE Al Jazeera Font ONLY when language is Arabic */
html[lang="ar"] body {
  font-family: "AlJazeera", "Segoe UI", Tahoma, sans-serif;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 {
  font-family: "AlJazeera";
  font-weight: 700;
}

/* Helpers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.section {
  padding: 80px 0;
}
.bg-light {
  background-color: var(--bg-gray);
}
.text-white {
  color: var(--white) !important;
}

/* --- Navbar --- */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: padding 0.3s;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 900;
  color: var(--primary);
  font-size: 1.2rem;
  z-index: 1001;
}

.brand-logo {
  height: 45px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 700;
  font-size: 1rem;
  transition: color 0.3s;
  position: relative;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 1001;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn {
  padding: 10px 25px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.2s;
}
.btn:hover {
  transform: scale(1.05);
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-login {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f0f0;
  color: var(--primary);
  padding: 10px 20px;
  font-size: 0.9rem;
}
.btn-login:hover {
  background: #e0e0e0;
  color: var(--primary);
}

.mobile-only {
  display: none;
}
.hamburger {
  display: none;
}

/* Mobile Responsive Styles */
@media (max-width: 992px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--primary);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .nav-links a {
    color: white;
    font-size: 1.5rem;
  }

  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: block;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
  }

  .hamburger span {
    width: 30px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 2px;
    transition: 0.3s;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 6px);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -6px);
  }
}

html[dir="ltr"] .nav-links {
  right: auto;
  left: 0;
}

/* Hero Section */
.hero {
  height: 90vh;
  background-image: url("../images/hero-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  align-items: center;
}

/* Impact Stats */
.impact-section {
  background-color: var(--primary);
  color: white;
  padding: 60px 0;
  position: relative;
  z-index: 5;
  margin-top: -5px;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  text-align: center;
}

.stat-item h3 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--cubs-yellow);
}

.stat-item p {
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0.9;
}

/* Identity Section */
.identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.identity-image img {
  width: 100%;
  border-radius: var(--radius-card);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  filter: sepia(0.5);
  transition: 0.3s;
}

.identity-image:hover img {
  filter: sepia(0);
}

/* Values Section */
.values-section {
  position: relative;
  background-image: url("../images/flag-bg.jpg");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  padding: 120px 0;
  text-align: center;
  color: white;
}

.overlay-dark {
  position: absolute;
  inset: 0;
  background: rgba(82, 37, 131, 0.85);
}

.values-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.values-content h2 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: var(--cubs-yellow);
}

.values-content blockquote {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 20px;
}

/* Cards (Stages) */
.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: var(--primary);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}

.card {
  background: white;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-10px);
}

.card-top {
  height: 10px;
  width: 100%;
}

/* 2. New Image Wrapper Style */
.card-img-wrapper {
  width: 100%; /* 80% of the card width */
  height: auto; /* Allow height to scale naturally */
  aspect-ratio: 1/1; /* Keep it square-ish */
  margin: 0 auto 15px;
  padding: 0;
  border-radius: 50%; /* Remove circle */
  background: transparent; /* Remove background */
  box-shadow: none; /* Remove shadow box */
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Show full image without cropping */
  border-radius: 50%; /* Remove circle crop */
  filter: drop-shadow(
    0 5px 10px rgba(0, 0, 0, 0.1)
  ); /* Add shadow to the image itself */
}

.card-body {
  padding: 30px 20px;
  text-align: center;
}

/* UPDATED BORDERS FOR ORANGE (ADVANCED) */
.border-yellow {
  border: 3px solid var(--cubs-yellow);
}
.border-green {
  border: 3px solid var(--scouts-green);
}
.border-orange {
  border: 3px solid var(--advanced-orange);
} /* NEW */
.border-red {
  border: 3px solid var(--rovers-red);
}

.bg-yellow {
  background: var(--cubs-yellow);
}
.bg-green {
  background: var(--scouts-green);
}
.bg-orange {
  background: var(--advanced-orange);
} /* NEW */
.bg-red {
  background: var(--rovers-red);
}

.card-cubs {
  border-bottom: 5px solid var(--cubs-yellow);
}
.card-scouts {
  border-bottom: 5px solid var(--scouts-green);
}
.card-advanced {
  border-bottom: 5px solid var(--advanced-orange);
} /* NEW */
.card-rovers {
  border-bottom: 5px solid var(--rovers-red);
}

/* SDG Section */
.sdg-section {
  background-color: var(--text-dark);
  padding: 80px 0;
  overflow: hidden;
}

.sdg-slider-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  align-items: center;
  position: relative;
  max-width: 100%;
  padding: 0 40px;
}

.sdg-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 20px;
  padding: 20px 0;
  scrollbar-width: none;
}

.sdg-container::-webkit-scrollbar {
  display: none;
}

.sdg-card {
  flex: 0 0 220px;
  height: 220px;
  scroll-snap-align: center;
  perspective: 1000px;
  cursor: pointer;
}

.sdg-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border-radius: 20px;
}

.sdg-card:hover .sdg-inner {
  transform: rotateY(180deg);
}

.sdg-front,
.sdg-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  overflow: hidden;
}

.sdg-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sdg-back {
  transform: rotateY(180deg);
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  text-align: center;
  font-weight: 600;
}

/* --- SDG Slider Controls --- */
.slider-btn {
  background-color: transparent;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  z-index: 10;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-btn:hover {
  background: var(--primary);
}

.prev-btn {
  inset-inline-start: 0;
}

.next-btn {
  inset-inline-end: 0;
}

/* News Section */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.news-card {
  background: white;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
}

a.news-card {
  background: white;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
  /* Fixes: */
  text-decoration: none;
  color: inherit;
  display: block;
}

a.news-card h3 {
  color: var(--primary); /* Keep title purple */
}

a.news-card p {
  color: var(--text-dark); /* Keep text dark/grey */
}

.news-card:hover {
  transform: translateY(-5px);
}

.news-img {
  height: 200px;
  width: 100%;
  object-fit: cover;
}

.news-content {
  padding: 20px;
}
.news-date {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 10px;
  display: block;
}
.news-content h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--primary);
}
.news-content a {
  text-decoration: none;
}

/* Map Section */
.section-subtitle {
  margin-bottom: 40px;
  text-align: center; /* Aligns Right in AR, Left in EN automatically */
  padding: 0 10px;
}

.map-wrapper {
  background: white;
  padding: 10px;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#map {
  height: 500px;
  width: 100%;
  border-radius: 12px;
  z-index: 1;
}

.custom-pin {
  background-color: #fff;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0.9;
}

.map-legend {
  background: white;
  padding: 10px;
  border-radius: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Footer */
.footer {
  background-color: var(--primary);
  color: white;
  padding: 80px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
}

.footer-col h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--cubs-yellow);
  font-weight: 700;
}

.footer-mission {
  margin-top: 20px;
  opacity: 0.8;
  line-height: 1.6;
  max-width: 300px;
}

.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li {
  margin-bottom: 12px;
}
.footer-links a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
}

.footer-contact-list {
  list-style: none;
  padding: 0;
}
.footer-contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-link {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.social-link:hover {
  background: var(--cubs-yellow);
}

.logo-white .brand-logo {
  filter: brightness(0) invert(1);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-contact-list li,
  .social-icons,
  .logo {
    justify-content: center;
  }

  .identity-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .year-badge {
    font-size: 1.5rem;
    padding: 10px 20px;
  }
}
