/*
==================================================================
 Theme Name:  Evolution Encre Fraiche (enfant)
 Template:    twentytwentyfive
 Theme URI:   https://encrefraiche.ch
 Description: Theme enfant des Editions Encre Fraiche. Habillage
              hybride : structure WordPress conservee, identite Trio 1
              (turquoise / soleil / corail, fond creme, Fraunces +
              Hanken Grotesk), responsive et accessible (WCAG AA).
 Author:      Jean Hertzschuch - Web design professionnel
 Version:     1.8.8
 Requires PHP: 8.0
 Text Domain: ef-evolution-enfant
 ------------------------------------------------------------------
 CHANGELOG
   2026-06-24 (Europe/Zurich) - v1.8.2 - Images inline evenements Gutenberg :
     proportions conservees (height:auto, max-width:300px). Suppression de
     object-fit:cover et height fixe qui rognaient les images.
     REVERT : remettre width:300px; height:220px; object-fit:cover.
   2026-06-24 (Europe/Zurich) - v1.8.1 - Images inline evenements Gutenberg
     (.ef-ev .wp-block-image img) : contrainte 300x220px object-fit cover.
   2026-06-24 (Europe/Zurich) - v1.8.0 - Galerie photos par annee
     sur les pages evenements-YYYY : 50% de largeur, centree, grille
     carree 4 colonnes, effet hover, compatible GLightbox.
   2026-06-20 03:46 (Europe/Zurich) - v1.7.0 - Espace uniforme 100px header.
   2026-06-19 22:57 (Europe/Zurich) - v1.6.0 - Page auteur : masquer blocs natifs.
   2026-06-17 07:22 (Europe/Zurich) - v1.0.0 - Creation design system Trio 1.
   2026-06-17 21:34 (Europe/Zurich) - v1.1.0 - Logo tailles par contexte.
   2026-06-18 00:50 (Europe/Zurich) - v1.2.0 - Produits similaires hauteur egale.
   2026-06-18 01:24 (Europe/Zurich) - v1.3.0 - Logo clamp().
   2026-06-18 01:40 (Europe/Zurich) - v1.4.0 - Logo accueil grand + photo auteur.
   2026-06-18 02:09 (Europe/Zurich) - v1.5.0 - Logo PNG carre hauteur forcee.
 Auteur : Jean Hertzschuch - Web design professionnel
==================================================================
*/

/* ---------- Jetons (palette Trio 1) ---------- */
:root {
	--ef-turquoise: #07C3AE;
	--ef-soleil:    #FFC93D;
	--ef-corail:    #FF7A52;
	--ef-cream:     #FFFDF6;
	--ef-prune:     #3E2A63;
	--ef-prune-2:   #564278;
	--ef-line:      #E7E0D2;

	--ef-serif: "Fraunces", Georgia, "Times New Roman", serif;
	--ef-sans:  "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */
body {
	background-color: var(--ef-cream);
	color: var(--ef-prune);
	font-family: var(--ef-sans);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

/* Titres en Fraunces */
h1, h2, h3, h4, h5, h6,
.wp-block-heading,
.wp-block-post-title,
.wp-block-site-title,
.wp-block-query-title {
	font-family: var(--ef-serif);
	font-weight: 600;
	color: var(--ef-prune);
	line-height: 1.12;
}

h1, .wp-block-post-title { font-size: clamp(2rem, 4.4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

/* ---------- Liens ---------- */
a {
	color: var(--ef-prune);
	text-decoration-color: var(--ef-turquoise);
	text-underline-offset: 3px;
}
a:hover {
	text-decoration-color: var(--ef-corail);
}

/* ---------- Focus clavier visible (WCAG 2.4.7) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.wp-element-button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 3px solid var(--ef-corail);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---------- Selection ---------- */
::selection {
	background: var(--ef-soleil);
	color: var(--ef-prune);
}

/* ---------- Boutons ---------- */
.wp-element-button,
.wp-block-button__link,
button,
input[type="submit"],
.button,
.added_to_cart,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	font-family: var(--ef-sans);
	font-weight: 700;
	background-color: var(--ef-prune);
	color: var(--ef-cream);
	border: 0;
	border-radius: 10px;
	padding: 0.8em 1.5em;
	text-decoration: none;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.wp-element-button:hover,
.wp-block-button__link:hover,
button:hover,
.button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 22px rgba(62, 42, 99, 0.25);
	color: var(--ef-cream);
}

/* ---------- WooCommerce : prix et fiche produit ---------- */
.woocommerce div.product p.price,
.woocommerce div.product span.price,
.woocommerce ul.products li.product .price {
	font-family: var(--ef-serif);
	font-weight: 600;
	color: var(--ef-prune);
}

/* Genres en pastilles turquoise */
.woocommerce .posted_in a,
.wc-block-product-categories a {
	display: inline-block;
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 0.3em 0.8em;
	margin: 0.15em 0.2em 0.15em 0;
	border: 1.5px solid var(--ef-turquoise);
	border-radius: 999px;
	background: rgba(7, 195, 174, 0.06);
	text-decoration: none;
}
.woocommerce .posted_in a:hover {
	background: rgba(7, 195, 174, 0.16);
}

/* ---------- Filets de section ---------- */
hr.wp-block-separator {
	border: 0;
	border-top: 1px solid var(--ef-line);
}

/* ---------- Lien d'evitement ---------- */
.skip-link:focus {
	background: var(--ef-prune);
	color: var(--ef-cream);
}

/* ---------- Mouvement reduit (WCAG 2.3.3) ---------- */
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

/* ==================================================================
   Pied de page
   ================================================================== */
.ef-footer-inner{max-width:80%;margin-left:auto;margin-right:auto;border-top:1px solid #E7E0D2;padding-top:3rem;padding-bottom:2rem;}
@media (max-width:1024px){.ef-footer-inner{max-width:92%;}}
@media (max-width:600px){.ef-footer-inner{max-width:96%;}}

/* ==================================================================
   Images / WooCommerce
   ================================================================== */
img { max-width: 100%; height: auto; }
.wp-block-image { max-width: 760px; margin-left: auto; margin-right: auto; }
.wp-block-image img { display: block; margin: 0 auto; }
.woocommerce div.product .woocommerce-product-gallery, .single-product .woocommerce-product-gallery { max-width: 340px; }
.woocommerce div.product .woocommerce-product-gallery img { max-height: 480px; width: auto; margin: 0 auto; }
.woocommerce ul.products li.product img, ul.products li.product img, .wc-block-grid__product-image img, .wp-block-woocommerce-product-template img, .wc-block-components-product-image img, .wc-block-product img { width: auto; max-width: 100%; height: auto; max-height: 300px; object-fit: contain; display: block; margin-left: auto; margin-right: auto; }
.wc-block-grid__product-image, .wp-block-woocommerce-product-image, .wc-block-components-product-image { aspect-ratio: auto; height: auto; }
.ef-evenements{box-sizing:border-box;}.ef-evenements table{width:100%;}
/* Galerie d'en-tete (.images-container) */
.images-container{margin-top:1.5rem;box-sizing:border-box;}
.images-container *{max-width:100%;}
.images-container br{display:none;}
.images-container .image-preview{margin:0 0 12px;}
.images-container .image-preview img{width:100%;height:auto;max-height:520px;object-fit:cover;display:block;border-radius:8px;}
.images-container .image-listing-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px;margin:0;}
.images-container .image-listing-item{margin:0;}
.images-container .image-popup{display:block;position:relative;border-radius:6px;overflow:hidden;outline:0;}
.images-container .image-popup:focus-visible{outline:3px solid #07C3AE;outline-offset:3px;}
.images-container .image-listing-items img{width:100%;height:180px;object-fit:cover;display:block;transition:transform .25s ease;}
.images-container .image-popup:hover img,.images-container .image-popup:focus-visible img{transform:scale(1.05);}
.images-container .overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;opacity:0;background:rgba(62,42,99,0);transition:opacity .2s ease;pointer-events:none;}
.images-container .image-popup:hover .overlay,.images-container .image-popup:focus-visible .overlay{opacity:1;background:rgba(62,42,99,.35);}
@media (max-width:1024px){.images-container .image-listing-items{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));}.images-container .image-listing-items img{height:150px;}}
@media (max-width:600px){.images-container .image-listing-items{grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:6px;}.images-container .image-listing-items img{height:110px;}}
/* Page evenements (.ef-evpage) */
.ef-evpage{margin-top:2rem;box-sizing:border-box;font-family:'Hanken Grotesk',system-ui,sans-serif;color:#3E2A63;}
.ef-evpage .ef-intro{opacity:.85;margin:0 0 1rem;}
.ef-evnav{display:flex;flex-wrap:wrap;gap:.4rem;position:sticky;top:0;background:#FFFDF6;padding:.6rem 0;margin-bottom:1rem;border-bottom:1px solid rgba(62,42,99,.15);z-index:5;}
.ef-evnav a{display:inline-block;padding:.25rem .7rem;border-radius:999px;background:#fff;border:1px solid rgba(62,42,99,.2);color:#3E2A63;text-decoration:none;font-size:.9rem;font-weight:500;}
.ef-evnav a:hover,.ef-evnav a:focus-visible{background:#07C3AE;color:#fff;border-color:#07C3AE;outline:none;}
.ef-evyear{margin:1rem 0 1.5rem;}
.ef-evyear summary{cursor:pointer;list-style:none;display:flex;align-items:baseline;gap:.8rem;padding:.4rem 0;border-bottom:2px solid #07C3AE;}
.ef-evyear summary::-webkit-details-marker{display:none;}
.ef-evyear summary .ef-evy{font-family:'Fraunces',Georgia,serif;font-size:1.7rem;font-weight:500;}
.ef-evyear summary .ef-evn{font-size:.85rem;opacity:.6;}
.ef-ev{display:grid;grid-template-columns:170px 1fr;gap:1.4rem;padding:1.2rem 0;border-bottom:1px solid rgba(62,42,99,.1);}
.ef-ev-date{font-family:'Fraunces',Georgia,serif;font-weight:500;line-height:1.3;font-size:1.05rem;}
.ef-ev-text{margin:0 0 .5rem;line-height:1.6;}
.ef-ev-links,.ef-ev-docs{margin:.2rem 0;display:flex;flex-wrap:wrap;gap:.5rem .9rem;font-size:.92rem;}
.ef-ev-links a,.ef-ev-docs a{color:#07C3AE;text-decoration:underline;text-underline-offset:2px;word-break:break-word;}
.ef-ev-docs a{font-weight:500;}
.ef-ev-thumbs{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:.7rem;}
.ef-ev-thumbs a{display:block;border-radius:8px;overflow:hidden;outline-offset:3px;}
.ef-ev-thumbs a:focus-visible{outline:3px solid #07C3AE;}
.ef-ev-thumbs img{width:190px;height:auto;object-fit:contain;display:block;transition:transform .25s ease;}
.ef-ev-thumbs a:hover img,.ef-ev-thumbs a:focus-visible img{transform:scale(1.05);}

@media (max-width:768px){.ef-ev{grid-template-columns:1fr;gap:.4rem;}.ef-ev-date{border-bottom:1px solid #07C3AE;padding-bottom:.25rem;margin-bottom:.3rem;}.ef-ev-thumbs a{flex:0 0 calc((100% - .6rem)/2);max-width:calc((100% - .6rem)/2);}.ef-ev-thumbs img{width:100%;height:auto;object-fit:contain;}}


/* ==================================================================
   Largeur 80% sur PC
   ================================================================== */



/* ---------- Logo ---------- */
header .wp-block-site-logo,
header .wp-block-site-logo a { width: auto !important; }
header .wp-block-site-logo img {
	height: clamp(46px, 8vw, 96px) !important;
	width: auto !important;
	max-width: 70vw !important;
}
body.home header .wp-block-site-logo img,
body.page-id-737 header .wp-block-site-logo img {
	height: clamp(80px, 16vw, 150px) !important;
}
.ef-footer .wp-block-site-logo img {
	height: clamp(46px, 6vw, 80px) !important;
	width: auto !important;
	max-width: 60vw !important;
}

/* ---------- Produits similaires ---------- */
.single-product .wp-block-woocommerce-product-template { align-items: stretch; }
.single-product .wp-block-woocommerce-product-template > li,
.single-product .related.products ul.products li.product { display: flex; flex-direction: column; }
.single-product .wp-block-woocommerce-product-template .wp-block-post-title,
.single-product .wp-block-woocommerce-product-template .wc-block-components-product-name,
.single-product .related.products li.product .woocommerce-loop-product__title { min-height: 2.7em; }
.single-product .wp-block-woocommerce-product-template .wp-block-woocommerce-product-button,
.single-product .wp-block-woocommerce-product-template .wc-block-components-product-button,
.single-product .related.products li.product .button { margin-top: auto; }

/* ---------- Fiche auteur ---------- */
.single-auteur .wp-block-post-featured-image,
.single-auteur .wp-block-post-featured-image a { aspect-ratio: auto !important; }
.single-auteur .wp-block-post-featured-image img {
	aspect-ratio: auto !important;
	height: auto !important;
	width: auto !important;
	max-height: 560px;
	max-width: 100%;
	object-fit: contain;
	margin-inline: auto;
	display: block;
}

/* ---------- Archive auteurs — photos complètes ---------- */
.post-type-archive-auteur .wp-block-post-featured-image{
	aspect-ratio:auto !important;
}
.post-type-archive-auteur .wp-block-post-featured-image img{
	aspect-ratio:auto !important;
	height:auto !important;
	width:100%;
	object-fit:contain;
	max-height:400px;
	display:block;
	margin-inline:auto;
}

/* ==================================================================
   v1.7.0 — Espace 100px header → premier element
   ================================================================== */
main.wp-block-group { margin-top: 0 !important; }
main.wp-block-group > .wp-block-group.alignfull:first-child,
main.wp-block-group > .wp-block-group:first-child { padding-top: 100px !important; }

/* ==================================================================
   v1.8.0 — Galerie photos par annee (.ef-gallery-year)
   ================================================================== */
.ef-gallery-year {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	width: 50%;
	margin: 1.5rem auto 2.5rem;
}
.ef-gallery-year .ef-gallery-item {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 4px;
	outline-offset: 3px;
}
.ef-gallery-year .ef-gallery-item:focus-visible {
	outline: 3px solid var(--ef-turquoise);
}
.ef-gallery-year .ef-gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .2s ease;
}
.ef-gallery-year .ef-gallery-item:hover img,
.ef-gallery-year .ef-gallery-item:focus-visible img {
	transform: scale(1.06);
}
@media (max-width: 900px) {
	.ef-gallery-year { width: 80%; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
	.ef-gallery-year { width: 100%; grid-template-columns: repeat(3, 1fr); }
}

/* ==================================================================
   v1.8.8 — 2026-06-25 20:10 (Europe/Zurich) - .ef-ev-thumbs img :
            object-fit:cover → object-fit:contain + height:auto.
            Suppression aspect-ratio:4/3 mobile. Photos jamais coupees.
   v1.8.7 — 2026-06-25 20:00 (Europe/Zurich) - Archive auteurs :
            suppression aspect-ratio:3/2 inline TT25 sur photos
            (.post-type-archive-auteur). Photos affichees completes,
            object-fit:contain, max-height:400px.
   v1.8.6 — 2026-06-25 19:45 (Europe/Zurich) - Refonte conteneur page :
            suppression regles 80vw hors-conteneur (ef-evpage, ef-evenements,
            images-container) et regle min-width:1025px. Le conteneur est
            desormais gere par theme.json v2.0 (contentSize:1280px +
            padding clamp(16px,4vw,48px)). ef-ev-thumbs : desktop restaure
            190x140px fixes ; mobile <=768px flex:0 0 2col + aspect-ratio:4/3.
   v1.8.5 — 2026-06-25 19:20 (Europe/Zurich) - Suppression width:Xvw +
            margin:calc(50%-Xvw) mobiles sur ef-evpage (<=1024px, <=768px),
            ef-evenements (<=600px), images-container (<=1024px, <=600px).
            Ces conteneurs reintegrent le flux TT25 (padding
            clamp(30px,5vw,50px) automatique). WCAG 1.4.10 Reflow.
   v1.8.4 — 2026-06-25 19:10 (Europe/Zurich) - .ef-ev-thumbs : refonte
            mobile selon SPEC_CSS_MOBILE_v1_1. Remplacement vw par
            flex-basis % + aspect-ratio:4/3. Desktop : flex item
            calc((100%-2*.6rem)/3). <=768px : calc((100%-2*.6rem)/2).
            <=480px : calc((100%-.6rem)/2). Suppression width/height
            fixes en vw. WCAG AA : focus-visible inchange.
   v1.8.3 — 2026-06-25 17:30 (Europe/Zurich) - Mobile : vignettes evenements
            (.ef-ev-thumbs img) reduites a 22vw/16vw a <=768px (etaient 30vw/22vw
            -> trop grandes). Ajout breakpoint <=480px : 28vw/21vw pour tres
            petits ecrans. Conformite WCAG AA (focus-visible inchange).
   v1.8.2 — Images inline evenements Gutenberg (.ef-ev .wp-block-image)
   Proportions conservees : height:auto, max-width:300px.
   REVERT : width:300px; height:220px; object-fit:cover.
   Jean Hertzschuch — Web design professionnel
   ================================================================== */
.ef-ev .wp-block-image {
	max-width: 300px;
	margin-left: 0;
	margin-right: 0;
}
.ef-ev .wp-block-image img {
	width: 100%;
	max-width: 300px;
	height: auto;
	display: block;
	border-radius: 6px;
}
