/* ================================================================
   1. COULEURS ET VARIABLES GÉNÉRALES
   Modifiez ici les couleurs principales utilisées dans tout le site.
   ================================================================ */
:root {
  --navy: #082542;   /* Bleu foncé des grands bandeaux */
  --blue: #1769e0;   /* Bleu des liens et éléments actifs */
  --red: #ef5842;    /* Rouge des boutons et accents */
  --cyan: #68d9ee;   /* Bleu clair des détails décoratifs */
  --ink: #14243a;    /* Couleur principale du texte */
  --muted: #607087;  /* Couleur des textes secondaires */
  --paper: #f5f7fa;  /* Fond gris très clair des pages */
  --line: #dfe6ef;   /* Bordures claires */
  --white: #fff;     /* Blanc */
}

/* ================================================================
   2. RÉGLAGES DE BASE
   Ces règles s'appliquent à toutes les pages et à tous les éléments.
   ================================================================ */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

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

/* ================================================================
   3. EN-TÊTE, LOGO ET MENU PRINCIPAL
   .topbar : bandeau blanc situé en haut de chaque page.
   .logo   : image du logo Prof-TC.
   .nav    : liens du menu principal.
   ================================================================ */
.topbar {
  min-height: 92px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.logo img {
  width: min(400px, 80vw);
  height: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav > a,
.nav-group > a {
  display: block;
  padding: 24px 11px;
  font-size: 13px;
  font-weight: 800;
}

.nav a:hover,
.nav a.active {
  color: var(--blue);
}

/* ================================================================
   4. SOUS-MENUS DÉROULANTS
   .dropdown reste caché et apparaît au survol ou au clavier.
   ================================================================ */
.nav-group {
  position: relative;
}

.dropdown {
  position: absolute;
  top: 60px;
  right: 0;
  width: 260px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 45px #11294222;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: .2s;
}

.nav-group:hover .dropdown,
.nav-group:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.dropdown a:hover {
  background: #edf5ff;
}

/* ================================================================
   5. GRANDE ZONE D'ACCUEIL
   .hero      : grand bandeau bleu de la page d'accueil.
   .hero-copy : bloc contenant le titre et le texte.
   .orbit     : décoration scientifique située à droite.
   ================================================================ */
.hero {
  min-height: 520px;
  background: var(--navy);
  color: #fff;
  padding: 72px 7vw;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero:after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  border: 1px solid #69dff044;
  border-radius: 50%;
  right: 7vw;
  top: 25px;
  box-shadow: 0 0 0 60px #1974d015, 0 0 0 120px #1974d009;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.kicker {
  font-size: 11px;
  letter-spacing: 2.2px;
  color: var(--cyan);
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(50px, 6vw, 76px);
  line-height: 1;
  margin: 14px 0 25px;
  letter-spacing: -3px;
}

.hero h1 em {
  font-style: normal;
  color: var(--red);
}

.hero p {
  max-width: 660px;
  color: #c6d3e1;
  font-size: 17px;
}

/* Boutons de la page d'accueil et du mode d'emploi */
.button {
  display: inline-block;
  margin: 20px 8px 0 0;
  padding: 13px 18px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

.button.secondary {
  background: transparent;
  border: 1px solid #7996b4;
}

/* Décoration circulaire de l'accueil */
.orbit {
  position: relative;
  z-index: 2;
  width: 290px;
  height: 290px;
  border: 2px solid #68d9ee55;
  border-radius: 50%;
  margin: auto;
  display: grid;
  place-items: center;
  font-size: 70px;
  color: var(--cyan);
  box-shadow: 0 0 45px #68d9ee25;
}

.orbit:before,
.orbit:after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #68d9ee45;
  border-radius: 50%;
  transform: rotate(60deg);
}

.orbit:after {
  transform: rotate(-60deg);
}

/* ================================================================
   6. SECTIONS ET TITRES DE LA PAGE D'ACCUEIL
   .section      : largeur et marges communes.
   .section-head : titre à gauche et texte à droite.
   ================================================================ */
.section {
  max-width: 1220px;
  margin: auto;
  padding: 75px 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 35px;
}

.section-head h2 {
  font-size: 37px;
  letter-spacing: -1.3px;
  margin: 7px 0 0;
}

.section-head > p {
  max-width: 450px;
  color: var(--muted);
}

/* ================================================================
   7. CARTES DES RUBRIQUES DE L'ACCUEIL
   .cards : grille qui contient les cartes.
   .card  : une rubrique (Numérique, Astronomie, etc.).
   ================================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  transition: .2s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px #14324f14;
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: #eaf4ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 24px;
}

.card h3 {
  font-size: 21px;
  margin: 18px 0 8px;
}

.card p {
  font-size: 13px;
  color: var(--muted);
  min-height: 43px;
}

.card a {
  display: inline-block;
  margin-top: 13px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

/* ================================================================
   8. BANDEAU DES PAGES INTERNES
   Utilisé en haut de Numérique, Astronomie et des pages de cours.
   ================================================================ */
.page-hero {
  background: var(--navy);
  color: #fff;
  padding: 55px 7vw;
}

.crumb {
  font-size: 12px;
  color: #93b9d2;
}

.page-hero h1 {
  font-size: 46px;
  margin: 10px 0 8px;
  letter-spacing: -1.5px;
}

.page-hero p {
  color: #c5d2df;
  max-width: 740px;
}

/* ================================================================
   9. MISE EN PAGE DES PAGES INTERNES ET MENU LATÉRAL
   .layout  : colonne du menu + colonne du contenu.
   .sidebar : menu placé à gauche.
   .content : contenu principal placé à droite.
   ================================================================ */
.layout {
  max-width: 1200px;
  margin: auto;
  padding: 52px 24px;
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 35px;
}

.sidebar {
  height: max-content;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
}

.sidebar b {
  display: block;
  padding: 7px 9px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
}

.sidebar a {
  display: block;
  padding: 10px;
  border-radius: 7px;
  font-size: 13px;
}

.sidebar a:hover,
.sidebar a.active {
  background: #eaf4ff;
  color: var(--blue);
  font-weight: 800;
}

.content h2 {
  font-size: 29px;
  margin-top: 0;
}

/* Encadré bleu d'introduction placé avant les ressources */
.intro-box {
  background: #eaf4ff;
  border-left: 4px solid var(--blue);
  padding: 16px 18px;
  border-radius: 8px;
  margin-bottom: 24px;
  color: #38516e;
}

/* ================================================================
   10. CARTES DE RESSOURCES, FICHIERS ET DOSSIERS
   .resource-grid : grille des ressources.
   .resource      : une carte de fichier ou de dossier.
   .file          : petite icône placée à gauche de la carte.
   ================================================================ */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 15px;
}

.resource {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.file {
  width: 45px;
  height: 55px;
  border-radius: 6px;
  background: #edf5ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
}

.resource div {
  display: grid;
}

.resource strong {
  font-size: 14px;
}

.resource small {
  color: var(--muted);
}

.resource i {
  margin-left: auto;
  color: var(--red);
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

/* Encadré affiché lorsqu'une rubrique ne contient pas encore de document */
.empty {
  background: #fff;
  border: 2px dashed #cad6e3;
  border-radius: 12px;
  padding: 38px;
  text-align: center;
  color: var(--muted);
}

.empty h3 {
  color: var(--ink);
  margin-top: 0;
}

/* ================================================================
   11. PIED DE PAGE
   Bandeau bleu foncé situé en bas de chaque page.
   ================================================================ */
.footer {
  background: #061b33;
  color: #aab9ca;
  padding: 25px 6vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.footer img {
  width: 400px;
  filter: invert(1);
  opacity: 0.85;
}

/* ================================================================
   12. PAGE MODE D'EMPLOI
   .help correspond au grand encadré blanc de mode-emploi.html.
   ================================================================ */
.help {
  max-width: 900px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 35px;
}

.help code {
  background: #edf1f6;
  padding: 2px 6px;
  border-radius: 4px;
}

.help li {
  margin: 10px 0;
}

/* ================================================================
   13. AFFICHAGE SUR TABLETTE
   Règles utilisées lorsque la largeur de l'écran est inférieure à 1000 px.
   ================================================================ */
@media (max-width: 1000px) {
  .topbar {
    display: block;
    text-align: center;
  }

  .logo img {
    width: min(390px, 90vw);
    margin: auto;
  }

  .nav {
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav > a,
  .nav-group > a {
    padding: 10px;
  }

  .dropdown {
    top: 35px;
    right: auto;
    left: 0;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .orbit {
    display: none;
  }
}

/* ================================================================
   14. AFFICHAGE SUR TÉLÉPHONE
   Règles utilisées lorsque la largeur de l'écran est inférieure à 680 px.
   ================================================================ */
@media (max-width: 680px) {
  .topbar {
    position: static;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .dropdown {
    display: none;
  }

  .hero {
    min-height: 480px;
    padding: 55px 22px;
  }

  .hero h1 {
    font-size: 48px;
  }

  .section {
    padding: 55px 18px;
  }

  .section-head {
    display: block;
  }

  .section-head h2 {
    font-size: 30px;
  }

  .cards,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 35px 18px;
  }

  .sidebar {
    display: flex;
    overflow: auto;
  }

  .sidebar b {
    display: none;
  }

  .sidebar a {
    white-space: nowrap;
  }

  .page-hero {
    padding: 40px 22px;
  }

  .page-hero h1 {
    font-size: 36px;
  }

  .footer {
    display: block;
    text-align: center;
  }

  .footer img {
    margin-bottom: 15px;
  }
}
