/*
Theme Name: Endo & Moi
Theme URI: https://www.endo-et-moi.fr
Author: Endo & Moi
Description: Thème à blocs (FSE) du site Endo & Moi : conseils, recettes et sélection de produits pour mieux vivre avec l'endométriose. Couleurs, typographies, en-tête, pied de page et modèles se modifient dans Apparence → Éditeur.
Version: 1.1.0
Requires at least: 6.6
Tested up to: 6.9
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: endo-et-moi
Tags: block-patterns, full-site-editing, blog, one-column, custom-colors, editor-style
*/

/* -----------------------------------------------------------------
   Ce fichier ne contient que ce que les réglages de blocs ne savent
   pas faire seuls. Les couleurs, polices, tailles et espacements
   sont dans theme.json (et modifiables dans Apparence → Éditeur → Styles).
----------------------------------------------------------------- */

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

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- En-tête ---------- */
.em-header {
	border-bottom: 1px solid #e8e8e4;
}

.em-logo {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
}

.em-logo a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

/* Liens du menu en forme de pastille */
.em-nav .wp-block-navigation-item__content {
	display: inline-block;
	padding: 12px 18px;
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.em-nav .wp-block-navigation-item__content:hover {
	background-color: var(--wp--preset--color--mist);
	color: var(--wp--preset--color--contrast);
}

.em-nav .current-menu-item > .wp-block-navigation-item__content,
.em-nav .wp-block-navigation-item__content[aria-current="page"] {
	background-color: var(--wp--preset--color--primary-light);
}

.em-nav .wp-block-navigation__container {
	gap: 4px;
}

/* Menu mobile ouvert */
.em-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 24px;
}

.em-nav .is-menu-open .wp-block-navigation__container {
	gap: 8px;
}

/* ---------- Pied de page ---------- */
.em-footer {
	border-top: 1px solid #e8e8e4;
}

.em-footer-text {
	max-width: 460px;
}

.em-footer .wp-block-navigation-item__content {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Style de groupe « Carte blanche » ---------- */
:where(.wp-block-group.is-style-carte) {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--medium);
	padding: 24px;
}

/* ---------- Cartes entièrement cliquables ---------- */
.em-card-link {
	position: relative;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.em-card-link :is(h2, h3) a {
	color: inherit;
	text-decoration: none;
}

.em-card-link :is(h2, h3) a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.em-card-link:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(31, 42, 42, 0.08);
}

@media (prefers-reduced-motion: reduce) {
	.em-card-link,
	.em-card-link:hover {
		transition: none;
		transform: none;
	}
}

/* Petit carré de couleur des thèmes */
.wp-block-group.em-pastille {
	width: 36px;
	height: 36px;
	min-height: 36px;
	padding: 0;
	border-radius: var(--wp--custom--radius--small);
	flex-shrink: 0;
}

/* ---------- Hero ---------- */
.wp-block-cover.em-hero {
	border-radius: var(--wp--custom--radius--large);
	overflow: hidden;
}

.em-hero-card {
	max-width: 500px;
}

.em-surtitre {
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

@media (max-width: 600px) {
	.wp-block-cover.em-hero {
		padding: 16px !important;
		align-items: flex-end;
	}

	.em-hero-card {
		padding: 24px !important;
	}
}

/* ---------- Cartes d'articles ---------- */
.em-post-card {
	height: 100%;
	box-sizing: border-box;
}

.em-post-card .wp-block-post-featured-image {
	margin: 0;
}

.em-post-card .wp-block-post-featured-image img {
	width: 100%;
	object-fit: cover;
}

.em-post-card .wp-block-post-title {
	margin: 0;
}

.em-post-card .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.em-post-meta {
	font-size: var(--wp--preset--font-size--x-small);
}

/* ---------- Filtres par catégorie (style « Pastilles ») ---------- */
.wp-block-categories.is-style-pastilles,
.is-style-pastilles .wp-block-categories-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.is-style-pastilles .cat-item {
	margin: 0;
}

.is-style-pastilles .cat-item a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border: 1.5px solid var(--wp--preset--color--primary);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	box-sizing: border-box;
}

.is-style-pastilles .cat-item a:hover,
.is-style-pastilles .current-cat a {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
}

/* ---------- Boutons ---------- */
.wp-block-button.em-btn-small .wp-block-button__link {
	padding: 11px 18px;
	font-size: 14px;
}

/* ---------- Cartes produits ---------- */
.wp-block-group.em-product {
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
	height: 100%;
	box-sizing: border-box;
}

.em-product-media {
	position: relative;
	background: var(--wp--preset--color--mist);
}

.em-product-media .wp-block-image {
	margin: 0;
}

.em-product-media .wp-block-image img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
	border-radius: 0;
}

.em-badge {
	position: absolute;
	top: 14px;
	left: 14px;
	margin: 0 !important;
	padding: 6px 12px;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--yellow);
	color: var(--wp--preset--color--contrast);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.em-product-body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	padding: 22px;
}

.em-product-body > .em-product-grow {
	flex-grow: 1;
}

.em-price {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
}

/* ---------- Encadrés ---------- */
.em-placeholder {
	padding: 18px 22px;
	border: 2px dashed var(--wp--preset--color--primary);
	border-radius: 16px;
	color: var(--wp--preset--color--contrast-2);
	font-size: 15px;
}

/* ---------- Formulaires (Contact Form 7, WPForms, Jetpack, MailPoet, Brevo…) ---------- */
.em-form :is(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], select, textarea) {
	width: 100%;
	min-height: 46px;
	padding: 0 14px;
	border: 1px solid #c9cfcd;
	border-radius: var(--wp--custom--radius--small);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: 16px;
	box-sizing: border-box;
}

.em-form textarea {
	min-height: 160px;
	padding: 12px 14px;
	resize: vertical;
}

.em-form label {
	font-size: 14px;
	font-weight: 600;
}

.em-form input[type="checkbox"] {
	width: 20px;
	height: 20px;
	accent-color: var(--wp--preset--color--primary);
}

.em-form :is(input[type="submit"], button[type="submit"]) {
	min-height: 48px;
	padding: 0 26px;
	border: none;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.em-form :is(input[type="submit"], button[type="submit"]):hover {
	background: var(--wp--preset--color--primary-dark);
}

/* Variante newsletter : champs en pastille */
.em-form--pill :is(input[type="text"], input[type="email"]) {
	min-height: 48px;
	padding: 0 18px;
	border-color: #d9d4bf;
	border-radius: var(--wp--custom--radius--pill);
}

/* ---------- Contenu des articles et pages légales ---------- */
.em-legal h2 {
	margin-top: 40px;
	font-size: 24px;
}

.em-legal :is(table) {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

.em-legal :is(th, td) {
	padding: 10px 12px;
	border-bottom: 1px solid var(--wp--preset--color--border);
	text-align: left;
	vertical-align: top;
}

.em-legal th {
	background: var(--wp--preset--color--base);
	font-weight: 600;
}

@media (max-width: 600px) {
	.em-legal {
		padding: 28px 22px !important;
	}
}

.wp-block-post-content a {
	text-underline-offset: 3px;
}

/* ---------- Pagination ---------- */
.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
	text-decoration: none;
}

.wp-block-query-pagination-numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	border-radius: var(--wp--custom--radius--pill);
}

.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
}

/* ---------- Ajustements de mise en page ---------- */
.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part:last-child {
	margin-block-start: 0;
}

.em-legal {
	max-width: 760px;
	box-sizing: border-box;
}

.em-post-meta p {
	margin: 0;
}

.wp-block-search__input {
	min-height: 48px;
	padding: 0 18px;
	border: 1px solid #c9cfcd;
	border-radius: var(--wp--custom--radius--pill);
	font: inherit;
}

.wp-block-search__button {
	border-radius: var(--wp--custom--radius--pill);
}

/* ---------- Corrections de fidélité (v1.1) ---------- */
.em-hero-card {
	color: var(--wp--preset--color--contrast);
}

.em-hero-card h1 {
	color: var(--wp--preset--color--contrast);
}

/* Newsletter : texte à gauche, formulaire à droite (comme la maquette) */
.em-form--pill {
	flex: 1 1 360px !important;
	max-width: 520px;
}

