/* ============================================================================
   FEUILLE DE STYLE — Site du DUP (Lille)
   ============================================================================
   Ce fichier gère uniquement l'APPARENCE du site (couleurs, espacements,
   mise en page). Il n'y a normalement rien à modifier ici pour changer un
   texte, un lien ou un membre de l'équipe : tout cela se passe dans
   js/data.js. Voir le README pour le détail.
   ============================================================================ */

/* ----------------------------------------------------------------------
   1. VARIABLES — palette de couleurs et réglages globaux
   ---------------------------------------------------------------------- */
:root {
  /* Violet / aubergine (couleur dominante) */
  --violet-900: #2b1934;
  --violet-800: #382142;
  --violet-700: #4a2c5a;
  --violet-600: #5d3a70;
  --violet-500: #7a4f93;
  --violet-100: #f2ecf6;
  --violet-50:  #f9f6fb;

  /* Anthracite / textes */
  --anthracite-900: #1c1a20;
  --anthracite-700: #3a3742;
  --anthracite-400: #74707c;

  /* Vert accent */
  --green-600: #2f8f5b;
  --green-500: #3fa86e;
  --green-100: #e5f5ec;

  /* Neutres */
  --white: #ffffff;
  --bg: #faf9fb;

  /* Effets */
  --shadow-sm: 0 2px 10px rgba(43, 25, 52, 0.06);
  --shadow-md: 0 10px 30px rgba(43, 25, 52, 0.10);
  --shadow-lg: 0 20px 50px rgba(43, 25, 52, 0.16);
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --nav-height: 72px;
}

/* ----------------------------------------------------------------------
   2. RESET / BASE
   ---------------------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--anthracite-900);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

h1, h2, h3 { line-height: 1.2; font-weight: 800; color: var(--violet-900); }

h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; color: var(--anthracite-900); }

/* Décale l'ancrage de scroll sous la nav fixe */
section[id], header[id] { scroll-margin-top: var(--nav-height); }

/* ----------------------------------------------------------------------
   3. NAVIGATION
   ---------------------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  z-index: 100;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.navbar.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.navbar__brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--violet-900);
  letter-spacing: 0.02em;
}

.navbar__brand span {
  color: var(--green-600);
  font-weight: 600;
}

.navbar__menu {
  display: flex;
  gap: clamp(1rem, 2vw, 2.25rem);
}

.navbar__menu a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--anthracite-700);
  position: relative;
  padding: 6px 2px;
  transition: color 0.2s ease;
}

.navbar__menu a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--green-500);
  transition: width 0.25s ease;
  border-radius: var(--radius-full);
}

.navbar__menu a:hover { color: var(--violet-700); }
.navbar__menu a:hover::after { width: 100%; }

.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}

.navbar__toggle span {
  display: block;
  height: 2px;
  background: var(--violet-900);
  border-radius: var(--radius-full);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ----------------------------------------------------------------------
   4. HERO / EN-TÊTE
   ---------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
  background:
    radial-gradient(60% 60% at 15% 10%, rgba(63, 168, 110, 0.12), transparent 60%),
    linear-gradient(155deg, var(--violet-900) 0%, var(--violet-700) 55%, var(--violet-600) 100%);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(45% 45% at 85% 90%, rgba(122, 79, 147, 0.35), transparent 70%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  max-width: 780px;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  letter-spacing: -0.01em;
}

.hero__etablissement {
  margin-top: 0.6rem;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
  color: var(--green-100);
}

.hero__soustitre {
  margin-top: 0.85rem;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.78);
}

.hero__scroll {
  margin-top: 2.25rem;
}

/* ----------------------------------------------------------------------
   5. BOUTONS
   ---------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn--ghost {
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.btn--accent {
  color: var(--white);
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  box-shadow: var(--shadow-sm);
}

.btn--accent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--disabled {
  color: var(--anthracite-400);
  background: var(--violet-50);
  border: 1.5px dashed #d8cfe0;
  cursor: default;
}

/* ----------------------------------------------------------------------
   6. SECTIONS GÉNÉRIQUES
   ---------------------------------------------------------------------- */
.section {
  padding: clamp(3.5rem, 7vw, 6rem) 1.5rem;
}

.section--alt {
  background: var(--violet-50);
}

.section__inner {
  max-width: 1080px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-600);
  margin-bottom: 0.6rem;
}

.lead {
  max-width: 68ch;
  color: var(--anthracite-700);
  font-size: 1.05rem;
  margin-top: 0.75rem;
}

.text-muted { color: var(--anthracite-400); font-size: 0.92rem; }

/* Badges (philosophie pédagogique) */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.75rem;
}

.badges li {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1px solid var(--violet-100);
  box-shadow: var(--shadow-sm);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--violet-700);
}

/* ----------------------------------------------------------------------
   7. GRILLES ET CARTES
   ---------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.25rem;
}

.grid--equipe { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid--ressources { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--aide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(43, 25, 52, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* -- Cartes équipe -- */
.card--membre {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.membre__photo,
.membre__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.membre__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--violet-600), var(--green-500));
}

.membre__nom { font-size: 1.02rem; margin-bottom: 0.2rem; }
.membre__titre {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.membre__attribution {
  font-size: 0.88rem;
  color: var(--anthracite-400);
  margin-bottom: 0.9rem;
  min-height: 1.2em;
}
.membre__email {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--violet-700);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--violet-100);
  transition: background 0.2s ease, color 0.2s ease;
}
.membre__email:hover { background: var(--violet-700); color: var(--white); }

/* -- Cartes ressources -- */
.card--ressource {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card--ressource h3 { color: var(--violet-900); }

.card--ressource p {
  font-size: 0.92rem;
  color: var(--anthracite-700);
  flex-grow: 1;
}

.card--ressource .btn { align-self: flex-start; margin-top: 0.5rem; }

/* -- Codes Moodle -- */
.codes-moodle {
  margin-top: 3.5rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(43, 25, 52, 0.05);
}

.codes-moodle h3 { margin-bottom: 0.3rem; }

.table-wrap { overflow-x: auto; margin-top: 1.25rem; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 560px;
}

.table th, .table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--violet-100);
}

.table th {
  color: var(--violet-900);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table td.code {
  font-weight: 700;
  color: var(--green-600);
}

.table td.code--vide {
  font-style: italic;
  font-weight: 500;
  color: var(--anthracite-400);
}

/* -- Cartes aide pratique -- */
.card--aide h3 { margin-bottom: 0.9rem; }
.card--aide p { color: var(--anthracite-700); font-size: 0.95rem; }

.steps { margin-top: 1.1rem; counter-reset: step; }

.steps li {
  counter-increment: step;
  display: flex;
  gap: 0.85rem;
  padding: 0.55rem 0;
  font-size: 0.95rem;
  color: var(--anthracite-700);
}

.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--violet-100);
  color: var(--violet-700);
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps a {
  color: var(--green-600);
  font-weight: 700;
  border-bottom: 1.5px solid var(--green-100);
}
.steps a:hover { border-color: var(--green-500); }

/* ----------------------------------------------------------------------
   8. PIED DE PAGE
   ---------------------------------------------------------------------- */
.footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--anthracite-900);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

.footer p + p { margin-top: 0.35rem; }

.footer__muted { color: rgba(255, 255, 255, 0.5); font-size: 0.82rem; }

/* ----------------------------------------------------------------------
   9. RESPONSIVE — MENU MOBILE
   ---------------------------------------------------------------------- */
@media (max-width: 780px) {
  .navbar__toggle { display: flex; }

  .navbar__menu {
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--white);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .navbar__menu.is-open { max-height: 320px; }

  .navbar__menu li { width: 100%; }

  .navbar__menu a {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--violet-100);
  }

  .navbar__menu a::after { display: none; }

  .navbar.is-open .navbar__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .navbar.is-open .navbar__toggle span:nth-child(2) { opacity: 0; }
  .navbar.is-open .navbar__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 480px) {
  .grid--equipe { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
