/* ============================================
   MDN Plagiarism System — COMPOSANTS SPÉCIFIQUES MDN
   Bandeau d'État, lockup de marque, écosystème
   institutionnel, modèle de déploiement, RTL/AR.
   Chargé APRÈS components.css / animations.css.
   ============================================ */

:root { --gov-bar-h: 56px; }

/* ═══════════════════════════════════════════
   BANDEAU OFFICIEL (République Tunisienne · MDN)
   Statique, au-dessus de la nav sticky : il défile
   puis la nav se colle en haut.
   ═══════════════════════════════════════════ */
.gov-bar {
  position: relative;
  z-index: calc(var(--z-nav) + 2);
  background: var(--dr-white);
  border-bottom: 3px solid var(--dr-red-500);
  box-shadow: 0 1px 0 rgba(23,23,27,0.04);
}
.gov-bar__inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  min-height: var(--gov-bar-h);
  padding: 6px clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.gov-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.gov-id__emblem {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: block;
}
/* Emplacement pour l'EMBLÈME OFFICIEL du MDN (fourni par le Ministère).
   Par défaut : emblème national (croissant+étoile). Pour insérer l'emblème
   officiel, remplacer le fichier assets/img/mdn-emblem.svg puis pointer
   .gov-id__emblem dessus dans index.html. */
.gov-id__text { min-width: 0; }
.gov-id__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  color: var(--dr-ink-900);
  line-height: 1.3;
  white-space: nowrap;
}
html[lang="ar"] .gov-id__name { font-family: var(--font-ar); font-size: 0.98rem; }
.gov-flag {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto;
}
.gov-flag__img {
  width: 46px; height: 31px;
  border: 1px solid rgba(23,23,27,0.12);
  border-radius: 3px;
  display: block;
}
.gov-flag__label {
  font-family: var(--font-display);
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--dr-ink-400);
  white-space: nowrap;
}
.gov-mobile-short { display: none; }

@media (max-width: 860px) {
  .gov-id__name { font-size: 0.78rem; }
  .gov-flag__label { display: none; }
}
@media (max-width: 620px) {
  :root { --gov-bar-h: 46px; }
  .gov-id__text, .gov-flag__img { display: none; }
  .gov-mobile-short {
    display: block;
    font-weight: 700; font-size: 0.9rem; color: var(--dr-ink-900);
  }
  .gov-flag { gap: 0; }
  .gov-flag .gov-flag__img { display: block; width: 38px; height: 25px; }
  .gov-id__emblem { width: 34px; height: 34px; }
}

/* ═══════════════════════════════════════════
   LOCKUP DE MARQUE (logo nav / footer)
   ═══════════════════════════════════════════ */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand__mark { width: 40px; height: 45px; flex: 0 0 auto; display: block; }
.brand__mark--sm { width: 30px; height: 34px; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: 0.14em;
  color: var(--dr-ink-900);
}
.brand__word .brand__ar {
  font-family: var(--font-ar);
  color: var(--dr-red-500);
  margin-inline-start: 6px;
  letter-spacing: 0;
}
.brand__sub {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  color: var(--dr-ink-400);
  margin-top: 3px;
  white-space: nowrap;
}
.footer .brand__word { color: var(--dr-ink-900); }
@media (max-width: 620px) {
  .brand__sub { display: none; }
  .brand__word { font-size: 1.1rem; }
}

/* ═══════════════════════════════════════════
   ÉCOSYSTÈME INSTITUTIONNEL (institutions du MDN)
   ═══════════════════════════════════════════ */
.inst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.inst-card {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid rgba(23,23,27,0.08);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}
.inst-card:hover {
  border-color: rgba(231,0,19,0.28);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.inst-card__badge {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(231,0,19,0.06);
  color: var(--dr-red-500);
}
.inst-card__badge svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.inst-card__name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.02rem;
  color: var(--dr-ink-900); margin: 0 0 3px;
}
.inst-card__meta {
  font-size: 0.86rem; color: var(--dr-ink-500); line-height: 1.5; margin: 0;
}

/* ═══════════════════════════════════════════
   MODÈLE DE DÉPLOIEMENT (phases + inclus)
   ═══════════════════════════════════════════ */
.deploy-lead {
  max-width: 780px; margin: 0 auto var(--space-6);
  text-align: center; color: var(--dr-ink-700);
}
.deploy-phases {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4); counter-reset: phase;
}
.deploy-phase {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid rgba(23,23,27,0.08);
  border-top: 3px solid var(--dr-red-500);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.deploy-phase__step {
  font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 700;
  color: var(--dr-red-500); letter-spacing: 0.1em;
}
.deploy-phase__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; color: var(--dr-ink-900); margin: 6px 0 8px;
}
.deploy-phase__desc { font-size: 0.9rem; color: var(--dr-ink-600, var(--dr-ink-500)); line-height: 1.55; margin: 0; }
.deploy-phase__when { margin-top: 10px; font-size: 0.78rem; font-weight: 600; color: var(--dr-ink-400); }

.deploy-incl {
  margin-top: var(--space-6);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: var(--space-3);
  background: var(--bg-soft);
  border: 1px solid rgba(23,23,27,0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.deploy-incl li {
  list-style: none; display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.94rem; color: var(--dr-ink-700);
}
.deploy-incl li::before {
  content: '✓'; color: var(--dr-green-500); font-weight: 700; flex: 0 0 auto;
}
@media (max-width: 900px) { .deploy-phases { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px) { .deploy-phases { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════
   BANDE DE CONFIDENTIALITÉ / MENTION SÉCURITÉ
   ═══════════════════════════════════════════ */
.security-note {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-5);
  border: 1px dashed rgba(231,0,19,0.3);
  border-radius: var(--radius-md);
  background: rgba(231,0,19,0.02);
  color: var(--dr-ink-700); font-size: 0.9rem; text-align: center;
}
.security-note svg { width: 22px; height: 22px; stroke: var(--dr-red-500); fill: none; stroke-width: 2; flex: 0 0 auto; }

/* ═══════════════════════════════════════════
   CRÉDIT ÉDITEUR (footer)
   ═══════════════════════════════════════════ */
.footer-editor { color: var(--dr-ink-400); }
.footer-editor strong { color: var(--dr-ink-700); font-weight: 600; }

/* ═══════════════════════════════════════════
   TYPOGRAPHIE ARABE / RTL
   ═══════════════════════════════════════════ */
html[lang="ar"] body,
html[dir="rtl"] body {
  font-family: var(--font-ar);
}
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
html[lang="ar"] h4, html[lang="ar"] .brand__word,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 {
  font-family: var(--font-ar);
  letter-spacing: 0;
}
/* En RTL, inverser quelques marges directionnelles gérées en px */
html[dir="rtl"] .gov-id__ar,
html[dir="rtl"] .gov-id__fr,
html[dir="rtl"] .gov-flag__label { white-space: normal; }
html[dir="rtl"] .deploy-phase { border-top: 3px solid var(--dr-red-500); }

/* Petits ajustements universels */
.eyebrow { color: var(--dr-red-600); }

/* ═══════════════════════════════════════════
   BOUTON CONNEXION (contour rouge, visible sur blanc)
   ═══════════════════════════════════════════ */
.btn.nav__login {
  background: transparent;
  color: var(--dr-red-600);
  border: 1.5px solid var(--dr-red-500);
  box-shadow: none;
}
.btn.nav__login::after { display: none; } /* pas de shimmer */
.btn.nav__login:hover {
  background: var(--dr-red-500);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
/* Dans le menu mobile : pleine largeur */
.nav__mobile .btn.nav__login { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════
   GALERIE « APERÇU DE LA PLATEFORME » + LIGHTBOX
   ═══════════════════════════════════════════ */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}
.gallery__item {
  padding: 0; margin: 0; border: 1px solid rgba(23,23,27,0.08);
  border-radius: var(--radius-md); overflow: hidden; cursor: zoom-in;
  background: var(--bg-elevated); box-shadow: var(--shadow-sm); display: block;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .25s;
}
.gallery__item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(231,0,19,0.28); }
.gallery__item img { width: 100%; height: 200px; object-fit: cover; object-position: top center; display: block; }
.gallery__item::after { display: none; }

.lightbox {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(23,23,27,0.93); display: flex; align-items: center; justify-content: center; padding: 3vw;
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 94vw; max-height: 88vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.55); }
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(255,255,255,0.12); color: #fff; border: none; cursor: pointer;
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; line-height: 1; transition: background .2s;
}
.lightbox__close { top: 20px; right: 24px; font-size: 1.7rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 20px; } .lightbox__next { right: 20px; }
.lightbox__close:hover, .lightbox__nav:hover { background: var(--dr-red-500); }
@media (max-width: 620px) { .lightbox__nav { width: 42px; height: 42px; font-size: 1.5rem; } }

/* ═══════════════════════════════════════════
   DIRECTION A — HERO « RÉGALIEN / SPLIT »
   (surcharge le hero centré hérité)
   ═══════════════════════════════════════════ */
.hero__content--split {
  text-align: left;
  max-width: var(--container-wide);
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 4.5vw, 60px);
  align-items: center;
}
.hero__content--split .hero__tagline { color: var(--dr-red-600); }
.hero__content--split .hero__title { font-size: clamp(2.2rem, 4.2vw, 3.9rem) !important; line-height: 1.07 !important; margin-bottom: var(--space-5) !important; }
.hero__content--split .hero__sub { margin-left: 0 !important; margin-right: 0 !important; max-width: 50ch; }
.hero__content--split .hero__cta { justify-content: flex-start; }
.hero__content--split .hero__trust {
  flex-direction: column; align-items: flex-start; justify-content: flex-start;
  gap: 10px; margin-top: var(--space-6);
  border-left: 3px solid var(--dr-red-500); padding-left: 16px;
}
.hero__content--split .hero__trust-item { background: transparent; border: none; padding: 0; font-size: 0.95rem; }

.hero__visual { position: relative; aspect-ratio: 1; width: 100%; max-width: 460px; margin-inline: auto; display: grid; place-items: center; }
.hero__visual .hero__rings { position: absolute; inset: 0; }
.hero__visual .hero__rings span { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(231,0,19,.28); animation: heroPulse 3.2s var(--ease-out) infinite; }
.hero__visual .hero__rings span:last-child { animation-delay: 1.6s; }
.hero__ring { position: absolute; border-radius: 50%; }
.hero__ring.r2 { inset: 15%; border: 1px solid rgba(23,23,27,.12); }
.hero__ring.r3 { inset: 30%; border: 1px solid rgba(23,23,27,.10); }
.hero__emblem { width: 46%; height: 46%; object-fit: contain; position: relative; filter: drop-shadow(0 14px 34px rgba(231,0,19,.22)); }
@keyframes heroPulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.16); opacity: 0; } }

@media (max-width: 900px) {
  .hero__content--split { grid-template-columns: 1fr; text-align: center; gap: 8px; }
  .hero__content--split .hero__cta { justify-content: center; }
  .hero__content--split .hero__sub { margin-inline: auto !important; }
  .hero__content--split .hero__trust { align-items: center; border-left: none; border-top: 3px solid var(--dr-red-500); padding-left: 0; padding-top: 14px; }
  .hero__visual { order: -1; max-width: 240px; margin-bottom: 14px; }
}

/* ═══════════════════════════════════════════
   DIRECTION A — SIGNATURE RÉGALIENNE (sections + cartes)
   ═══════════════════════════════════════════ */
/* Filet rouge à gauche de chaque en-tête de section */
.section__head {
  position: relative;
  padding-left: 22px;
  border-left: 3px solid var(--dr-red-500);
  text-align: left;
}
.section__head > * { margin-left: 0 !important; margin-right: 0 !important; }
.section__head .eyebrow { justify-content: flex-start; }
@media (max-width: 620px) { .section__head { padding-left: 15px; } }

/* Cartes : liseré rouge en tête (motif « dossier officiel »), coins plus sobres */
.card { border-top: 3px solid var(--dr-red-500); border-radius: var(--radius-md); }
.card--forum { border-top: 3px solid var(--dr-red-500); }
/* le tableau comparatif et les cartes déjà dotées d'un filet ne doublent pas */
.deploy-phase, .inst-card { border-top-width: 3px; }
