/*
Theme Name: Perruque Perruquier
Theme URI: https://perruque-perruquier.com
Author: Perruque Perruquier
Description: Thème sur mesure pour perruque-perruquier.com — perruques médicales, accompagnement personnalisé et remboursement AI. Site vitrine (sans boutique en ligne) avec catalogue de produits, blog « Conseils » et formulaire de contact.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: perruque-perruquier
*/

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
	--pp-copper: rgb(174 105 49 / 0.84);
	--pp-copper-solid: #bb8152;
	--pp-copper-light: #d8b69b;
	--pp-copper-hover: rgb(174 105 49 / 0.42);
	--pp-white: #ffffff;
	--pp-grey: #f2f2f2;
	--pp-text: #000000;
	--pp-muted: #666666;
	--pp-border: #e6e6e6;
	--pp-button: #000000;
	--pp-button-hover: #383838;

	--pp-font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--pp-font-heading: "Newsreader", Georgia, "Times New Roman", serif;

	--pp-h1: clamp(3rem, 7.2vw, 4.5rem);
	--pp-h2: clamp(2.25rem, 4.8vw, 3rem);
	--pp-h3: 2rem;
	--pp-h4: 1.5rem;

	--pp-page-width: 1200px;
	--pp-gutter: clamp(16px, 4vw, 40px);
	--pp-section-space: clamp(48px, 7vw, 88px);
	--pp-header-height: 72px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--pp-white);
	color: var(--pp-text);
	font-family: var(--pp-font-body);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

/* Fond cuivré du site (identique au schéma de couleurs principal) */
.site { background: var(--pp-copper); min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-underline-offset: 0.2em; }
a:hover { color: var(--pp-muted); }

h1, h2, h3, h4, h5, h6 {
	overflow-wrap: break-word;
	font-family: var(--pp-font-heading);
	font-weight: 400;
	line-height: 1.2;
	margin: 0 0 0.5em;
	letter-spacing: 0;
}
h1 { font-size: var(--pp-h1); line-height: 1.1; }
h2 { font-size: var(--pp-h2); }
h3 { font-size: var(--pp-h3); line-height: 1.25; }
h4 { font-size: var(--pp-h4); }
h5, h6 { font-size: 1rem; }

p { margin: 0 0 0.75em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: 0.25em; }
strong { font-weight: 600; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto;
	position: fixed !important; top: 8px; left: 8px; z-index: 1000;
	background: var(--pp-white); padding: 12px 16px;
}

:focus-visible { outline: 2px solid var(--pp-text); outline-offset: 3px; }

.page-width {
	width: 100%;
	max-width: calc(var(--pp-page-width) + 2 * var(--pp-gutter));
	margin-inline: auto;
	padding-inline: var(--pp-gutter);
}

/* ==========================================================================
   Boutons
   ========================================================================== */
.button,
.wp-block-button__link,
.wp-element-button,
input[type="submit"],
button.pp-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	padding: 14px 28px;
	border: 0;
	border-radius: 0;
	background: var(--pp-button);
	color: var(--pp-white);
	font-family: var(--pp-font-body);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.button:hover,
.wp-block-button__link:hover,
.wp-element-button:hover,
input[type="submit"]:hover,
button.pp-button:hover { background: var(--pp-button-hover); color: var(--pp-white); }

/* Bouton secondaire (style « contour » de l'éditeur) */
.button--secondary,
.is-style-outline > .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link {
	background: var(--pp-copper);
	color: var(--pp-text);
	border: 1px solid #efefef;
}
.button--secondary:hover,
.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--pp-copper-hover);
	color: var(--pp-text);
	border-color: #dedede;
}

.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.25em 0 0; }

/* ==========================================================================
   En-tête
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--pp-copper-solid);
	border-bottom: 1px solid rgb(0 0 0 / 0.08);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.site-header__inner {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 24px;
	min-height: var(--pp-header-height);
}

.site-brand { padding-block: 16px; }
.site-brand a {
	font-family: var(--pp-font-body);
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	color: var(--pp-text);
}
.site-brand .custom-logo { max-height: 56px; width: auto; }

/* Navigation principale */
.site-nav { justify-self: center; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px clamp(14px, 1.6vw, 26px); }
.site-nav li { position: relative; margin: 0; }
.site-nav a {
	display: block;
	padding: 10px 0;
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	white-space: nowrap;
	text-decoration: none;
	color: var(--pp-text);
}
.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current-menu-ancestor > a { text-decoration: underline; color: var(--pp-text); }

.site-nav .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	width: 6px; height: 6px;
	margin-left: 8px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: translateY(-3px) rotate(45deg);
}

.site-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: -20px;
	min-width: 260px;
	padding: 12px 20px;
	background: var(--pp-copper-solid);
	box-shadow: 0 10px 30px rgb(0 0 0 / 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.site-nav .sub-menu a { text-transform: none; letter-spacing: 0; font-size: 0.95rem; padding: 8px 0; }

/* Actions (recherche, menu mobile) */
.site-header__actions { display: flex; align-items: center; gap: 8px; justify-self: end; }
.icon-button {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px;
	padding: 0; border: 0; background: transparent; color: var(--pp-text);
	cursor: pointer;
}
.icon-button svg { width: 22px; height: 22px; }
.menu-toggle { display: none; }

.site-search { padding-block: 0 20px; }
.site-search[hidden] { display: none; }

/* Formulaire de recherche */
.search-form { display: flex; gap: 0; max-width: 640px; margin-inline: auto; }
.search-form label { flex: 1; }
.search-form .search-field { width: 100%; }

/* Navigation mobile */
@media (max-width: 1024px) {
	.site-header__inner { grid-template-columns: 1fr auto; }
	.menu-toggle { display: inline-flex; }
	.site-nav {
		display: none;
		grid-column: 1 / -1;
		justify-self: stretch;
		padding-bottom: 20px;
	}
	.site-nav.is-open { display: block; }
	.site-nav > ul { flex-direction: column; gap: 0; }
	.site-nav > ul > li { border-top: 1px solid rgb(0 0 0 / 0.12); }
	.site-nav a { padding: 14px 0; }
	.site-nav .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none;
		box-shadow: none; padding: 0 0 8px 16px; min-width: 0; background: transparent;
	}
	.site-nav .menu-item-has-children > a::after { display: none; }
	.site-header__actions { grid-column: 2; grid-row: 1; }
}

/* ==========================================================================
   Contenu des pages
   ========================================================================== */
.entry-content > * {
	max-width: var(--pp-page-width);
	margin-inline: auto;
}
.entry-content > .alignfull { max-width: none; }
.entry-content > .alignwide { max-width: var(--pp-page-width); }

/* Page classique (avec titre) */
.page-standard { padding-block: var(--pp-section-space); }
.page-standard .entry-header,
.page-standard .entry-content > * { max-width: 760px; margin-inline: auto; }
.page-standard .entry-content > .alignfull { max-width: none; }
.page-standard .entry-title { margin-bottom: 0.6em; }
.content-card {
	background: var(--pp-white);
	padding: clamp(24px, 5vw, 56px);
}

/* Sections (groupes pleine largeur) */
.pp-section {
	padding: var(--pp-section-space) var(--pp-gutter);
	margin-block: 0;
}
.pp-section > * { max-width: var(--pp-page-width); margin-inline: auto; }
.pp-section.is-narrow > * { max-width: 760px; }
.pp-section.is-center { text-align: center; }
.pp-section.is-center .wp-block-buttons { justify-content: center; }
.is-copper { background: var(--pp-copper-solid); }
.is-copper-light { background: var(--pp-copper-light); }
.is-white { background: var(--pp-white); }
.is-grey { background: var(--pp-grey); }
.is-black { background: #000; color: #fff; }

.entry-content > .pp-section + .pp-section,
.entry-content > .pp-split + .pp-section,
.entry-content > .pp-section + .pp-split { margin-top: 0; }

.pp-eyebrow {
	font-family: var(--pp-font-body);
	font-size: 0.875rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 0.75em;
}
.pp-lead { font-size: 1.125rem; }

/* Bloc « texte + image » (colonnes pleine largeur, image collée au bord) */
.wp-block-columns.pp-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 0;
	margin: 0;
	align-items: stretch;
}
.pp-split > .wp-block-column { margin: 0; min-width: 0; }
.pp-split .pp-split__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: var(--pp-section-space) clamp(24px, 6vw, 96px);
}
.pp-split .pp-split__content > * { max-width: 560px; }
.pp-split .pp-split__media { display: flex; flex-direction: column; min-height: 420px; }
.pp-split .pp-split__media > figure,
.pp-split .pp-split__media > .wp-block-image { flex: 1 1 auto; display: flex; margin: 0; min-height: 420px; }
.pp-split .pp-split__media img { flex: 1 1 auto; width: 100%; height: auto; min-height: 100%; object-fit: cover; }
.pp-split.is-hero { min-height: min(78vh, 760px); }
.pp-split.is-hero h1 { margin-bottom: 0.4em; }
.pp-split.media-left .pp-split__media { order: -1; }

@media (max-width: 781px) {
	.wp-block-columns.pp-split { grid-template-columns: minmax(0, 1fr); }
	.pp-split .pp-split__media,
	.pp-split .pp-split__media > figure,
	.pp-split .pp-split__media > .wp-block-image { min-height: 0; }
	.pp-split .pp-split__media { order: -1; }
	.pp-split .pp-split__media img { aspect-ratio: 4 / 3; min-height: 0; }
	.pp-split .pp-split__content { padding: 40px var(--pp-gutter) 56px; }
}

/* Cartes (3 colonnes) */
.wp-block-columns.pp-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin-top: 1.5em;
}
.pp-cards > .wp-block-column {
	display: flex;
	flex-direction: column;
	background: var(--pp-white);
	border: 1px solid var(--pp-border);
	padding: clamp(24px, 3vw, 36px);
	margin: 0;
}
.pp-cards > .wp-block-column > .wp-block-buttons { margin-top: auto; padding-top: 1em; }
.pp-cards h3 { font-size: 1.75rem; }
.pp-cards.is-plain > .wp-block-column { background: transparent; border: 0; padding: 0; }
@media (max-width: 900px) { .wp-block-columns.pp-cards { grid-template-columns: minmax(0, 1fr); } }

/* Étapes numérotées */
.pp-steps h3 { font-size: 1.6rem; margin-top: 1.4em; }
.pp-steps h3:first-of-type { margin-top: 0.6em; }

/* Encadré contact */
.pp-callout {
	background: var(--pp-copper-light);
	padding: clamp(24px, 4vw, 48px);
	text-align: center;
}
.pp-callout .wp-block-buttons { justify-content: center; }

/* Sections alternées (page « Pour qui ? ») */
.pp-feature {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: clamp(24px, 5vw, 72px);
	align-items: center;
}
.pp-feature .wp-block-column { margin: 0; }
.pp-feature.media-left > .wp-block-column:last-child { order: -1; }
.pp-feature img { width: 100%; height: auto; }
@media (max-width: 781px) {
	.pp-feature { grid-template-columns: minmax(0, 1fr); }
	.pp-feature > .wp-block-column:last-child { order: -1; }
}

.wp-block-image { margin: 0 0 1em; }
.wp-block-image img { height: auto; }
.wp-block-separator { border: 0; border-top: 1px solid rgb(0 0 0 / 0.15); margin: 2em auto; }

/* ==========================================================================
   Formulaires
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
textarea,
select {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid rgb(0 0 0 / 0.13);
	border-radius: 0;
	background: var(--pp-white);
	color: var(--pp-text);
	font: inherit;
}
input:hover, textarea:hover { background: #f5f5f5; }
textarea { min-height: 160px; resize: vertical; }

.pp-form { display: grid; gap: 16px; max-width: 760px; margin-inline: auto; }
.pp-form__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.pp-form label { display: block; font-size: 0.875rem; margin-bottom: 6px; }
.pp-form .pp-hp { position: absolute; left: -9999px; }
.pp-form__actions { margin-top: 8px; }
.pp-form__notice { padding: 14px 18px; margin-bottom: 8px; background: var(--pp-white); border-left: 4px solid #006400; }
.pp-form__notice.is-error { border-left-color: #8b0000; }
@media (max-width: 600px) { .pp-form__row { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Produits (catalogue sans vente en ligne)
   ========================================================================== */
.catalogue-header { padding-block: var(--pp-section-space) 24px; }
.catalogue-header .archive-description { max-width: 760px; }
.catalogue { padding-bottom: var(--pp-section-space); }
.catalogue-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.catalogue-filters a {
	padding: 8px 16px; border: 1px solid rgb(0 0 0 / 0.25);
	text-decoration: none; font-size: 0.875rem;
}
.catalogue-filters a.is-active,
.catalogue-filters a:hover { background: var(--pp-text); color: var(--pp-white); border-color: var(--pp-text); }

.product-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 28px 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}
@media (max-width: 1024px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 749px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; } }

.product-card { margin: 0; }
.product-card a { text-decoration: none; color: inherit; display: block; }
.product-card__media {
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: var(--pp-white);
	margin-bottom: 12px;
	position: relative;
}
.product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s ease, transform 0.6s ease; }
.product-card__media .is-secondary { position: absolute; inset: 0; opacity: 0; }
.product-card:hover .product-card__media .is-secondary { opacity: 1; }
.product-card:hover .product-card__media img { transform: scale(1.02); }
.product-card__title { font-family: var(--pp-font-body); font-size: 0.95rem; font-weight: 400; margin: 0 0 4px; line-height: 1.4; }
.product-card__price { font-size: 0.95rem; }

.product { padding-block: clamp(32px, 5vw, 64px) var(--pp-section-space); }
.product__layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .product__layout { grid-template-columns: minmax(0, 1fr); } }
.product__main-image { aspect-ratio: 3 / 4; background: var(--pp-white); overflow: hidden; }
.product__main-image img { width: 100%; height: 100%; object-fit: cover; }
.product__thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; list-style: none; padding: 0; }
.product__thumbs button {
	display: block; width: 100%; padding: 0; border: 2px solid transparent;
	background: none; cursor: pointer; aspect-ratio: 3 / 4; overflow: hidden;
}
.product__thumbs button[aria-current="true"] { border-color: var(--pp-text); }
.product__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product__info { position: sticky; top: calc(var(--pp-header-height) + 24px); }
.product__title { font-size: clamp(2rem, 4vw, 2.75rem); }
.product__price { font-size: 1.25rem; margin-bottom: 1em; }
.product__note { font-size: 0.9rem; color: rgb(0 0 0 / 0.75); margin-top: 12px; }
.product__description { margin-top: 1.75em; padding-top: 1.5em; border-top: 1px solid rgb(0 0 0 / 0.15); }
.product__back { display: inline-block; margin-bottom: 20px; font-size: 0.9rem; }

/* ==========================================================================
   Blog « Conseils »
   ========================================================================== */
.blog-header { padding-block: var(--pp-section-space) 24px; }
.post-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	padding-bottom: var(--pp-section-space);
}
@media (max-width: 900px) { .post-grid { grid-template-columns: minmax(0, 1fr); } }
.post-card { background: var(--pp-white); display: flex; flex-direction: column; }
.post-card__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.post-card__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.post-card__title { font-size: 1.6rem; }
.post-card__title a { text-decoration: none; }
.post-card__meta { font-size: 0.85rem; color: rgb(0 0 0 / 0.65); margin-bottom: 8px; }
.post-card__more { margin-top: auto; padding-top: 12px; }

.single-post-wrap { padding-block: var(--pp-section-space); }
.single-post-wrap .content-card { max-width: 860px; margin-inline: auto; }
.single-post-wrap .entry-content > * { max-width: none; }
.single-post-wrap .entry-content h2 { font-size: 2rem; margin-top: 1.4em; }
.single-post-wrap .entry-content h3 { font-size: 1.4rem; margin-top: 1.1em; }
.entry-meta { font-size: 0.9rem; color: rgb(0 0 0 / 0.65); margin-bottom: 1.5em; }

.pagination, .nav-links { display: flex; gap: 8px; justify-content: center; padding-bottom: var(--pp-section-space); }
.page-numbers { padding: 8px 14px; text-decoration: none; background: var(--pp-white); }
.page-numbers.current { background: var(--pp-text); color: var(--pp-white); }

/* ==========================================================================
   Pied de page
   ========================================================================== */
.site-footer { background: var(--pp-copper-solid); border-top: 1px solid rgb(0 0 0 / 0.08); }
.site-footer__top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 40px;
	padding-block: 56px 40px;
}
.site-footer h2 {
	font-family: var(--pp-font-body);
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 1em;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: inherit; }
.site-footer address { font-style: normal; line-height: 1.8; }

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px 32px;
	padding-block: 24px;
	border-top: 1px solid rgb(0 0 0 / 0.12);
	font-size: 0.8125rem;
}
.site-footer__legal ul { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer__legal li { margin: 0; }
.social-links { display: flex; gap: 6px; }
.social-links a { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; }
.social-links svg { width: 20px; height: 20px; fill: currentColor; }

@media (max-width: 700px) {
	.site-footer__top { grid-template-columns: 1fr; gap: 32px; }
	.site-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Divers
   ========================================================================== */
.not-found, .search-results-wrap { padding-block: var(--pp-section-space); }
.search-results-list { list-style: none; padding: 0; }
.search-results-list li { background: var(--pp-white); padding: 20px 24px; margin-bottom: 12px; }
.search-results-list h2 { font-size: 1.5rem; margin-bottom: 0.3em; }
.search-results-list a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
