/*
Theme Name: Nouilles qui courent
Description: Thème de la communauté de running Les Nouilles qui courent : « Textile », une toile, des écussons cousus, un dossard épinglé.
Version: 0.4.3
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: nouilles
*/

/* ---------- Polices hébergées sur le site (licence SIL OFL) ---------- */
@font-face {
	font-family: 'Fredoka';
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url("assets/fonts/fredoka-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Fredoka';
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url("assets/fonts/fredoka-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Space Mono';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/space-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
	font-family: 'Space Mono';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("assets/fonts/space-mono-latin-700-normal.woff2") format("woff2");
}

/* ---------- Le vocabulaire Textile ---------- */
:root {
	--nqc-ink: var(--wp--preset--color--encre);
	--nqc-cloth: var(--wp--preset--color--creme);
	--nqc-cloth2: var(--wp--preset--color--sable);
	--nqc-cream: var(--wp--preset--color--creme);
	--nqc-sand: var(--wp--preset--color--sable);
	--nqc-yellow: var(--wp--preset--color--nouille);
	--nqc-yellow2: #d9a62e;
	--nqc-red: var(--wp--preset--color--piment);
	--nqc-brick: var(--wp--preset--color--brique);
	--nqc-green: var(--wp--preset--color--ciboulette);
	--nqc-sky: var(--wp--preset--color--ciel);
	--nqc-mute: #655848;
	--nqc-thread: rgba(42, 34, 28, .45);
	--nqc-line: 2px solid var(--wp--preset--color--encre);
	--nqc-radius: 6px;
	--nqc-shadow: 0 10px 24px -16px rgba(42, 34, 28, .6);
	--nqc-shadow-hover: 0 18px 30px -16px rgba(42, 34, 28, .6);
	--nqc-weave:
		repeating-linear-gradient(0deg, rgba(0, 0, 0, .035) 0 1px, transparent 1px 4px),
		repeating-linear-gradient(90deg, rgba(255, 255, 255, .08) 0 1px, transparent 1px 4px);
}

body {
	-webkit-font-smoothing: antialiased;
	background-image: var(--nqc-weave);
}
a { text-underline-offset: 3px; text-decoration-thickness: 2px; }

/* Un écusson : fond blanc, coutures en pointillé à 10 px du bord, ombre douce. Tout bloc .nqc-patch l'obtient. */
.nqc-patch, .nqc-card, .nqc-post-card, .nqc-lvl, .nqc-author-box,
.woocommerce ul.products li.product, .wc-block-grid__product {
	position: relative;
	background: #fff;
	border-radius: var(--nqc-radius);
	box-shadow: var(--nqc-shadow);
}
.nqc-patch::after, .nqc-card::after, .nqc-post-card::after, .nqc-lvl::after, .nqc-author-box::after,
.woocommerce ul.products li.product::after, .wc-block-grid__product::after {
	content: "";
	position: absolute;
	inset: 10px;
	border: 1.5px dashed var(--nqc-thread);
	border-radius: 4px;
	pointer-events: none;
}

/* ---------- Boutons ---------- */
.wp-block-button__link,
.wp-element-button {
	box-shadow: 0 2px 0 #8f2219;
	transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.wp-block-button__link:hover,
.wp-element-button:hover { transform: translateY(1px); box-shadow: 0 1px 0 #8f2219; }
.is-style-outline > .wp-block-button__link {
	background: #fff;
	border: var(--nqc-line);
	color: var(--nqc-ink);
	box-shadow: 0 2px 0 var(--nqc-ink);
}
.is-style-outline > .wp-block-button__link:hover { background: var(--nqc-cloth); color: var(--nqc-ink); box-shadow: 0 1px 0 var(--nqc-ink); }

/* ---------- En-tête : une bande blanche cousue à la toile ---------- */
.nqc-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: #fff;
	border-bottom: 3px dashed var(--nqc-thread);
}
.admin-bar .nqc-header { top: 32px; }
.nqc-header .wp-block-site-title a { text-decoration: none; color: var(--nqc-ink); }
.nqc-header .wp-block-navigation a { font-weight: 600; color: var(--nqc-ink); text-decoration: none; }
.nqc-header .wp-block-navigation a:hover { text-decoration: underline; text-decoration-style: dashed; text-decoration-color: var(--nqc-red); text-decoration-thickness: 2px; }
.nqc-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.nqc-actions__user { font-weight: 700; font-size: .95rem; }

/* ---------- Hero : la mascotte imprimée sur un carré de jersey jaune ---------- */
.nqc-hero { background: transparent; color: var(--nqc-ink); min-height: 600px; display: flex; align-items: center; }
.nqc-eyebrow {
	display: inline-block;
	margin: 0;
	padding: .2rem .9rem;
	background: #fff;
	color: var(--nqc-ink);
	border: 1.5px dashed var(--nqc-thread);
	border-radius: 3px;
	font-family: var(--wp--preset--font-family--ticket);
	font-weight: 400;
	font-size: .8rem;
	letter-spacing: .1em;
	text-transform: uppercase;
}
.nqc-hero h1 { margin-block: .9rem 1rem; }
.nqc-hero-mascotte { position: relative; margin: 0; width: min(100%, 460px); margin-inline: auto; aspect-ratio: 1; }
.nqc-hero-mascotte::before {
	content: "";
	position: absolute;
	inset: 12% 2% 10% 2%;
	background: var(--nqc-yellow);
	background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 4px);
	border-radius: 18px;
	transform: rotate(-3deg);
	box-shadow: 0 18px 30px -18px rgba(42, 34, 28, .6), inset 0 0 0 12px var(--nqc-yellow), inset 0 0 0 13.5px rgba(42, 34, 28, .45);
}
.nqc-hero-mascotte::after {
	content: "Championnat";
	position: absolute;
	right: 0;
	top: 4%;
	padding: .45rem 1rem;
	font-weight: 700;
	font-size: clamp(.85rem, 1.5vw, 1.05rem);
	color: var(--nqc-ink);
	background: #fff;
	border: 1.5px dashed var(--nqc-thread);
	border-radius: 4px;
	transform: rotate(4deg);
	box-shadow: 0 8px 16px -10px rgba(42, 34, 28, .6);
	background-image: radial-gradient(circle at 50% 0, #fff 0 5px, #b8b0a4 5.5px 8px, transparent 8.5px);
	background-repeat: no-repeat;
	background-position: 50% -8px;
}
.nqc-hero-mascotte img {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	filter: drop-shadow(0 16px 14px rgba(42, 34, 28, .35));
	animation: nqc-trot 1.8s ease-in-out infinite;
	transform-origin: 50% 100%;
}
@keyframes nqc-trot {
	0%, 100% { transform: translateY(0) rotate(-1.5deg); }
	50% { transform: translateY(-10px) rotate(1.5deg); }
}
@media (prefers-reduced-motion: reduce) { .nqc-hero-mascotte img { animation: none; } }

/* ---------- Sections et cartes ---------- */
.nqc-section-brume,
.nqc-section-sable { background: var(--nqc-cloth2); background-image: var(--nqc-weave); }
.nqc-section-nuit { background: var(--nqc-ink); color: var(--nqc-cloth); }
.nqc-section-nuit h2, .nqc-section-nuit h3, .nqc-section-nuit p { color: var(--nqc-cloth); }

.nqc-card {
	padding: 1.75rem;
	height: 100%;
	transition: transform .15s ease, box-shadow .15s ease;
}
.nqc-card:hover { transform: translateY(-3px); box-shadow: var(--nqc-shadow-hover); }
.nqc-card h3 { margin-top: .75rem; margin-bottom: .4rem; }
.nqc-card p { margin: 0; color: var(--nqc-mute); }
.nqc-icon {
	display: grid;
	place-items: center;
	width: 3.6rem;
	height: 3.6rem;
	border-radius: 50%;
	background: var(--nqc-cloth);
	border: 1.5px dashed var(--nqc-thread);
	font-size: 1.6rem;
}

/* ---------- Niveaux : trois épaisseurs de nouille ---------- */
.nqc-lvls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin: 0; padding: 0; list-style: none; }
.nqc-lvl { padding: 1.4rem 1.5rem 1.6rem; color: var(--nqc-ink); }
.nqc-lvl svg { display: block; margin: 0 0 .4rem -10px; max-width: 100%; height: auto; }
.nqc-lvl h3 { margin: 0; font-size: 1.45rem; color: var(--nqc-ink); }
.nqc-lvl p { margin: .3rem 0 .9rem; color: var(--nqc-mute); }
.nqc-lvl em { display: inline-block; font-style: normal; font-weight: 700; font-size: .92rem; padding: .1rem .8rem; border: 1.5px dashed var(--nqc-thread); border-radius: 999px; background: var(--nqc-cloth); }
.nqc-lvl__n { position: absolute; right: 1.2rem; top: 1rem; font-family: var(--wp--preset--font-family--ticket); font-weight: 400; font-size: .8rem; color: var(--nqc-mute); }
.nqc-lvl--or { background: var(--nqc-yellow); background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 4px); }
.nqc-lvl--or p, .nqc-lvl--or .nqc-lvl__n { color: #4a3a10; }
.nqc-lvl--or em { background: rgba(255, 255, 255, .7); }
@media (max-width: 781px) { .nqc-lvls { grid-template-columns: 1fr; } }

.nqc-badge-tease { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.nqc-badge-tease span {
	padding: .3rem .9rem;
	border: 1.5px dashed var(--nqc-thread);
	border-radius: 3px;
	background: #fff;
	color: var(--nqc-ink);
	font-weight: 600;
	font-size: .92rem;
}
.nqc-appel { border-block: 3px dashed var(--nqc-thread); background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 4px); }

/* ---------- Blog ---------- */
.nqc-page-hero { background: var(--nqc-yellow); background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 4px); color: var(--nqc-ink); border-bottom: 3px dashed var(--nqc-thread); }
.nqc-page-hero h1, .nqc-page-hero p { color: var(--nqc-ink); margin-block: 0; }
.nqc-page-hero a { color: var(--nqc-ink); }
.nqc-page-hero .wp-block-categories.nqc-pills { margin-top: 1.4rem; }

.nqc-post-card {
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
	transition: transform .15s ease, box-shadow .15s ease;
}
.nqc-post-card:hover { transform: translateY(-3px); box-shadow: var(--nqc-shadow-hover); }
.nqc-post-media { min-height: 190px; border-bottom: 1.5px dashed var(--nqc-thread); background: url("assets/vignette.svg") center / cover no-repeat; }
.nqc-post-media figure { margin: 0; }
.nqc-post-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nqc-post-body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.nqc-post-body > * { margin-block: 0 !important; }
.nqc-post-body .wp-block-post-title a { text-decoration: none; color: var(--nqc-ink); }
.nqc-post-body .wp-block-post-title a:hover { text-decoration: underline; text-decoration-style: dashed; text-decoration-color: var(--nqc-red); }
.nqc-post-body .wp-block-post-excerpt { color: var(--nqc-mute); font-size: .98rem; }
.nqc-post-body .wp-block-post-date { color: var(--nqc-mute); font-size: .85rem; margin-top: auto !important; font-family: var(--wp--preset--font-family--ticket); font-weight: 400; }
.wp-block-post-content h2 { margin-block: 2.6rem 1rem; }
.wp-block-post-content > h2:first-child { margin-top: 0; }

.nqc-pill a,
.wp-block-categories.nqc-pills a {
	display: inline-block;
	padding: .1rem .8rem;
	border: 1.5px dashed var(--nqc-thread);
	border-radius: 3px;
	background: var(--nqc-cloth);
	color: var(--nqc-ink);
	font-weight: 700;
	font-size: .76rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
}
.nqc-pill a:hover,
.wp-block-categories.nqc-pills a:hover { background: var(--nqc-yellow); color: var(--nqc-ink); }
.wp-block-categories.nqc-pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.nqc-page-hero .wp-block-categories.nqc-pills a { background: #fff; }
.nqc-page-hero .wp-block-categories.nqc-pills a:hover { background: var(--nqc-ink); color: var(--nqc-yellow); }

.nqc-author-box { padding: 1.25rem 1.5rem; }
.wp-block-post-featured-image img { border-radius: var(--nqc-radius); box-shadow: var(--nqc-shadow); }
.wp-block-query-pagination { gap: 1rem; font-weight: 700; }

/* ---------- Pied de page : l'envers du tissu ---------- */
.nqc-footer { background: var(--nqc-ink); color: var(--nqc-cloth); border-top: 3px dashed rgba(243, 233, 210, .45); }
.nqc-footer a { color: var(--nqc-cloth); text-decoration: none; }
.nqc-footer a:hover { color: var(--nqc-yellow); text-decoration: underline; text-decoration-style: dashed; }
.nqc-footer h2, .nqc-footer h3, .nqc-footer .wp-block-site-title a { color: var(--nqc-yellow); }
.nqc-footer h3 { margin-bottom: .6rem; }
.nqc-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }

/* ---------- Boutique ---------- */
.nqc-shop-preview { background: var(--nqc-cloth2); background-image: var(--nqc-weave); padding: 4.5rem 1.25rem; }
.nqc-shop-preview__inner { max-width: 1240px; margin: 0 auto; }
.nqc-shop-preview__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 2rem; }
.nqc-shop-preview__head h2 { margin: 0; }

.woocommerce ul.products li.product,
.wc-block-grid__product { padding: 1rem; transition: transform .15s ease, box-shadow .15s ease; }
.woocommerce ul.products li.product:hover { transform: translateY(-3px); box-shadow: var(--nqc-shadow-hover); }
.woocommerce ul.products li.product img, .wc-block-product img { border-radius: 4px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-weight: 700; font-size: 1.1rem; }
.woocommerce .price, .wc-block-components-product-price { color: var(--nqc-brick); font-weight: 700; }
.woocommerce a.button, .woocommerce button.button, .woocommerce #respond input#submit, .wc-block-components-button:not(.is-link) {
	background: var(--nqc-red);
	color: #fff;
	border: 2px solid var(--nqc-red);
	border-radius: 999px;
	font-weight: 700;
	padding: .65rem 1.2rem;
	box-shadow: 0 2px 0 #8f2219;
}
.woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--nqc-brick); color: #fff; }
.woocommerce a.button.alt, .woocommerce button.button.alt { background: var(--nqc-red); color: #fff; }
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover { background: var(--nqc-brick); color: #fff; }
.woocommerce span.onsale { background: var(--nqc-red); color: #fff; border-radius: 3px; min-width: 0; min-height: 0; line-height: 1; padding: .45em .8em; }
.woocommerce-message, .woocommerce-info { border: 1.5px dashed var(--nqc-thread); border-radius: 4px; background: #fff; color: var(--nqc-ink); }

/* Produits en rupture de stock : une étiquette cousue sur la boutique et sur la fiche */
.wc-block-product.outofstock { position: relative; }
.wc-block-product.outofstock::before,
.single-product.outofstock h1.wp-block-post-title::after {
	content: "Rupture de stock";
	background: var(--nqc-ink);
	color: var(--nqc-cloth);
	border-radius: 3px;
	padding: .2rem .8rem;
	font-weight: 700;
	font-size: .8rem;
}
.wc-block-product.outofstock::before { position: absolute; z-index: 3; top: 1.3rem; left: 1.3rem; }
.single-product.outofstock h1.wp-block-post-title::after { display: inline-block; vertical-align: middle; margin-left: .7rem; font-size: .9rem; }

/* Gabarits WooCommerce (boutique, catégories, fiche produit) : marges et largeur comme le reste du site */
.post-type-archive-product .wp-site-blocks > main,
.tax-product_cat .wp-site-blocks > main,
.tax-product_tag .wp-site-blocks > main,
.single-product .wp-site-blocks > main {
	box-sizing: border-box;
	max-width: 1240px;
	margin-inline: auto;
	padding: 3rem 1.25rem 5rem;
}

/* ---------- La nouille décorative (accueil, grands écrans) ---------- */
.nqc-noodle-deco { display: none; position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
@media (min-width: 1360px) { .home main { position: relative; } .home .nqc-noodle-deco { display: block; } }

/* ---------- Téléphone ---------- */
figure.wp-block-image.nqc-hero-mascotte { display: block !important; aspect-ratio: auto; height: auto; }
figure.wp-block-image.nqc-hero-mascotte img { height: auto; }
@media (max-width: 781px) {
	.nqc-hero { min-height: 0; padding-bottom: 3rem; }
	.nqc-actions__user { display: none; }
	.nqc-card { height: auto; }
	/* En-tête : logo et menu, puis une seule rangée de boutons fins. Il défile avec la page pour laisser la place au contenu. */
	.nqc-header { position: relative; top: auto; }
	.admin-bar .nqc-header { top: auto; }
	.nqc-header .nqc-actions { flex: 1 0 100%; flex-wrap: nowrap; gap: .5rem; }
	.nqc-header .nqc-btn { flex: 1 1 auto; padding: .42rem .7rem; font-size: .88rem; text-align: center; white-space: nowrap; box-shadow: none; }
	.nqc-header .nqc-actions__logout { display: none; }
}

/* ---------- Accessibilité ---------- */
:focus-visible {
	outline: 3px solid var(--nqc-ink);
	outline-offset: 3px;
	border-radius: 4px;
}
.nqc-footer :focus-visible, .nqc-section-nuit :focus-visible { outline-color: var(--nqc-yellow); }

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