/*
Theme Name: NutriCoach
Theme URI: https://nutricoachai.com
Author: NutriCoach AI
Description: Thème bloc (FSE) sur mesure pour nutricoachai.com. Maigrir sans régime, avec les Peps au cœur du modèle.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nutricoach
Tags: blog, e-commerce, full-site-editing, block-patterns, custom-colors, custom-logo, wide-blocks
*/

/* --- Confort de lecture --- */

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Évite que les mots isolés cassent mal sur mobile */
h1, h2, h3 {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

/* --- Accessibilité --- */

.nc-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	padding: .75rem 1.25rem;
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--blanc);
	border-radius: 0 0 8px 0;
	text-decoration: none;
}

.nc-skip-link:focus {
	left: 0;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--encre);
	outline-offset: 3px;
	border-radius: 4px;
}

/* --- Boutons : transition douce --- */

.wp-block-button__link {
	transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px -12px rgba(169, 47, 65, .65);
}

/* Bouton secondaire (contour) */
.wp-block-button.is-style-outline .wp-block-button__link {
	border-width: 1.5px;
	box-shadow: none;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--encre);
	border-color: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--blanc);
}

/* --- Style de bloc : la carte --- */

.is-style-nc-carte {
	background: var(--wp--preset--color--blanc);
	border: 1px solid rgba(36, 30, 28, .07);
	border-radius: 18px;
	box-shadow: var(--wp--preset--shadow--douce);
	height: 100%;
}

/* --- Style de bloc : la pastille Peps --- */

.is-style-nc-pastille {
	display: inline-flex;
	align-items: center;
	gap: .45em;
	background: var(--wp--preset--color--peps);
	color: var(--wp--preset--color--encre);
	font-family: var(--wp--preset--font-family--titre);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--petit);
	line-height: 1;
	padding: .55em 1em;
	border-radius: 999px;
	margin: 0;
}

/* --- Listes sans puces (pied de page) --- */

.is-style-no-bullets {
	list-style: none;
	padding-left: 0;
}

.is-style-no-bullets a {
	text-decoration: none;
}

.is-style-no-bullets a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --- Chiffres clés --- */

.nc-chiffre {
	font-family: var(--wp--preset--font-family--titre);
	font-weight: 800;
	font-size: clamp(2.75rem, 6vw, 4rem);
	line-height: 1;
	letter-spacing: -.03em;
	margin: 0 0 .25rem;
}

/* --- En-tête collant --- */

.nc-header {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: saturate(180%) blur(12px);
	background: rgba(255, 249, 242, .86);
	border-bottom: 1px solid rgba(36, 30, 28, .07);
}

.admin-bar .nc-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .nc-header { top: 46px; }
}

/* Navigation : soulignement animé */
.nc-header .wp-block-navigation-item__content {
	position: relative;
	padding-block: .35rem;
}

.nc-header .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 100%;
	bottom: 0;
	height: 2px;
	background: var(--wp--preset--color--framboise);
	border-radius: 2px;
	transition: right .22s ease;
}

.nc-header .wp-block-navigation-item__content:hover::after,
.nc-header .current-menu-item .wp-block-navigation-item__content::after {
	right: 0;
}

/* Le sous-menu déroulant ne doit pas hériter du soulignement */
.nc-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content::after {
	display: none;
}

/* --- Bandeau incliné (sections colorées) --- */

.nc-biseau {
	position: relative;
}

.nc-biseau::before {
	content: "";
	position: absolute;
	inset: -3.5rem 0 auto 0;
	height: 3.5rem;
	background: inherit;
	clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* --- Grilles : cartes de hauteur égale --- */

.wp-block-columns.nc-egales > .wp-block-column {
	display: flex;
	flex-direction: column;
}

/* --- Articles (recettes) --- */

.wp-block-post-title a {
	text-decoration: none;
}

.wp-block-post-title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wp-block-post-featured-image img {
	border-radius: 14px;
}

/* --- WooCommerce : accord minimal avec le thème --- */

.woocommerce ul.products li.product a img {
	border-radius: 14px;
}

.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button.alt,
.woocommerce button.button.alt {
	background-color: var(--wp--preset--color--framboise);
	color: #fff;
	font-family: var(--wp--preset--font-family--titre);
	font-weight: 600;
	border-radius: 999px;
	padding: .9rem 1.85rem;
	transition: background-color .18s ease;
}

.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
	background-color: var(--wp--preset--color--framboise-fonce);
	color: #fff;
}

.woocommerce span.onsale {
	background-color: var(--wp--preset--color--peps);
	color: var(--wp--preset--color--encre);
	font-family: var(--wp--preset--font-family--titre);
	font-weight: 700;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price,
.woocommerce ul.products li.product .price {
	color: var(--wp--preset--color--framboise-fonce);
	font-family: var(--wp--preset--font-family--titre);
	font-weight: 700;
}
