/* Ghanaayem - Hero video + categories
   Layout : sticky hero (video plein ecran) qui se reduit et disparait au scroll,
            la section des categories monte par-dessus.
   Couleurs du logo : bleu marine + dore, fond creme des banners. */
.gh-hero, .gh-cats {
  --gh-navy: #0A2F55;
  --gh-navy-deep: #061F3A;
  --gh-gold: #D49B26;
  --gh-gold-soft: #EBCB86;
  --gh-cream: #F7F2EA;
  --gh-sand: #EEE5D6;
  --gh-ink: #16233A;
  --gh-muted: #5E6B80;
  --gh-display: "Alexandria", "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --gh-body: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --gh-top: 0px;            /* hauteur d'un header sticky si tu en as un */
  direction: rtl;
  font-family: var(--gh-body);
  color: var(--gh-ink);
  box-sizing: border-box;
  /* pleine largeur meme dans un conteneur de theme */
  width: calc(100vw - var(--gh-sbw, 0px));
  max-width: calc(100vw - var(--gh-sbw, 0px));
  margin-inline: calc(50% - 50vw + var(--gh-sbw, 0px) / 2);
}
.gh-hero *, .gh-cats * { box-sizing: border-box; }
html:has(.gh-hero) { overflow-x: clip; }   /* clip (pas hidden) pour garder le sticky */

/* ---------- HERO ---------- */
.gh-hero {
  position: relative;
  background: var(--gh-cream);
  --o: 1; --h: 1; --py: 0px;
}
/* le hero remplit l'ecran sous le header ; au scroll il disparait en fondu (parallaxe douce) */
.gh-hero__sticky {
  position: relative;
  height: calc(100vh - var(--gh-top) - var(--gh-bottom, 0px));
  height: calc(100svh - var(--gh-top) - var(--gh-bottom, 0px));
  min-height: 480px;
  max-height: 980px;
  overflow: hidden;
}
/* desktop : panneau texte bleu marine a droite, video a gauche */
.gh-hero__media {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  overflow: hidden;
  background: var(--gh-navy-deep);
  opacity: var(--o);
  will-change: opacity;
}
.gh-hero__video { position: relative; min-width: 0; overflow: hidden; background: var(--gh-navy); }
.gh-hero__video video, .gh-hero__video img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 35%;
  display: block;
  transform: translate3d(0, var(--py), 0) scale(1.08);
  will-change: transform;
}
.gh-hero__copy > * { transform: translate3d(0, calc(var(--py) * -0.35), 0); }
/* fondu du bord de la video vers le panneau */
.gh-hero__video::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to left, var(--gh-navy-deep) 0, rgba(6, 31, 58, 0) 22%);
  pointer-events: none;
}
.gh-hero__copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  padding-block: 48px;
  padding-inline: clamp(28px, 5vw, 80px) clamp(20px, 3vw, 48px);
  color: var(--gh-cream);
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(212, 155, 38, .16), rgba(212, 155, 38, 0) 60%),
    var(--gh-navy-deep);
}
.gh-hero__logo { width: clamp(120px, 11vw, 170px); height: auto; display: block; }
.gh-hero__title {
  margin: 0;
  font-family: var(--gh-display);
  font-weight: 700;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.18;
  color: #fff;
  text-wrap: balance;
}
.gh-hero__title em { font-style: normal; color: var(--gh-gold-soft); }
.gh-hero__sub { margin: 0; font-size: clamp(16px, 1.35vw, 20px); line-height: 1.6; color: rgba(247, 242, 234, .82); max-width: 32ch; }
.gh-hero__cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 30px;
  border-radius: 999px;
  background: var(--gh-gold);
  color: var(--gh-navy-deep);
  font-weight: 700; font-size: 17px;
  text-decoration: none;
  box-shadow: 0 10px 30px -12px rgba(212, 155, 38, .7);
  transition: background .3s, transform .3s;
}
.gh-hero__cta svg { width: 18px; height: 18px; stroke: currentColor; transition: transform .3s; }
.gh-hero__cta:hover { background: var(--gh-gold-soft); }
.gh-hero__cta:hover svg { transform: translateX(-4px); }
.gh-hero__cta:focus-visible { outline: 2px solid var(--gh-gold-soft); outline-offset: 4px; }
.gh-hero__trust {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin: 4px 0 0; padding: 0; list-style: none;
  font-size: 14px; font-weight: 500; color: rgba(247, 242, 234, .86);
}
.gh-hero__trust li { display: inline-flex; align-items: center; gap: 7px; }
.gh-hero__trust svg { width: 17px; height: 17px; stroke: var(--gh-gold-soft); flex: none; }

.gh-hero__hint {
  position: absolute;
  left: 0; width: 57.5%;            /* centre sur la video */
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--gh-navy);
  opacity: var(--h);
  pointer-events: none;
}
.gh-hero__hint span { background: rgba(247, 242, 234, .9); padding: 6px 14px; border-radius: 999px; }
.gh-hero__hint svg { width: 18px; height: 18px; stroke: var(--gh-gold-soft); animation: gh-bob 1.8s ease-in-out infinite; }
@keyframes gh-bob { 50% { transform: translateY(5px); } }

/* mobile : video verticale plein ecran, texte en bas sur un degrade bleu marine */
@media (max-width: 767px) {
  .gh-hero__media { display: block; }
  .gh-hero__video { position: absolute; inset: 0; }
  .gh-hero__video video, .gh-hero__video img { object-position: 50% 20%; }
  .gh-hero__video::after {
    background: linear-gradient(to top, var(--gh-navy-deep) 0, rgba(6, 31, 58, .92) 30%, rgba(6, 31, 58, 0) 62%);
  }
  .gh-hero__copy {
    position: absolute; inset: auto 0 0 0;
    justify-content: flex-end;
    gap: 12px;
    padding-block: 24px max(26px, env(safe-area-inset-bottom, 0px));
    padding-inline: max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-left, 0px));
    background: none;
  }
  .gh-hero__logo { width: 104px; }
  .gh-hero__title { font-size: clamp(30px, 8.6vw, 38px); }
  .gh-hero__sub { font-size: 15.5px; }
  .gh-hero__cta { padding: 13px 26px; font-size: 16px; }
  .gh-hero__trust { font-size: 13px; gap: 6px 14px; }
  .gh-hero__hint { display: none; }
}

/* ---------- CATEGORIES ---------- */
.gh-cats {
  position: relative;
  z-index: 2;
  padding-block: 8px 64px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  background: var(--gh-cream);
}
.gh-cats__inner { max-width: 1180px; margin-inline: auto; display: grid; gap: 28px; }
.gh-cats__head { display: grid; gap: 10px; justify-items: center; text-align: center; padding-top: 40px; }
.gh-cats__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--gh-gold);
}
.gh-cats__eyebrow::before, .gh-cats__eyebrow::after {
  content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7;
}
.gh-cats__title {
  margin: 0;
  font-family: var(--gh-display);
  font-weight: 700;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.25;
  color: var(--gh-navy);
  text-wrap: balance;
}
.gh-cats__perks {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px;
  margin: 6px 0 0; padding: 0; list-style: none;
}
.gh-cats__perks li {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--gh-sand);
  font-size: 13.5px; font-weight: 700; color: var(--gh-navy);
}
.gh-cats__perks svg { width: 16px; height: 16px; stroke: var(--gh-gold); flex: none; }

.gh-cats__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0; padding: 0; list-style: none;
}
/* mobile : une categorie seule sur la derniere ligne prend toute la largeur */
@media (max-width: 767px) {
  .gh-cat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .gh-cat:last-child:nth-child(odd) .gh-cat__img { aspect-ratio: 2 / 1; }
}
/* tablette / desktop : cartes de largeur fixe, centrees, quel que soit le nombre */
@media (min-width: 768px) {
  .gh-cats__grid { grid-template-columns: repeat(auto-fit, minmax(210px, 270px)); justify-content: center; gap: 20px; }
}

.gh-cat a {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 0 var(--gh-sand), 0 12px 30px -22px rgba(6, 31, 58, .45);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s;
}
.gh-cat__img { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--gh-sand); }
.gh-cat__img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.gh-cat__mono {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--gh-display); font-size: 54px; font-weight: 700;
  color: var(--gh-gold-soft); background: var(--gh-navy);
}
.gh-cat__body {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px 14px;
}
.gh-cat__text { min-width: 0; display: grid; gap: 2px; }
.gh-cat__name {
  font-family: var(--gh-display); font-weight: 600; font-size: 15.5px; line-height: 1.35;
  color: var(--gh-navy); overflow-wrap: anywhere;
}
.gh-cat__count { font-size: 12.5px; color: var(--gh-muted); font-variant-numeric: tabular-nums; }
.gh-cat__go {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--gh-gold-soft); color: var(--gh-gold);
  transition: background .3s, color .3s, transform .3s;
}
.gh-cat__go svg { width: 16px; height: 16px; stroke: currentColor; }
.gh-cat a:hover, .gh-cat a:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 1px 0 var(--gh-sand), 0 22px 40px -24px rgba(6, 31, 58, .55);
}
.gh-cat a:focus-visible { outline: 2px solid var(--gh-gold); outline-offset: 3px; }
.gh-cat a:hover .gh-cat__img img { transform: scale(1.06); }
.gh-cat a:hover .gh-cat__go { background: var(--gh-navy); color: var(--gh-gold-soft); transform: translateX(-3px); }

@media (min-width: 768px) {
  .gh-cat__body { padding: 14px 18px 18px; }
  .gh-cat__name { font-size: 17px; }
}

/* apparition en cascade (seulement si JS a tourne) */
.gh-js .gh-cat { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.gh-js .gh-cat.is-pending { opacity: 0; transform: translateY(26px); }

.gh-cats__all { justify-self: center; }
.gh-cats__all a {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px; border-radius: 999px;
  background: var(--gh-navy); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(235, 203, 134, .5);
  transition: background .3s;
}
.gh-cats__all a:hover { background: var(--gh-navy-deep); }
.gh-cats__all a:focus-visible { outline: 2px solid var(--gh-gold); outline-offset: 3px; }
.gh-cats__all svg { width: 16px; height: 16px; stroke: var(--gh-gold-soft); }

/* mouvement reduit : pas d'effet scroll */
@media (prefers-reduced-motion: reduce) {
  .gh-hero__media { opacity: 1 !important; }
  .gh-hero__video video, .gh-hero__copy > * { transform: none !important; }
  .gh-hero__hint { display: none; }
  .gh-js .gh-cat.is-pending { opacity: 1; transform: none; }
}

/* ---------- SLIDER (banners) ---------- */
.gh-slider {
  --gh-navy: #0A2F55; --gh-navy-deep: #061F3A; --gh-gold: #D49B26; --gh-gold-soft: #EBCB86; --gh-cream: #F7F2EA;
  --gh-dur: 5500ms;
  direction: rtl;
  background: var(--gh-cream);
  padding-block: 8px 56px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  width: calc(100vw - var(--gh-sbw, 0px));
  max-width: calc(100vw - var(--gh-sbw, 0px));
  margin-inline: calc(50% - 50vw + var(--gh-sbw, 0px) / 2);
}
.gh-slider * { box-sizing: border-box; }
.gh-slider__inner { position: relative; max-width: 1180px; margin-inline: auto; }
.gh-slider__track {
  position: relative;
  aspect-ratio: 1600 / 700;
  border-radius: 22px;
  overflow: hidden;
  background: #EEE5D6;
  box-shadow: 0 24px 50px -30px rgba(6, 31, 58, .45);
  isolation: isolate;
  touch-action: pan-y;
}
.gh-slide {
  position: absolute; inset: 0;
  display: block;
  opacity: 0;
  z-index: 0;
  clip-path: inset(0 0 0 0);
}
.gh-slide picture, .gh-slide img { display: block; width: 100%; height: 100%; }
.gh-slide img { object-fit: cover; transform-origin: 70% 50%; }
.gh-slide.is-prev { opacity: 1; z-index: 1; }
.gh-slide.is-prev img { transition: transform 1.2s cubic-bezier(.4, 0, .2, 1), filter 1.2s; transform: scale(.97); filter: brightness(.92); }
.gh-slide.is-active { opacity: 1; z-index: 2; animation: gh-reveal 1.15s cubic-bezier(.77, 0, .18, 1) both; }
.gh-slide.is-active img { animation: gh-settle 1.8s cubic-bezier(.2, .7, .2, 1) both; }
.gh-slider.no-anim .gh-slide.is-active, .gh-slider.no-anim .gh-slide.is-active img { animation: none; }
/* rideau de droite a gauche (sens de lecture arabe) */
@keyframes gh-reveal { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes gh-settle { from { transform: scale(1.12); } to { transform: scale(1); } }
/* fil dore qui accompagne le rideau */
.gh-slide.is-active::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px;
  background: linear-gradient(to bottom, rgba(235, 203, 134, 0), var(--gh-gold-soft), rgba(235, 203, 134, 0));
  animation: gh-line 1.15s cubic-bezier(.77, 0, .18, 1) both;
  pointer-events: none;
}
@keyframes gh-line { from { left: 100%; opacity: 1; } 85% { opacity: 1; } to { left: 0; opacity: 0; } }

.gh-slider__nav {
  position: absolute; top: 50%; z-index: 3;
  width: 46px; height: 46px; margin-top: -23px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--gh-navy);
  box-shadow: 0 8px 20px -10px rgba(6, 31, 58, .5);
  cursor: pointer;
  opacity: 0; transition: opacity .3s, background .3s, transform .3s;
}
.gh-slider__nav svg { width: 20px; height: 20px; stroke: currentColor; }
.gh-slider__nav--prev { right: 16px; }
.gh-slider__nav--next { left: 16px; }
.gh-slider__nav--next svg { transform: none; }
.gh-slider__nav--prev svg { transform: scaleX(-1); }
.gh-slider__inner:hover .gh-slider__nav, .gh-slider__nav:focus-visible { opacity: 1; }
.gh-slider__nav:hover { background: var(--gh-navy); color: var(--gh-gold-soft); }
.gh-slider__nav:focus-visible { outline: 2px solid var(--gh-gold); outline-offset: 3px; }

.gh-slider__dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.gh-slider__dot {
  position: relative; width: 44px; height: 4px; padding: 0; border: 0; border-radius: 4px;
  background: rgba(10, 47, 85, .14); cursor: pointer; overflow: hidden;
}
.gh-slider__dot::before { content: ""; position: absolute; inset: -10px 0; }   /* zone tactile */
.gh-slider__dot span { position: absolute; inset: 0; width: 0; background: var(--gh-gold); border-radius: inherit; }
.gh-slider__dot.is-done span { width: 100%; background: rgba(212, 155, 38, .45); }
.gh-slider__dot.is-active span { animation: gh-fill var(--gh-dur) linear both; }
.gh-slider.is-paused .gh-slider__dot.is-active span { animation-play-state: paused; }
.gh-slider.no-auto .gh-slider__dot.is-active span { animation: none; width: 100%; }
.gh-slider__dot:focus-visible { outline: 2px solid var(--gh-gold); outline-offset: 4px; }
@keyframes gh-fill { from { width: 0; } to { width: 100%; } }

@media (max-width: 767px) {
  .gh-slider { padding-block: 4px 44px; }
  .gh-slider__track { aspect-ratio: 1000 / 620; border-radius: 16px; }
  .gh-slider__nav { display: none; }
  .gh-slider__dot { width: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .gh-slide.is-active, .gh-slide.is-active img, .gh-slide.is-active::after { animation: none; }
  .gh-slide.is-prev img { transition: none; }
}
