/* =====================================================
   GLOBAL RESPONSIVE
===================================================== */

@media (max-width: 1200px) {
  .container {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* =====================================================
   TABLET
===================================================== */

@media (max-width: 992px) {
  /* HERO */
  .page-hero-title {
    font-size: 2.4rem;
    line-height: 1.2;
  }

  .page-hero-container {
    padding: 50px 30px;
  }

  /* MEMBERS */
  .member-card {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .member-name-block {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding-right: 0;
    padding-bottom: 18px;
  }

  /* FORMATIONS */
  .formations-grid {
    grid-template-columns: 1fr;
  }

  /* CONTACT */
  .contact-layout {
    grid-template-columns: 1fr;
  }

  /* ACTUALITES */
  .actualites-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 768px) {
  /* GLOBAL */
  body {
    overflow-x: hidden;
  }

  section {
    padding-left: 18px;
    padding-right: 18px;
  }

  /* HERO */
  .page-hero-container {
    padding: 36px 20px;
  }

  .page-hero-title {
    font-size: 1.9rem;
    line-height: 1.25;
  }

  /* NAVBAR */
  .navbar {
    padding: 14px 18px;
  }

  .nav-links {
    gap: 12px;
  }

  /* CARDS */
  .member-card,
  .formation-card,
  .actualite-card,
  .actualite-featured-card,
  .contact-info-box,
  .contact-form-box,
  .membership-info-box,
  .membership-form-box,
  .formations-info-box,
  .ce2-box,
  .ejc-box,
  .formations-text-block,
  .membership-box {
    padding: 22px;
    border-radius: 18px;
  }

  /* TEXT */
  .ce2-subtitle {
    font-size: 1.1rem;
  }

  .actualite-title {
    font-size: 1.35rem;
    line-height: 1.3;
  }

  /* ACTUALITES */
  .actualites-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .actualite-card {
    width: 100%;
  }

  .actualite-image {
    height: 220px;
    object-fit: cover;
  }

  /* FORM */
  .form-row {
    grid-template-columns: 1fr;
  }

  .membership-form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  /* SEARCH */
  .formations-search {
    max-width: 100%;
    padding: 14px 16px;
  }

  /* EJC */
  .ejc-links {
    flex-direction: column;
    gap: 14px;
  }
}

/* =====================================================
   SMALL MOBILE
===================================================== */

@media (max-width: 480px) {
  /* HERO */
  .page-hero-title {
    font-size: 1.6rem;
  }

  /* GLOBAL SPACING */
  section {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* ACTUALITES */
  .actualite-image {
    height: 180px;
  }

  .actualite-card {
    padding: 18px;
  }

  /* BUTTONS */
  .btn,
  button {
    width: 100%;
    justify-content: center;
  }

  /* TITLES */
  h2 {
    font-size: 1.7rem;
  }

  h3 {
    font-size: 1.25rem;
  }
}

/* =====================================================
   MOBILE HEADER FIX
===================================================== */

@media (max-width: 768px) {
  .header {
    height: auto;
    padding: 12px 0;
  }

  .header-container {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .logo-image {
    height: 50px;
  }

  .nav {
    width: 100%;
  }

  .nav-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .nav-list a {
    font-size: 0.9rem;
  }

  .header-action {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .header-btn {
    width: auto;
    padding: 12px 18px;
  }

  /* HERO */

  .hero {
    padding-top: 40px;
  }

  .hero-container {
    flex-direction: column;
    padding: 30px 20px;
    min-height: auto;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-text {
    font-size: 1rem;
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-visual {
    min-height: 180px;
    width: 100%;
  }

  .hero-circle-1 {
    width: 140px;
    height: 140px;
    right: 50%;
    transform: translateX(50%);
  }

  .hero-circle-2 {
    width: 80px;
    height: 80px;
    right: 20%;
    top: 120px;
  }

  .hero-circle-3 {
    width: 50px;
    height: 50px;
    right: 70%;
    top: 70px;
  }
}

/* =====================================================
   FINAL MOBILE FIX
===================================================== */

@media (max-width: 768px) {
  /* Prevent horizontal overflow */
  html,
  body {
    overflow-x: hidden;
    width: 100%;
  }

  * {
    max-width: 100%;
  }

  /* CONTAINER */
  .container {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  /* HEADER */
  .header-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .nav-list {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* HERO */
  .hero-container,
  .page-hero-container {
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    width: 100%;
  }

  .hero-content,
  .page-hero-content {
    width: 100%;
    max-width: 100%;
  }

  .hero-title,
  .page-hero-title {
    font-size: 1.8rem;
    line-height: 1.2;
    word-break: break-word;
  }

  .hero-text,
  .page-hero-text {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  /* GRID FIXES */
  .news-grid,
  .actualites-grid,
  .formations-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 20px;
    width: 100%;
  }

  /* CARDS */
  .news-card,
  .actualite-card,
  .formation-card,
  .member-card {
    width: 100%;
    min-width: 0;
  }

  /* IMAGES */
  .news-image,
  .actualite-image,
  img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  /* FOOTER */
  .footer-top {
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }

  .footer-column {
    width: 100%;
  }

  .footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .footer-bottom {
    text-align: center;
  }
}
