/* Aramko app additions — honeypot, form flash toast, skip link.
   Kept separate from the theme/vendor CSS so the template files stay untouched. */

/* Skip-to-content link: hidden until keyboard-focused.
   It is clipped to a 1px box rather than pushed off-screen with a negative
   offset. `left: -9999px` works in LTR only: in RTL the scroll origin is the
   right edge, so the element does NOT get clipped — it extends the document
   ~10,000px past the content, the browser zooms out to fit, and every Arabic
   page paints as a blank white screen (worst on phones). Clipping keeps the
   link in its normal position, so the document stays viewport-width. */
.aramko-skip-link {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  z-index: 100000;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  background: #ffffff;
  color: #111111;
  font-weight: 600;
  border-radius: 0 0 6px 0;
  text-decoration: none;
}

.aramko-skip-link:focus {
  width: auto;
  height: auto;
  padding: 12px 20px;
  border: 2px solid #E30613;
  overflow: visible;
  clip: auto;
  clip-path: none;
}

/* Honeypot: never visible or focusable for real users. Same rule as above —
   no negative offset, or the contact page blanks out in Arabic. */
.it-hp {
  position: absolute !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

/* Flash toast (contact / newsletter feedback). */
.aramko-flash {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  animation: aramkoFlashIn 0.3s ease-out;
}

.aramko-flash--success {
  background: #16a34a;
}

.aramko-flash--error {
  background: #dc2626;
}

.aramko-flash__msg {
  flex: 1 1 auto;
}

.aramko-flash__close {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.85;
}

.aramko-flash__close:hover {
  opacity: 1;
}

@keyframes aramkoFlashIn {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .aramko-flash {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

/* --------------------------------------------------------------------------
   /services — Our Services cards: CSS Grid + flex (high-specificity overrides)
   Markup: website/views/pages/service.ejs
   Classes: .it-service-2-cards-row > .col-* > .it-service-2-item
   -------------------------------------------------------------------------- */
#main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-cards-row.row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 30px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  --bs-gutter-x: 0 !important;
  --bs-gutter-y: 0 !important;
}

#main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-cards-row.row > [class*="col-"] {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-top: 0 !important;
}

#main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-cards-row .it-service-2-item {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  height: 100% !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  margin-bottom: 0 !important;
  /* Compact cards: no divider line, so no extra bottom padding needed */
  padding: 32px 28px !important;
}

#main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-icon {
  flex-shrink: 0 !important;
  min-height: 56px;
  /* Overrides .mb-35 from the markup — tighter icon-to-title gap */
  margin-bottom: 20px !important;
}

#main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-title {
  flex-shrink: 0 !important;
  line-height: 1.35;
  /* No min-height: the title sits right on top of its own copy. Card heights stay
     equal via the row grid, so a 1-line title no longer reserves blank space. */
  min-height: 0 !important;
  /* Overrides .mb-25 from the markup */
  margin-bottom: 12px !important;
}

#main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-card-body {
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1 !important;
  flex: 1 1 auto !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
  width: 100% !important;
}

#main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-card-body > p {
  flex-grow: 0 !important;
  flex: 0 0 auto !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

#main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-item:hover .it-service-2-card-body > p {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

/* Neutralize main.css paragraph divider/spacing inside aligned cards */
#main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-item p {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
  border-bottom: none !important;
}

@media (max-width: 1399.98px) {
  #main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-cards-row.row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 991.98px) {
  #main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-cards-row.row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 767.98px) {
  #main-content .it-service-2-area.it-service-2-area--aligned-cards .it-service-2-cards-row.row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ==========================================================================
   Text marquee — see marquee.js. The track is moved by one JS-driven
   transform; nothing here animates, so CSS can never fight the rAF loop.
   ========================================================================== */
.am-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  /* Vertical scrolling stays with the browser; horizontal is ours to drag. */
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  /* Geometry is always left-to-right — marquee.js flips the travel direction
     for RTL itself, so a rtl container must not also reverse the flex row. */
  direction: ltr;
}

.am-marquee.is-dragging {
  cursor: grabbing;
}

.am-marquee__track {
  display: flex;
  width: -webkit-max-content;
  width: max-content;
  will-change: transform;
}

.am-marquee__group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.am-marquee .it-text-slider-item {
  flex: 0 0 auto;
}

html[dir="rtl"] .am-marquee .it-text-slider-item {
  direction: rtl;
}

/* The separator shapes must never swallow a drag or start a native image drag. */
.am-marquee .it-text-slider-item img {
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Offcanvas language switcher — horizontal centering (see also aramko-lang-switcher-center.css) */
.itoffcanvas .it-lang-switcher.it-lang-switcher--offcanvas button.it-lang-switcher__toggle[data-lang-toggle] {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

.itoffcanvas .it-lang-switcher.it-lang-switcher--offcanvas .it-lang-switcher__menu > li[role="none"] {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

/* ==========================================================================
   Back-to-top (authoritative — loads last so theme CSS cannot bury it)
   Hidden until .open; desktop 30px / mobile 20px; RTL via inset-inline-end
   ========================================================================== */
#aramkoBackToTop.scroll-top,
button.scroll-top {
  --scroll-top-size: 48px;
  --scroll-top-offset: 30px;

  position: fixed !important;
  z-index: 99990 !important;
  bottom: var(--scroll-top-offset) !important;
  right: var(--scroll-top-offset) !important;
  left: auto !important;
  inset-inline-end: var(--scroll-top-offset) !important;
  inset-inline-start: auto !important;

  box-sizing: border-box !important;
  width: var(--scroll-top-size) !important;
  height: var(--scroll-top-size) !important;
  min-width: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  border: none !important;
  border-radius: 50% !important;
  background: var(--it-theme-1, #E30613) !important;
  color: #ffffff !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html[dir="rtl"] #aramkoBackToTop.scroll-top,
html[dir="rtl"] button.scroll-top {
  right: auto !important;
  left: var(--scroll-top-offset) !important;
}

#aramkoBackToTop.scroll-top.open,
button.scroll-top.open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translate3d(0, 0, 0) !important;
}

#aramkoBackToTop.scroll-top:hover,
button.scroll-top:hover {
  filter: brightness(0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24) !important;
}

#aramkoBackToTop.scroll-top:focus-visible,
button.scroll-top:focus-visible {
  outline: 2px solid var(--it-theme-1, #E30613);
  outline-offset: 3px;
}

#aramkoBackToTop.scroll-top i,
button.scroll-top i {
  pointer-events: none;
  line-height: 1;
  color: inherit;
}

@media (max-width: 767.98px) {
  #aramkoBackToTop.scroll-top,
  button.scroll-top {
    --scroll-top-size: 48px;
    --scroll-top-offset: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #aramkoBackToTop.scroll-top,
  button.scroll-top {
    transition: opacity 0.01ms linear, visibility 0.01ms linear !important;
    transform: none !important;
  }

  #aramkoBackToTop.scroll-top.open,
  button.scroll-top.open {
    transform: none !important;
  }
}

.itoffcanvas .it-lang-switcher.it-lang-switcher--offcanvas a.it-lang-switcher__option[role="menuitem"] {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

/* ==========================================================================
   About Us (.it-about-5-area) — RTL lockdown (loads LAST)
   Production serves 7d asset cache + cached EJS; this file’s version bump
   forces browsers to pick up the fix. Scoped to [dir="rtl"] only — LTR safe.
   EN composition: [small | text] [tall]. No collage bleed in Arabic.
   ========================================================================== */
[dir="rtl"] .it-about-5-area {
  overflow-x: clip;
}

[dir="rtl"] .it-about-5-content,
[dir="rtl"] .it-about-5-text,
[dir="rtl"] .it-about-5-text p,
[dir="rtl"] .it-about-5-area .it-section-title-box,
[dir="rtl"] .it-about-5-area .it-section-title {
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-inline: 0 !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

[dir="rtl"] .it-about-5-content {
  direction: rtl;
  text-align: right;
  overflow-wrap: anywhere;
  position: relative;
  z-index: 2;
}

[dir="rtl"] .it-about-5-thumb,
[dir="rtl"] .it-about-5-thumb.thumb-style-1 {
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
}

[dir="rtl"] .it-about-5-area .it-about-5-thumb img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}

@media (min-width: 1200px) {
  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end {
    display: grid !important;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) !important;
    grid-template-areas: "about-copy about-tall" !important;
    column-gap: 2rem !important;
    row-gap: 1.5rem !important;
    align-items: end !important;
    direction: ltr !important;
    margin-inline: 0 !important;
  }

  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end > [class*="col-"] {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    padding-inline: 0 !important;
    flex: none !important;
    float: none !important;
  }

  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end > .col-xxl-9,
  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end > .col-xl-9 {
    grid-area: about-copy !important;
    direction: rtl;
    overflow: hidden !important;
  }

  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end > .col-xxl-3,
  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end > .col-xl-3 {
    grid-area: about-tall !important;
    overflow: hidden !important;
  }
}

@media (min-width: 992px) {
  [dir="rtl"] .it-about-5-area .col-xxl-9 > .row.align-items-center,
  [dir="rtl"] .it-about-5-area .col-xl-9 > .row.align-items-center {
    display: grid !important;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) !important;
    grid-template-areas: "about-thumb about-text" !important;
    column-gap: 1.75rem !important;
    align-items: center !important;
    direction: ltr !important;
    margin-inline: 0 !important;
  }

  [dir="rtl"] .it-about-5-area .col-xxl-9 > .row.align-items-center > [class*="col-"],
  [dir="rtl"] .it-about-5-area .col-xl-9 > .row.align-items-center > [class*="col-"] {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    padding-inline: 0 !important;
    flex: none !important;
    order: 0 !important;
  }

  [dir="rtl"] .it-about-5-area .col-xxl-9 > .row.align-items-center > .col-lg-5,
  [dir="rtl"] .it-about-5-area .col-xl-9 > .row.align-items-center > .col-lg-5 {
    grid-area: about-thumb !important;
    overflow: hidden !important;
  }

  [dir="rtl"] .it-about-5-area .col-xxl-9 > .row.align-items-center > .col-lg-7,
  [dir="rtl"] .it-about-5-area .col-xl-9 > .row.align-items-center > .col-lg-7 {
    grid-area: about-text !important;
    direction: rtl;
    overflow: hidden !important;
    max-width: 100% !important;
  }
}

@media (max-width: 1199.98px) {
  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    direction: rtl;
  }

  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end > .col-xxl-9,
  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end > .col-xl-9 {
    order: 1 !important;
  }

  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end > .col-xxl-3,
  [dir="rtl"] .it-about-5-area > .container > .row.align-items-end > .col-xl-3 {
    order: 2 !important;
  }
}

@media (max-width: 991.98px) {
  [dir="rtl"] .it-about-5-area .col-xxl-9 > .row.align-items-center,
  [dir="rtl"] .it-about-5-area .col-xl-9 > .row.align-items-center {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
  }

  [dir="rtl"] .it-about-5-area .col-xxl-9 > .row.align-items-center > [class*="col-"],
  [dir="rtl"] .it-about-5-area .col-xl-9 > .row.align-items-center > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    order: 0 !important;
  }
}

/* Homepage hero — video slides (markup in views/pages/index.ejs, loader in
   assets/js/hero-video.js).

   This mirrors .it-slider-bg's box so a video slide occupies exactly the same
   layer as an image slide: z-index -2 puts it behind .it-slider-overlay::after,
   the dark gradient the headline is read against, and behind .it-slider-content.

   The Ken-Burns zoom that .it-slider-bg animates is deliberately not applied —
   the footage already moves, and scaling a decoding video forces a repaint of
   the whole layer every frame, which is what makes hero videos stutter on
   mid-range phones.

   The dark fill is the first thing painted and never removed: it is what the
   poster fades in over, and what a visitor sees if the poster itself is still
   in flight. It matches the left end of the overlay gradient (#0A0A0A), so an
   unloaded slide reads as an intentionally dark hero rather than a gap. */
.it-slider-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  background-color: #0a0a0a;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.it-slider-video-bg video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Held transparent until the `playing` event so the first decoded frame is
     never shown as a freeze-frame next to the poster. */
  opacity: 0;
  transition: opacity 700ms ease-in;
  pointer-events: none;
}

.it-slider-video-bg.is-playing video {
  opacity: 1;
}

/* Reduced motion: hero-video.js never fetches an encode, so this only removes
   the empty element. The poster frame stays as the slide's background. */
@media (prefers-reduced-motion: reduce) {
  .it-slider-video-bg video {
    display: none;
  }
}

/* Homepage hero — keep the headline on its own line.

   main.css promotes the subtitle and the title to `display: inline-block` on the
   active slide so both can be animated in. Two inline-blocks share a line
   whenever they fit, so a headline short enough to fit beside the subtitle gets
   pulled up next to it instead of sitting under it — which is what happens to
   "Zustellung bis / zur Haustür" on the second video slide.

   aramko-rtl.css already forces the vertical stack for Arabic ("subtitle ABOVE
   title"); this is the same fix for the LTR layouts. Headlines long enough to
   wrap already started their own line, so nothing about them changes. */
.it-slider-active .swiper-slide-active .it-slider-title {
  display: block;
}
