/* 
=========================================================
* Le Pax Funèbre - Architecture CSS Unifiée (LPF_light)
* WCAG 2.1 AAA Compliant Design (USB & Offline Ready)
* Multi-Theme Matrix & Responsive Typography
=========================================================
*/

/* --- 1. THEME MATRIX (CSS CUSTOM PROPERTIES) --- */

:root {
  /* Dynamic font scaling factor (default: 1) */
  --font-scale: 1;

  /* Emergency Bar Dimensions & WCAG AAA Contrast (Zero-Overlap Dynamic Engine) */
  --emergency-bar-height-desktop: 58px;
  --emergency-bar-height-tablet: 64px;
  --emergency-bar-height-mobile: 70px;
  --emergency-bar-current-h: var(--emergency-bar-height-desktop);
  --emergency-red-aaa: #991b1b;
  --emergency-green-aaa: #166534;

  /* Default Palette: Charcoal & Gold (Signature) */
  --bg-color: #111413;       
  --card-bg: #1c201e;        
  --text-color: #ffffff;     
  --text-muted: #a3b0a9;     
  
  --primary: #e5b026;        /* Warm Gold (Brand Primary) */
  --primary-color: var(--primary); /* Legacy alias */
  --accent: #ffd54f;         /* Bright Yellow (Highlight) */
  --accent-color: var(--accent);   /* Legacy alias */
  --accent-dark: #b28919;    
  
  /* Layout Banners */
  --banner-bg: #e5b026;
  --banner-text: #111413;
  --banner-muted: #3d341c;
  
  --border-color: rgba(229, 176, 38, 0.25); 
  --border-glow: rgba(229, 176, 38, 0.45);
  --glass-bg: rgba(17, 20, 19, 0.92);
  --glass-border: rgba(229, 176, 38, 0.15);
  
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 40px rgba(229, 176, 38, 0.18); 
  
  /* Fonts */
  --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-sans-ar: "Segoe UI Arabic", "Geeza Pro", "Traditional Arabic", Tahoma, Arial, sans-serif;
  --font-serif-ar: "Amiri", "Scheherazade New", "Traditional Arabic", Georgia, serif;
  
  /* Transitions (Hardware GPU accelerated) & Radii */
  --transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  --border-radius: 14px;
}

/* Theme 1: Charcoal & Gold (Explicit) */
:root[data-theme="charcoal-gold"] {
  --bg-color: #111413;       
  --card-bg: #1c201e;        
  --text-color: #ffffff;     
  --text-muted: #a3b0a9;     
  
  --primary: #e5b026;
  --primary-color: #e5b026;
  --accent: #ffd54f;
  --accent-color: #ffd54f;
  --accent-dark: #b28919;    
  
  --banner-bg: #e5b026;
  --banner-text: #111413;
  --banner-muted: #3d341c;
  
  --border-color: rgba(229, 176, 38, 0.25); 
  --border-glow: rgba(229, 176, 38, 0.45);
  --glass-bg: rgba(17, 20, 19, 0.92);
  --glass-border: rgba(229, 176, 38, 0.15);
  
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 40px rgba(229, 176, 38, 0.18); 
  --border-radius: 14px;
}

/* Theme 2: Éco-Humaniste Émeraude (Forest Emerald) */
:root[data-theme="forest-emerald"] {
  --bg-color: #081410;       
  --card-bg: #11221c;        
  --text-color: #ffffff;     
  --text-muted: #a3b0a9;     
  
  --primary: #2ed573;
  --primary-color: #2ed573;
  --accent: #55efc4;
  --accent-color: #55efc4;
  --accent-dark: #10b981;    
  
  --banner-bg: #2ed573;
  --banner-text: #05140e;
  --banner-muted: #3d341c;
  
  --border-color: rgba(46, 213, 115, 0.25); 
  --border-glow: rgba(46, 213, 115, 0.45);
  --glass-bg: rgba(8, 20, 16, 0.92);
  --glass-border: rgba(46, 213, 115, 0.15);
  
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 40px rgba(46, 213, 115, 0.18); 
  --border-radius: 20px;
}

/* Theme 3: Sérénité Céleste Ardoise (Serene Sky) */
:root[data-theme="serene-sky"] {
  --bg-color: #0b1120;       
  --card-bg: #151f38;        
  --text-color: #ffffff;     
  --text-muted: #a3b0a9;     
  
  --primary: #38bdf8;
  --primary-color: #38bdf8;
  --accent: #7dd3fc;
  --accent-color: #7dd3fc;
  --accent-dark: #0284c7;    
  
  --banner-bg: #0284c7;
  --banner-text: #ffffff;
  --banner-muted: #3d341c;
  
  --border-color: rgba(56, 189, 248, 0.22); 
  --border-glow: rgba(56, 189, 248, 0.45);
  --glass-bg: rgba(11, 17, 32, 0.92);
  --glass-border: rgba(56, 189, 248, 0.15);
  
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 40px rgba(56, 189, 248, 0.18); 
  --border-radius: 10px;
}

/* Theme 4: Prestige Midnight Champagne */
:root[data-theme="prestige-midnight"] {
  --bg-color: #060914;       
  --card-bg: #0e142c;        
  --text-color: #ffffff;     
  --text-muted: #a3b0a9;     
  
  --primary: #f5d77f;
  --primary-color: #f5d77f;
  --accent: #fae8b2;
  --accent-color: #fae8b2;
  --accent-dark: #c5a059;    
  
  --banner-bg: #c5a059;
  --banner-text: #060914;
  --banner-muted: #3d341c;
  
  --border-color: rgba(245, 215, 127, 0.28); 
  --border-glow: rgba(245, 215, 127, 0.55);
  --glass-bg: rgba(6, 9, 20, 0.92);
  --glass-border: rgba(245, 215, 127, 0.18);
  
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 40px rgba(245, 215, 127, 0.18); 
  --border-radius: 8px;
}

/* Theme 5: Haute Accessibilité AAA (Jaune sur Noir Pur) */
:root[data-theme="high-contrast"] {
  --bg-color: #000000;       
  --card-bg: #000000;        
  --text-color: #ffffff;     
  --text-muted: #ffffbb;     
  
  --primary: #ffff00;
  --primary-color: #ffff00;
  --accent: #ffff00;
  --accent-color: #ffff00;
  --accent-dark: #ffff00;    
  
  --banner-bg: #ffff00;
  --banner-text: #000000;
  --banner-muted: #000000;
  
  --border-color: #ffffff; 
  --border-glow: #ffff00;
  --glass-bg: #000000;
  --glass-border: #ffffff;
  
  --shadow: none;
  --shadow-hover: none;
  --border-radius: 4px;
}

/* Theme 6: Mode Clair (Light Theme) */
:root[data-theme="light"] {
  --bg-color: #f7f9f8;       
  --card-bg: #ffffff;        
  --text-color: #111413;     
  --text-muted: #535f59;     
  
  --primary: #1e4233;        /* Dark Forest Green */
  --primary-color: #1e4233;
  --accent: #7a5f22;         /* WCAG AA Gold */
  --accent-color: #7a5f22;
  --accent-dark: #6f561e;    
  
  --banner-bg: #1e4233;
  --banner-text: #ffffff;
  --banner-muted: #d5dedb;
  
  --border-color: rgba(30, 66, 51, 0.18); 
  --border-glow: rgba(30, 66, 51, 0.35);
  --glass-bg: rgba(247, 249, 248, 0.94);
  --glass-border: rgba(30, 66, 51, 0.12);
  
  --shadow: 0 8px 30px rgba(30, 66, 51, 0.05);
  --shadow-hover: 0 12px 40px rgba(30, 66, 51, 0.12);
  --border-radius: 14px;
}

/* System Preference Fallback (if data-theme is system or default) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="charcoal-gold"]):not([data-theme="forest-emerald"]):not([data-theme="serene-sky"]):not([data-theme="prestige-midnight"]):not([data-theme="high-contrast"]):not([data-theme="dark"]) {
    --bg-color: #f7f9f8;       
    --card-bg: #ffffff;        
    --text-color: #111413;     
    --text-muted: #535f59;     
    
    --primary: #1e4233;        
    --primary-color: #1e4233;
    --accent: #7a5f22;         
    --accent-color: #7a5f22;
    --accent-dark: #6f561e;    
    
    --banner-bg: #1e4233;
    --banner-text: #ffffff;
    --banner-muted: #d5dedb;
    
    --border-color: rgba(30, 66, 51, 0.18); 
    --border-glow: rgba(30, 66, 51, 0.35);
    --glass-bg: rgba(247, 249, 248, 0.94);
    --glass-border: rgba(30, 66, 51, 0.12);
    
    --shadow: 0 8px 30px rgba(30, 66, 51, 0.05);
    --shadow-hover: 0 12px 40px rgba(30, 66, 51, 0.12);
  }
}

/* --- 2. DOCUMENT & LAYOUT RESET --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: calc(16px * var(--font-scale)); /* Scale dynamically from accessibility options */
  line-height: 1.65;
  scroll-behavior: smooth;
  background-color: var(--bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--emergency-bar-current-h) + max(14px, env(safe-area-inset-bottom, 0px)));
}

/* Touch targets and interactions */
button, a, input, select, textarea, .btn, .a11y-btn, .lang-bubble {
  touch-action: manipulation;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border: 3px solid var(--bg-color);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* --- 3. ACCESSIBILITY UTILITIES --- */
.visually-hidden {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  background-color: var(--accent);
  color: var(--banner-text);
  padding: 12px 24px;
  z-index: 10000;
  font-weight: 800;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  transition: top 0.25s ease;
  text-decoration: none;
  box-shadow: var(--shadow-hover);
}
.skip-link:focus, .skip-link:focus-visible {
  top: 0;
}

/* Focus Indicator (Yellow/Gold Outline) */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* --- 4. PERSISTENT UNIVERSAL EMERGENCY BOTTOM BAR (ALWAYS VISIBLE AT BOTTOM) --- */
.emergency-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  z-index: 9995;
  padding: 0.4rem 1rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.emergency-bottom-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem 1.2rem;
  flex-wrap: wrap;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-color);
}

.emergency-bottom-bar .badge-247 {
  background: var(--emergency-red-aaa);
  color: #ffffff;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(153, 27, 27, 0.4);
}

.emergency-bottom-bar .emergency-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-color);
}

.emergency-bottom-bar .emergency-separator {
  color: var(--accent);
  opacity: 0.6;
}

.emergency-bottom-bar .btn-emergency-call {
  background: var(--emergency-red-aaa);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 800;
  padding: 0.4rem 1rem;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  min-height: 48px;
  white-space: nowrap;
  transition: transform 0.2s ease, filter 0.2s ease;
  box-shadow: 0 2px 10px rgba(153, 27, 27, 0.45);
}
.emergency-bottom-bar .btn-emergency-call:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

.emergency-bottom-bar .btn-emergency-islam {
  background: var(--emergency-green-aaa);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 800;
  padding: 0.4rem 1rem;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  min-height: 48px;
  white-space: nowrap;
  transition: transform 0.2s ease, filter 0.2s ease;
  box-shadow: 0 2px 10px rgba(22, 101, 52, 0.45);
}
.emergency-bottom-bar .btn-emergency-islam:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

/* Dynamic Responsive Breakpoints for Emergency Bar */
@media (max-width: 768px) {
  :root {
    --emergency-bar-current-h: var(--emergency-bar-height-tablet);
  }
  .emergency-bottom-bar {
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }
  .emergency-bottom-container {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
  }
  .emergency-bottom-bar .emergency-label,
  .emergency-bottom-bar .emergency-separator {
    display: none;
  }
  .emergency-bottom-bar .badge-247 {
    grid-column: auto;
    justify-self: center;
    white-space: nowrap;
  }
  .emergency-bottom-bar .btn-emergency-call,
  .emergency-bottom-bar .btn-emergency-islam {
    width: 100%;
    min-height: 48px;
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
    padding: 0.4rem 0.5rem;
  }
}

@media (max-width: 480px) {
  :root {
    --emergency-bar-current-h: 110px;
  }
  .emergency-bottom-container {
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.5rem;
  }
  .emergency-bottom-bar .badge-247 {
    grid-column: span 2;
    justify-self: center;
  }
  .emergency-bottom-bar .btn-emergency-call,
  .emergency-bottom-bar .btn-emergency-islam {
    font-size: 0.82rem;
    padding: 0.4rem 0.3rem;
  }
}

@media (max-width: 360px) {
  :root {
    --emergency-bar-current-h: 160px;
  }
  .emergency-bottom-container {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .emergency-bottom-bar .badge-247 {
    grid-column: span 1;
    justify-self: center;
    width: fit-content;
  }
  .emergency-bottom-bar .btn-emergency-call,
  .emergency-bottom-bar .btn-emergency-islam {
    grid-column: span 1;
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
  }
}

/* --- 6. TYPOGRAPHY --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
}
h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin-bottom: 0;
  color: var(--primary);
}
h3 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin-bottom: 1rem;
}

p, li {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-color);
  max-width: 75ch; /* Maximum optimal reading width */
}
p {
  margin-bottom: 1.5rem;
}
.lead {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-family: var(--font-serif);
  line-height: 1.75;
  color: var(--accent);
}

/* Breadcrumbs Navigation */
.breadcrumbs-nav {
  padding: 0.8rem 0;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.breadcrumbs-nav ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0.5rem;
  align-items: center;
}
.breadcrumbs-nav li + li::before {
  content: '›';
  margin-right: 0.5rem;
  color: var(--primary);
  font-weight: 700;
}
.breadcrumbs-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumbs-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.breadcrumbs-nav [aria-current="page"] {
  color: var(--primary);
  font-weight: 700;
}

/* --- 7. STICKY HEADER / NAVIGATION --- */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
}
.logo-link img {
  height: 60px;
  width: auto;
  transition: transform 0.25s ease;
}
.logo-link:hover img {
  transform: scale(1.05);
}

/* Nav Menu */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.2rem;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.25s ease;
  transform: translateX(-50%);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}
.nav-link:hover {
  color: var(--accent);
}

/* Mobile Menu Button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  width: 48px;
  height: 48px;
}
.nav-toggle-icon {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--primary);
  position: relative;
  transition: background-color 0.25s ease;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background-color: var(--primary);
  left: 0;
  transition: transform 0.25s ease, top 0.25s ease;
}
.nav-toggle-icon::before { top: -8px; }
.nav-toggle-icon::after { top: 8px; }

/* Mobile Menu Active States */
@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background-color: var(--card-bg);
    border-left: 2px solid var(--border-color);
    box-shadow: var(--shadow-hover);
    flex-direction: column;
    padding: 6rem 2rem 2rem;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
  }
  
  .nav-menu.open {
    right: 0;
  }
  
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon {
    background-color: transparent;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
    transform: rotate(45deg);
    top: 0;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
    transform: rotate(-45deg);
    top: 0;
  }
}

/* --- 8. HERO & PAGE HEADERS --- */
.hero {
  position: relative;
  min-height: 75vh;
  background-color: #111413;
  background-image: linear-gradient(to bottom, rgba(17, 20, 19, 0.45) 0%, rgba(17, 20, 19, 0.85) 100%), url('../imgs/header.jpg');
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 11rem 1.5rem 6rem;
  overflow: hidden;
  border-bottom: 3px solid var(--primary);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

/* Hero Title - Guaranteed High Contrast in All Modes */
.hero-title,
.hero .hero-title {
  color: #ffffff !important;
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.95), 0 2px 6px rgba(0, 0, 0, 0.85);
  margin-bottom: 0.8rem;
}
.hero-subtitle,
.hero .hero-subtitle {
  color: #ffffff !important;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 3vw, 1.95rem);
  max-width: 65ch;
  margin: 0 auto;
  font-weight: 700;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.95);
}

/* Subpage Headers with Parallax Background Image */
.page-header {
  position: relative;
  padding-top: 10rem;
  padding-bottom: 4.5rem;
  min-height: 38vh; 
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #111413;
  background-image: linear-gradient(to bottom, rgba(17, 20, 19, 0.5) 0%, rgba(17, 20, 19, 0.85) 100%), url('../imgs/header.jpg');
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-bottom: 3px solid var(--primary);
}
.page-header h1 {
  color: #ffffff !important;
  margin-bottom: 0.5rem;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.95), 0 2px 6px rgba(0, 0, 0, 0.85);
}
.page-header .hero-subtitle {
  color: #ffffff !important;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.95);
}

/* --- 9. MAIN CONTENT & GRID SYSTEMS --- */
main {
  flex-grow: 1;
  padding: 4rem 1.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.container {
  width: 100%;
}
.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 1400px) {
  .row, .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
}

/* --- 10. SECTION HEADERS & AIRY TITLE HEADINGS --- */
.section-header, .title-card {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 1rem 0;
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
  width: 100%;
}
.section-header h2, .section-header h3,
.title-card h2, .title-card h3 {
  margin: 0;
  display: inline-block;
  position: relative;
  padding-bottom: 0.6rem;
}
.section-header h2::after, .section-header h3::after,
.title-card h2::after, .title-card h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* --- 11. PREMIUM ACCESSIBLE CARDS --- */
.card {
  background-color: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 2px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.2);
}
.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.card:hover .card-image-wrapper img {
  transform: scale(1.05);
}

.card-body {
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.45rem;
  margin-bottom: 1.2rem;
  color: var(--primary);
}
.card:hover .card-title {
  color: var(--accent);
}

.card-text {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  flex-grow: 1;
}
.card-text:last-child {
  margin-bottom: 0;
}

/* --- 12. 4 PILIERS DE CONFIANCE --- */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.pillar-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2.2rem 1.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary);
}
.pillar-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.pillar-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(229, 176, 38, 0.12);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  color: var(--primary);
  font-size: 1.6rem;
}
.pillar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.8rem;
  font-family: var(--font-serif);
}
.pillar-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

/* --- 13. BANNERS WITH INVERTED CONTRAST --- */
.cta-banner {
  background-color: var(--banner-bg);
  color: var(--banner-text);
  padding: 3rem 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  border: 2px solid var(--accent);
  width: 100%;
}
.cta-banner h2, .cta-banner h3 {
  color: var(--banner-text);
  margin-bottom: 1rem;
}
.cta-banner p {
  color: var(--banner-muted);
  max-width: 80ch;
  font-weight: 500;
}
.cta-banner .lead {
  color: var(--banner-text);
  font-weight: 700;
}

/* --- 14. MEDIA ELEMENTS (VIDEO, PDF, TTS) --- */
.video-responsive {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  margin: 0;
  border: 1px solid var(--border-color);
}
.video-responsive iframe,
.video-responsive video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background-color: #000;
}

/* Floating TTS (Text-to-Speech) Toggle Button */
.tts-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease, background-color 0.25s ease;
  padding: 0;
}
.tts-toggle:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  transform: scale(1.08);
}
.tts-toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.tts-toggle.enabled {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}
.tts-toggle.enabled:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.img-responsive {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 2px solid var(--border-color);
  margin: 0 auto;
  display: block;
}

/* Custom PDF Viewer Wrapper */
.pdf-container {
  margin: 1.5rem 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 2px solid var(--border-color);
  width: 100%;
}
.pdf-container iframe {
  border: 0;
  width: 100%;
  height: 650px;
}
@media (max-width: 768px) {
  .pdf-container iframe {
    height: 400px;
  }
}

/* --- 15. BUTTONS (TOUCH TARGET >= 48px) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.8rem;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  border-radius: 8px;
  transition: var(--transition);
  cursor: pointer;
  font-family: var(--font-sans);
  min-height: 48px;
  border: 2px solid transparent;
  width: fit-content;
}

/* Primary Button */
.btn-primary {
  background-color: var(--primary);
  color: var(--banner-text);
}
.btn-primary:hover {
  background-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Accent Button */
.btn-accent {
  background-color: var(--accent);
  color: var(--banner-text);
  box-shadow: 0 4px 15px rgba(255, 213, 79, 0.2);
}
.btn-accent:hover {
  background-color: #ffe082;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Outline Button */
.btn-outline {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background-color: var(--primary);
  color: var(--banner-text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Special CTA Button */
.cta-banner .btn-primary {
  background-color: var(--banner-text);
  color: var(--primary);
  border: 2px solid var(--banner-text);
}
.cta-banner .btn-primary:hover {
  background-color: transparent;
  color: var(--banner-text);
  border-color: var(--banner-text);
}

/* --- 16. CONTENT DIVIDERS, ALERTS & LISTS --- */
section {
  margin-bottom: 5rem;
}

.alert-box {
  background-color: var(--card-bg);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  padding: 1.8rem;
  margin: 0;
  box-shadow: var(--shadow);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  width: 100%;
}
.alert-box h3 {
  margin-bottom: 1rem;
}

ul.checked-list {
  list-style: none;
  margin: 1.5rem 0;
  width: 100%;
}
ul.checked-list li {
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 0.9rem;
  font-size: 1.05rem;
}
ul.checked-list li::before {
  content: '✓';
  position: absolute;
  left: 0.2rem;
  top: 0.1rem;
  color: var(--accent);
  font-weight: 900;
  font-size: 1.2rem;
}

/* Pricing Block */
.pricing-block {
  text-align: center;
  background-color: var(--banner-bg);
  color: var(--banner-text);
  padding: 3rem 2rem;
  border-radius: var(--border-radius);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-hover);
  margin-bottom: 2rem;
  width: 100%;
}
.pricing-block h3 {
  color: var(--banner-text);
}
.pricing-price {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 900;
  color: var(--banner-text);
  margin: 1.2rem 0;
  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.4);
}
.pricing-tax {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--banner-muted);
}

/* Social Icons */
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background-color: rgba(229, 176, 38, 0.12);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  transition: var(--transition);
}
.social-link:hover {
  background-color: var(--primary);
  border-color: var(--accent);
  transform: scale(1.1);
}
.social-link svg {
  fill: var(--primary);
  width: 24px;
  height: 24px;
  transition: fill 0.25s ease;
}
.social-link:hover svg {
  fill: var(--banner-text);
}

/* --- 17. ACCORDION COMPONENT (CSS GRID EXPANSION) --- */
.lpf-accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--card-bg);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color 0.25s ease;
}
.lpf-accordion:focus-within, .lpf-accordion.open {
  border-color: var(--primary);
}
.lpf-accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-color);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  gap: 1rem;
  min-height: 48px;
}
.lpf-accordion-header:hover {
  color: var(--accent);
}
.lpf-accordion-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.lpf-accordion.open .lpf-accordion-icon,
.lpf-accordion[open] .lpf-accordion-icon {
  transform: rotate(180deg);
}
.lpf-accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.lpf-accordion.open .lpf-accordion-content,
.lpf-accordion[open] .lpf-accordion-content {
  grid-template-rows: 1fr;
}
.lpf-accordion-inner {
  overflow: hidden;
  padding: 0 1.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* --- 18. DEVIS TYPE & COST ESTIMATOR --- */
.devis-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}
.devis-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 2px solid var(--border-color);
}
.devis-table-wrapper .devis-table {
  min-width: 580px;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.devis-table th {
  background: rgba(229, 176, 38, 0.15);
  color: var(--primary);
  font-family: var(--font-serif);
  padding: 1rem 1.2rem;
  text-align: left;
  font-size: 1.05rem;
  border-bottom: 2px solid var(--border-color);
}
.devis-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 0.95rem;
}
.devis-table tr:last-child td {
  border-bottom: none;
}
.devis-table .category-header td {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.devis-table .price-col {
  text-align: right;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}


/* --- 19. TIMELINE RITUELLE ISLAMIQUE --- */
.ritual-timeline {
  position: relative;
  padding: 2rem 0;
  margin: 2rem 0;
}
.ritual-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 24px;
  width: 3px;
  background: var(--border-color);
}
:root[dir="rtl"] .ritual-timeline::before {
  left: auto;
  right: 24px;
}
.ritual-step {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 60px;
}
:root[dir="rtl"] .ritual-step {
  padding-left: 0;
  padding-right: 60px;
}
.ritual-step:last-child {
  margin-bottom: 0;
}
.ritual-number {
  position: absolute;
  left: 6px;
  top: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--banner-text);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 10px var(--border-glow);
}
:root[dir="rtl"] .ritual-number {
  left: auto;
  right: 6px;
}
.ritual-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}
.ritual-card h3 {
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 0.8rem;
}

/* --- 20. DOWNLOADS & METADATA BADGES --- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}
.download-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.download-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.download-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(229, 176, 38, 0.15);
  color: var(--primary);
  margin-bottom: 1rem;
  width: fit-content;
}
.download-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 1rem 0 1.5rem;
}

/* --- 21. ACCESSIBILITY CONTROL PANEL WIDGET --- */
.a11y-trigger {
  position: fixed;
  bottom: calc(var(--emergency-bar-current-h, 58px) + max(16px, env(safe-area-inset-bottom, 0px)));
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 2px solid var(--accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}
.a11y-trigger:hover {
  transform: scale(1.1) rotate(6deg);
  background-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.a11y-trigger svg {
  width: 26px;
  height: 26px;
  fill: var(--banner-text);
}
:root[dir="rtl"] .a11y-trigger {
  right: auto;
  left: 20px;
}

.a11y-panel {
  position: fixed;
  bottom: calc(var(--emergency-bar-current-h, 58px) + 80px);
  right: 25px;
  width: 340px;
  background-color: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-hover);
  padding: 1.8rem;
  z-index: 10000;
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  animation: a11yFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 3px solid var(--primary);
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.a11y-panel.open {
  display: flex;
}
:root[dir="rtl"] .a11y-panel {
  right: auto;
  left: 25px;
}

@media (max-width: 768px) {
  .a11y-trigger {
    bottom: calc(var(--emergency-bar-current-h, 64px) + max(14px, env(safe-area-inset-bottom, 0px)));
    right: 14px;
    width: 48px;
    height: 48px;
  }
  :root[dir="rtl"] .a11y-trigger {
    right: auto;
    left: 14px;
  }
  .a11y-trigger svg {
    width: 24px;
    height: 24px;
  }
  .a11y-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 82vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
    z-index: 10005;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }
}

@keyframes a11yFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.a11y-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.8rem;
}
.a11y-header h4 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--primary);
}
.a11y-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: var(--transition);
}
.a11y-close:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--primary);
}

.a11y-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.a11y-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.a11y-buttons {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  flex-wrap: wrap;
}
.a11y-btn {
  flex: 1;
  min-width: 70px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 0.4rem;
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.a11y-btn:hover {
  background-color: rgba(229, 176, 38, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}
.a11y-btn.active {
  background-color: var(--primary);
  color: var(--banner-text);
  border-color: var(--accent);
}

/* --- 22. FOOTER (ENRICHED 4 COLUMNS) --- */
footer.site-footer {
  background-color: #0b0d0c;
  color: #ffffff;
  padding: 5rem 1.5rem 2.5rem;
  border-top: 3px solid var(--primary);
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-column h3 {
  color: var(--primary);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-serif);
  position: relative;
  padding-bottom: 0.5rem;
}
.footer-column h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary);
}

.footer-column p {
  color: #dee3e0;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
  max-width: 100%;
  line-height: 1.55;
}

.footer-column a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}
.footer-column a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-column ul {
  list-style: none;
}
.footer-column ul li {
  margin-bottom: 0.6rem;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(229, 176, 38, 0.15);
  text-align: center;
}
.footer-bottom p {
  font-size: 0.9rem;
  color: #9baba3;
  margin: 0;
  max-width: 100%;
}

/* --- 23. ILLUSTRATION SWITCHER --- */
.illustration-gold {
  display: block;
}
.illustration-pixar {
  display: none;
}

:root[data-illustration-style="pixar"] .illustration-gold {
  display: none;
}
:root[data-illustration-style="pixar"] .illustration-pixar {
  display: block;
}

/* --- 24. LANGUAGE SWITCHER (FLAG BUBBLES) --- */
.lang-switcher {
  position: relative;
  margin-left: 1rem;
  z-index: 1002;
}

.lang-trigger {
  background: rgba(229, 176, 38, 0.1);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  transition: var(--transition);
}
.lang-trigger:hover {
  background: var(--primary);
  border-color: var(--accent);
  transform: scale(1.08);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background-color: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 20px var(--border-glow);
  box-sizing: border-box;
  grid-template-columns: repeat(4, 44px);
  gap: 0.65rem;
  width: auto;
  min-width: 240px;
  max-width: calc(100vw - 20px);
  z-index: 1010;
}
.lang-dropdown.open {
  display: grid;
}

.lang-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease;
  padding: 0;
  box-sizing: border-box;
}
.lang-bubble:hover, .lang-bubble.active {
  background: rgba(229, 176, 38, 0.25);
  border-color: var(--accent);
  transform: scale(1.12);
  box-shadow: 0 0 10px var(--border-glow);
}

/* --- 25. RTL (RIGHT-TO-LEFT) STYLES --- */
:root[dir="rtl"] {
  --font-sans: var(--font-sans-ar, "Segoe UI Arabic", "Geeza Pro", "Traditional Arabic", Tahoma, Arial, sans-serif);
  --font-serif: var(--font-serif-ar, "Amiri", "Scheherazade New", "Traditional Arabic", Georgia, serif);
  text-align: right;
  direction: rtl;
}
:root[dir="rtl"] body {
  direction: rtl;
  font-family: var(--font-sans);
}
:root[dir="rtl"] h1, 
:root[dir="rtl"] h2, 
:root[dir="rtl"] h3, 
:root[dir="rtl"] h4 {
  font-family: var(--font-serif);
  text-align: right;
}
:root[dir="rtl"] p, 
:root[dir="rtl"] li, 
:root[dir="rtl"] .card-title,
:root[dir="rtl"] .card-text {
  text-align: right;
}

:root[dir="rtl"] .skip-link {
  left: auto;
  right: 20px;
}

:root[dir="rtl"] .nav-container {
  flex-direction: row-reverse;
}
:root[dir="rtl"] .nav-menu {
  flex-direction: row-reverse;
}
:root[dir="rtl"] .lang-switcher {
  margin-left: 0;
  margin-right: 1rem;
}
:root[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

/* Breadcrumbs RTL with inverted chevron ‹ */
:root[dir="rtl"] .breadcrumbs-nav li + li::before {
  content: '‹';
  margin-right: 0;
  margin-left: 0.5rem;
}

/* Checked List RTL */
:root[dir="rtl"] ul.checked-list li {
  padding-left: 0;
  padding-right: 2.2rem;
}
:root[dir="rtl"] ul.checked-list li::before {
  left: auto;
  right: 0.2rem;
}

/* Alerts RTL */
:root[dir="rtl"] .alert-box {
  border-left: 1px solid var(--border-color);
  border-right: 5px solid var(--accent);
}

/* Footer RTL */
:root[dir="rtl"] .footer-column h3::after {
  left: auto;
  right: 0;
}

/* Devis Table RTL: Text right, Prices left */
:root[dir="rtl"] .devis-table th,
:root[dir="rtl"] .devis-table td {
  text-align: right;
}
:root[dir="rtl"] .devis-table .price-col {
  text-align: left;
}

/* Floating widgets in RTL */
:root[dir="rtl"] .a11y-trigger {
  right: auto;
  left: 16px;
}
:root[dir="rtl"] .a11y-panel {
  right: auto;
  left: 16px;
}
@media (max-width: 768px) {
  :root[dir="rtl"] .a11y-panel {
    right: 0;
    left: 0;
  }
}
:root[dir="rtl"] .tts-toggle {
  right: auto;
  left: 12px;
}

/* Mobile Nav Menu Drawer RTL (sliding from left) */
@media (max-width: 900px) {
  :root[dir="rtl"] .nav-menu {
    right: auto;
    left: -100%;
    border-left: none;
    border-right: 2px solid var(--border-color);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  :root[dir="rtl"] .nav-menu.open {
    left: 0;
    right: auto;
  }
}

/* --- 26. PDF MODAL READER --- */
.pdf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}
.pdf-modal.open {
  display: flex;
}
.pdf-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}
.pdf-modal-container {
  position: relative;
  width: 95vw;
  height: 90vh;
  max-width: 1400px;
  background-color: var(--card-bg);
  border: 3px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-hover);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
  animation: modalReveal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalReveal {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.pdf-modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);
}
.pdf-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary);
}
.pdf-modal-close {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  padding: 0 0.5rem;
  min-height: 48px;
}
.pdf-modal-close:hover {
  color: var(--accent);
  transform: scale(1.1);
}
.pdf-modal-body {
  flex-grow: 1;
  display: flex;
  overflow: hidden;
}
.pdf-modal-viewer {
  flex-grow: 1;
  height: 100%;
  background-color: #525659;
  display: flex;
  flex-direction: column;
}
.pdf-modal-viewer iframe {
  flex-grow: 1;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- 27. PRINT STYLES (@media print) --- */
@media print {
  *, *::before, *::after {
    background: transparent !important;
    color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
    line-height: 1.5;
    padding: 0 !important;
  }
  .site-header, .emergency-bar, .mobile-emergency-bar, .emergency-bottom-bar, .nav-toggle,
  .a11y-trigger, .a11y-panel, .lang-switcher, .social-link,
  .video-responsive, video, iframe, .tts-toggle, .btn, .skip-link,
  .footer-bottom, .theme-selector-bar, .viewport-tabs, .pdf-modal {
    display: none !important;
  }
  .hero, .page-header {
    background: none !important;
    padding: 1rem 0 !important;
    min-height: auto !important;
    border-bottom: 2px solid #000000 !important;
  }
  .hero-title, .page-header h1 {
    color: #000000 !important;
    font-size: 22pt !important;
    text-shadow: none !important;
  }
  .hero-subtitle, .page-header .hero-subtitle {
    color: #333333 !important;
    font-size: 13pt !important;
    text-shadow: none !important;
  }
  main {
    padding: 1rem 0 !important;
    max-width: 100% !important;
  }
  .card, .pricing-block, .alert-box, .cta-banner, .pillar-card, .estimator-container {
    border: 1px solid #777777 !important;
    border-radius: 4px !important;
    page-break-inside: avoid;
    margin-bottom: 1.5rem !important;
    padding: 1rem !important;
  }
  .grid-2, .grid-3, .grid-4, .row, .pillars-grid {
    display: block !important;
  }
  .grid-2 > *, .grid-3 > *, .grid-4 > *, .row > *, .pillars-grid > * {
    margin-bottom: 1.2rem !important;
  }
  ul.checked-list li::before {
    content: '□ ' !important;
    color: #000000 !important;
  }
  .devis-table th {
    background: #eeeeee !important;
    border-bottom: 2px solid #000000 !important;
  }
  .devis-table td {
    border-bottom: 1px solid #cccccc !important;
  }
  @page {
    margin: 1.5cm;
    size: A4 portrait;
  }
}

/* --- 28. REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  *,
  *::before,
  *::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}

/* --- 29. YOUTUBE FULL-WIDTH BANNER UNDER VIDEO PLAYER --- */
.video-youtube-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(18, 24, 32, 0.95);
  border: 1px solid var(--border-color, rgba(197, 160, 89, 0.3));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  color: var(--text-color, #e2e8f0);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
  margin-top: 0;
}

.video-youtube-banner:hover,
.video-youtube-banner:focus-visible {
  background: rgba(30, 41, 59, 0.98);
  color: #ff3333;
  border-color: rgba(255, 51, 51, 0.5);
  box-shadow: 0 4px 16px rgba(255, 0, 0, 0.25);
  outline: none;
}

[data-theme="light"] .video-youtube-banner {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .video-youtube-banner:hover,
[data-theme="light"] .video-youtube-banner:focus-visible {
  background: #ffffff;
  color: #cc0000;
  border-color: rgba(204, 0, 0, 0.4);
}

.video-youtube-banner .youtube-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.video-youtube-banner:hover .youtube-icon {
  transform: scale(1.12);
}

.video-youtube-banner .external-icon {
  opacity: 0.65;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.video-youtube-banner:hover .external-icon {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* --- 30. WEBVTT SUBTITLES ACCESSIBILITY (WCAG AAA) --- */
::cue,
video::cue {
  background: rgba(17, 20, 19, 0.9);
  color: #ffffff;
  border: 1px solid rgba(229, 176, 38, 0.3);
  font-size: clamp(0.85rem, 2.8vw, 1.05rem);
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.4;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

:root[dir="rtl"] ::cue,
:root[dir="rtl"] video::cue {
  font-family: var(--font-sans-ar, system-ui, -apple-system, sans-serif);
  line-height: 1.7;
}


