/*
Theme Name: Le Lien en Action
Theme URI: https://www.ventabren-lelienenaction.fr
Author: Ventabren — Le lien en action
Description: Thème bloc sur mesure de l'association Ventabren, le lien en action. Direction « Soir » : fond sombre chaud, photos plein cadre, mobile-first.
Version: 0.1.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lien-en-action
Tags: blog, one-column, block-patterns, full-site-editing
*/

/* Toutes les valeurs visuelles vivent dans theme.json.
   Ce fichier ne porte que ce qui n'est pas exprimable en theme.json. */

/* Cibles tactiles : jamais moins de 44 px de haut sur mobile. */
.wp-block-button__link,
.wp-block-search__button,
input[type="submit"] {
  min-height: 48px;
}

/* Focus clavier visible partout, y compris sur fond sombre. */
:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 2px;
}

/* Héros : l'en-tête se superpose à la photo. */
.lea-hero {
  position: relative;
  isolation: isolate;
}
.lea-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lea-hero__voile {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(27, 23, 20, 0.94) 6%,
    rgba(27, 23, 20, 0.45) 52%,
    rgba(27, 23, 20, 0.72)
  );
  pointer-events: none;
}
.lea-hero__contenu {
  position: relative;
  z-index: 2;
}

/* Pastille de date ronde. */
.lea-pastille-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--base);
  flex: 0 0 auto;
}
@media (min-width: 768px) {
  .lea-pastille-date {
    width: 130px;
    height: 130px;
  }
}

/* Pastille construite en blocs (boucles de requête) : deux paragraphes liés. */
.lea-pastille-date > p {
  margin: 0;
}
.lea-pastille-date__jour {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 24px;
  line-height: 1;
}
.lea-pastille-date__mois {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
@media (min-width: 768px) {
  .lea-pastille-date--grande .lea-pastille-date__jour {
    font-size: 44px;
  }
  .lea-pastille-date--grande .lea-pastille-date__mois {
    font-size: 13px;
  }
}

/* La boucle du héros ne doit ajouter ni marge ni puce autour du héros. */
.lea-hero-boucle,
.lea-hero-boucle .wp-block-post-template,
.lea-hero-boucle .wp-block-post {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lea-pastille-date.lea-pastille-date--petite {
  width: 64px;
  height: 64px;
}

/* Barre pratique collée en bas (page Rendez-vous, mobile). */
.lea-barre-pratique {
  position: sticky;
  bottom: 0;
  z-index: 20;
}

/* Mosaïque de rétrospective : photos bord à bord. */
.lea-mosaique .wp-block-gallery.has-nested-images {
  gap: 2px;
}

/* Héros : 520 px sur mobile, 760 px à partir du desktop. */
.lea-hero.wp-block-cover {
  min-height: 520px;
}
@media (min-width: 782px) {
  .lea-hero.wp-block-cover {
    min-height: 760px;
  }
}

/* L'en-tête transparent posé sur le héros ne doit pas pousser le contenu. */
.lea-hero .wp-block-template-part {
  width: 100%;
}

/* Le contenu du héros se colle en bas, sous l'en-tête. */
.lea-hero > .wp-block-cover__inner-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}
.lea-hero > .wp-block-cover__inner-container > :last-child {
  margin-top: auto;
}

/* Cartes : l'image touche les bords, le texte respire à l'intérieur. */
.lea-carte {
  overflow: hidden;
}
.lea-carte > figure.wp-block-image {
  margin: 0;
}

/* Tuiles de rétrospective : l'image à la une est souvent une affiche. Le voile
   suit le bloc de texte, presque opaque derrière lui quelle que soit sa
   longueur, puis fondu sur les 60 px au-dessus. */
.lea-tuile .wp-block-cover__image-background {
  object-position: 50% 0;
}
.lea-tuile.wp-block-cover > .wp-block-cover__inner-container {
  width: 100%;
  padding: 60px var(--wp--preset--spacing--50) var(--wp--preset--spacing--50);
  background: linear-gradient(
    to top,
    rgba(27, 23, 20, 0.95) calc(100% - 60px),
    rgba(27, 23, 20, 0)
  );
  text-shadow: 0 1px 3px rgba(27, 23, 20, 0.8);
}

/* Rétro en vedette : image entière, jamais recadrée. Sur téléphone, elle garde
   ses proportions d'origine pour qu'une affiche reste lisible. */
.lea-vedette-image {
  margin: 0;
  background: var(--wp--preset--color--neutral-900);
}
@media (max-width: 781px) {
  .lea-vedette-image.wp-block-post-featured-image {
    aspect-ratio: auto !important;
  }
  .lea-vedette-image.wp-block-post-featured-image img {
    height: auto !important;
  }
}

/* Bandeau de partage : quatre pastilles aux couleurs des
   réseaux, icône blanche, lisibles sur la photo comme sur fond sombre. */
.lea-partage__icones {
  display: flex;
  justify-content: center;
  gap: var(--wp--preset--spacing--30);
}
.lea-partage__icone {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  /* Liseré clair et ombre : la pastille se détache de la photo et du fond sombre. */
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--wp--preset--color--neutral-100) 55%, transparent),
    0 2px 8px rgb(0 0 0 / 0.35);
  color: #fff;
}
.lea-partage__icone[data-lea-share="facebook"] {
  background: #1877f2;
}
.lea-partage__icone[data-lea-share="whatsapp"] {
  background: #25d366;
}
.lea-partage__icone[data-lea-share="instagram"] {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}
.lea-partage__icone[data-lea-share="copie"] {
  background: var(--wp--preset--color--neutral-600);
}
.lea-partage__icone:hover {
  color: #fff;
  filter: brightness(1.12);
  box-shadow:
    0 0 0 3px var(--wp--preset--color--neutral-100),
    0 2px 8px rgb(0 0 0 / 0.35);
}
/* Double anneau clair puis sombre : visible quel que soit le fond. */
.lea-partage__icone:focus-visible {
  color: #fff;
  outline: 3px solid var(--wp--preset--color--neutral-100);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--wp--preset--color--contrast);
}
.lea-partage__icone svg {
  width: 22px;
  height: 22px;
}
/* Hauteur réservée : le message ne fait pas sauter la page. */
.lea-partage__retour {
  min-height: 1.55em;
  margin: var(--wp--preset--spacing--10) 0 0;
  text-align: center;
  font-size: var(--wp--preset--font-size--small);
  color: var(--wp--preset--color--neutral-200);
}
