/* ==========================================================================
   ISEC Luxembourg — feuille de style unique
   Palette relevee pixel par pixel sur les captures du site Odoo d'origine.
   Aucune dependance externe : pas de framework, pas de police distante.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Jetons de design
   -------------------------------------------------------------------------- */
:root {
  /* Couleurs de marque (relevees sur le site d'origine) */
  --red:            #E51B1B;  /* rouge ISEC : logo, boutons, liens        */
  --red-dark:       #B81515;  /* survol / focus — contraste renforce      */
  --red-hero-from:  #C42019;  /* degrade banniere, bord                   */
  --red-hero-to:    #E5261E;  /* degrade banniere, centre                 */
  --red-overlay:    rgba(160, 26, 20, .88);  /* encadre titre accueil     */
  --grey-overlay:   rgba(88, 88, 88, .74);   /* encadre titre pages int.  */

  /* Neutres */
  --bg:             #FFFFFF;
  --bg-soft:        #F8F8F8;  /* en-tete, pied de page                    */
  --bg-alt:         #EEEEEE;  /* sections alternees                       */
  --border:         #E7E7E7;
  --text:           #333333;  /* 12,6:1 sur blanc                         */
  --text-muted:     #5F5F5F;  /* 7,0:1 sur blanc                          */
  /* Teinte des continents de world-map.png. Plus utilisee directement en
     CSS depuis que le motif est une image, mais conservee comme reference :
     c est la valeur a reprendre si la carte est regeneree. */
  --tint-map:       #FFF1F4;

  /* Typographie — pile systeme : zero requete reseau, zero cookie tiers.
     Le site d'origine utilise une lineale humaniste. Pour un rendu
     identique, auto-heberger la police officielle dans assets/fonts/
     et l'ajouter en tete de cette pile. */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;

  /* Rythme */
  --container: 1140px;
  --gutter: 1.25rem;
  --section-y: clamp(2.75rem, 6vw, 4.5rem);
  --radius: 2px;
}

/* --------------------------------------------------------------------------
   2. Reinitialisation ciblee
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg, picture { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  margin: 0 0 .6em;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p  { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }

a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red-dark); }

/* Anneau de focus visible et homogene partout (WCAG 2.4.7). */
:focus-visible {
  outline: 3px solid var(--red-dark);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   3. Utilitaires
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Masque visuellement, lu par les lecteurs d'ecran. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  padding: .7rem 1.1rem;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: top .15s ease-in;
}
.skip-link:focus { top: .6rem; color: #fff; }

.section      { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }
.section--soft{ background: var(--bg-soft); }

.lead { font-size: 1.0625rem; }

/* --------------------------------------------------------------------------
   4. Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: .62rem 1.15rem;
  background: var(--red);
  color: #fff;                      /* 4,66:1 — conforme AA texte normal */
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover,
.btn:focus-visible { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }

.btn--ghost { background: transparent; color: var(--red); }
.btn--ghost:hover,
.btn--ghost:focus-visible { background: var(--red); color: #fff; }

/* --------------------------------------------------------------------------
   5. En-tete et navigation
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 84px;
  padding-block: .75rem;
}

.site-logo { display: inline-flex; flex: 0 0 auto; }
.site-logo img { width: 172px; height: auto; }

.nav-toggle {
  display: none;                     /* affiche sous 900px */
  align-items: center;
  gap: .5rem;
  padding: .55rem .8rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.nav-toggle__bars {
  display: block;
  position: relative;
  width: 20px; height: 2px;
  background: currentColor;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px; height: 2px;
  background: currentColor;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after  { top:  6px; }

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

.main-nav a {
  display: block;
  padding: .72rem .95rem;
  color: var(--text-muted);
  font-size: .98rem;
  text-decoration: none;
  border-radius: var(--radius);
}
.main-nav a:hover { color: var(--text); background: var(--border); }

/* Page courante : fond gris clair, comme sur le site d'origine. */
.main-nav a[aria-current="page"] { background: var(--border); color: var(--text); }

/* --------------------------------------------------------------------------
   6. Bannieres
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(260px, 38vw, 420px);
  padding: var(--section-y) var(--gutter);
  text-align: center;
  overflow: hidden;
}

/* Banniere d'accueil : degrade rouge, fidele a l'original (aucune image). */
.hero--home {
  background: linear-gradient(90deg,
    var(--red-hero-from) 0%, var(--red-hero-to) 50%, var(--red-hero-from) 100%);
}

/* Bannieres de pages interieures posees sur une photo.
   Les images sont declarees ici et non dans un attribut style= :
   la CSP interdit les styles en ligne (style-src 'self'). */
.hero--photo { background: #777 center / cover no-repeat; }

/* La premiere declaration sert de repli aux navigateurs qui ignorent
   image-set() ; la seconde sert le WebP quand il est supporte. */
.hero--partnering {
  background-image: url("../img/hero-partnering.jpg");
  background-image: image-set(url("../img/hero-partnering.webp") type("image/webp"),
                              url("../img/hero-partnering.jpg")  type("image/jpeg"));
}
.hero--studies {
  background-image: url("../img/hero-studies.jpg");
  background-image: image-set(url("../img/hero-studies.webp") type("image/webp"),
                              url("../img/hero-studies.jpg")  type("image/jpeg"));
}

/* Motif « carte du monde » rose pale, comme sur le site d origine.
   Le planispere est un derive du domaine public (voir docs/credits-images.md) :
   silhouette de continents en #FFF1F4 sur fond blanc, sans frontieres. */
.bg-map {
  background-color: var(--bg);
  background-image: url("../img/world-map.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Quand l en-tete de page se trouve dans un conteneur qui porte deja la
   carte, il ne doit pas la redessiner : deux fonds en « cover » se
   recadrent independamment et laissent une cassure horizontale a la
   jonction. Sur les pages legales, ou l en-tete est seul, il garde la
   sienne. */
.bg-map .page-head { background-image: none; }

.hero--map {
  background-color: var(--bg);
  background-image: url("../img/world-map.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.hero__title {
  margin: 0;
  padding: .55em .85em;
  color: #fff;
  font-size: clamp(1.75rem, 4.6vw, 3.1rem);
  font-weight: 700;
  line-height: 1.18;
  max-width: 24ch;      /* l original casse le titre sur 2 lignes */
}
.hero--home  .hero__title { background: var(--red-overlay); }
.hero--photo .hero__title,
.hero--map   .hero__title { background: var(--grey-overlay); max-width: none; }

/* Titre simple, sans encadre (page Contact de l'original). */
.page-head {
  background-color: var(--bg);
  background-image: url("../img/world-map.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  padding-block: var(--section-y);
  text-align: center;
}
.page-head h1 { color: var(--red); margin: 0; }

/* --------------------------------------------------------------------------
   7. Carrousels (banniere + temoignages)
   -------------------------------------------------------------------------- */
.carousel { position: relative; }

.carousel__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel__track::-webkit-scrollbar { display: none; }

.carousel__slide { flex: 0 0 100%; scroll-snap-align: center; }

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;        /* cible tactile >= 44px (WCAG 2.5.8) */
  background: rgba(255, 255, 255, .22);
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease;
}
.carousel__btn:hover { background: rgba(255, 255, 255, .4); }
.carousel__btn--prev { left: .5rem; }
.carousel__btn--next { right: .5rem; }

/* Sur fond clair (temoignages), les fleches doivent rester lisibles. */
.carousel--light .carousel__btn { background: rgba(0, 0, 0, .12); color: var(--text); }
.carousel--light .carousel__btn:hover { background: rgba(0, 0, 0, .24); }

/* En colonne etroite, les fleches du carrousel de temoignages se posent sur
   le texte de la citation. On les retire : les puces restent accessibles au
   clavier et le balayage tactile fonctionne via scroll-snap. La banniere, dont
   les fleches ne recouvrent qu une photo, les conserve. */
@media (max-width: 699px) {
  .carousel--light .carousel__btn { display: none; }
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: .6rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}
.carousel__dot {
  width: 15px; height: 15px;
  padding: 0;
  background: transparent;
  border: 2px solid #8A8A8A;
  border-radius: 50%;
  cursor: pointer;
}
.carousel__dot[aria-current="true"] { background: var(--red); border-color: var(--red); }

/* --------------------------------------------------------------------------
   8. Grilles de contenu
   -------------------------------------------------------------------------- */
/* Deux colonnes : corps de texte + encart contact (accueil, a propos). */
.layout-aside {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .layout-aside { grid-template-columns: minmax(0, 2.1fr) minmax(240px, .9fr); }
}

.contact-card h2 { font-size: 1.1rem; margin-bottom: .5rem; }
.contact-card p  { margin-bottom: .55rem; }
.contact-card a  { font-weight: 600; word-break: break-word; }

.card-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  margin: 0; padding: 0;
  list-style: none;
}

/* Variante « sélection de programmes » de la page d accueil.
   Sur le site d origine, les affiches y sont affichees a leur taille
   naturelle (~254 px) et calees a gauche : elles n occupent que la moitie
   gauche du conteneur, contrairement a la page Formations ou les trois
   cartes se partagent toute la largeur. */
.card-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(0, 254px));
  justify-content: start;
  gap: 2rem 3.25rem;
}
.card-grid--compact .card h3 {
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.35;
}

.card { display: flex; flex-direction: column; }
.card__media { margin-bottom: 1rem; background: var(--bg-alt); }
.card__media img { width: 100%; }
.card h3 { margin-bottom: .5rem; }
.card p  { flex: 1 1 auto; }
.card .btn { align-self: flex-start; margin-top: .4rem; }

/* Bandeaux de logos partenaires. */
.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin: 0; padding: 0;
  list-style: none;
}
.logo-row img { max-height: 62px; width: auto; }
.logo-row__label { font-weight: 700; margin: 0; }

/* Citation / temoignage. */
.quote {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
  border: 3px solid var(--red);
  background: #fff;
}
@media (min-width: 700px) {
  .quote { grid-template-columns: 186px minmax(0, 1fr); }
}

/* Le portrait est un <picture> (WebP + repli PNG) occupant la premiere
   colonne de la grille. Il remplit toute la hauteur du bloc, comme sur le
   site d origine.
   Les sources ne font que ~180x180 px : a la largeur de bureau le bloc
   mesure environ 210 px de haut, soit un agrandissement de 1,2 — invisible.
   object-position recadre vers le haut pour garder le visage dans le cadre
   quand le texte rend le bloc plus haut. */
.quote > picture {
  display: block;
  align-self: start;
  height: 100%;
  /* Garde-fou : les portraits sources ne font que ~180 px de haut. En
     largeur bureau le bloc mesure ~210 px, le portrait le remplit avec un
     agrandissement de 1,2 — invisible. Sur un bloc plus haut (texte qui
     se replie davantage) on s arrete a 248 px plutot que de monter a 2x,
     ce qui rendrait le visage flou. Avec des portraits haute definition,
     ce plafond peut etre retire. */
  max-height: 248px;
  min-width: 0;
}
.quote__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

/* En colonne unique, l image ne doit pas etre etiree sur toute la largeur :
   on la laisse a sa taille naturelle, centree. */
@media (max-width: 699px) {
  .quote > picture {
    height: auto;
    width: 186px;
    margin-inline: auto;
    margin-top: 1rem;
  }
  .quote__photo { height: auto; }
}

.quote__body  { padding: 1.45rem 1.65rem; margin: 0; }
/* Interligne plus ouvert et citation rapprochee du texte, comme l original. */
.quote__body p { margin-bottom: .5rem; line-height: 1.68; }
.quote__cite  { display: block; font-size: .92rem; color: var(--text-muted); font-style: normal; }

/* Bloc coordonnees de la page contact. */
.contact-details ul { list-style: none; padding: 0; }
.contact-details li { display: flex; gap: .7rem; margin-bottom: .7rem; }
.contact-details .icon { flex: 0 0 1.2rem; color: var(--red); }

.map-card {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 1.25rem;
}
.map-card p:last-child { margin-bottom: 0; }

.reason-list { list-style: none; padding: 0; }
.reason-list li { margin-bottom: .6rem; }

/* --------------------------------------------------------------------------
   9. Pied de page
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding-block: 1.6rem;
  font-size: .92rem;
}

.lang-switch ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.lang-switch a { font-weight: 600; }
.lang-switch [aria-current="true"] { color: var(--text); text-decoration: none; cursor: default; }

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. Responsive — navigation repliable
   -------------------------------------------------------------------------- */
@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; }

  .site-header__inner { position: relative; flex-wrap: wrap; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    z-index: 20;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .07);
  }
  .main-nav.is-open { display: block; }

  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem var(--gutter) 1rem; }
  .main-nav a  { padding: .85rem .6rem; }
}

/* Sans JavaScript, le menu reste accessible : il s'affiche en permanence. */
.no-js .nav-toggle { display: none; }
.no-js .main-nav   { display: block; position: static; box-shadow: none; }

/* --------------------------------------------------------------------------
   11. Preferences utilisateur et impression
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root { --text-muted: #3A3A3A; --border: #B0B0B0; }
}

@media print {
  .site-header, .site-footer, .carousel__btn, .carousel__dots, .skip-link { display: none; }
  body { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
