/* CIMOS — vitrine refonte FR / EN / AR */
:root {
  --color-bg: #f4f2ed;
  --color-surface: #ffffff;
  --color-text: #1a1f1e;
  --color-muted: #5c6563;
  --color-brand: #0d3d47;
  --color-brand-light: #165a68;
  --color-accent: #c9a227;
  --color-accent-hover: #a8861c;
  --font-sans: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-ar: "Noto Sans Arabic", "Noto Sans", system-ui, sans-serif;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(13, 61, 71, 0.08);
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

body[dir="rtl"] {
  font-family: var(--font-ar);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: var(--color-brand-light);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-accent-hover);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.75rem 1rem;
  background: var(--color-brand);
  color: #fff;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid rgba(13, 61, 71, 0.08);
  width: 100%;
  max-width: 100%;
  padding-top: 0;
}

@media (min-width: 861px) {
  .site-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-logo img {
  max-height: 52px;
  width: auto;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-switch a {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-brand);
  border: 1px solid rgba(13, 61, 71, 0.15);
  background: var(--color-surface);
}

.lang-switch a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-hover);
}

.lang-switch a[aria-current="true"] {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

.nav-toggle {
  display: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(13, 61, 71, 0.2);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-weight: 600;
  cursor: pointer;
  color: var(--color-brand);
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
}

.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--color-text);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-brand);
}

.cta-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn--primary {
  background: var(--color-accent);
  color: #1a1508;
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  color: #1a1508;
}

.btn--ghost {
  background: transparent;
  color: var(--color-brand);
  border: 2px solid var(--color-brand);
}

.btn--ghost:hover {
  background: var(--color-brand);
  color: #fff;
}

.hero {
  background: linear-gradient(135deg, var(--color-brand) 0%, #0a2f36 100%);
  color: #e8f4f2;
  padding: 3rem 1.25rem 3.5rem;
}

.hero__inner {
  max-width: var(--max);
  margin: 0 auto;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.2;
  font-weight: 700;
}

.hero p.lead {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
  max-width: 42rem;
  opacity: 0.95;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__actions .btn--primary {
  background: var(--color-accent);
}

.hero__actions .btn--ghost {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.hero__actions .btn--ghost:hover {
  background: #fff;
  color: var(--color-brand);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.prose h2 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  color: var(--color-brand);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--color-muted);
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--color-muted);
}

body[dir="rtl"] .prose ul {
  padding-left: 0;
  padding-right: 1.25rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(13, 61, 71, 0.06);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--color-brand);
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.card a {
  font-weight: 600;
}

.breadcrumbs {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--color-muted);
}

/* Plan d’accès : carte Leaflet (plan + satellite), contrôles en LTR */
.plan-map-wrap {
  max-width: 100%;
  margin-top: 1rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(13, 61, 71, 0.12);
  direction: ltr;
  unicode-bidi: isolate;
}

.plan-map {
  height: 380px;
  width: 100%;
  z-index: 0;
}

.plan-map .leaflet-container {
  font-family: var(--font-sans);
}

.page-hero {
  margin-bottom: 2rem;
}

.page-hero > img {
  display: block;
  max-width: min(28rem, 100%);
  width: 100%;
  height: auto;
  margin-inline: auto;
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--color-brand);
}

.page-hero .intro {
  margin: 0;
  color: var(--color-muted);
  max-width: 40rem;
}

.image-carousel {
  position: relative;
  margin: 0 auto 2rem;
  max-width: min(50rem, 100%);
  /* RTL: évite l’inversion flex + translateX sur les pages arabe */
  direction: ltr;
  unicode-bidi: isolate;
}

.image-carousel.home-carousel {
  margin-top: 0.5rem;
}

.image-carousel__viewport {
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(13, 61, 71, 0.12);
  aspect-ratio: 3 / 2;
  outline: none;
  background: rgba(13, 61, 71, 0.06);
}

.image-carousel__viewport:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
}

.image-carousel__track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .image-carousel__track {
    transition: none;
  }
}

.image-carousel__slide {
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
}

.image-carousel__slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-carousel__btn {
  position: absolute;
  top: 50%;
  margin-top: -1.5rem;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-brand);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(13, 61, 71, 0.2);
  z-index: 2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, transform 0.15s ease;
}

.image-carousel__btn:hover {
  background: #fff;
  transform: scale(1.05);
}

.image-carousel__btn:active {
  transform: scale(0.98);
}

.image-carousel__btn--prev {
  left: 0.5rem;
}

.image-carousel__btn--next {
  right: 0.5rem;
}

.image-carousel__counter {
  margin: 0.65rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-muted);
}

@media (max-width: 480px) {
  .image-carousel__btn {
    width: 2.5rem;
    height: 2.5rem;
    margin-top: -1.25rem;
    font-size: 1.4rem;
  }

  .image-carousel__btn--prev {
    left: 0.35rem;
  }

  .image-carousel__btn--next {
    right: 0.35rem;
  }
}

.site-footer {
  background: var(--color-brand);
  color: rgba(255, 255, 255, 0.88);
  padding: 2rem 1.25rem;
  margin-top: 2rem;
}

.site-footer a {
  color: #fff;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

.site-footer h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.site-footer p {
  margin: 0.35rem 0;
  font-size: 0.95rem;
}

.footer-copy {
  grid-column: 1 / -1;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  opacity: 0.8;
}

@media (max-width: 860px) {
  .site-header {
    z-index: 1000;
  }

  .site-header__inner {
    padding: 0.65rem 1rem;
    gap: 0.65rem;
  }

  .site-logo {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
  }

  .site-logo img {
    max-height: 46px;
  }

  .nav-toggle {
    display: block;
    order: 2;
    flex: 0 0 auto;
    -webkit-tap-highlight-color: transparent;
  }

  .lang-switch {
    order: 3;
    flex: 1 1 100%;
  }

  .cta-bar {
    order: 4;
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
  }

  .main-nav {
    order: 5;
    flex: 1 1 100%;
    width: 100%;
    display: none;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(13, 61, 71, 0.1);
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  body[dir="rtl"] .main-nav ul {
    align-items: flex-end;
  }
}
