/*
Theme Name: PPC Carnet
Theme URI: https://pierrepapierciseaux.fr
Author: Guillaume Guénez
Description: Thème bloc de Pierre Papier Ciseaux, direction « Carnet de parent geek ».
Version: 0.4.1
Requires at least: 6.6
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: ppc-theme
*/

/* Les réglages (couleurs, polices, tailles) sont dans theme.json.
   Ce fichier ne contient que ce que theme.json ne sait pas exprimer. */

/* ---------- Logo : trois formes ---------- */
.ppc-logo { display: flex; align-items: center; gap: 0.75rem; }
.ppc-logo__formes { flex: none; width: 66px; height: 22px; }
.ppc-logo .wp-block-site-title { margin: 0; }

/* ---------- En-tête et pied ---------- */
.ppc-entete { border-bottom: 2px solid var(--wp--preset--color--encre); }
.ppc-entete .wp-block-navigation-item__content { padding: 0.6rem 1rem; border-radius: 999px; }
.ppc-entete .wp-block-navigation-item__content:hover { background: var(--wp--preset--color--sable); }
.ppc-pied a { color: var(--wp--preset--color--papier); }
.ppc-pied a:hover { color: var(--wp--preset--color--papier-jaune); }

/* ---------- Pastille de rubrique ---------- */
.ppc-rubrique a,
.ppc-rubrique { text-decoration: none; }
.ppc-rubrique a {
	display: inline-block;
	background: var(--wp--preset--color--pierre-texte);
	color: #FFFFFF;
	font-weight: 600;
	font-size: 0.8125rem;
	line-height: 1;
	padding: 0.45rem 0.8rem;
	border-radius: 999px;
	margin: 0 0.25rem 0.25rem 0;
}
.ppc-rubrique a[href*="famille"] { background: var(--wp--preset--color--papier-texte); }
.ppc-rubrique .wp-block-post-terms__separator { display: none; }

/* ---------- Cartes d'articles ---------- */
.ppc-carte {
	background: var(--wp--preset--color--carte);
	border: 2px solid var(--wp--preset--color--encre);
	border-radius: 16px;
	overflow: hidden;
	height: 100%;
	transition: transform 0.15s ease;
}
.ppc-carte:hover { transform: translateY(-3px); }
.ppc-carte .wp-block-post-featured-image { margin: 0; }
.ppc-carte .wp-block-post-featured-image img { border-radius: 0; aspect-ratio: 16 / 9; object-fit: cover; }
.ppc-carte__texte { padding: 0.25rem 1.1rem 1.25rem; }
.ppc-carte .wp-block-post-title { font-size: 1.3rem; line-height: 1.2; }
.ppc-carte .wp-block-post-title a { text-decoration: none; }

/* Image absente : bloc de remplacement fourni par functions.php */
.ppc-image-absente { margin: 0; aspect-ratio: 16 / 9; background: var(--wp--preset--color--sable); display: flex; align-items: center; justify-content: center; border-radius: 18px; }
.ppc-image-absente svg { width: 30%; max-width: 160px; opacity: 0.55; }
.ppc-une__image.ppc-image-absente { aspect-ratio: 16 / 10; }
.ppc-carte .ppc-image-absente { border-radius: 0; }

/* ---------- Titres de section avec forme ---------- */
.ppc-section-titre { display: flex; align-items: center; gap: 0.75rem; }
.ppc-section-titre::before { content: ""; flex: none; width: 18px; height: 18px; }
.ppc-section-titre--pierre::before { background: var(--wp--preset--color--pierre); border-radius: 50%; }
.ppc-section-titre--papier::before { background: var(--wp--preset--color--papier-jaune); border-radius: 3px; }
.ppc-section-titre--ciseaux::before { background: var(--wp--preset--color--ciseaux); clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 20px; }

/* ---------- Liste des derniers articles ---------- */
.ppc-liste .wp-block-post { border-top: 1px solid var(--wp--preset--color--trait); padding: 1rem 0; }
.ppc-liste .wp-block-post-title { font-size: 1.25rem; margin: 0; }
.ppc-liste .wp-block-post-title a { text-decoration: none; }

/* ---------- Article ---------- */
/* Chapô : premier paragraphe, ou celui qui suit la mention d'affiliation */
.ppc-article .wp-block-post-content > p:first-child:not(.ppc-affi-mention),
.ppc-article .wp-block-post-content > .ppc-affi-mention + p { font-size: var(--wp--preset--font-size--chapo); font-weight: 500; line-height: 1.6; }

/* Intertitres : pastille rond, carré, triangle à tour de rôle */
.ppc-article .wp-block-post-content h2 { display: flex; gap: 0.85rem; align-items: baseline; margin-top: 2.5rem; }
.ppc-article .wp-block-post-content h2::before { content: ""; flex: none; width: 0.5em; height: 0.5em; transform: translateY(-0.05em); }
.ppc-article .wp-block-post-content h2:nth-of-type(3n+1)::before { background: var(--wp--preset--color--pierre); border-radius: 50%; }
.ppc-article .wp-block-post-content h2:nth-of-type(3n+2)::before { background: var(--wp--preset--color--papier-jaune); border-radius: 2px; }
.ppc-article .wp-block-post-content h2:nth-of-type(3n)::before { background: var(--wp--preset--color--ciseaux); clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 0.56em; }

.ppc-article .wp-block-post-content strong { font-weight: 700; }
.ppc-article .wp-block-post-content a[rel~="sponsored"] { text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- Affiliation (balisage fourni par ppc-core) ---------- */
.ppc-affi-mention,
.ppc-article .wp-block-post-content > .ppc-affi-mention {
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--encre-douce);
	background: var(--wp--preset--color--creme-fonce);
	padding: 0.65rem 0.9rem;
	border-radius: 10px;
}
.ppc-affi-encadre {
	background: var(--wp--preset--color--carte);
	border: 2px solid var(--wp--preset--color--encre);
	border-radius: 18px;
	padding: 1.5rem;
	margin-top: 2.5rem;
}
.ppc-affi-encadre__titre { font-family: var(--wp--preset--font-family--titres); font-weight: 800; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
.ppc-affi-encadre__accroche { margin: 0.35rem 0 0.75rem; color: var(--wp--preset--color--encre-douce); }
.ppc-affi-encadre ul { list-style: none; margin: 0; padding: 0; }
.ppc-affi-encadre li { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; padding: 0.9rem 0; border-top: 1px solid var(--wp--preset--color--trait); }
.ppc-affi-encadre__produit { flex: 1 1 260px; display: flex; flex-direction: column; }
.ppc-affi-encadre__nom { font-weight: 600; }
.ppc-affi-encadre__marchand { font-size: 0.875rem; color: var(--wp--preset--color--encre-douce); }
.ppc-affi-encadre__bouton {
	display: inline-block;
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--papier) !important;
	font-weight: 600;
	font-size: 0.9375rem;
	text-decoration: none;
	padding: 0.75rem 1.1rem;
	border-radius: 12px;
	min-height: 44px;
	box-sizing: border-box;
}
.ppc-affi-encadre__bouton:hover { background: var(--wp--preset--color--ciseaux-texte); }
.ppc-affi-encadre__note { font-size: 0.8125rem; color: var(--wp--preset--color--encre-douce); margin: 0.5rem 0 0; }

/* ---------- Bloc auteur ---------- */
.ppc-auteur { border-top: 2px solid var(--wp--preset--color--encre); padding-top: 1.4rem; }
.ppc-auteur__badge { flex: none; width: 112px; height: 112px; margin: 0; }
.ppc-auteur p { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: #45403A; }

/* ---------- Accessibilité ---------- */
:where(a, button, input):focus-visible { outline: 3px solid var(--wp--preset--color--pierre-texte); outline-offset: 2px; }

/* ---------- Titres sans balise Hn (liens et titres de design) ---------- */
p.wp-block-post-title,
.ppc-section-titre,
.ppc-a-propos__titre {
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0;
}
.ppc-section-titre { font-size: clamp(1.375rem, 3vw, 1.75rem); }
.ppc-section-titre + p { white-space: nowrap; margin: 0; }
.ppc-une__titre { font-size: clamp(2rem, 4vw, 2.875rem); line-height: 1.05; }
.ppc-carte p.wp-block-post-title { font-size: 1.3rem; }
.ppc-liste p.wp-block-post-title { font-size: 1.25rem; }

/* ---------- Accueil : présentation (H1) et à propos ---------- */
.ppc-presentation { border-top: 2px solid var(--wp--preset--color--encre); border-bottom: 2px solid var(--wp--preset--color--encre); padding: 1.1rem 0; }
.ppc-presentation__titre { font-size: clamp(1.0625rem, 1.8vw, 1.3125rem); font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; margin: 0; text-align: center; }
.ppc-a-propos { background: var(--wp--preset--color--carte); border: 2px solid var(--wp--preset--color--encre); border-radius: 18px; padding: clamp(1.25rem, 3vw, 2rem); }
.ppc-a-propos__badge { flex: none; margin: 0; }
.ppc-a-propos__titre { font-size: 1.5rem; }
.ppc-a-propos p { margin: 0; }
@media (max-width: 600px) {
	.ppc-a-propos { flex-direction: column; align-items: flex-start !important; }
	.ppc-auteur__badge, .ppc-auteur__badge img { width: 88px !important; height: 88px !important; }
}

/* ---------- Commentaires ---------- */
.ppc-commentaires { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid var(--wp--preset--color--encre); }
.ppc-commentaires__titre,
.ppc-commentaires .comment-reply-title {
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 800;
	font-size: 1.5rem;
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0 0 1rem;
}
.ppc-commentaires .wp-block-comment-template { list-style: none; margin: 0 0 2rem; padding: 0; }
.ppc-commentaires .wp-block-comment-template ol { list-style: none; padding-left: clamp(1rem, 4vw, 2.5rem); }
.ppc-commentaire {
	background: var(--wp--preset--color--carte);
	border: 2px solid var(--wp--preset--color--encre);
	border-radius: 16px;
	padding: 1rem 1.25rem;
	margin-bottom: 1rem;
}
.ppc-commentaire__auteur { font-weight: 700; }
.ppc-commentaire__date { font-size: 0.875rem; color: var(--wp--preset--color--encre-douce); }
.ppc-commentaire .wp-block-comment-content p { margin: 0.25rem 0; font-size: 1rem; line-height: 1.6; }
.ppc-commentaire__repondre a { font-size: 0.875rem; font-weight: 600; }
/* Le commentaire de l'auteur du blog se distingue */
.ppc-commentaires .bypostauthor > .ppc-commentaire { background: var(--wp--preset--color--creme-fonce); }
.ppc-commentaires .comment-form { display: flex; flex-direction: column; gap: 0.75rem; }
.ppc-commentaires .comment-form p { margin: 0; }
.ppc-commentaires .comment-form label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.3rem; }
.ppc-commentaires .comment-form input[type="text"],
.ppc-commentaires .comment-form input[type="email"],
.ppc-commentaires .comment-form input[type="url"],
.ppc-commentaires .comment-form textarea {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	font-size: 1rem;
	padding: 0.7rem 0.85rem;
	border: 2px solid var(--wp--preset--color--encre);
	border-radius: 12px;
	background: #FFFFFF;
	color: var(--wp--preset--color--encre);
}
.ppc-commentaires .comment-notes,
.ppc-commentaires .comment-form-cookies-consent { font-size: 0.875rem; color: var(--wp--preset--color--encre-douce); }
.ppc-commentaires .comment-form-cookies-consent { display: flex; gap: 0.5rem; align-items: flex-start; }
.ppc-commentaires .comment-form-cookies-consent label { font-weight: 400; margin: 0; }
.ppc-commentaires .form-submit .submit { min-height: 44px; }

/* ---------- Recherche (loupe) et temps de lecture ---------- */
.ppc-recherche .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--encre);
	border: 2px solid var(--wp--preset--color--encre);
	border-radius: 999px;
	width: 44px;
	height: 44px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ppc-recherche .wp-block-search__button:hover { background: var(--wp--preset--color--sable); }
.ppc-recherche .wp-block-search__button svg { width: 22px; height: 22px; fill: currentColor; }
.ppc-recherche .wp-block-search__input { border: 2px solid var(--wp--preset--color--encre); border-radius: 999px; padding: 0.5rem 1rem; font: inherit; font-size: 0.9375rem; background: #FFFFFF; }
.ppc-recherche .wp-block-search__inside-wrapper { gap: 0.4rem; border: 0; padding: 0; }
.wp-block-shortcode:has(.ppc-temps-lecture) { margin: 0; }

@media (max-width: 600px) {
	.ppc-entete .wp-block-site-title { font-size: 1.1875rem !important; white-space: nowrap; line-height: 1.2; }
	.ppc-logo { gap: 0.5rem; }
	.ppc-logo__formes { width: 48px; height: 16px; }
}

/* ---------- Pied de page ---------- */
.ppc-pied .wp-block-navigation a { color: var(--wp--preset--color--papier); text-decoration: none; }
.ppc-pied .wp-block-navigation a:hover { color: var(--wp--preset--color--papier-jaune); text-decoration: underline; }
.ppc-pied__copyright { border-top: 1px solid rgba(251, 245, 234, 0.25); padding-top: 1.25rem; opacity: 0.8; }
