/* ==========================================================================
   Constructeur d'article — CPT `actualite`
   Blocs rendus par template-parts/article-builder/art_*.php
   --------------------------------------------------------------------------
   Feuille AUTONOME : le Tailwind du thème est pré-compilé (style-tailwind.css)
   et node_modules est absent, donc une nouvelle classe `tw-` serait sans effet
   sans `npm run build`. On reproduit donc ici, en CSS, le vocabulaire visuel du
   MODÈLE 13 — celui du site — relevé dans :
     template-parts/typo/typo-13.php
     template-parts/text-photo/text-photo-13.php
     template-parts/blog/blog-13.php

   Ce qu'on en retient :
     • Titres : titleFont (Baskervville), graisse NORMALE, NOIRS
               1.3rem/1.5rem en mobile → 1.8rem/2.2rem à partir de md
     • Corps  : 1.2rem / 1.5 (base du thème, style.css)
     • Photos : arche tw-rounded-[30px] → md:tw-rounded-[350px], ratio 1/1.5
     • Accents: uppercase + letter-spacing 3px, vert --color-tertiary
   Palette : primary #FAF3E2 · secondary #BF9E65 · tertiary #0F5940 · quaternary #F6E9C7
   ========================================================================== */

.art-builder {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 4rem);
  text-align: left;
}

.art-block {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Titres — calqués sur les titres de section du modèle 13
   -------------------------------------------------------------------------- */

.art-title {
  font-family: titleFont, serif;
  font-weight: normal;
  color: #000;
  margin: 0.75rem 0 1.5rem;
  text-align: left;
}

.art-block--titre .art-title {
  margin-bottom: 0;
}

h2.art-title {
  font-size: 1.3rem;
  line-height: 1.5rem;
}

h3.art-title {
  font-size: 1.2rem;
  line-height: 1.45rem;
}

h4.art-title {
  font-size: 1.1rem;
  line-height: 1.4rem;
}

h5.art-title {
  font-size: 1rem;
  line-height: 1.35rem;
}

@media (min-width: 768px) {
  h2.art-title {
    font-size: 1.8rem;
    line-height: 2.2rem;
  }

  h3.art-title {
    font-size: 1.5rem;
    line-height: 1.9rem;
  }

  h4.art-title {
    font-size: 1.25rem;
    line-height: 1.6rem;
  }

  h5.art-title {
    font-size: 1.1rem;
    line-height: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Corps de texte (sortie WYSIWYG)
   -------------------------------------------------------------------------- */

.art-prose {
  font-size: 1.2rem;
  line-height: 1.5;
  color: #000;
}

.art-prose > *:first-child {
  margin-top: 0;
}

.art-prose > *:last-child {
  margin-bottom: 0;
}

.art-prose a {
  color: var(--color-tertiary, #0f5940);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s ease;
}

.art-prose a:hover {
  color: var(--color-secondary, #bf9e65);
}

.art-prose strong,
.art-prose b {
  font-weight: 700;
}

/* Les titres saisis DANS le WYSIWYG suivent la même règle que les blocs Titre. */
.art-prose h2,
.art-prose h3,
.art-prose h4,
.art-prose h5 {
  font-family: titleFont, serif;
  font-weight: normal;
  color: #000;
  margin: 2rem 0 1rem;
}

.art-prose h2 {
  font-size: 1.3rem;
  line-height: 1.5rem;
}
.art-prose h3 {
  font-size: 1.2rem;
  line-height: 1.45rem;
}
.art-prose h4 {
  font-size: 1.1rem;
  line-height: 1.4rem;
}

@media (min-width: 768px) {
  .art-prose h2 {
    font-size: 1.8rem;
    line-height: 2.2rem;
  }
  .art-prose h3 {
    font-size: 1.5rem;
    line-height: 1.9rem;
  }
  .art-prose h4 {
    font-size: 1.25rem;
    line-height: 1.6rem;
  }
}

.art-prose ul,
.art-prose ol {
  margin: 0 0 1.5em;
}

.art-prose li {
  margin-bottom: 0.4rem;
}

.art-prose blockquote {
  border-left: 2px solid var(--color-secondary, #bf9e65);
  margin: 2rem 0 2rem 1rem;
  padding: 0.75rem 0 0.75rem 1.75rem;
  font-family: titleFont, serif;
  font-style: italic;
}

.art-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 30px;
  margin: 1.5rem 0;
}

.art-prose hr {
  border: 0;
  border-top: 1px solid var(--color-secondary, #bf9e65);
  opacity: 0.4;
  margin: 2.5rem 0;
}

/* --------------------------------------------------------------------------
   Bloc Texte + photo — mêmes proportions que text-photo-13
   (photo ~550px, arche 350px, ratio 1/1.5 ; colonne texte sur le reste)
   -------------------------------------------------------------------------- */

.art-textphoto {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
}

.art-textphoto--no-media {
  grid-template-columns: 1fr;
}

.art-textphoto__media {
  margin: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 30px;
}

.art-textphoto__media img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease-linear;
}

.art-textphoto__media:hover img {
  transform: scale(1.1);
}

@media (min-width: 768px) {
  .art-textphoto {
    grid-template-columns: minmax(0, 1fr) 550px;
  }

  .art-textphoto--no-media {
    grid-template-columns: 1fr;
  }

  .art-textphoto__media {
    border-radius: 350px;
  }

  .art-textphoto__media img {
    aspect-ratio: 1 / 1.5;
  }

  /* Photo à droite par défaut. Le DOM garde l'ordre lisible (image puis texte)
     pour le lecteur d'écran et le mobile ; seul l'ordre visuel change.
     L'override --media-left doit rester APRÈS la règle générique : même
     spécificité, c'est la dernière déclarée qui gagne. */
  .art-textphoto .art-textphoto__media {
    order: 2;
  }
  .art-textphoto .art-textphoto__body {
    order: 1;
  }

  .art-textphoto--media-left {
    grid-template-columns: 550px minmax(0, 1fr);
  }

  .art-textphoto--media-left .art-textphoto__media {
    order: 1;
  }
  .art-textphoto--media-left .art-textphoto__body {
    order: 2;
  }
}

/* --------------------------------------------------------------------------
   Bloc Image seule
   -------------------------------------------------------------------------- */

.art-figure {
  margin: 0;
}

/* On plafonne la HAUTEUR plutôt que d'imposer la largeur : une image portrait
   ne part plus en pleine page, et l'image n'est jamais recadrée — le cadrage
   choisi par la cliente est conservé. Une image paysage reste pleine largeur
   tant que sa hauteur naturelle ne dépasse pas le plafond. */
.art-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(480px, 70vh);
  margin-left: auto;
  margin-right: auto;
  border-radius: 30px;
}

.art-caption {
  margin-top: 1rem;
  text-align: center;
  font-family: titleFont, serif;
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #000;
}
