/* ═══════════════════════════════════════════════════════════════
   TORQ homepage clone — minimal supplement.
   The saved website.css turned out to be the FULL build (byte-identical
   to the live site); it only lacks the map-marker styles, which lived
   in website.js-injected CSS on the original site.
   Marker geometry below is measured from the live site:
   halo 40px rgba(162,29,40,.25) · dot 20px · ping ring 64px / 2s.
   ═══════════════════════════════════════════════════════════════ */

/* ── Map markers ── */
.marker {
  position: relative;
  width: 40px;
  height: 40px;
  background: rgba(162, 29, 40, 0.25);
  border-radius: 9999px;
}
.marker::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: rgb(162, 29, 40);
  border-radius: 9999px;
  transform: translate(-50%, -50%);
}
.marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  background: rgb(162, 29, 40);
  border-radius: 9999px;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: marker 2s ease-out infinite;
}
@keyframes marker {
  0%   { opacity: 0.8; transform: translate(-50%, -50%) scale(0.4); }
  70%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ── Heading reveal used by torq-website.js (homeHeader / title) ── */
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span {
  display: block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.9s ease;
}
.reveal-in .reveal-line > span { transform: translateY(0); opacity: 1; }
.reveal-in .reveal-line:nth-child(2) > span { transition-delay: 0.12s; }
.reveal-in .reveal-line:nth-child(3) > span { transition-delay: 0.24s; }
.reveal-in .reveal-line:nth-child(4) > span { transition-delay: 0.36s; }

/* ── Parallax: images shift down a fixed 20px (measured on live site) ── */
[data-paraller-image] {
  transform: translateY(20px);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* ── AL-KAFI navbar logo ──
   Same dark/light behavior as the reference TORQ SVG: over dark sections
   (navbar data-theme=light) the logo renders solid white; over light
   sections it keeps its original colors. brightness(0) turns every pixel
   black while preserving alpha, invert(1) maps it to white — a clean
   silhouette with the smooth anti-aliased edges of the keyed PNG. */
img.navbar-logo {
  width: auto;
  transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar[data-theme="light"] img.navbar-logo {
  filter: brightness(0) invert(1);
}

/* ── Arabic (RTL) localization ──
   Cairo — geometric Arabic sans matching the reference display type.
   Loaded conditionally in the <head> when lang=ar. */
html[dir="rtl"] body,
html[dir="rtl"] .font-title {
  font-family: 'Cairo', ui-sans-serif, system-ui, sans-serif;
}
/* language switch separator: the reference draws a physical right border
   on the first link — mirror it in RTL so the "|" stays BETWEEN ar/en */
html[dir="rtl"] .navbar .site-switch-link:not(:last-child) {
  border-right-width: 0;
  border-left-width: 1px;
}
/* the reference zeroes the OUTER padding of each link (first:left, last:right)
   — physical values that land on the INNER side in RTL and crush the texts
   against the separator. Mirror them so spacing matches the EN page. */
html[dir="rtl"] .navbar .site-switch-link:first-child {
  padding-left: 0.5rem;  /* inner side (faces separator) */
  padding-right: 0;      /* outer side */
}
html[dir="rtl"] .navbar .site-switch-link:last-child {
  padding-right: 0.5rem; /* inner side (faces separator) */
  padding-left: 0;       /* outer side */
}

/* ═══════════════════════════════════════════════════════════════
   PRODUCTS SECTION — six AL-KAFI machinery divisions
   Design DNA preserved from the reference: black canvas, vertical
   cards, bottom gradient caption, hover-reveal chips, staggered
   offsets. Executed in pure CSS (no reliance on partial Tailwind).
   ═══════════════════════════════════════════════════════════════ */

.prod-carousel { position: relative; }
.prod-track {
  --prod-gap: 20px;
  display: flex;
  gap: var(--prod-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.prod-track::-webkit-scrollbar { display: none; }
.prod-slide { flex: 0 0 86%; min-width: 0; scroll-snap-align: start; }
@media (min-width: 640px) {
  .prod-slide { flex-basis: calc((100% - var(--prod-gap)) / 2); }
}
@media (min-width: 1024px) {
  .prod-slide { flex-basis: calc((100% - 3 * var(--prod-gap)) / 4); }
}
.prod-nav {
  position: absolute;
  top: 42%;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 50%;
  background: #001172;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 18px #0008;
}
.prod-nav[hidden] { display: none; }
.prod-nav--prev { inset-inline-start: -20px; }
.prod-nav--next { inset-inline-end: -20px; }
html[dir="rtl"] .prod-nav span { transform: scaleX(-1); }
.prod-nav:hover { background: #142e9a; }
.prod-nav:focus-visible, .prod-track .prod-card:focus-visible {
  outline: 2px solid white;
  outline-offset: -3px;
}
.prod-track .prod-cap { padding: 16px; }
.prod-track .prod-title { font-size: clamp(.95rem, 1.15vw, 1.2rem); line-height: 1.45; }
.prod-track .prod-chips { opacity: 1; }
.prod-track .prod-chip { white-space: normal; line-height: 1.3; }
@media (prefers-reduced-motion: reduce) {
  .prod-track *, .prod-track *::before { transition: none !important; }
}

/* card */
.prod-media {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #0a0a0a;           /* shows behind the +20px parallax shift */
  overflow: hidden;
  border-radius: 2px;
}
.prod-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.prod-card:hover .prod-img { transform: translateY(20px) scale(1.06); }
.prod-media--dry { background: #000; }
.prod-media--dry .prod-img {
  object-fit: contain;
  object-position: center top;
}
.prod-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #001172 0%, #000e59 100%);
}
.prod-fallback .iconify { font-size: 4rem; color: rgba(255,255,255,0.85); }

/* bottom gradient — same ramp as the reference cards */
.prod-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5,5,5,0.92) 0%, rgba(5,5,5,0.35) 38%, rgba(5,5,5,0) 62%);
  transition: background 0.5s ease;
}
.prod-card:hover .prod-shade {
  background: linear-gradient(to top, rgba(5,5,5,0.95) 0%, rgba(5,5,5,0.15) 55%, rgba(5,5,5,0) 70%);
}

/* ghost division number — display type, quiet opacity */
.prod-num {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 1rem;
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 255, 255, 0.22);
  letter-spacing: -0.02em;
  transition: color 0.4s ease;
  pointer-events: none;
}
.prod-card:hover .prod-num { color: rgba(255, 255, 255, 0.5); }

/* caption block */
.prod-cap {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 1.25rem;
  color: #fff;
}
@media (min-width: 768px)  { .prod-cap { padding: 1rem; } }
@media (min-width: 1280px) { .prod-cap { padding: 1.75rem; } }
.prod-cap-ic {
  font-size: 1.6rem;
  color: #fff;
  opacity: 0.85;
  margin-bottom: 0.4rem;
  display: inline-block;
}
.prod-title {
  font-size: 1.125rem;
  line-height: 1.25;
  color: #fff;
}
@media (min-width: 768px)  { .prod-title { font-size: 1rem; } }
@media (min-width: 1024px) { .prod-title { font-size: 1.125rem; } }
@media (min-width: 1280px) { .prod-title { font-size: 1.375rem; } }

/* concept chips — always visible on touch, hover-revealed on desktop */
.prod-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
  transition: opacity 0.5s ease;
}
.prod-chip {
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}
.prod-cap { transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
@media (min-width: 1024px) {
  .prod-chips { opacity: 0; }
  .prod-card:hover .prod-chips { opacity: 1; }
  .prod-card:hover .prod-cap { transform: translateY(-0.5rem); }
}

/* discover link — reference DNA: appears on hover (desktop) */
.prod-go {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}
.prod-arrow { font-size: 1.1rem; transition: transform 0.3s ease; }
.prod-card:hover .prod-arrow { transform: translateX(3px); }
html[dir="rtl"] .prod-arrow { transform: scaleX(-1); }
html[dir="rtl"] .prod-card:hover .prod-arrow { transform: scaleX(-1) translateX(3px); }
/* Arabic script must never be letter-spaced — it breaks joined letters */
html[dir="rtl"] * { letter-spacing: normal !important; }
/* extra vertical room for Arabic diacritics in the large display sizes */
html[dir="rtl"] .leading-\[1\.1\] { line-height: 1.3; }
/* innovation block reads right-to-left at lg+ */
@media (min-width: 1024px) {
  html[dir="rtl"] .lg\:text-left { text-align: right; }
  /* mirror physical paddings so title/paragraph/button share the same
     right edge (the reference uses pr-12 = end-side inset in LTR only) */
  html[dir="rtl"] .lg\:pr-12 { padding-right: 0; padding-left: 3rem; }
}
@media (min-width: 1536px) {
  html[dir="rtl"] .\32xl\:pr-0 { padding-left: 0; }
}

/* reveal lines must not clip Arabic diacritics (شدة/تنوين above letters) —
   padding + negative margin keeps geometry while widening the clip window */
html[dir="rtl"] .reveal-line {
  padding-top: 0.14em;
  padding-bottom: 0.14em;
  margin-top: -0.14em;
  margin-bottom: -0.14em;
}

/* ── "Get in touch" bar: brand navy from the AL-KAFI logo ── */
footer a.bg-brand-500 {
  background-color: #000e59;
}
footer a.bg-brand-500:hover {
  background-color: #001172;
}

/* ── Main navigation (AL-KAFI structure) ──
   navbar-link-sm: slightly tighter horizontal padding so the eight
   approved items + CTA fit the desktop bar at xl without any change
   to the reference typography. */
.navbar-link-sm {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* prominent Request-a-Quote button — brand navy pill */
.navbar-cta {
  display: inline-flex;
  align-items: center;
  background-color: #000e59;
  color: #fff;
  border-radius: 9999px;
  padding: 0.6rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-decoration: none;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-inline-start: 0.75rem;
}
.navbar-cta:hover {
  background-color: #001172;
}

/* Mega menu panel — the six approved machinery divisions.
   Pure CSS hover (independent of the partial Tailwind build):
   all positioning/sizing lives here explicitly. */
.mega-wrap { position: relative; }
.mega-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 1080px);
  background: #fff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border-radius: 0 0 1rem 1rem;
  overflow: hidden;
  z-index: 50;
  color: #050505;
}
@media (min-width: 1280px) {
  .mega-wrap:hover .mega-panel,
  .mega-wrap:focus-within .mega-panel {
    display: block;
    animation: megaIn 0.22s ease;
  }
}
@keyframes megaIn {
  from { opacity: 0; margin-top: -6px; }
  to   { opacity: 1; margin-top: 0; }
}
.mega-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 16px;
}
@media (min-width: 768px)  { .mega-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .mega-grid { grid-template-columns: repeat(3, 1fr); } }
.mega-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.25s ease;
}
.mega-item:hover { background-color: #f3f4f6; }
.mega-item .mega-ic {
  font-size: 1.8rem;
  line-height: 1;
  color: #000e59;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.mega-item-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mega-item-txt .font-title { font-size: 1rem; line-height: 1.25; }
.mega-item-desc {
  font-size: 0.875rem;
  line-height: 1.35;
  opacity: 0.7;
}
