/* ============================================================================
   Language toggle button (EN / עב)
   ========================================================================== */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-inline-end: 18px;
  margin-inline-start: 6px;
}

.lang-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #16a34a;
  background: transparent;
  color: #16a34a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  padding: 0;
}

.lang-btn:hover {
  transform: translateY(-1px);
}

.lang-btn.active {
  background: #16a34a;
  color: #fff;
}

/* On small screens, tuck the toggle in a touch smaller */
@media (max-width: 480px) {
  .lang-btn {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }
}

/* ---------------------------------------------------------------------------
   Mobile header (<=991px): the toggle now lives directly inside .navbar as a
   sibling of the logo and the hamburger button (see Header.tsx), so it isn't
   hidden along with .header-btn on small screens. Without this, space-between
   on .navbar would float it in the middle of the header, away from the
   hamburger. Pull it flush against the hamburger instead — on the side the
   hamburger actually sits on for the current text direction.
   ------------------------------------------------------------------------- */
@media only screen and (max-width: 991px) {
  html[dir='ltr'] .navbar > .lang-toggle,
  html:not([dir='rtl']) .navbar > .lang-toggle {
    margin-left: auto;
    margin-right: 16px;
  }

  html[dir='rtl'] .navbar > .lang-toggle {
    margin-right: auto;
    margin-left: 16px;
  }

  /* Give the hamburger button breathing room from the screen edge too, so the
     toggle + hamburger don't read as one cramped cluster pinned to the corner. */
  .navbar-toggle {
    margin-inline-start: 4px;
  }
}

/* ============================================================================
   Right-to-left (Hebrew) overrides — only active when <html dir="rtl">
   The native dir="rtl" attribute already flips inline direction and default
   text alignment; the rules below fix the bootstrap-based layout bits that
   don't flip on their own.
   ========================================================================== */
html[dir='rtl'] body {
  direction: rtl;
  text-align: right;
  /* Heebo carries Hebrew glyphs; falls back to the site font for Latin text */
  font-family: 'Heebo', 'Hanken Grotesk', sans-serif;
}

html[dir='rtl'] .navbar-nav,
html[dir='rtl'] ul {
  padding-right: 0;
}

/* ---------------------------------------------------------------------------
   Swiper sliders (hero video slider, testimonials, brand + client logos)
   are initialised in LTR at page load. If the RTL flip reaches the flex track
   the active slide is pushed off-screen (the hero video "disappears"). Keep
   the track itself LTR so Swiper's transforms stay correct, while letting the
   slide CONTENT flow right-to-left.
   ------------------------------------------------------------------------- */
html[dir='rtl'] .swiper,
html[dir='rtl'] .swiper-wrapper {
  direction: ltr;
}

html[dir='rtl'] .swiper-slide {
  direction: rtl;
}

/* Hero heading/content stays right-aligned even though the track is LTR */
html[dir='rtl'] .hero-content,
html[dir='rtl'] .hero-content .section-title,
html[dir='rtl'] .hero-content h1,
html[dir='rtl'] .hero-content h3,
html[dir='rtl'] .hero-content p {
  text-align: right;
}

/* Logo/menu order: .navbar inherits direction:rtl from <body>, which on its
   own already flips the flex main-axis so the logo (first DOM child) lands on
   the right and the nav/menu flows to its left — the natural RTL convention.
   No flex-direction override needed here; adding row-reverse on top of the
   inherited rtl direction would cancel it back out and strand the logo on
   the left again. */
/* The gap between the logo and the first nav link comes from a physical
   margin-left on .nav-menu-wrapper (it sits immediately right of the logo in
   English). Now that the logo sits on the right in RTL, the wrapper sits
   immediately LEFT of it, so the gap must move to margin-right instead. */
html[dir='rtl'] .main-menu .nav-menu-wrapper {
  margin-left: 0;
  margin-right: 40px;
}

/* "Why Choose Us" items: dir:rtl already flips the flex main-axis so the icon
   lands on the right and the content on its left (no row-reverse needed —
   see navbar note above). But the physical margin-right on .icon-box that
   creates the gap in LTR then sits on the OUTER edge instead of between the
   icon and the text, leaving them far apart. Mirror it to margin-left. */
html[dir='rtl'] .why-choose-item .icon-box {
  margin-right: 0;
  margin-left: 20px;
}

/* Contact info items (phone / email cards): same icon-box + margin-right
   pattern as .why-choose-item above — mirror for the same reason. */
html[dir='rtl'] .contact-info-item .icon-box {
  margin-right: 0;
  margin-left: 20px;
}

/* Footer + content columns: right-align text, flip icon spacing */
html[dir='rtl'] .footer-contact-item {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir='rtl'] .footer-social-links ul,
html[dir='rtl'] .footer-links ul {
  padding-right: 0;
}

/* Social icon gaps: the physical margin-right on each <li> creates the gap
   in LTR because the next icon sits to its right. In RTL the icons flow the
   other way (next icon sits to the LEFT), so that same margin-right lands on
   the outer edge instead of between icons, leaving them touching. Mirror it. */
html[dir='rtl'] .footer-social-links ul li {
  margin-right: 0;
  margin-left: 10px;
}

html[dir='rtl'] .footer-social-links ul li:last-child {
  margin-left: 0;
}

/* Generic content alignment for headings/paragraphs/lists */
html[dir='rtl'] h1,
html[dir='rtl'] h2,
html[dir='rtl'] h3,
html[dir='rtl'] h4,
html[dir='rtl'] h5,
html[dir='rtl'] h6,
html[dir='rtl'] p,
html[dir='rtl'] li,
html[dir='rtl'] .section-title,
html[dir='rtl'] .about-content,
html[dir='rtl'] .service-content {
  text-align: right;
}

/* Round stat badges ("10+ Years of experience", "100% Positive feedback"):
   their own CSS already centers the number/text inside the circle with
   text-align:center (and flex centering). The generic h1–h6/p right-align
   rule above has equal selector specificity and loads later, so it was
   winning and pushing the number off-center. Restore centering here. */
html[dir='rtl'] .experience-counter h3,
html[dir='rtl'] .experience-counter p,
html[dir='rtl'] .feedback-counter p {
  text-align: center;
}

/* Form fields read right-to-left */
html[dir='rtl'] input,
html[dir='rtl'] textarea,
html[dir='rtl'] select {
  text-align: right;
  direction: rtl;
}

/* Keep intentionally-LTR data (phones, emails, URLs) readable.
   Excludes .whatsapp-button: that link's OWN stylesheet (inline <style> in
   app/contact/page.tsx) relies on display:flex + align-items:center to lay
   out its icon circle and tooltip. This selector also matches
   .whatsapp-button (its href is a wa.me link too), so without the
   :not() exclusion this rule was overriding that flex layout to
   inline-block in RTL/Hebrew mode, breaking the floating button. */
html[dir='rtl'] a[href^='tel:'],
html[dir='rtl'] a[href^='mailto:'],
html[dir='rtl'] a[href^='https://wa.me']:not(.whatsapp-button),
html[dir='rtl'] .footer-contact-content a {
  direction: ltr;
  unicode-bidi: embed;
  display: inline-block;
}

/* ---------------------------------------------------------------------------
   Floating WhatsApp button (Contact page): its own stylesheet always anchors
   it bottom-right (the LTR default). In RTL, move it to the bottom-left —
   the conventional corner for a floating action button on a Hebrew site —
   and flip the hover tooltip (which opens toward the button's inner side) to
   match, so it opens away from the screen edge instead of overlapping it.
   ------------------------------------------------------------------------- */
html[dir='rtl'] .whatsapp-button {
  right: auto;
  left: 20px;
}

html[dir='rtl'] .whatsapp-button .tooltip {
  right: auto;
  left: 70px;
}

html[dir='rtl'] .whatsapp-button:hover .tooltip {
  right: auto;
  left: 80px;
}

@media (max-width: 480px) {
  html[dir='rtl'] .whatsapp-button .tooltip {
    right: auto;
    left: 60px;
  }

  html[dir='rtl'] .whatsapp-button:hover .tooltip {
    right: auto;
    left: 70px;
  }
}

/* The language toggle itself must never be flipped or translated (עב/En keep
   their own internal LTR order). NOTE: margin-inline-end on .lang-toggle
   resolves against the element's OWN direction, not the page's — forcing
   direction:ltr here silently turned that logical margin into a physical
   margin-right, which lands on the toggle's outer/right edge (already the
   flex main-start in RTL, i.e. nowhere useful) instead of between the toggle
   and the "Book a meeting" button that sits to its left. Cancel the logical
   margin and set the gap explicitly with a physical margin-left so it lands
   on the correct side and matches the English gap exactly. */
html[dir='rtl'] .lang-toggle {
  direction: ltr;
  margin-inline-end: 0;
  margin-left: 18px;
  margin-right: 6px;
}

/* ---------------------------------------------------------------------------
   Hero buttons ("Explore More" / "View Projects"): the template creates the
   gap between them with margin-left on the second (highlighted) button, which
   only lands "between" the two buttons in LTR. Under RTL the visual neighbour
   flips to the other side, so the same margin ends up on the outer edge
   instead of the gap. Mirror it so the two buttons keep an identical gap in
   both languages.
   ------------------------------------------------------------------------- */
html[dir='rtl'] .hero-content .btn-default.btn-highlighted {
  margin-left: 0;
  margin-right: 30px;
}

@media only screen and (max-width: 767px) {
  html[dir='rtl'] .hero-content .btn-default {
    margin-right: 0;
    margin-left: 40px;
  }

  html[dir='rtl'] .hero-content .btn-default.btn-highlighted {
    margin: 0;
  }
}

/* ---------------------------------------------------------------------------
   Arrow icons: every "arrow" affordance on the site (main CTA buttons, blog
   "read more" links, service/FAQ category lists, the team "read more" circle)
   is built the same way — an arrow image glued to the RIGHT edge, pointing
   right, because the template assumes LTR. In RTL that reads backwards (the
   arrow visually points "back" instead of "forward"). Move each to the left
   edge and mirror the icon so it points the natural reading direction.
   ------------------------------------------------------------------------- */

/* Main CTA buttons (Explore More, View Projects, Read More, Submit, etc.) */
html[dir='rtl'] .btn-default {
  padding: 17px 20px 17px 46px;
}

html[dir='rtl'] .btn-default::before {
  right: auto;
  left: 0;
  transform: translate(20px, -50%) scaleX(-1);
}

html[dir='rtl'] .btn-default:hover::before {
  transform: translate(18px, -50%) scaleX(-1);
}

/* Bootstrap's .form-check is LTR-only (float:left / margin-left), so in RTL
   the checkbox stays stranded on the left, far from its Hebrew label. */
html[dir='rtl'] .form-check {
  padding-right: 1.5em;
  padding-left: 0;
}

html[dir='rtl'] .form-check .form-check-input {
  float: right;
  margin-right: -1.5em;
  margin-left: 0;
}

/* Blog card "read more" links */
html[dir='rtl'] .post-item-btn a {
  padding-right: 0;
  padding-left: 25px;
}

html[dir='rtl'] .post-item-btn a::after {
  right: auto;
  left: 0;
  transform: translate(0px, -50%) scaleX(-1);
  background-position: left center;
}

html[dir='rtl'] .post-item-btn a:hover::after {
  transform: translate(-2px, -50%) scaleX(-1);
}

/* Service & FAQ category sidebar list links */
html[dir='rtl'] .service-catagery-list ul li a,
html[dir='rtl'] .faq-catagery-list ul li a {
  padding-right: 0;
  padding-left: 25px;
}

html[dir='rtl'] .service-catagery-list ul li a::before,
html[dir='rtl'] .faq-catagery-list ul li a::before {
  right: auto;
  left: 0;
  transform: translateY(-50%) rotate(-45deg) scaleX(-1);
}

html[dir='rtl'] .service-catagery-list ul li:hover a::before,
html[dir='rtl'] .faq-catagery-list ul li:hover a::before {
  transform: translateY(-50%) rotate(0) scaleX(-1);
}

/* ---------------------------------------------------------------------------
   "Our Skill" section (image collage + progress bars): the template builds
   the collage assuming the text column sits on the LEFT and the image column
   on the RIGHT — img2/img3 are pinned with `right:0` to stick out on the
   image column's OUTER edge (away from the text), and the whole group gets
   `margin-left:65px` to open a gap on its INNER edge (toward the text).
   dir:rtl already flips which column the text/image land in (text -> right,
   images -> left), but none of those physical left/right values follow, so
   in RTL the "outer" edge is now the LEFT and the "inner" edge is now the
   RIGHT — the opposite of what the rules say. Mirror them all so the collage
   reads the same way, just flipped: accent images stick out on the left,
   the gap opens on the right, and the count-bar fills from the reading
   start (right) instead of the left.
   ------------------------------------------------------------------------- */
html[dir='rtl'] .our-skill-image {
  margin-left: 0;
  margin-right: 65px;
}

html[dir='rtl'] .our-skill-img-1 {
  background-position: top right;
  padding: 30px 30px 0 0;
}

html[dir='rtl'] .our-skill-img-2,
html[dir='rtl'] .our-skill-img-3 {
  right: auto;
  left: 0;
}

html[dir='rtl'] .skill-data .skill-no {
  margin-left: 0;
  margin-right: 20px;
}

html[dir='rtl'] .skill-progress .count-bar {
  left: auto;
  right: 0;
}

/* At <=991px the columns stack and custom.css re-centers the collage with
   `margin: 0 auto` — the RTL margin-right above has higher specificity than
   that plain-class rule and would win outside a media query, so restate the
   centering here to keep it inside the same breakpoint. */
@media only screen and (max-width: 991px) {
  html[dir='rtl'] .our-skill-image {
    margin-left: auto;
    margin-right: auto;
  }
}

/* At <=767px custom.css shrinks .our-skill-img-1's padding for the smaller
   collage; mirror it the same way the base rule above does. */
@media only screen and (max-width: 767px) {
  html[dir='rtl'] .our-skill-img-1 {
    padding: 20px 20px 0 0;
  }
}

/* Team card circular "read more" button */
html[dir='rtl'] .team-readmore-btn {
  right: auto;
  left: 30px;
}

html[dir='rtl'] .team-readmore-btn img {
  transform: rotate(-45deg) scaleX(-1);
}

html[dir='rtl'] .team-readmore-btn a:hover img {
  transform: rotate(0deg) scaleX(-1);
}
