/*
Theme Name: Popote Maline
Template: twentytwentyfive
Description: Thème enfant de Twenty Twenty-Five pour popotemaline.com : tons crème et brique, Playfair Display + Karla (hébergées localement), accueil éditorial à la manière des blogs de recettes, commentaires mis en avant.
Version: 2.2.0
Text Domain: popote
*/

:root {
	--pm-creme: var(--wp--preset--color--base);
	--pm-lin: var(--wp--preset--color--accent-5);
	--pm-brun: var(--wp--preset--color--contrast);
	--pm-brique: var(--wp--preset--color--accent-1);
	--pm-brique-f: #8E3520;
	--pm-sauge: #55704A; /* sauge assombrie : 4,5:1 sur crème pour les petits libellés */
	--pm-moutarde: var(--wp--preset--color--accent-3);
	--pm-taupe: var(--wp--preset--color--accent-4);
	--pm-ligne: #E6D9C6;
	--pm-titre: var(--wp--preset--font-family--playfair);
	--pm-texte: var(--wp--preset--font-family--karla);
	--pm-r: 14px;
}

/* ---------- Base ---------- */
.pm-wrap { max-width: 1200px; margin-inline: auto; padding-inline: 24px; box-sizing: border-box; }
.pm-ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.pm-sur { font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--pm-brique); margin: 0; }
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible { outline: 3px solid var(--pm-brique); outline-offset: 2px; }
:where(.pm-footer, .pm-topbar, .pm-batch) :where(a, button):focus-visible { outline-color: var(--pm-brun); }
.pm-footer :where(a):focus-visible { outline-color: var(--pm-moutarde); }

.pm-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; min-height: 48px; box-sizing: border-box; border-radius: 999px; font: 700 15px/1.2 var(--pm-texte); border: 2px solid var(--pm-brique); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
.pm-btn-plein { background: var(--pm-brique); color: var(--pm-creme); }
.pm-btn-plein:hover { background: var(--pm-brique-f); border-color: var(--pm-brique-f); color: var(--pm-creme); }
.pm-btn-fonce { background: var(--pm-brun); border-color: var(--pm-brun); color: var(--pm-creme); }
.pm-btn-fonce:hover { background: #000; color: #fff; }
.pm-btn-ico { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--pm-ligne); display: grid; place-items: center; background: #fff; color: var(--pm-brun); }
.pm-btn-ico:hover { border-color: var(--pm-brique); color: var(--pm-brique); }

/* ---------- En-tête ---------- */
.pm-topbar { background: var(--pm-brique); color: var(--pm-creme); font: 500 14px/1.4 var(--pm-texte); }
.pm-topbar .pm-wrap { display: flex; justify-content: center; gap: 28px; padding-block: 8px; flex-wrap: wrap; }
.pm-topbar span { display: inline-flex; align-items: center; gap: 8px; }
header.wp-block-template-part { position: sticky; top: 0; z-index: 50; }
.admin-bar header.wp-block-template-part { top: 32px; }
.pm-header { background: var(--pm-creme); border-bottom: 1px solid var(--pm-ligne); }
.pm-header-in { min-height: 84px; gap: 24px; }
.pm-header .wp-block-site-logo img { width: 210px; height: auto; }
.pm-nav .wp-block-navigation-item__content { display: block; padding: 10px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; text-decoration: none; }
.pm-nav .wp-block-navigation-item__content:hover { background: var(--pm-lin); color: var(--pm-brique); }
.pm-nav .wp-block-navigation__container { gap: 4px; }
.pm-actions { display: flex; align-items: center; gap: 10px; }
.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { padding: 10px; margin: -10px; }

/* ---------- Accroche ---------- */
.pm-baseline { text-align: center; padding: 34px 0 26px; }
.pm-baseline h1 { margin: 0; font: 500 15px/1.6 var(--pm-texte); letter-spacing: .22em; text-transform: uppercase; color: var(--pm-taupe); }
.pm-baseline em { font: italic 500 26px/1 var(--pm-titre); letter-spacing: 0; text-transform: none; color: var(--pm-brique); }

/* ---------- À la une (cartes photo avec titre en surimpression) ---------- */
.pm-une { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; }
.pm-une .wp-block-post-template { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; height: 100%; }
.pm-une-petites .wp-block-post-template { grid-template-rows: 1fr 1fr; }
.pm-cartes-une > li, .pm-carte-attente { position: relative; border-radius: var(--pm-r); overflow: hidden; background: var(--pm-brun); min-height: 249px; margin: 0; }
.pm-une-grande .pm-cartes-une > li, .pm-carte-attente { min-height: 520px; }
.pm-cartes-une .wp-block-post-featured-image, .pm-carte-attente > img { position: absolute; inset: 0; margin: 0; }
.pm-cartes-une .wp-block-post-featured-image img, .pm-carte-attente > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.pm-cartes-une > li:hover .wp-block-post-featured-image img { transform: scale(1.03); }
.pm-cartes-une .pm-fond { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pm-une .wp-block-query, .pm-une .wp-block-query-no-results { height: 100%; }
.pm-cartes-une > li::after, .pm-carte-attente::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(43,33,28,0) 35%, rgba(43,33,28,.88) 100%); pointer-events: none; }
.pm-une-txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 32px; z-index: 1; color: var(--pm-creme); }
.pm-une-txt .wp-block-post-title, .pm-une-txt h2 { font-family: var(--pm-titre); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.12; margin: 12px 0 10px; color: #fff; }
.pm-une-petites .pm-une-txt { padding: 22px 26px; }
.pm-une-petites .pm-une-txt .wp-block-post-title { font-size: 24px; }
.pm-une-txt .wp-block-post-title a { color: #fff; text-decoration: none; }
.pm-une-txt .wp-block-post-title a::before { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */
.pm-etiquette { display: inline-block; background: var(--pm-moutarde); color: var(--pm-brun); font: 700 12px/1 var(--pm-texte); letter-spacing: .12em; text-transform: uppercase; padding: 7px 12px; border-radius: 4px; }
.pm-metas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font: 500 15px/1.4 var(--pm-texte); margin: 0; }
.pm-metas > span { display: inline-flex; align-items: center; gap: 6px; }
.pm-metas .pm-note { color: #fff; }
.pm-metas .pm-note .pm-ico { color: var(--pm-moutarde); }
.pm-une > *, .pm-une .wp-block-query { margin-block: 0; }
.pm-prix { display: inline-block; background: var(--pm-creme); color: var(--pm-brique-f); padding: 4px 11px; border-radius: 999px; font: 700 14px/1.3 var(--pm-texte); white-space: nowrap; }

/* ---------- Catégories en ronds + recherche ---------- */
.pm-cats { padding: 56px 0 8px; }
.pm-cats ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 18px; text-align: center; }
.pm-cats a { display: block; font: 700 14px/1.3 var(--pm-texte); letter-spacing: .06em; text-transform: uppercase; color: var(--pm-brun); text-decoration: none; }
.pm-rond { display: block; aspect-ratio: 1; border-radius: 50%; overflow: hidden; margin: 0 auto 12px; width: 100%; max-width: 130px; border: 4px solid #fff; box-shadow: 0 6px 18px rgba(43,33,28,.12); transition: transform .25s ease; box-sizing: border-box; }
.pm-cats a:hover .pm-rond { transform: translateY(-4px); }
.pm-cats a:hover { color: var(--pm-brique); }
.pm-rond img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-tout .pm-rond { display: grid; place-items: center; background: var(--pm-brique); color: var(--pm-creme); }
.pm-tout .pm-ico { width: 34px; height: 34px; }
.pm-recherche { display: flex; gap: 12px; max-width: 720px; margin: 36px auto 0; align-items: center; }
.pm-recherche label { flex: 1; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--pm-ligne); border-radius: 999px; padding: 0 20px; min-height: 54px; }
.pm-recherche input { border: 0; flex: 1; min-width: 0; font: 400 16px var(--pm-texte); background: transparent; min-height: 50px; color: var(--pm-brun); }
.pm-recherche input:focus { outline: none; }
.pm-recherche label:focus-within { outline: 3px solid var(--pm-brique); outline-offset: 2px; }

/* ---------- Titres de section ---------- */
.pm-titre-section { display: flex; align-items: center; gap: 20px; margin: 64px 0 28px; }
.pm-titre-section h2 { font-size: clamp(28px, 3vw, 38px); margin: 0; }
.pm-titre-section h2 i { color: var(--pm-brique); font-weight: 500; }
.pm-titre-section::after { content: ""; flex: 1; height: 1px; background: var(--pm-brun); opacity: .25; }
.pm-titre-section a { order: 3; font: 700 15px var(--pm-texte); color: var(--pm-brique); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 10px 0; text-decoration: none; }

/* ---------- Grille de recettes ---------- */
.pm-cartes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 26px; }
.pm-cartes > li { display: flex; flex-direction: column; margin: 0; position: relative; }
.pm-photo { position: relative; border-radius: var(--pm-r); overflow: hidden; background: var(--pm-lin); }
.pm-photo .wp-block-post-featured-image { margin: 0; }
.pm-photo img { transition: transform .5s ease; }
.pm-cartes > li:hover .pm-photo img { transform: scale(1.04); }
.pm-photo .pm-prix { position: absolute; left: 12px; top: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.pm-cat { display: block; margin: 16px 0 4px; font: 700 13px/1.3 var(--pm-texte); letter-spacing: .12em; text-transform: uppercase; color: var(--pm-sauge); }
.pm-cartes .wp-block-post-title { font-size: 23px; line-height: 1.2; margin: 0; }
.pm-cartes .wp-block-post-title a { color: var(--pm-brun); text-decoration: none; }
.pm-cartes .wp-block-post-title a::before { content: ""; position: absolute; inset: 0; z-index: 1; }
.pm-cartes > li:hover .wp-block-post-title a { color: var(--pm-brique); }
.pm-bas { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--pm-ligne); font: 400 15px var(--pm-texte); color: var(--pm-taupe); }
.pm-cartes .wp-block-post-title { margin-bottom: 12px; }
.pm-bas > span, .pm-avis { display: inline-flex; align-items: center; gap: 6px; }
.pm-note { color: var(--pm-brun); font-weight: 700; }
.pm-note .pm-ico { color: var(--pm-brique); }
.pm-avis { position: relative; z-index: 2; color: var(--pm-taupe); text-decoration: none; padding-block: 4px; }
.pm-avis:hover { color: var(--pm-brique); }
.pm-vide { font-size: 18px; color: var(--pm-taupe); margin: 0; }

/* ---------- Bande batch cooking ---------- */
.pm-batch { margin-top: 80px; background: var(--pm-moutarde); border-radius: 24px; overflow: hidden; display: grid; grid-template-columns: 1.1fr 1fr; }
.pm-batch-txt { padding: 56px; color: var(--pm-brun); }
.pm-batch .pm-sur { color: var(--pm-brun); }
.pm-batch h2 { font-size: clamp(30px, 3.2vw, 42px); margin: 10px 0 16px; }
.pm-batch ul { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; font: 500 18px var(--pm-texte); }
.pm-batch li { display: flex; gap: 12px; align-items: center; }
.pm-batch li .pm-ico { color: var(--pm-brique-f); }
.pm-batch-photo img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 360px; }

/* ---------- Communauté ---------- */
.pm-commu { margin-top: 96px; background: var(--pm-lin); }
.pm-commu .pm-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding-block: 80px; }
.pm-commu-photo { border-radius: 24px; overflow: hidden; aspect-ratio: 5/4; box-shadow: 24px 24px 0 var(--pm-brique); }
.pm-commu-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-commu h2 { font-size: clamp(30px, 3.2vw, 44px); margin: 10px 0 16px; }
.pm-intro { font-size: 19px; margin: 0 0 28px; }
.pm-etapes { display: grid; gap: 18px; margin: 0 0 32px; padding: 0; list-style: none; }
.pm-etapes li { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start; }
.pm-pastille { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--pm-brique); }
.pm-pastille .pm-ico { width: 24px; height: 24px; }
.pm-etapes b { display: block; font: 700 20px/1.3 var(--pm-titre); }
.pm-etapes span:not(.pm-pastille) { color: var(--pm-taupe); }

/* ---------- Qui cuisine ici ---------- */
.pm-apropos { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; margin: 96px 0; }
.pm-apropos-photo { border-radius: 24px; overflow: hidden; aspect-ratio: 4/5; }
.pm-apropos-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-apropos-txt { background: #fff; border-radius: 24px; padding: 56px; margin-left: -60px; box-shadow: 0 20px 50px rgba(43,33,28,.08); position: relative; }
.pm-apropos h2 { font-size: clamp(30px, 3vw, 40px); margin: 10px 0 16px; }
.pm-signature { font: italic 500 30px var(--pm-titre); color: var(--pm-brique); margin: 20px 0 0; }

/* Cocotte, la mascotte qui anime les commentaires */
.pm-cocotte .pm-apropos-photo { background: var(--pm-lin); display: grid; place-items: center; }
.pm-cocotte .pm-apropos-photo img { width: 72%; height: auto; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(43,33,28,.15)); }
.pm-honnete { font-size: 15px; color: var(--pm-taupe); font-style: italic; border-left: 3px solid var(--pm-moutarde); padding-left: 12px; }
.pm-cocotte .pm-signature { display: inline-block; margin-left: 20px; vertical-align: middle; }

/* ---------- Pied de page ---------- */
.pm-footer { background: var(--pm-brun); color: var(--pm-lin); padding: 64px 0 28px; font: 400 15px/1.6 var(--pm-texte); }
.pm-footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.pm-footer h2 { font: 700 13px/1.4 var(--pm-texte); letter-spacing: .14em; text-transform: uppercase; color: var(--pm-moutarde); margin: 0 0 14px; }
.pm-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.pm-footer a { color: var(--pm-lin); text-decoration: none; }
.pm-footer ul a { display: inline-block; padding: 5px 0; }
.pm-footer a:hover { color: var(--pm-moutarde); }
.pm-footer-marque p { margin: 14px 0 0; max-width: 300px; opacity: .85; }
.pm-legal { border-top: 1px solid rgba(243,231,214,.15); margin-top: 48px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; opacity: .8; font-size: 14px; }
.wp-site-blocks > footer, .wp-site-blocks > .wp-block-template-part:last-child { margin-block-start: 0; }

/* ---------- Commentaires (articles) ---------- */
.wp-block-comment-template li.comment > div { background: var(--pm-lin); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.wp-block-comment-template li.bypostauthor > div { border-left: 4px solid var(--pm-brique); }
.wp-block-comment-template li.bypostauthor .wp-block-comment-author-name::after { content: " · Auteur"; color: var(--pm-brique); font-weight: 700; }

/* ---------- Fiche recette WP Recipe Maker (modèle Meadow) ---------- */
body { --comment-rating-star-color: var(--pm-brique); }
body .wprm-recipe-template-meadow {
	--meadow-accent-color: var(--pm-brique);
	--meadow-list-border-color: var(--pm-moutarde);
	--meadow-main-background-color: var(--pm-lin);
	--wprm-popup-accent: var(--pm-brique);
	font-family: var(--pm-texte);
	border-radius: 16px;
	overflow: hidden;
}
.wprm-recipe-template-meadow .wprm-recipe-ingredient,
.wprm-recipe-template-meadow .wprm-recipe-instruction-text,
.wprm-recipe-template-meadow .wprm-recipe-summary { font-family: var(--pm-texte); font-size: 1.05rem; }
.wprm-recipe-template-meadow .wprm-recipe-name,
.wprm-recipe-template-meadow .wprm-recipe-header { font-family: var(--pm-titre) !important; }
.wprm-comment-rating svg path, .comment-form-wprm-rating svg path { fill: var(--pm-brique); }

@media (prefers-reduced-motion: reduce) { .pm-accueil *, .pm-header * { transition: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) { .pm-cta { display: none !important; } }
@media (max-width: 1024px) {
	.pm-nav .wp-block-navigation-item__content { padding: 10px 8px; font-size: 13px; }
	.pm-cats ul { grid-template-columns: repeat(4, 1fr); }
	.pm-cartes { grid-template-columns: repeat(2, 1fr); }
	.pm-footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
	.pm-header-in .pm-nav { order: 3; }
	.pm-header-in .pm-actions { margin-left: auto; }
	.pm-wrap { padding-inline: 16px; }
	.pm-topbar { font-size: 13px; }
	.pm-topbar span:nth-child(2) { display: none; }
	.pm-header-in { min-height: 68px; }
	.pm-header .wp-block-site-logo img { width: 165px; }
	.pm-baseline { padding: 22px 0 18px; }
	.pm-baseline h1 { font-size: 12px; letter-spacing: .14em; }
	.pm-baseline em { font-size: 21px; }
	.pm-une { grid-template-columns: 1fr; gap: 14px; }
	.pm-une .wp-block-post-template { gap: 14px; }
	.pm-une-petites .wp-block-post-template { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
	.pm-une-grande .pm-cartes-une > li, .pm-carte-attente { min-height: 380px; }
	.pm-cartes-une > li { min-height: 220px; }
	.pm-une-txt { padding: 22px; }
	.pm-une-petites .pm-une-txt { padding: 14px; }
	.pm-une-petites .pm-une-txt .wp-block-post-title { font-size: 18px; }
	.pm-une-petites .pm-prix { font-size: 12px; }
	.pm-cats { padding-top: 40px; }
	.pm-cats ul { gap: 14px 10px; }
	.pm-cats a { font-size: 11px; letter-spacing: .03em; }
	.pm-recherche { gap: 8px; }
	.pm-recherche label { padding: 0 14px; }
	.pm-recherche .pm-btn { padding: 12px 16px; }
	.pm-titre-section { flex-wrap: wrap; gap: 4px 16px; margin-top: 52px; }
	.pm-titre-section::after { display: none; }
	.pm-cartes { grid-template-columns: 1fr; gap: 30px; }
	.pm-batch { grid-template-columns: 1fr; margin-top: 56px; }
	.pm-batch-txt { padding: 32px 24px; }
	.pm-batch-photo { order: -1; }
	.pm-batch-photo img { min-height: 220px; max-height: 260px; }
	.pm-btn { white-space: normal; }
	.pm-commu { margin-top: 64px; }
	.pm-commu .pm-wrap { grid-template-columns: 1fr; gap: 36px; padding-block: 56px; }
	.pm-commu-photo { box-shadow: 12px 12px 0 var(--pm-brique); }
	.pm-apropos { grid-template-columns: 1fr; margin: 64px 0; }
	.pm-apropos-photo { aspect-ratio: 4/3; }
	.pm-apropos-txt { margin: -40px 12px 0; padding: 32px 24px; }
	.pm-footer-cols { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Pages de liste (toutes les recettes, catégories, recherche) ---------- */
.pm-entete-liste { padding: 48px 0 32px; text-align: center; }
.pm-entete-liste h1 { font-size: clamp(34px, 4vw, 52px); margin: 10px 0 0; }
.pm-entete-liste h1 i { color: var(--pm-brique); font-weight: 500; }
.pm-entete-liste .wp-block-term-description { max-width: 640px; margin: 14px auto 0; color: var(--pm-taupe); font-size: 18px; }
.pm-liste .pm-cartes .wp-block-post-title { font-size: 23px; }
.pm-pagination { margin: 48px 0 80px; gap: 8px; font-weight: 700; }
.pm-pagination a, .pm-pagination .current { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--pm-ligne); text-decoration: none; }
.pm-pagination .current { background: var(--pm-brique); color: var(--pm-creme); border-color: var(--pm-brique); }
.pm-liste .pm-grille { padding-bottom: 72px; }
