/* ==========================================================================
   al-moualime.com — Feuille de style optimisée (mobile + desktop)
   ========================================================================== */

/* Hauteur pleine page */
html,
body {
  height: 100%;
}

/* Reset marges et padding */
body {
  margin: 0 !important;
  padding: 0 !important;
}

/* Navbar / bandeau */
#header-band,
.navbar {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Variables marque */
:root {
  --brand: #0b6ea9;
  --brand-2: #0d8bd1;
}

/* Bandeaux haut/bas */
#header-band,
#footer-band {
  background-image: url("../img/band.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 3rem;
  color: #fff;
}

/* Hero : léger dégradé fluide, rapide au rendu */
.hero {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(13, 139, 209, .25), transparent),
    radial-gradient(1200px 500px at 110% 110%, rgba(11, 110, 169, .25), transparent);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}

/* Cartes de cours : état de base */
.card.course-card {
  border: 1px solid var(--bs-border-color);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  outline: 0;
}

/* Survol souris (fusion des deux règles hover) */
.card.course-card:hover {
  border-color: var(--brand, #0d6efd);
  box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .08), 0 2px 12px rgba(13, 110, 253, .15);
  transform: translateY(-2px);
}

/* Focus clavier sur la carte OU sur un élément interne (lien/bouton) */
.card.course-card:focus,
.card.course-card:focus-visible,
.card.course-card:focus-within {
  border-color: var(--brand, #0d6efd) !important;
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
  outline: 0;
}

/* Contenu des cartes (pousse le bouton en bas) */
.course-card .card-body {
  display: flex;
  flex-direction: column;
  text-align: start;
  /* texte à gauche */
}

.course-card .btn-wrap {
  margin-top: auto;
  text-align: center;
}

/* Badge constant (rayures jaunes) */
.badge-const {
  background: repeating-linear-gradient(45deg,
      #ffc107, #ffc107 8px,
      #ffcf3f 8px, #ffcf3f 16px);
  color: #212529;
  border: 1px solid rgba(255, 193, 7, .35);
}

/* ----- IMAGES DE CARTE ----- */
/* Version optimisée pour stabilité et rendu mobile */
.card-illus {
  display: block;
  margin-inline: auto;
  /* centre horizontalement */

  /* largeur maîtrisée et cohérente */
  height: auto;
  aspect-ratio: 1 / 1;
  /* carré stable */
  object-fit: contain;
  /* pas de rognage */
  object-position: top center;
  border-radius: .75rem;
  background-color: #e9f4ff;
  /* fond doux bleu clair */
  padding: .5rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}

.card-illus {
  width: 160px;
}

@media (min-width: 992px) {
  .card-illus {
    width: 180px;
  }
}


/* Sélection active visuelle (si tu ajoutes .active côté HTML) */
.course-card.active {
  outline: 3px solid var(--brand-2);
  outline-offset: 2px;
  box-shadow: 0 .75rem 1.5rem rgba(13, 139, 209, .18);
  transform: translateY(-3px);
}

.course-card.active .btn.btn-primary {
  filter: saturate(1.15);
}

/* Footer : correction couleur soulignement */
footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(13, 139, 209, .4);
}

/* Médias (images, svg) : comportement fluide */
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Divers utilitaires */
.nowrap {
  white-space: nowrap;
}

html {
  scroll-behavior: smooth;
}

.anchor-offset,
:target {
  scroll-margin-top: 4rem;
}

/* Accessibilité : réduit animations si utilisateur préfère */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsif fin : adaptation petites tailles */
@media (max-width: 576px) {
  .card.course-card:hover {
    transform: none;
    box-shadow: 0 .25rem .5rem rgba(0, 0, 0, .05);
  }

  #header-band,
  #footer-band {
    height: 2.5rem;
  }

  .card-illus {
    padding: .35rem;
    border-radius: .75rem;
  }
}

/* Taille réduite du sous-titre du brand */
.brand-sub {
  font-size: .85rem;
  line-height: 1.1;
  opacity: .85;
}

/* Boutons de taille uniforme pour toutes les cartes */
.uniform-btn {
  display: inline-block;
  width: 10rem;
  /* largeur identique */
  max-width: 100%;
  text-align: center;
  padding: .5rem 0;
  /* hauteur uniforme */
  font-weight: 500;
  border-radius: .5rem;
}

/* État désactivé harmonisé */
.uniform-btn.disabled,
.uniform-btn[aria-disabled="true"] {
  opacity: .75;
  cursor: not-allowed;
}