/* =========================================================
   GUYENNE ENTREPRISES — Surcouches v8
   - Cards .case-v2 (home « Quelques projets récents »)
   - Footer mobile redesign
   - Fix rendu arabe (lettres coupées, espacement)
   ========================================================= */

/* ─────────── 0. RENDU ARABE — police, line-height, descendeurs ─────────── */
/* L'arabe a des lettres avec descendeurs (ya' ي, jim ج, ha' ح, qaf ق, etc.)
   qui sont coupés en bas si line-height trop serré ou overflow:hidden.
   On force ici un rendu propre, désactive letter-spacing et split-words. */

html[lang="ar"],
html[dir="rtl"] {
  font-family: 'Noto Naskh Arabic', 'Amiri', 'Geeza Pro', 'Arial', system-ui, sans-serif;
}

html[lang="ar"] body,
html[dir="rtl"] body {
  font-family: 'Noto Naskh Arabic', 'Amiri', 'Geeza Pro', 'Arial', system-ui, sans-serif;
  text-align: right;
}

/* Headings : line-height très généreux pour les descendeurs */
html[lang="ar"] h1, html[dir="rtl"] h1,
html[lang="ar"] h2, html[dir="rtl"] h2,
html[lang="ar"] h3, html[dir="rtl"] h3,
html[lang="ar"] h4, html[dir="rtl"] h4,
html[lang="ar"] .t-h1, html[dir="rtl"] .t-h1,
html[lang="ar"] .t-h2, html[dir="rtl"] .t-h2 {
  font-family: 'Noto Naskh Arabic', 'Amiri', 'Geeza Pro', 'Arial', system-ui, sans-serif;
  line-height: 1.6;
  letter-spacing: 0 !important;
  padding-bottom: 0.15em;
  overflow: visible;
  text-align: right;
}

/* Paragraphes et corps : line-height encore plus généreux */
html[lang="ar"] p, html[dir="rtl"] p,
html[lang="ar"] li, html[dir="rtl"] li,
html[lang="ar"] .lead, html[dir="rtl"] .lead,
html[lang="ar"] span, html[dir="rtl"] span,
html[lang="ar"] a, html[dir="rtl"] a,
html[lang="ar"] label, html[dir="rtl"] label {
  line-height: 1.85;
  letter-spacing: 0 !important;
  text-align: right;
}

/* Hero, headings, eyebrows : enlève les transforms qui coupent les lettres */
html[lang="ar"] [data-letters],
html[lang="ar"] [data-split],
html[dir="rtl"] [data-letters],
html[dir="rtl"] [data-split] {
  font-family: 'Noto Naskh Arabic', 'Amiri', 'Geeza Pro', 'Arial', system-ui, sans-serif !important;
  letter-spacing: 0 !important;
  line-height: 1.7 !important;
  overflow: visible !important;
  padding-bottom: 0.2em;
}

/* Désactive le split-letters et split-words sur l'arabe — ces effets découpent
   les ligatures arabes et empêchent les lettres de s'enchaîner correctement */
html[lang="ar"] .letter,
html[lang="ar"] .word,
html[lang="ar"] .letter-word,
html[dir="rtl"] .letter,
html[dir="rtl"] .word,
html[dir="rtl"] .letter-word {
  display: inline !important;
  letter-spacing: 0 !important;
  font-family: inherit !important;
  transform: none !important;
  overflow: visible !important;
  padding: 0 !important;
}

/* Tous les conteneurs : pas d'overflow hidden vertical en arabe */
html[lang="ar"] section,
html[lang="ar"] .container,
html[lang="ar"] .hero,
html[lang="ar"] .page-header,
html[dir="rtl"] section,
html[dir="rtl"] .container,
html[dir="rtl"] .hero,
html[dir="rtl"] .page-header {
  overflow: visible;
}

/* Boutons et badges : respiration verticale supplémentaire */
html[lang="ar"] .btn, html[dir="rtl"] .btn,
html[lang="ar"] .pill, html[dir="rtl"] .pill,
html[lang="ar"] .case-tag, html[dir="rtl"] .case-tag {
  line-height: 1.6;
  padding-top: 0.6em;
  padding-bottom: 0.65em;
  letter-spacing: 0 !important;
  font-family: 'Noto Naskh Arabic', 'Arial', sans-serif;
}

/* Marquee : la traduction arabe en marquee — line-height généreux et pas de coupe */
html[lang="ar"] .marquee-track,
html[dir="rtl"] .marquee-track {
  line-height: 1.6;
  font-family: 'Noto Naskh Arabic', 'Arial', sans-serif !important;
  letter-spacing: 0 !important;
  padding: 0.15em 0;
}

/* Footer mega : taille réduite en arabe car la police arabe est plus large */
html[lang="ar"] .footer-mega,
html[dir="rtl"] .footer-mega {
  font-family: 'Noto Naskh Arabic', 'Arial', sans-serif;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1.4;
  padding-bottom: 0.25em;
}

/* Form labels et placeholders */
html[lang="ar"] input::placeholder,
html[lang="ar"] textarea::placeholder,
html[dir="rtl"] input::placeholder,
html[dir="rtl"] textarea::placeholder {
  font-family: 'Noto Naskh Arabic', 'Arial', sans-serif;
  text-align: right;
}

/* RTL : sens de lecture inversé pour les flex et grid */
html[dir="rtl"] .nav-links {
  flex-direction: row-reverse;
}
html[dir="rtl"] .pillars,
html[dir="rtl"] .case-grid,
html[dir="rtl"] .case-services {
  direction: rtl;
}
html[dir="rtl"] .btn-arrow {
  transform: scaleX(-1); /* la flèche pointe vers la gauche en RTL */
}


/* ─────────── 1. CASE V2 : home — cards joliment finies ─────────── */
.case-v2 {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 360px;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border-radius: 22px;
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
  color: #0d0d0d;
  background: linear-gradient(160deg, var(--ge-c1, #f4f4f1) 0%, var(--ge-c2, #d8d8d2) 100%);
  transition: transform .55s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .55s;
  border: 1px solid rgba(13, 13, 13, 0.06);
}
.case-v2:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 50px -22px rgba(13, 13, 13, 0.28);
}
.case-v2 .case-v2-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.10));
}
.case-v2 .case-v2-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.55), transparent 65%);
}
.case-v2 .case-v2-bg img {
  position: relative;
  z-index: 1;
  max-width: 58%;
  max-height: 58%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.92;
  transition: transform .9s cubic-bezier(0.16, 1, 0.3, 1), opacity .55s;
  transform: translateY(-10%);
}
.case-v2:hover .case-v2-bg img {
  transform: translateY(-14%) scale(1.04);
  opacity: 1;
}
.case-v2-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.case-v2 .case-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 6px 12px;
  background: rgba(13, 13, 13, 0.92);
  color: #fff;
  border-radius: 999px;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.case-v2 .case-title {
  font-family: var(--ff-display);
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #0d0d0d;
  margin-top: 4px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.case-v2-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: 14px;
  background: rgba(13, 13, 13, 0.92);
  color: #fff;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 500;
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1), background .25s;
}
.case-v2:hover .case-v2-arrow {
  transform: translateX(6px) rotate(-12deg);
  background: var(--c-accent, #31EC56);
  color: #0d0d0d;
}

/* ─────────── 2. FOOTER — refresh mobile ─────────── */
@media (max-width: 900px) {
  .site-footer .footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }
  .site-footer .footer-col:first-child {
    grid-column: 1 / -1;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(13, 13, 13, 0.08);
    margin-bottom: 8px;
  }
  .site-footer .footer-col h5 {
    font-family: var(--ff-mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--c-text-muted, rgba(13, 13, 13, 0.55));
    margin-bottom: 14px;
  }
  .site-footer .footer-col:first-child h5 {
    font-family: var(--ff-display);
    font-size: 1rem;
    letter-spacing: -0.01em;
    text-transform: none;
    color: #0d0d0d;
    line-height: 1.45;
  }
  .site-footer .footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    list-style: none;
    margin: 0;
  }
  .site-footer .footer-col ul li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #0d0d0d;
    text-decoration: none;
    line-height: 1.4;
  }
  .site-footer .footer-col ul li a::before {
    content: '→';
    color: var(--c-accent, #31EC56);
    font-size: 0.8rem;
    transition: transform .25s;
  }
  .site-footer .footer-col ul li a:hover::before {
    transform: translateX(3px);
  }
  .site-footer .footer-mega {
    font-size: clamp(2.5rem, 14vw, 4.5rem);
    line-height: 0.95;
    word-break: break-word;
    margin-bottom: 32px;
  }
  .site-footer .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid rgba(13, 13, 13, 0.08);
    margin-top: 28px;
    font-size: 0.85rem;
  }
  .site-footer .footer-bottom > div {
    width: 100%;
  }
  .site-footer .footer-bottom > div:last-child {
    display: flex !important;
    flex-wrap: wrap;
    gap: 16px !important;
  }
  .site-footer .footer-bottom a {
    font-size: 0.82rem;
    color: var(--c-text-muted, rgba(13, 13, 13, 0.6));
  }
}

@media (max-width: 480px) {
  .site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .site-footer .footer-col:first-child {
    padding-bottom: 18px;
    margin-bottom: 0;
  }
  .case-v2 {
    min-height: 280px;
  }
}

/* ─────────── 3. Marquee : harmonisation des couleurs ─────────── */
.marquee-track span {
  white-space: nowrap;
}
