/* ====== Font Face ====== */
@font-face {
  font-family: 'InkBrushArabic';
  src: url('../webfonts/InkBrushArabic_DEMO-Textured.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* ====== Global Styles ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Cairo', sans-serif;
  scroll-behavior: smooth;
}

:root {
  --headers-color: #FCF2E7; /* Light cream color for headers */
  --paragraphs-color: #D1C9BF; /* Soft beige for paragraphs */
  --primary-background-icons-and-links-color: #9E6C29; /* Dark gold background */
  --secondry-background-color: #06423F; /* Dark teal for secondary backgrounds */
  --active-hover-focus-color: #634018; /* Darker gold for button hover */
}

body, h1, h2, h3, h4, h5, h6, .hero-content h1 {
  font-family: 'InkBrushArabic', 'Cairo', sans-serif !important;
}

h1, h2, h3, h4, h5, h6, button {
  color: var(--headers-color) !important;
}

p {
  color: var(--paragraphs-color) !important;
}

body {
  text-align: right;
  background-color: var(--primary-background-icons-and-links-color) !important;
  background-attachment: fixed;
}

html {
  background-color: var(--primary-background-icons-and-links-color) !important;
}

i {
  color: var(--primary-background-icons-and-links-color) !important;
}

/* ====== Navbar Styles ====== */
    header {
      position: fixed;
      top: 0; left: 0;
      width: 100%;
      z-index: 1000;
      background-color: var(--secondry-background-color);
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .container-fluid img {
      width: 45px; 
      height: 45px;
      border-radius: 3px;
      object-fit: cover;
      margin-left: 10px;
    }

    .navlnk {
      margin-left: 6px;
    }

    .navbar-brand {
      font-weight: bold;
      font-size: 1.3rem;
      cursor: default;
      color: var(--headers-color);
      text-decoration: none;
    }
    
    .navbar-brand h3 {
      margin: 0;
    }

    .navbar-nav .nav-link {
      font-weight: 500;
      color: var(--paragraphs-color);
      font-size: 1.1rem !important;
      padding: 10px 15px;
      transition: transform 0.3s ease, color 0.3s ease;
      display: inline-block;
    }

    /* FIX: Align Dropdown elements cleanly in the middle */
    .navbar-nav .nav-link.dropdown-toggle {
      display: inline-flex !important;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .dropdown-toggle::after {
      display: inline-block;
      vertical-align: middle;
      margin-inline-start: 6px;
    }

    /* ===========================
       Navbar Menu Dropdown
    =========================== */
    .menu-dropdown {
      background: var(--secondry-background-color);
      border: none;
      border-radius: 18px;
      overflow: hidden;
      min-width: 240px;
      padding: 8px;
      margin-top: 10px;
      box-shadow: 0 15px 40px rgba(0,0,0,.35);
      animation: menuFade .25s ease;
      text-align: right;
    }

    .menu-dropdown .dropdown-item {
      color: var(--headers-color);
      padding: 14px 18px;
      border-radius: 12px;
      transition: .3s;
      font-size: 1rem;
    }

    .menu-dropdown .dropdown-item:hover {
      background: rgba(255,255,255,.08);
      color: #F3CA6B !important;
      transform: translateX(-5px);
    }

    .menu-dropdown .dropdown-divider {
      margin: 6px 0;
      border-color: rgba(255,255,255,.1);
    }

    .dropdown-toggle:active,
    .dropdown-toggle:hover,
    .dropdown-toggle:focus {
      color: #9E6C29 !important;
    }

    @keyframes menuFade {
      from {
        opacity: 0;
        transform: translateY(-10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .navbar-nav .nav-link:hover {
      color: var(--primary-background-icons-and-links-color) !important;
      transform: translateY(-3px);
    }

    .navbar-nav .nav-link.active {
      color: #F3CA6B !important;
      font-weight: bold;
      border-bottom: 2px solid #F3CA6B;
    }

    .nav-item i {
      transition: transform 0.3s ease;
    }

    .nav-item a:hover i {
      transform: scale(1.2);
    }

    .hotline-text, .hotline-mobile {
      color: var(--paragraphs-color);
      background-color: #0a544f;
      font-weight: 500;
      box-shadow: 0 2px 6px rgba(0,0,0,0.3);
      transition: transform 0.3s ease, background-color 0.3s ease;
    }

    .hotline-text {
      font-size: 1rem;
      padding: 6px 15px;
      border-radius: 20px;
      display: flex;
      align-items: center;
      gap: 8px;
      margin-inline-start: 10px;
    }

    .hotline-text:hover {
      transform: translateY(-2px);
      background-color: #0d675f;
    }

    .hotline-mobile {
      font-size: 0.95rem;
      padding: 5px 12px;
      border-radius: 16px;
    }

    .hotline-mobile:hover {
      transform: translateY(-2px);
      background-color: #0d675f;
    }

    @media (min-width: 992px) {
      .hotline-mobile { display: none !important; }
    }

    .custom-toggler {
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 4px;
      background: transparent;
      border: none;
      padding: 0.5rem;
      cursor: pointer;
    }

    .toggler-line {
      width: 25px; height: 3px;
      background-color: var(--paragraphs-color);
      border-radius: 2px;
      transition: all 0.3s ease;
    }

    .custom-toggler.collapsed .toggler-line:nth-child(1) {
      transform: rotate(0) translate(0, 0);
    }
    .custom-toggler:not(.collapsed) .toggler-line:nth-child(1) {
      transform: rotate(45deg) translate(5px, 5px);
    }
    .custom-toggler:not(.collapsed) .toggler-line:nth-child(2) {
      opacity: 0;
    }
    .custom-toggler:not(.collapsed) .toggler-line:nth-child(3) {
      transform: rotate(-45deg) translate(5px, -5px);
    }

    @media (max-width: 991.98px) {
      .navbar-collapse {
        background-color: var(--secondry-background-color);
        padding: 1rem 0;
        border-radius: 10px;
      }
      .navbar-nav {
        width: 100%;
        text-align: center;
      }
      .nav-link {
        width: 100%;
        display: block;
        text-align: center;
      }
      .navbar-nav .nav-link.dropdown-toggle {
        display: flex !important;
        justify-content: center;
      }
    }

/* ==========================================================
   HERO SECTION
========================================================== */
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)), url("../images/khairia3.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,.15), rgba(0,0,0,.45));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 90%;
  max-width: 900px;
  padding: 30px;
}

.hero-content h1 {
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 700;
  color: var(--headers-color);
  margin-bottom: 20px;
  text-shadow: 0 6px 20px rgba(0,0,0,.5);
  animation: fadeUp .8s ease;
}

.tagline {
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  color: #F3CA6B !important;
  line-height: 1.8;
  max-width: 750px;
  margin-bottom: 40px;
  text-shadow: 0 3px 12px rgba(0,0,0,.45);
  animation: fadeUp 1s ease;
}

.herolink {
  display: flex;
  justify-content: center;
  animation: fadeUp 1.2s ease;
}

.hero-menu-btn {
  background: var(--primary-background-icons-and-links-color) !important;
  color: var(--headers-color) !important;
  border: none !important;
  border-radius: 50px;
  padding: 15px 40px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .5px;
  transition: .35s ease;
  box-shadow: 0 15px 35px rgba(0,0,0,.35);
}

.hero-menu-btn:hover {
  background: var(--active-hover-focus-color) !important;
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 22px 45px rgba(0,0,0,.45);
}

.hero-menu-btn:focus {
  background: var(--active-hover-focus-color) !important;
  box-shadow: 0 0 0 .2rem rgba(255,255,255,.08);
}

.hero-menu-btn::after {
  margin-right: 12px;
  transition: .3s;
}

.show .hero-menu-btn::after {
  transform: rotate(180deg);
}

.hero-dropdown {
  margin-top: 15px !important;
  min-width: 290px;
  padding: 10px;
  border: none;
  border-radius: 22px;
  background: var(--secondry-background-color);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  animation: dropdownFade .3s ease;
}

.hero-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--headers-color);
  transition: .3s;
  background: transparent;
}

.hero-dropdown .dropdown-item:hover {
  background: rgba(255,255,255,.08);
  color: #F3CA6B !important;
  transform: translateX(-6px);
}

.hero-dropdown .dropdown-divider {
  border-color: rgba(255,255,255,.08);
  margin: 8px 0;
}

/* Animations Variables */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive Logic */
@media (max-width: 992px) {
  #hero { background-attachment: scroll; }
  .hero-content { padding: 20px; }
  .hero-menu-btn { padding: 14px 30px; font-size: 1.05rem; }
  .hero-dropdown { min-width: 250px; }
}

@media (max-width: 576px) {
  .hero-content h1 { font-size: 2.7rem; }
  .tagline { font-size: 1rem; margin-bottom: 30px; }
  .hero-menu-btn { width: 100%; max-width: 280px; }
  .hero-dropdown { width: 100%; }
}

/* ====== Features Section ====== */
.features-section {
  padding: 60px 10px;
  background-color: var(--primary-background-icons-and-links-color);
  color: var(--headers-color);
}

.section-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--headers-color) !important;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--paragraphs-color);
  margin-top: 10px;
}

.feature-box {
  background-color: var(--secondry-background-color);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.feature-box:hover {
  transform: translateY(-8px);
  background-color: #0a544f;
}

.feature-icon {
  font-size: 3rem;
  color: var(--primary-background-icons-and-links-color);
  margin-bottom: 15px;
}

.feature-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-text {
  font-size: 1rem;
}

/* ====== Stories Section ====== */
.stories {
  background-color: var(--secondry-background-color);
  padding: 60px 20px;
  width: 75%;
  margin: 60px auto;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stories-img {
  position: absolute;
  top: 50%;
  left: 50px;
  transform: translateY(-50%);
  height: 75%;
  width: 22%;
  border-radius: 8px;
}

@media (max-width: 1024px) {
  .stories { width: 90%; }
  .stories-img { width: 25%; height: auto; left: 20px; }
}

@media (max-width: 1357px) {
  .stories-img { display: none; }
}

.stories h1 {
  text-align: center;
  color: var(--headers-color);
  font-family: 'InkBrushArabic', 'Cairo', sans-serif;
  font-size: 2rem;
  margin-bottom: 30px;
}

.story {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  position: relative;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story::before {
  content: "";
  position: absolute;
  right: 0; top: 10%;
  height: 70%; width: 5px;
  background-color: var(--primary-background-icons-and-links-color);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.story:hover::before {
  opacity: 1;
}

.story-image {
  width: 180px;
  min-width: 150px;
  max-width: 200px;
  border-radius: 10px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.story:hover .story-image {
  transform: rotate(-2deg) scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.story h4 {
  font-size: 1.4rem;
  color: var(--headers-color);
  margin-bottom: 10px;
  font-family: 'InkBrushArabic', 'Cairo', sans-serif;
}

.story p {
  color: var(--paragraphs-color);
  line-height: 1.6;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .story { flex-direction: column; text-align: center; }
  .story-image { width: 80%; max-width: 300px; }
  .story h4 { font-size: 1.3rem; }
  .story p { font-size: 0.95rem; }
}

/* ====== RTL-Compatible Infinite Gallery Styles ====== */
.gallary-con {
  padding: 60px 0;
  overflow: hidden;
}

.gallery-wrapper {
  display: flex;
  flex-direction: column;
  gap: 25px;
  width: 100%;
}

/* Force layout calculations to read left-to-right to fix missing rows */
.gallery-container {
  overflow: hidden;
  display: flex;
  width: 100%;
  position: relative;
  direction: ltr !important; 
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.gallery-row {
  display: flex;
  gap: 20px;
  padding: 10px 0;
  flex-shrink: 0;
}

/* Continuous Marquee Assignments */
.row1 .gallery-row {
  animation: scrollLeftRTL 45s linear infinite;
}

.row2 .gallery-row {
  animation: scrollRightRTL 45s linear infinite;
}

/* Halts scrolling on container interaction safely */
.gallery-container:hover .gallery-row {
  animation-play-state: paused;
}

/* Individual Image Item Layouts */
.gallery-row img {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
  cursor: pointer;
}

.gallery-row img:hover {
  transform: scale(1.05) translateY(-6px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

/* Mathematically accurate loops (accounting for structural 20px gaps) */
@keyframes scrollLeftRTL {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100% - 20px)); }
}

@keyframes scrollRightRTL {
  0% { transform: translateX(calc(-100% - 20px)); }
  100% { transform: translateX(0); }
}

/* Responsive Scaling Viewports */
@media (max-width: 768px) {
  .gallery-row img {
    width: 180px;
    height: 180px;
    border-radius: 12px;
  }
  .gallary-con {
    padding: 30px 0;
  }
  .gallery-wrapper {
    gap: 15px;
  }
}

/* ====== Footer Section ====== */
#about-us {
  background-color: var(--secondry-background-color);
  padding: 20px 0; text-align: center;
}

.social-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px; height: 45px;
  background-color: var(--primary-background-icons-and-links-color);
  border-radius: 50%;
  font-size: 1.4rem;
  margin: 0 10px;
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.social-icons a:hover {
  transform: translateY(-3px);
  background-color: var(--primary-background-icons-and-links-color);
  color: var(--headers-color);
}

.social-icons i {
  color: var(--paragraphs-color) !important;
  transition: transform 0.3s ease;
}

#year {
  display: contents;
}

.contact-text { font-size: 1.2rem; }

@media (max-width: 576px) {
  .social-icons { justify-content: center; }
  .social-icons a { font-size: 1.6rem; width: 40px; height: 40px; }
  .contact-text { font-size: 1rem; }
}

/* ====== Scroll to Top ====== */
#scrollTopBtn {
  position: fixed; bottom: 30px; right: 40px;
  display: none;
  background-color: var(--paragraphs-color);
  color: var(--primary-background-icons-and-links-color);
  border: none;
  padding: 10px 14px;
  font-size: 16px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: background-color 0.3s ease;
  z-index: 99;
}

/* ====== Splash Screen & Lazy Images ====== */
#splash-screen {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background-color: var(--secondry-background-color);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  text-align: center;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: splashFadeIn 1s ease-in-out;
  height: 100%;
}

.splash-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
}

.splash-loader {
  display: flex;
  text-align: center;
  width: 40px;
  height: 40px;
  border: 4px solid var(--headers-color);
  border-top: 4px solid var(--primary-background-icons-and-links-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.splash-text {
  color: var(--headers-color);
  font-size: 1.2rem;
}

@keyframes splashFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

/* ====== Lazy Loading Image Blur ====== */
img[loading="lazy"] {
  filter: blur(10px);
  transition: filter 0.5s ease-out;
}

img.lazyloaded {
  filter: blur(0);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}