.hg-hero-fiche-titre {
  background-color: #f4f9ff;
  padding: 35px 20px 0px 20px;
}

/* Classes WordPress pour alignfull */
.wp-block-acf-hg-hero-fiche-titre.alignfull .hg-hero-fiche-titre {
  padding-left: 20px;
  padding-right: 20px;
}

.hg-hero-fiche-titre__container {
  max-width: var(--wp--style--global--content-size, 1400px);
  margin: 20px auto 0;
  display: flex;
  gap: 4%;
  align-items: flex-start;
}

/* Colonne gauche 45% */
.hg-hero-fiche-titre__left {
  flex: 0 0 43%;
}

/* Colonne droite 55% */
.hg-hero-fiche-titre__right {
  flex: 0 0 53%;
  z-index: 30;
}

/* Tags Type et Genre */
.hg-hero-fiche-titre__tags {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  max-width: var(--wp--style--global--content-size, 1400px);
  margin: 0 auto;
}

.hg-hero-fiche-titre__tag {
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  width: fit-content;
}

.hg-hero-fiche-titre__tag--type {
  background-color: #ffcd00;
  color: #000;
}

.hg-hero-fiche-titre__tag--genre {
  background-color: #023e72;
  color: #fff;
}

/* Titre */
.hg-hero-fiche-titre__title {
  font-size: 48px;
  margin-top: 0;
  color: #000;
  line-height: 1.1;
  margin-bottom: 0;
}

.hg-hero-fiche-titre__prod_year {
  font-size: 14px;
  color: #333;
  margin: 0px 0 20px 0;
}

/* Synopsis */
.hg-hero-fiche-titre__synopsis {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 40px;
  color: #333;
}

/* Container des informations */
.hg-hero-fiche-titre__info-container {
  position: relative;
}

/* Overlay avec fond coloré */
.hg-hero-fiche-titre__info-overlay {
  top: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
}

.hg-hero-fiche-titre__info-overlay-style {
  position: absolute;
  background-color: rgba(121, 115, 115, 0.06);
  width: 100vw;
  height: 100%;
  border-radius: 16px;
}
.hg-hero-fiche-titre__info-overlay-style[data-connected="true"] {
  border-bottom-left-radius: 0px;
}

.hg-hero-fiche-titre__info-overlay-style[data-connected="false"] {
  border-bottom-left-radius: 16px;
}

/* Contenu des informations */
.hg-hero-fiche-titre__info-content {
  max-width: 600px;
  margin-left: 20px;
  padding: 20px 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 40px;
}

/* Item d'information */
.hg-hero-fiche-titre__info-item {
  display: flex;
  flex-direction: column;
}

.hg-hero-fiche-titre__info-item--full {
  grid-column: 1 / -1; /* Prend toute la largeur */
}

/* Label */
.hg-hero-fiche-titre__info-label {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Valeur */
.hg-hero-fiche-titre__info-value {
  font-size: 16px;
  color: #000;
  line-height: 1.4;
}

/* Lecteur vidéo */
.hg-hero-fiche-titre__video {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: #000;
  border-radius: 16px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

/* Conteneur responsive pour iframe Vimeo */
.hg-hero-fiche-titre__video-container {
  position: relative;
  width: 100%;
  height: 100%;
  padding-bottom: 56.25%; /* Ratio 16:9 */
}

.hg-hero-fiche-titre__video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

/* Placeholder quand pas de vidéo */
.hg-hero-fiche-titre__video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: #1a1a1a;
  color: #666;
  font-size: 16px;
  border-radius: 16px;
}

/* Boutons */
.hg-hero-fiche-titre__buttons {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* Styles des boutons */
.hg-hero-fiche-titre__button {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  width: fit-content;
}

/* Bouton Exporter la fiche - Bleu avec texte blanc */
.hg-hero-fiche-titre__button--export {
  background-color: #023e72;
  color: white;
}

.hg-hero-fiche-titre__button--export:hover {
  background-color: #034a88;
}

/* Bouton Autre document - Blanc avec bordure bleue */
.hg-hero-fiche-titre__button--document {
  background-color: white;
  color: #023e72;
  border: 2px solid #023e72;
}

.hg-hero-fiche-titre__button--document:hover {
  background-color: #f8f9ff;
}

/* Bouton Plus d'information - Jaune avec texte noir */
.hg-hero-fiche-titre__button--info {
  background-color: #ffcd00;
  color: #1e1e1e;
}

.hg-hero-fiche-titre__button--info:hover {
  background-color: #e6b800;
}

/* SVG dans les boutons */
.hg-hero-fiche-titre__button svg {
  flex-shrink: 0;
}

/* Éléments mobiles cachés par défaut */
.hg-hero-fiche-titre__video-mobile,
.hg-hero-fiche-titre__buttons-mobile {
  display: none;
}

/* Media Queries */
@media (max-width: 1024px) {
  .hg-hero-fiche-titre__info-content {
    width: 100%;
  }
  .hg-hero-fiche-titre {
    padding: 40px 20px;
  }
  .hg-hero-fiche-titre__container {
    flex-direction: column;
    gap: 30px;
  }

  .hg-hero-fiche-titre__left,
  .hg-hero-fiche-titre__right {
    flex: 1;
  }

  .hg-hero-fiche-titre__right {
    display: none;
  }

  .hg-hero-fiche-titre__video-mobile {
    display: block;
    order: 1;
    margin-bottom: 20px;
  }

  .hg-hero-fiche-titre__buttons-mobile {
    display: block;
    order: 2;
    margin-bottom: 20px;
  }
  .hg-hero-fiche-titre__video {
    margin-bottom: 0px;
  }

  /* Boutons en colonne dès 1024px */
  .hg-hero-fiche-titre__buttons {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .hg-hero-fiche-titre__button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .hg-hero-fiche-titre__title {
    font-size: 36px;
  }

  .hg-hero-fiche-titre__synopsis {
    font-size: 16px;
    margin-bottom: 30px;
  }

  /* Réorganisation mobile avec flexbox order */
  .hg-hero-fiche-titre__left {
    display: flex;
    flex-direction: column;
  }

  .hg-hero-fiche-titre__info-container {
    order: 3;
    min-height: auto;
  }

  .hg-hero-fiche-titre__right {
    display: none; /* Cache la colonne droite originale en mobile */
  }

  .hg-hero-fiche-titre__info-content {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-left: 0;
    padding: 20px;
    background-color: rgba(121, 115, 115, 0.06);
    border-radius: 16px;
  }

  .hg-hero-fiche-titre__info-overlay {
    position: static;
    width: 100%;
    margin-left: 0;
    padding: 0px;
  }
  .hg-hero-fiche-titre__info-overlay-style {
    display: none;
  }

  .hg-hero-fiche-titre__tags {
    flex-wrap: wrap;
    gap: 10px;
  }

  .hg-hero-fiche-titre__tag {
    padding: 4px 10px;
    font-size: 10px;
  }
}

/* ======================================== */
/* Container PDF - Dimensions A4 optimisées */
/* ======================================== */
/* Le format A4 = 210mm × 297mm */
.hg-hero-fiche-titre__pdf-container {
  width: 211mm; /* 210mm + 1mm de marge */
  min-height: 286mm; /* 297mm - 1mm de marge */
  background-color: white;
  padding: 0 5mm;
  margin-left: -0.5mm;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  color: #333;
  line-height: 1.4;
  overflow: visible;
  page-break-inside: avoid;
  position: relative;
  -webkit-print-color-adjust: exact;
  color-adjust: exact;
}

/* En-tête rectangulaire pleine largeur */
.hg-hero-fiche-titre__pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5mm;
  padding: 8mm 10mm;
  background-color: #023e72;
  color: white;
  border-radius: 10px;
}

.hg-hero-fiche-titre__pdf-logo {
  flex: 0 0 auto;
}

.hg-hero-fiche-titre__pdf-logo-img {
  max-height: 15mm;
  max-width: 60mm;
  object-fit: contain;
}

.hg-hero-fiche-titre__pdf-logo-placeholder {
  font-size: 20px;
  font-weight: bold;
  color: white;
  letter-spacing: 2px;
}

.hg-hero-fiche-titre__pdf-contact-info {
  display: flex;
  flex-direction: column;
  gap: 3mm;
  align-items: flex-end;
}

.hg-hero-fiche-titre__pdf-contact-item {
  display: flex;
  align-items: center;
  gap: 2mm;
  font-size: 11px;
  color: white;
}

.hg-hero-fiche-titre__pdf-contact-icon {
  width: 4mm;
  height: 4mm;
  flex-shrink: 0;
  stroke: white;
}

/* Section principale */
.hg-hero-fiche-titre__pdf-main {
  flex: 1;
}

/* Tags PDF */
.hg-hero-fiche-titre__pdf-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 8mm;
  flex-wrap: wrap;
}

.hg-hero-fiche-titre__pdf-tag {
  padding: 4px 8px 2px 8px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.hg-hero-fiche-titre__pdf-tag--type {
  background-color: #ffcd00;
  color: #000;
}

.hg-hero-fiche-titre__pdf-tag--genre {
  background-color: #023e72;
  color: #fff;
}

/* Titre PDF */
.hg-hero-fiche-titre__pdf-title {
  font-size: 32px;
  color: #023e72;
  line-height: 1.2;
  font-weight: bold;
  margin: 0 0 0 0;
}

.hg-hero-fiche-titre__pdf-prod_year {
  font-size: 12px;
  color: #333;
  margin: 0 0 5mm 0;
}

/* Layout 2 colonnes pour synopsis + image */
.hg-hero-fiche-titre__pdf-content {
  display: flex;
  gap: 15mm;
  height: auto;
}

.hg-hero-fiche-titre__pdf-left {
  flex: 1;
  max-width: 55%;
}

.hg-hero-fiche-titre__pdf-right {
  flex: 0 0 45%;
  max-width: 45%;
}

.hg-hero-fiche-titre__pdf-full-width-sections {
  width: 100%;
  margin-top: 6mm;
}

.hg-hero-fiche-titre__pdf-section-title {
  font-size: 16px;
  color: #023e72;
  margin: 8mm 0 6mm 0;
  font-weight: bold;
  text-transform: none;
  letter-spacing: 0.3px;
}

.hg-hero-fiche-titre__pdf-synopsis {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 2mm 0;
  color: #333;
  text-align: justify;
}

/* Grille d'informations en 3 colonnes : Label au-dessus, valeur en-dessous */
.hg-hero-fiche-titre__pdf-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4mm;
  margin-bottom: 6mm; /* Augmenté pour plus d'espace entre sections */
  align-items: start;
}

.hg-hero-fiche-titre__pdf-info-item {
  display: flex;
  flex-direction: column; /* Label au-dessus, valeur en-dessous */
  gap: 0.5mm; /* Réduit de 1mm à 0.5mm */
  font-size: 11px;
  line-height: 1.3; /* Réduit de 1.4 à 1.3 */
  page-break-inside: avoid;
}

.hg-hero-fiche-titre__pdf-info-label {
  font-weight: 600;
  color: #023e72;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0;
}

.hg-hero-fiche-titre__pdf-info-value {
  color: #333;
  font-size: 11px;
  line-height: 1.3;
  word-break: break-word;
}

/* Vidéo/Thumbnail */
.hg-hero-fiche-titre__pdf-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hg-hero-fiche-titre__pdf-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hg-hero-fiche-titre__pdf-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #023e72;
  font-weight: bold;
}

.hg-hero-fiche-titre__pdf-video-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: #1a1a1a;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 8px;
  text-align: center;
}

/* Pied de page */
.hg-hero-fiche-titre__pdf-footer {
  position: absolute;
  bottom: 15mm;
  left: 15mm;
  right: 15mm;
  border-top: 1px solid #ddd;
  padding-top: 5mm;
}

.hg-hero-fiche-titre__pdf-contact {
  text-align: center;
}

.hg-hero-fiche-titre__pdf-contact p {
  font-size: 10px;
  color: #666;
  margin: 0;
}

/* Styles pour l'affichage temporaire lors de la génération PDF */
.hg-hero-fiche-titre__pdf-container.pdf-generating {
  display: block;
  position: fixed;
  top: -9999px;
  left: -9999px;
  z-index: -1;
}

/* Amélioration du rendu des liens pour PDF - Layout 3 colonnes */
.hg-hero-fiche-titre__pdf-info-value a {
  color: #0066cc !important;
  text-decoration: underline !important;
  word-break: break-all;
  font-size: 10px !important;
  line-height: 1.3 !important;
  display: block;
}

/* Grille des diffuseurs avec logos */
.hg-hero-fiche-titre__pdf-diffuseurs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8mm;
  justify-content: flex-start;
  align-items: center;
}

.hg-hero-fiche-titre__pdf-diffuseur-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40mm;
  max-width: 50mm;
  height: 15mm;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2mm;
  box-sizing: border-box;
}

.hg-hero-fiche-titre__pdf-diffuseur-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.hg-hero-fiche-titre__pdf-diffuseur-placeholder {
  font-size: 8px;
  color: #666;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}
