/* =========================================================
   AFROTUNE PREMIUM V4.3
   Responsive / fluid layout
   ========================================================= */

/* ---------- Protections générales ---------- */

#afrotune-home-premium,
#afrotune-home-premium * {
  box-sizing: border-box;
}

#afrotune-home-premium {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

#afrotune-home-premium img,
#afrotune-home-premium video {
  max-width: 100%;
}

#afrotune-home-premium img {
  height: auto;
}

/* ---------- Sections ---------- */

#afrotune-home-premium .afh-section {
  width: 100%;
  min-width: 0;
}

#afrotune-home-premium .afh-section-header {
  min-width: 0;
}

#afrotune-home-premium .afh-section-header > * {
  min-width: 0;
}

/* ---------- Hero ---------- */

#afrotune-home-premium .afh-hero {
  width: 100%;
  min-width: 0;
}

#afrotune-home-premium .afh-hero-content {
  width: min(690px, 100%);
  max-width: 100%;
}

#afrotune-home-premium .afh-hero h1 {
  overflow-wrap: anywhere;
}

/* ---------- Cartes ---------- */

#afrotune-home-premium .afh-card,
#afrotune-home-premium .afh-track-card,
#afrotune-home-premium .afh-playlist-card,
#afrotune-home-premium .afh-artist-card {
  min-width: 0;
  max-width: 100%;
}

/* ---------- Contrôles tactiles ---------- */

#afrotune-home-premium button,
#afrotune-home-premium a {
  touch-action: manipulation;
}

#afrotune-home-premium button {
  min-height: 40px;
}

/* =========================================================
   GRANDS ECRANS
   ========================================================= */

@media (min-width: 1600px) {

  #afrotune-home-premium {
    max-width: 1540px;
    margin-inline: auto;
  }

  #afrotune-home-premium .afh-hero {
    min-height: 460px;
  }
}

/* =========================================================
   DESKTOP
   ========================================================= */

@media (min-width: 1200px) and (max-width: 1599px) {

  #afrotune-home-premium .afh-hero {
    min-height: 420px;
  }
}

/* =========================================================
   PETITS ORDINATEURS / GRANDES TABLETTES
   ========================================================= */

@media (min-width: 901px) and (max-width: 1199px) {

  #afrotune-home-premium .afh-hero {
    min-height: 390px;
    border-radius: 22px;
  }

  #afrotune-home-premium .afh-hero-content {
    width: min(620px, 88%);
    padding: 34px;
  }

  #afrotune-home-premium .afh-section {
    margin-top: 32px;
  }
}

/* =========================================================
   TABLETTES
   ========================================================= */

@media (min-width: 641px) and (max-width: 900px) {

  #afrotune-home-premium .afh-hero {
    min-height: 360px;
    border-radius: 20px;
  }

  #afrotune-home-premium .afh-hero-content {
    width: min(580px, 92%);
    padding: 30px 26px;
  }

  #afrotune-home-premium .afh-section {
    margin-top: 28px;
  }

  #afrotune-home-premium .afh-section-header {
    gap: 14px;
  }

  #afrotune-home-premium .afh-artists {
    grid-auto-columns: minmax(135px, 165px);
  }
}

/* =========================================================
   SMARTPHONES
   ========================================================= */

@media (max-width: 640px) {

  #afrotune-home-premium {
    padding-bottom: 22px;
  }

  #afrotune-home-premium .afh-hero {
    min-height: 350px;
    border-radius: 18px;
  }

  #afrotune-home-premium .afh-hero-content {
    width: 100%;
    padding: 24px 18px;
  }

  #afrotune-home-premium .afh-hero h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
    line-height: 1;
  }

  #afrotune-home-premium .afh-hero-text {
    line-height: 1.5;
    margin-bottom: 18px;
  }

  #afrotune-home-premium .afh-section {
    margin-top: 24px;
  }

  #afrotune-home-premium .afh-section-header {
    gap: 10px;
  }

  #afrotune-home-premium .afh-card,
  #afrotune-home-premium .afh-track-card,
  #afrotune-home-premium .afh-playlist-card {
    border-radius: 16px;
  }

  #afrotune-home-premium .afh-artists {
    grid-auto-columns: minmax(118px, 36vw);
  }

  #afrotune-home-premium .afh-play {
    opacity: 1;
    transform: none;
  }

  #afrotune-home-premium .afh-pro {
    padding: 22px 18px;
    border-radius: 18px;
  }

  #afrotune-home-premium .afh-modal-head {
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 10px;
  }

  #afrotune-home-premium .afh-modal-head img {
    width: 76px;
    height: 76px;
  }

  #afrotune-home-premium .afh-modal-track {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 9px;
  }
}

/* =========================================================
   TRES PETITS SMARTPHONES
   ========================================================= */

@media (max-width: 390px) {

  #afrotune-home-premium .afh-hero {
    min-height: 330px;
    border-radius: 15px;
  }

  #afrotune-home-premium .afh-hero-content {
    padding: 21px 15px;
  }

  #afrotune-home-premium .afh-hero h1 {
    font-size: clamp(1.85rem, 11vw, 2.65rem);
  }

  #afrotune-home-premium .afh-section-header h2 {
    font-size: 1.12rem;
  }

  #afrotune-home-premium .afh-artists {
    grid-auto-columns: minmax(108px, 42vw);
  }

  #afrotune-home-premium .afh-pro {
    padding: 19px 15px;
  }
}

/* =========================================================
   ACCESSIBILITE / REDUCTION DES ANIMATIONS
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  #afrotune-home-premium *,
  #afrotune-home-premium *::before,
  #afrotune-home-premium *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* =========================================================
   V4.3.1 - CANDIDATURE ARTISTE / PRODUCTEUR SUR MOBILE
   Permet de faire défiler toute la modale et d'atteindre
   le bouton "Envoyer ma candidature".
   ========================================================= */

@media (max-width: 700px) {

  #overlay-artiste-form {
    box-sizing: border-box;
    align-items: flex-start;
    justify-content: center;

    width: 100%;
    height: 100dvh;
    max-height: 100dvh;

    padding:
      max(12px, env(safe-area-inset-top))
      10px
      max(12px, env(safe-area-inset-bottom));

    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #overlay-artiste-form .modale {
    box-sizing: border-box;

    width: min(100%, 560px);
    max-width: 100%;

    height: auto;
    max-height: none;

    margin: auto 0;

    overflow: visible;
  }

  #overlay-artiste-form form,
  #overlay-artiste-form .champ {
    min-width: 0;
  }

  #overlay-artiste-form input[type="text"],
  #overlay-artiste-form input[type="email"],
  #overlay-artiste-form textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    font-size: 16px;
  }

  #overlay-artiste-form textarea {
    min-height: 110px;
    resize: vertical;
  }

  #overlay-artiste-form button[type="submit"] {
    width: 100%;
    min-height: 48px;

    margin-top: 6px;
    margin-bottom:
      max(8px, env(safe-area-inset-bottom));

    touch-action: manipulation;
  }
}

/* Fallback pour navigateurs sans unité dvh */
@supports not (height: 100dvh) {

  @media (max-width: 700px) {

    #overlay-artiste-form {
      height: 100vh;
      max-height: 100vh;
    }
  }
}


/* =========================================================
   V4.3.2 - FIX FINAL CANDIDATURE MOBILE
   - modale au-dessus du lecteur
   - radios Artiste/Producteur correctement dimensionnés
   - formulaire entièrement défilable
   ========================================================= */

#overlay-artiste-form {
  z-index: 1000;
}

#overlay-artiste-form input[type="radio"] {
  width: auto !important;
  min-width: 18px;
  height: 18px;
  padding: 0 !important;
  margin: 0;
  flex: 0 0 18px;
  accent-color: #e0163c;
}

#overlay-artiste-form .champ label:has(input[type="radio"]) {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: 100%;
  max-width: 100%;
  margin-top: 10px !important;
  margin-bottom: 0 !important;
}

@media (max-width: 700px) {

  #overlay-artiste-form {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100dvh;
    max-height: 100dvh;

    padding:
      max(10px, env(safe-area-inset-top))
      10px
      max(18px, env(safe-area-inset-bottom));

    align-items: flex-start;
    justify-content: center;

    overflow-x: hidden;
    overflow-y: auto;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #overlay-artiste-form .modale {
    width: 100%;
    max-width: 520px;

    height: auto;
    max-height: none;

    margin: 0 auto 24px;

    padding: 24px 18px 28px;

    overflow: visible;
  }

  #overlay-artiste-form .modale h2 {
    padding-right: 42px;
  }

  #overlay-artiste-form .champ {
    width: 100%;
    min-width: 0;
  }

  #overlay-artiste-form .champ > label:first-child {
    max-width: 100%;
  }

  #overlay-artiste-form input[type="text"],
  #overlay-artiste-form input[type="email"],
  #overlay-artiste-form textarea {
    display: block;

    width: 100% !important;
    max-width: 100%;

    font-size: 16px;
  }

  #overlay-artiste-form textarea {
    min-height: 105px;
  }

  #overlay-artiste-form button[type="submit"] {
    display: block;

    width: 100% !important;
    min-height: 50px;

    margin: 8px 0 16px;

    position: relative;
    z-index: 2;
  }
}

@supports not (height: 100dvh) {

  @media (max-width: 700px) {

    #overlay-artiste-form {
      height: 100vh;
      max-height: 100vh;
    }
  }
}
