/* === Device Visibility Helpers === */

/* Desktop: visible by default */
.desktop-only {
  display: block;
}

/* Mobile/Tablet: hidden by default */
.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }
}

@media (max-width: 480px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }
}


/*** 

====================================================================
  Responsive
====================================================================

 ***/

@media (max-width: 768px) {
  .main-header-bar {
    width: 60px;
    /* Or alternatively, reposition to top-left corner: */
    /* width: auto; height: auto; top: 15px; left: 15px; */
  }

  .main-header-bar .nav-toggler {
    top: 20px;
  }

  .main-header-bar .nav-toggler .toggler-btn {
    width: 28px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .main-header-bar {
    width: 50px;
  }
}

/* full screen menu responsiveness */
@media (max-width: 768px) {

  /* Stack columns vertically */
  .main-nav-outer .main-nav-box .container-fluid .row {
    flex-direction: column-reverse;
  }

  .main-nav-outer .main-nav-box .main-nav.col-6,
  .main-nav-outer .main-nav-box .main-nav.col-5 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Fix the translateX that pushes content off-screen */
  .in-the-middle {
    transform: translateX(0) translateY(30px);
  }

  .main-nav-outer.now-visible .in-the-middle {
    transform: translateX(0) translateY(0);
  }

  /* Hide the rotated "خدمات عربي" label — it overlaps everything */
  .dead {
    display: none;
  }

  /* Shrink social icons */
  .icon-circle {
    width: 50px;
    height: 50px;
  }

  .icon-circle i {
    font-size: 16px;
  }

  /* Reduce nav link font size */
  .main-nav-outer .main-nav-box .main-nav .navigation>li>a {
    font-size: 22px;
    padding: 12px 0;
  }

  .nav-company-info {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .nav-company-address {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .arabic-text {
    margin-right: 20px;
  }

  /* Nav closer button */
  .main-nav-outer .nav-closer {
    left: 20px;
    top: 20px;
  }
}

/* ==============================================
   FIX 1: Logo stays pinned at top of nav menu
   ============================================== */

/*
   The problem: Smooth Scrollbar uses transform: translate3d()
   on the scroll content, which breaks position: fixed inside
   that context. On mobile, we need to pull the logo OUT of the
   scroll flow by making it absolute to the outer wrapper
   (which does NOT scroll).
*/

@media (max-width: 768px) {

    /* The logo should be positioned relative to .main-nav-outer,
       NOT inside .main-nav-box (which is the scrollable area) */
    .logo-menu-page {
        position: absolute;   /* not fixed — fixed breaks inside transformed parents */
        top: 25px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 100;
        width: 80px;
    }

    /*
       Make sure .main-nav-outer is the positioning parent.
       It already has position: absolute, so this works.
       The logo sits in .main-nav-outer but ABOVE .outer-nav-box,
       so it won't scroll with the menu content.
    */

    /* Add top padding to the scrollable content so it doesn't
       hide behind the now-pinned logo */
    .main-nav-outer .outer-nav-box {
        padding-top: 90px;
    }
}

@media (max-width: 480px) {
    .logo-menu-page {
        width: 65px;
        top: 18px;
    }

    .main-nav-outer .outer-nav-box {
        padding-top: 75px;
    }
}


/* ==============================================
   FIX 2: Kill horizontal scrollbar in nav menu
   ============================================== */

/*
   Root cause: .arabic-text has margin-right: 50px which pushes
   the Bootstrap .row beyond .container-fluid's width.
   Also: .in-the-middle uses translateX(-200px) which can cause
   the browser to compute a wider content box.
   Also: Bootstrap .row has negative margins that extend past
   the container when combined with extra margins.
*/

@media (max-width: 768px) {

    /* Remove the extra right margin that causes overflow */
    .arabic-text {
        margin-right: 0;
        padding-right: 20px;   /* use padding instead — stays inside the box */
        padding-left: 20px;
    }

    /* Kill the translateX that pushes content off-screen */
    .in-the-middle {
        transform: translateX(0) translateY(30px);
    }

    .main-nav-outer.now-visible .in-the-middle {
        transform: translateX(0) translateY(0);
    }

    /* Safety: prevent any overflow from the nav scroll area */
    .main-nav-outer .outer-nav-box {
        overflow-x: hidden;
    }

    .main-nav-outer .main-nav-box {
        overflow-x: hidden;
    }

    /* Bootstrap .container-fluid can cause issues with its padding
       when combined with .row negative margins on small screens */
    .main-nav-outer .container-fluid {
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
    }
}

@media (max-width: 1024px) {
  .hero-content {
    margin-right: 80px;
    margin-bottom: 80px;
  }

  .hero-text {
    font-size: 70px !important;
  }

  .hero-subtext {
    font-size: 36px !important;
  }
}

@media (max-width: 768px) {
  .hero-content {
    margin-right: 0;
    margin-bottom: 60px;
    text-align: center;
    width: 90%;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-text {
    font-size: 64px !important;
  }

  .hero-subtext {
    font-size: 28px !important;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-text {
    font-size: 64px !important;
  }

  .hero-subtext {
    font-size: 28px !important;
  }

  .hero-content {
    margin-bottom: 40px;
  }
}

@media (max-width: 768px) {
  .about-agency-section {
    padding: 80px 0 60px 0;
  }

  .about-wrapper {
    padding: 0 30px;
  }

  .agency-description {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .about-agency-section {
    padding: 60px 0 40px 0;
  }

  .agency-description {
    font-size: 1.05rem;
    text-align: right;
    text-align-last: right;
  }
}

/* =============================================
           RESPONSIVE FINE-TUNING
           ============================================= */

/* Larger phones / small tablets */
@media (min-width: 480px) {
  .mobile-portfolio-grid {
    gap: 6px;
    padding: 0 6px;
  }

  .mobile-portfolio-card-name {
    font-size: 1.1rem;
  }

  .mobile-portfolio-title {
    font-size: 2.6rem;
  }
}

/* Tablets */
@media (min-width: 600px) {
  .mobile-portfolio-grid {
    grid-template-columns: 1fr 1fr 1fr;
    max-width: 700px;
    margin: 0 auto;
  }

  .mobile-portfolio-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .mobile-portfolio-subtitle {
    max-width: 460px;
  }
}


@media (max-width: 768px) {
  .cta-section {
    padding: 80px 0;
  }

  .cta-description {
    font-size: 1.5rem;
  }

  .cta-content {
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .cta-description {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .featured-article {
    flex-direction: column;
  }

  .featured-article-image {
    width: 100%;
    min-height: 250px;
  }

  .featured-article-info {
    width: 100%;
    padding: 30px 25px;
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .blog-feed-title {
    font-size: 3rem;
  }

  .blog-feed-container {
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-feed-title {
    font-size: 2.2rem;
  }

  .blog-feed-section {
    padding: 60px 0;
  }
}

@media (max-width: 768px) {
  .contact-wrapper {
    flex-direction: column;
  }

  .contact-info-side,
  .contact-form-side {
    width: 100%;
  }

  .contact-form-side {
    padding: 40px 20px;
  }

  .contact-info-content {
    padding: 40px 25px;
  }

  .form-group {
    width: 100%;
  }

  .contact-info-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    gap: 40px;
    padding: 0 30px;
  }

  .main-footer {
    padding: 60px 0 10px 0;
  }
}

/***
====================================================================
  Other Media queries (side brand tag + section divider pattern)
====================================================================
***/
@media (max-width: 768px) {
  .side-brand-tag {
    display: none;
    /* Remove on mobile — it overlaps everything */
  }
}

@media (max-width: 768px) {
  .section-divider {
    background-size: 600px auto;
    height: 44px;
  }
}

/* ===== TABLET (max-width: 768px) ===== */
@media (max-width: 768px) {
  .top-nav-bar {
    padding: 20px 20px;
  }

  .nav-wing {
    display: none;
    /* Hide text nav links on tablet/mobile */
  }

  .logo-main-page {
    width: 90px;
  }
}

/* ===== MOBILE (max-width: 480px) ===== */
@media (max-width: 480px) {
  .top-nav-bar {
    padding: 15px 15px;
  }

  .logo-main-page {
    width: 70px;
  }
}