/* ============================================================
   1. LAYOUT & TEXTE (Base de la page)
   ============================================================ */
main {    
  gap: 8vw;
  flex-direction: column;
}

p { 
  font-size: clamp(16px, 1.2vw, 1.2vw); 
}

/* ============================================================
   2. COMPOSANTS GUMROAD + Bouton, Formulaire, Drapeaux
   ============================================================ */
#Krita-scripts {
  margin-left: 5%;
  margin-right: 5%;
  display: flex;
  gap: 10vw;
  flex-direction: column;
  flex-wrap: nowrap;
  align-content: center;
  justify-content: center;
  align-items: center;
}
/* images */
.image-container {
  display: flex; 
  flex-wrap: nowrap;
  justify-content: flex-start;
  flex-direction: row;
  align-items: flex-start;
  gap: 3vw;
}

.image-container > figure {
  flex: 0 0 25vw;
  margin: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.image-container img {
  user-select: none;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.titreh2 {
  font-family: var(--font-standard);
  font-size: clamp(11px, 0.8vw, 0.8vw);
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  margin-top: 0;
  margin-bottom: 10px;
  margin-left: 0;
}

.gumsection {
  display: flex;
  max-width: 130ch;
  gap: 2vw;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  align-items: flex-start;
}

/* ============================================================
    (Boutons et Formulaire)
   ============================================================ */
/* Boutoon Gumroad */
.gumroad-button { 
  user-select: none;
  white-space: nowrap !important;
  gap: 1.25vw !important;
  border-radius: clamp(8px, 0.5vw, 0.5vw) !important;
  padding: clamp(12px, 1.2vw, 1.2vw) clamp(40px, 5vw, 5vw) !important;
  font-size: clamp(17px, 1.2vw, 1.2vw) !important;
  line-height: 1.375 !important;
  background-color: rgb(255 144 232) !important;
  color: black !important;
}

/* Formulaire Embed (Structure) */
#gumroad-follow-form-embed {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-template-columns: 1fr !important;
  grid-auto-columns: max-content !important;
  align-items: center !important;
  gap: 2vw !important;
  box-sizing: border-box !important;
}

/* Input du formulaire */
#gumroad-follow-form-embed-input {
  padding: clamp(8px, 1vw, 1vw) clamp(9.5px, 3vw, 3vw) !important;
  font-size: clamp(14px, 1vw, 1vw) !important;
  color: rgb(221, 221, 221) !important;
  background-color: rgb(0, 0, 0) !important;
  border: 0.0625rem solid rgba(221, 221, 221, 0.35) !important;
  border-radius: clamp(3px, 0.2vw, 0.2vw) !important;
}

#gumroad-follow-form-embed-input::placeholder { color: rgba(221, 221, 221, 0.5); }
#gumroad-follow-form-embed-input:focus-within { outline: 0.125rem solid rgb(255, 144, 232); }
#gumroad-follow-form-embed-input:disabled { cursor: not-allowed; opacity: 0.3; }
#gumroad-follow-form-embed-input:read-only { background-color: #242423; }

/* Bouton du formulaire */
#gumroad-follow-form-embed-button {
  user-select: none;
  font-size: clamp(14px, 1vw, 1vw) !important;
  line-height: 1.4 !important;
  color: rgb(221, 221, 221) !important;
  background-color: rgba(221, 221, 221, 0) !important;
  border: 0.0625rem solid rgba(221, 221, 221, 0);
  border-radius: clamp(8px, 0.5vw, 0.5vw) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: transform 0.14s ease-out, background-color 0.14s ease-out !important;
}

#gumroad-follow-form-embed-button:hover {
  color: rgb(0, 0, 0) !important; /* Ajout du !important pour s'assurer que le noir passe au survol */
  background-color: rgb(255, 144, 232) !important;
  transform: translate(-0.25rem, -0.25rem) !important;
  box-shadow: 0.25rem 0.25rem 0rem rgb(0, 0, 0) !important;
}

/* ============================================================
   (SYSTÈME DE TOOLTIP) // (Drapeaux et Informations)
   ============================================================ */
.flag-container {
  display: flex;
  gap: clamp(8px, 1vw, 1vw);
  font-size: clamp(14px, 1.2vw , 1.2vw);
  padding: 1vw;
  justify-content: center;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  flex-direction: row;
  color: var(--text-muted);
  position: relative;
}

.flag {
  user-select: none;
  position: static; 
  cursor: pointer;
}

.flag:hover, 
.flag:focus {
  z-index: 50;
  outline: none;
}

.flag .tooltip {
  cursor: auto;
  user-select: text;
  display: inline; 
  visibility: hidden;
  
  width: max-content; 
  max-width: 36ch; 
  background-color: #1e1e1ee8; 
  text-align: left; 
  border-radius: 6px;
  padding: 10px;
  
  position: absolute; 
  z-index: 9999;
  
  left: 0;
  right: 0;
  margin: 0 auto;
  bottom: 100%;
  margin-bottom: 15px; 

  opacity: 0; 
  transition: opacity 0.3s; 
  box-shadow: 0 0 10px rgba(0,0,0,0.4); 
}

.flag .tooltip p {
  font-size: clamp(12px, 0.9vw , 0.9vw); 
  line-height: 1.3;
}

.flag:hover .tooltip,
.flag:focus .tooltip {
  visibility: visible;
  opacity: 1;
}

.flag:focus {
  outline: none;
}

/* ============================================================
   3. YOUTUBE (Éco-conçu)
   ============================================================ */
.media-section {
  user-select: none;
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  align-content: center;
}

/* La façade remplace l'iframe initiale dans le flux */
.youtube-facade {
  position: relative;
  width: 35vw; /* Ta largeur d'origine */
  max-width: 100%;
  aspect-ratio: 16/9;
  background-color: #000;
  cursor: pointer;
  overflow: hidden;
  border-radius: 8px; /* Un peu d'arrondi */
}

.youtube-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.youtube-facade:hover img {
  opacity: 1;
}

/* Le faux bouton YouTube */
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  background-color: rgba(33, 33, 33, 0.8);
  border-radius: 12px;
  transition: background-color 0.3s ease;
}

.play-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 20px;
  border-color: transparent transparent transparent #fff;
}

.youtube-facade:hover .play-button {
  background-color: #ff0000;
}

/* L'iframe une fois générée */
.youtube-facade iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================================
   4. Gallerie (ligne)
   ============================================================ */
/* Exception de disposition en ligne */
#gal-ligne {
  margin-right: 10%;
  margin-left: 10%;
}

/* ============================================================
   5. RESPONSIVE : DESIGN VERTICAL (Mobile et Tablette)
   ============================================================ */
@media only screen and (max-width: 767px),
only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait),
only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) and (min-resolution: 1.90001dppx),
only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) and (max-resolution: 1.9dppx) and (pointer: fine) {
.youtube-facade {
    width: 90vw; /* On applique tes 90vw à la façade sur mobile */
  }

  /* Ajustement de la grille d'images en colonne */
  .image-container {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
  }
  
  .image-container > figure { width: 100%; }
  .image-container img { width: 100%; max-width: 100%; height: auto; }
  
}

/* ============================================================
   6. RESPONSIVE : EXCEPTION MOBILE PAYSAGE (portion de JS dans script)
   ============================================================ */
@media only screen and (max-width: 950px) and (orientation: landscape) {
  body.is-landscape .image-container {
    justify-content: space-evenly;
    flex-direction: row;
    gap: 2.5vw;
    margin: 0 2.5%;
  }

  body.is-landscape .image-container > figure {
    flex: 0 0 clamp(150px, 25vw, 420px);
  }

  body.is-landscape .gumsection {
    min-width: 0ch;
    max-width: 70ch;
  }

}