/*
 Theme Name:   Divi Child – Pio Long
 Description:  Thème enfant de Divi pour piolong.com. Toutes les personnalisations (CSS, PHP, templates) se font ici, jamais dans le thème parent.
 Template:     Divi
 Version:      1.1.0
 Text Domain:  divi-child
*/

/* ==========================================================================
   Styles personnalisés
   Divi charge ce fichier automatiquement après celui du thème parent.
   ========================================================================== */

/* ==========================================================================
   Page « Accueil v2 »
   Les textes, polices, couleurs et espacements se règlent dans les modules
   Divi. Ce fichier ne porte que la mise en page que Divi ne sait pas faire
   seul. Toutes les classes commencent par « pl2- » : elles n'ont aucun effet
   sur les autres pages.
   ========================================================================== */

.pl2 strong { font-weight: 600; color: #2e2628; }
.pl2 h1, .pl2 h2, .pl2 h3 { text-wrap: balance; }
.pl2 ::selection { background: #7F1016; color: #f4f3ee; }
.pl2 a:focus-visible, .pl2 button:focus-visible, .pl2-album:focus-visible { outline: 2px solid #7F1016; outline-offset: 4px; }

/* ----- En-tête : texte à gauche, photo des producteurs à droite ----- */
.pl2-entete-rangee {
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  min-height: calc(100vh - 43px);
  min-height: calc(100svh - 43px);
}
.pl2-entete-rangee::after { display: none; }
.pl2-entete-rangee > .et_pb_column { float: none; width: auto !important; margin: 0 !important; }

.pl2-entete-texte { display: flex; flex-wrap: wrap; align-content: center; align-items: center; }
.pl2-entete-texte > .et_pb_module { flex: 0 0 100%; }
.pl2-entete-texte > .et_pb_button_module_wrapper { flex: 0 0 auto; margin-right: 28px; }
.pl2-entete-texte > .pl2-logo { position: absolute; top: 36px; }
.pl2-logo img { mix-blend-mode: multiply; }
.pl2-entete h1 { padding-bottom: 0; letter-spacing: 0.01em; }
.pl2-entete h1 span {
  display: block;
  margin-top: 0.75em;
  font-size: max(0.36em, 14px);
  line-height: 1.5;
  letter-spacing: 0.1em;
  color: #2e2628;
}

.pl2-entete-rangee > .pl2-entete-photo {
  align-self: center;
  justify-self: start;
  /* Divi force la marge droite de la dernière colonne à 0 : la marge se fait par la largeur */
  width: calc(100% - 24px) !important;
  height: calc(100% - 48px);
  /* Le cadre ne devient jamais trop étroit : les deux restent à l'image */
  max-height: calc((55vw - 24px) * 1.22);
  margin: 24px 0 !important;
  overflow: hidden;
  background: #34421f;
}
.pl2-entete-photo .et_pb_image { position: absolute; inset: 0; margin: 0 !important; }
.pl2-entete-photo .et_pb_image_wrap, .pl2-entete-photo .et_pb_image img { display: block; width: 100%; height: 100%; }
.pl2-entete-photo .et_pb_image img { object-fit: cover; object-position: 42% 50%; }
.pl2-entete-photo .pl2-legende {
  position: absolute; inset: auto 0 0 0;
  margin: 0 !important;
  padding: 70px 26px 20px;
  background: linear-gradient(to top, rgba(26, 16, 12, .84), rgba(26, 16, 12, .5) 45%, rgba(26, 16, 12, 0));
  letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: no-preference) {
  .pl2-entete-photo { animation: pl2-lever 1.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .pl2-entete-photo .et_pb_image img { animation: pl2-poser 1.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
}
@keyframes pl2-lever { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes pl2-poser { from { transform: scale(1.09); } to { transform: none; } }

/* ----- Récit : deux tirages photo qui se chevauchent ----- */
.pl2-tirages { padding-bottom: 9%; }
.pl2-tirages .pl2-tirage-petit { position: absolute; right: 5%; bottom: 0; width: 42%; margin: 0 !important; }
.pl2-inverse .pl2-tirages .pl2-tirage-petit { right: auto; left: 5%; }

/* ----- Albums : les photos défilent comme des tirages sur un fil ----- */
.pl2-album-titre > .et_pb_column { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.pl2-album-titre h3 { padding-bottom: 0; }
.pl2-album-nav { display: flex; gap: 10px; flex: none; }
.pl2-album-nav button {
  display: grid; place-items: center;
  width: 46px; height: 46px; padding: 0;
  border: 1px solid #7F1016; border-radius: 50%;
  background: transparent; color: #7F1016;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, opacity .25s ease;
}
.pl2-album-nav button:hover:not(:disabled) { background: #7F1016; color: #fff; }
.pl2-album-nav button:disabled { opacity: .3; cursor: default; }
.pl2-album-nav svg { width: 18px; height: 10px; }
.pl2-album-nav button:first-child svg { transform: scaleX(-1); }

.pl2-album {
  --pl2-bord: max(5.5%, calc((100% - 1104px) / 2));
  display: flex; gap: 14px;
  overflow-x: auto;
  padding: 2px var(--pl2-bord) 20px !important;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--pl2-bord);
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 16, 22, .55) transparent;
}
.pl2-album > .et_pb_image {
  flex: none;
  width: auto; max-width: none;
  height: clamp(210px, 25vw, 350px);
  margin: 0 !important;
  scroll-snap-align: start;
  background: #d9d5c8;
}
.pl2-album .et_pb_image a, .pl2-album .et_pb_image_wrap { display: block; height: 100%; }
.pl2-album .et_pb_image img { display: block; height: 100%; width: auto; max-width: none; }

/* ----- Citation ----- */
.pl2-citation { overflow: hidden; }
.pl2-citation .et_pb_row, .pl2-citation .et_pb_column { position: static; }
.pl2-citation .et_pb_text { position: relative; z-index: 1; }
.pl2-citation ::selection { background: #f4f3ee; color: #7F1016; }
.pl2-citation .pl2-ours {
  position: absolute; right: -1%; bottom: -22%;
  width: min(40vw, 470px);
  margin: 0 !important;
  filter: invert(1); mix-blend-mode: screen; opacity: .2;
  pointer-events: none;
}

/* ----- Vins ----- */
.pl2-bas { align-items: flex-end; }
.pl2-bas h3 { padding-bottom: 0; }
.pl2-carte > .et_pb_column { display: flex; flex-direction: column; scroll-margin-top: 28px; }
.pl2-carte .et_pb_button_module_wrapper { margin-top: auto; }
.pl2-carte .et_pb_image_wrap { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #d9d5c8; }
.pl2-carte .et_pb_image img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1); }
.pl2-carte > .et_pb_column:hover .et_pb_image img { transform: scale(1.045); }
.pl2-vin-nom h3 { padding-bottom: 0; }

/* ----- Jus de raisin ----- */
.pl2-centre { align-items: center; }
.pl2-jus-photo .pl2-etiquette {
  position: absolute; top: 26px; left: -14px;
  width: auto; margin: 0 !important;
  box-shadow: 0 10px 20px -10px rgba(46, 38, 40, .6);
}

/* ----- Environnement : frise des années ----- */
.pl2-jalon .et_pb_text_inner { display: grid; grid-template-columns: 7rem minmax(0, 1fr); column-gap: 28px; align-items: baseline; }
.pl2-jalon h4, .pl2-jalon p { padding-bottom: 0; }
.pl2-jalon h4 { font-variant-numeric: lining-nums tabular-nums; }
.pl2-ab { float: right; width: 62px; height: auto; margin: 0 0 6px 24px; }
@media (min-width: 981px) {
  .pl2-colle { position: sticky; top: 36px; }
}

/* ----- Partenaires ----- */
.pl2-enseignes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 36px); }
.pl2-enseignes > .et_pb_image { margin: 0 !important; transition: transform .45s cubic-bezier(0.16, 1, 0.3, 1); }
.pl2-enseignes > .et_pb_image:hover { transform: translateY(-5px); }
.pl2-enseignes .et_pb_image a { display: block; border-radius: 50%; }
.pl2-enseignes .et_pb_image_wrap {
  display: block; overflow: hidden;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 14px 26px -16px rgba(46, 38, 40, .55);
}
.pl2-enseignes .et_pb_image img { display: block; width: 100%; }

/* ----- Pied de page ----- */
.pl2-pied a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: rgba(236, 223, 216, .45); transition: text-decoration-color .25s ease; }
.pl2-pied a:hover { text-decoration-color: currentColor; }
.pl2-pied .et_pb_icon a { text-decoration: none; }
.pl2-pied ::selection { background: #f4f3ee; color: #3f0b11; }
.pl2-pied a:focus-visible { outline-color: #fff; }

/* ----- Tablette et mobile (mêmes seuils que Divi) ----- */
@media (max-width: 980px) {
  .pl2-entete-rangee { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .pl2-entete-texte { display: contents; }
  .pl2-entete-texte > .et_pb_module { margin-left: 5.5% !important; margin-right: 5.5% !important; }
  .pl2-entete-texte > .pl2-logo { position: static; order: 0; margin: 26px auto 0 !important; }
  .pl2-entete-texte > .pl2-h1 { order: 1; margin-top: 26px !important; }
  .pl2-entete-rangee > .pl2-entete-photo { order: 2; justify-self: center; width: 89% !important; height: auto; max-height: none; aspect-ratio: 1 / 1; margin: 0 !important; }
  .pl2-entete-photo .pl2-legende { padding: 56px 16px 14px; }
  .pl2-entete-texte > .pl2-signature { order: 3; margin-top: 26px !important; }
  .pl2-entete-texte > .pl2-metier { order: 4; margin-bottom: 18px !important; }
  .pl2-entete-texte > .pl2-intro { order: 5; margin-left: auto !important; margin-right: auto !important; width: 89%; }
  .pl2-entete-texte > .et_pb_button_module_wrapper { order: 6; margin-bottom: 8px !important; }
  .pl2-entete-texte > .et_pb_button_module_wrapper:last-child { margin-bottom: 44px !important; }

  .pl2-tirages { padding-bottom: 20%; max-width: 520px; }
  .pl2-inverse { display: flex; flex-direction: column-reverse; }
  .pl2-jus-photo { max-width: 420px; }
  .pl2-enseignes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .pl2-jalon .et_pb_text_inner { grid-template-columns: 5rem minmax(0, 1fr); column-gap: 18px; }
  .pl2-ab { width: 50px; margin-left: 16px; }
  .pl2-enseignes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pl2-album-nav { display: none; }
}
@media (max-width: 479px) {
  /* Carte d'un vin : photo à gauche, nom à côté, texte dessous */
  .pl2-carte > .et_pb_column { display: grid; grid-template-columns: 38% minmax(0, 1fr); column-gap: 20px; margin-bottom: 52px !important; }
  .pl2-carte > .et_pb_column:last-child { margin-bottom: 0 !important; }
  .pl2-carte .et_pb_image { grid-row: 1 / span 2; margin-bottom: 20px !important; }
  .pl2-carte .pl2-vin-nom { align-self: end; }
  .pl2-carte .pl2-vin-cepage { align-self: start; margin-bottom: 0 !important; }
  .pl2-carte .pl2-vin-texte, .pl2-carte .et_pb_button_module_wrapper { grid-column: 1 / -1; }
}
