/*
Theme Name: ECO DÉPANNAGE TV
Theme URI: https://ecodepannagetv.fr
Author: ECO DÉPANNAGE TV
Author URI: https://ecodepannagetv.fr
Description: Thème WordPress e-commerce « Full Site Editing » pour ECO DÉPANNAGE TV — expert éco-responsable de la réparation électronique, des pièces détachées TV, du matériel reconditionné et des accessoires. Entièrement construit en blocs Gutenberg natifs : chaque texte, image, couleur, bouton et espacement se modifie visuellement depuis Apparence → Éditeur, sans écrire une ligne de code. Compatible WooCommerce.
Version: 2.0.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: eco-depannage-tv
Tags: full-site-editing, block-patterns, block-styles, e-commerce, custom-colors, custom-logo, custom-menu, featured-images, wide-blocks, translation-ready, accessibility-ready, threaded-comments
*/

/* -------------------------------------------------------------------------
   ECO DÉPANNAGE TV — feuille de base
   -------------------------------------------------------------------------
   Ce fichier ne contient QUE ce que theme.json ne peut pas exprimer :
   survols, transitions, styles de blocs personnalisés et quelques
   ajustements responsive. Couleurs, tailles, espacements et typographie
   sont pilotés par theme.json (Apparence → Éditeur → Styles).
   ------------------------------------------------------------------------- */

/* 1. Base ---------------------------------------------------------------- */

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

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

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

/* Accessibilité : anneau de focus visible et cohérent partout (§ 24). */
:where( a, button, input, select, textarea, summary, [tabindex] ):focus-visible {
	outline: 3px solid var( --wp--preset--color--primary );
	outline-offset: 2px;
	border-radius: 4px;
}

.wp-block-button__link:focus-visible,
.wp-element-button:focus-visible {
	outline: 3px solid var( --wp--preset--color--dark );
	outline-offset: 3px;
}

/* Lien d'évitement (première tabulation). */
.skip-link.screen-reader-text {
	background-color: var( --wp--preset--color--base );
	border-radius: 6px;
	box-shadow: var( --wp--preset--shadow--raised );
	color: var( --wp--preset--color--primary-dark );
	font-size: 0.875rem;
	font-weight: 700;
	left: 8px;
	padding: 14px 22px;
	text-decoration: none;
	top: 8px;
	z-index: 100000;
}

/* Aucun média ne dépasse jamais de son conteneur (§ 22). */
img,
svg,
video,
iframe,
canvas {
	max-width: 100%;
	height: auto;
}

/* 2. Boutons : transition et micro-élévation ----------------------------- */

.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.18s ease, color 0.18s ease,
		box-shadow 0.18s ease, transform 0.18s ease;
	will-change: transform;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
	box-shadow: 0 6px 18px rgba( 10, 8, 9, 0.18 );
	transform: translateY( -1px );
}

/* Variante « contour » de core : garder le trait lisible au survol. */
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background-color: currentColor;
	color: var( --wp--preset--color--base ) !important;
}

/* 3. Style de bloc : Carte technique (is-style-eco-card) ----------------- */

.wp-block-group.is-style-eco-card,
.wp-block-column.is-style-eco-card,
.wp-block-media-text.is-style-eco-card {
	background-color: var( --wp--preset--color--base );
	border: 1px solid var( --wp--preset--color--outline );
	border-radius: 12px;
	box-shadow: var( --wp--preset--shadow--card );
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease,
		border-color 0.2s ease;
}

.wp-block-group.is-style-eco-card:hover,
.wp-block-column.is-style-eco-card:hover,
.wp-block-media-text.is-style-eco-card:hover {
	border-color: var( --wp--preset--color--primary );
	box-shadow: var( --wp--preset--shadow--raised );
	transform: translateY( -4px );
}

/* Carte sur fond sombre. */
.wp-block-group.is-style-eco-card-dark,
.wp-block-column.is-style-eco-card-dark {
	background-color: var( --wp--preset--color--surface-card-dark );
	border: 1px solid rgba( 255, 255, 255, 0.09 );
	border-radius: 12px;
	transition: transform 0.2s ease, box-shadow 0.2s ease,
		border-color 0.2s ease;
}

.wp-block-group.is-style-eco-card-dark:hover,
.wp-block-column.is-style-eco-card-dark:hover {
	border-color: var( --wp--preset--color--primary );
	box-shadow: var( --wp--preset--shadow--glow-primary );
	transform: translateY( -4px );
}

/* 4. Style de bloc : Carte catégorie cliquable --------------------------- */

.wp-block-group.is-style-eco-category-card {
	background-color: var( --wp--preset--color--base );
	border: 1px solid var( --wp--preset--color--outline );
	border-radius: 12px;
	height: 100%;
	position: relative;
	transition: transform 0.2s ease, box-shadow 0.2s ease,
		border-color 0.2s ease;
}

.wp-block-group.is-style-eco-category-card:hover {
	border-color: var( --wp--preset--color--secondary );
	box-shadow: var( --wp--preset--shadow--raised );
	transform: translateY( -4px );
}

.wp-block-group.is-style-eco-category-card:hover .wp-block-image img {
	transform: scale( 1.05 );
}

.wp-block-group.is-style-eco-category-card .wp-block-image img {
	transition: transform 0.35s ease;
}

/* La carte entière devient cliquable grâce au dernier lien qu'elle contient. */
.wp-block-group.is-style-eco-category-card .eco-card-link::after {
	content: "";
	inset: 0;
	position: absolute;
}

/* 5. Styles de bloc : étiquettes et pastilles ---------------------------- */

.is-style-eco-eyebrow {
	color: var( --wp--preset--color--primary-dark );
	font-size: var( --wp--preset--font-size--x-small );
	font-weight: 800;
	letter-spacing: 0.12em;
	margin-bottom: 0.5rem;
	text-transform: uppercase;
}

.is-style-eco-badge-promo,
.is-style-eco-badge-eco,
.is-style-eco-badge-ref,
.is-style-eco-badge-neutral {
	border-radius: 999px;
	display: inline-block;
	font-size: var( --wp--preset--font-size--x-small );
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.3;
	padding: 0.3125rem 0.75rem;
	text-transform: uppercase;
	width: auto;
}

.is-style-eco-badge-promo {
	background-color: var( --wp--preset--color--accent );
	color: #fff;
}

.is-style-eco-badge-eco {
	background-color: var( --wp--preset--color--secondary-light );
	color: var( --wp--preset--color--secondary-dark );
}

.is-style-eco-badge-neutral {
	background-color: var( --wp--preset--color--primary-light );
	color: var( --wp--preset--color--primary-dark );
}

/* Puce de référence technique : police à chasse fixe, aspect « étiquette ». */
.is-style-eco-badge-ref {
	background-color: var( --wp--preset--color--surface-light );
	border: 1px dashed var( --wp--preset--color--outline );
	border-radius: 6px;
	color: var( --wp--preset--color--dark );
	font-family: var( --wp--preset--font-family--monospace );
	letter-spacing: 0.02em;
	text-transform: none;
}

/* 6. Style de bloc : tuile d'icône --------------------------------------- */

.wp-block-group.is-style-eco-icon-tile,
.wp-block-image.is-style-eco-icon-tile {
	align-items: center;
	background-color: var( --wp--preset--color--primary-light );
	border-radius: 10px;
	display: flex;
	flex: 0 0 auto;
	height: 52px;
	justify-content: center;
	width: 52px;
}

.wp-block-group.is-style-eco-icon-tile img,
.wp-block-image.is-style-eco-icon-tile img {
	height: 26px;
	width: 26px;
}

/* 7. Style de bloc : fond « circuit imprimé » ---------------------------- */

.wp-block-group.is-style-eco-circuit {
	background-image: url( 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><g fill="none" stroke="%23ffffff" stroke-opacity="0.07" stroke-width="1.2"><path d="M0 30h34l12 12v26l14 14h60M30 120V86l14-14h30l16-16V0"/><path d="M120 60h-24l-12 12v18"/></g><g fill="%23ffffff" fill-opacity="0.11"><circle cx="34" cy="30" r="2.6"/><circle cx="60" cy="82" r="2.6"/><circle cx="90" cy="44" r="2.6"/><circle cx="84" cy="90" r="2.6"/></g></svg>' );
	background-position: center;
	background-repeat: repeat;
	background-size: 120px 120px;
	position: relative;
}

/* 8. Style de bloc : rangée défilante sur mobile ------------------------- */

@media ( max-width: 781px ) {
	.wp-block-group.is-style-eco-scroll-row > .wp-block-group__inner-container,
	.wp-block-columns.is-style-eco-scroll-row {
		-webkit-overflow-scrolling: touch;
		flex-wrap: nowrap !important;
		overflow-x: auto;
		padding-bottom: 0.75rem;
		scroll-snap-type: x mandatory;
		scrollbar-width: thin;
	}

	.wp-block-columns.is-style-eco-scroll-row > .wp-block-column {
		flex-basis: 78% !important;
		flex-shrink: 0;
		scroll-snap-align: start;
	}
}

/* 9. Style de bloc : séparateur « circuit » ------------------------------ */

.wp-block-separator.is-style-eco-circuit-line {
	background: linear-gradient(
		90deg,
		transparent 0%,
		var( --wp--preset--color--primary ) 30%,
		var( --wp--preset--color--secondary ) 70%,
		transparent 100%
	);
	border: 0;
	height: 2px;
	opacity: 1;
	width: 100%;
}

/* 10. En-tête ----------------------------------------------------------- */

/* La barre de navigation reste accessible au défilement (position: sticky
   se règle aussi par bloc dans l'éditeur). */
.eco-header-sticky {
	position: sticky;
	top: 0;
	z-index: 900;
}

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

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

/* Disposition de l'en-tête : la recherche occupe l'espace restant sur grand
   écran, puis passe sur sa propre ligne dès que la place manque. C'est ce qui
   évite tout débordement horizontal sur téléphone (section 22). */
.wp-block-group.eco-header-search {
	flex: 1 1 260px;
	min-width: 0;
}

.wp-block-group.eco-header-brand {
	min-width: 0;
}

@media ( max-width: 900px ) {
	.wp-block-group.eco-header-search {
		flex: 1 1 100%;
		order: 3;
		width: 100%;
	}
}

/* Recherche de l'en-tête : grand champ arrondi, bouton vert.
   Le champ doit pouvoir rétrécir sous 400 px sans pousser la page :
   sans min-width:0, la largeur intrinsèque d'un input déborde de l'écran. */
.wp-block-search.is-style-eco-search-bar {
	max-width: 100%;
	width: 100%;
}

.wp-block-search .wp-block-search__input {
	min-width: 0;
}

.wp-block-search.is-style-eco-search-bar .wp-block-search__input {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
}

.wp-block-search.is-style-eco-search-bar .wp-block-search__button {
	flex: 0 0 auto;
	white-space: nowrap;
}

.wp-block-search.is-style-eco-search-bar .wp-block-search__inside-wrapper {
	background-color: var( --wp--preset--color--base );
	border: 2px solid transparent;
	border-radius: 10px;
	box-shadow: 0 4px 14px rgba( 10, 8, 9, 0.14 );
	padding: 3px;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.wp-block-search.is-style-eco-search-bar
	.wp-block-search__inside-wrapper:focus-within {
	border-color: var( --wp--preset--color--secondary );
	box-shadow: 0 0 0 4px rgba( 98, 151, 36, 0.22 );
}

.wp-block-search.is-style-eco-search-bar .wp-block-search__input {
	background: transparent;
	border: 0;
	color: var( --wp--preset--color--dark );
	padding: 0.625rem 0.875rem;
}

.wp-block-search.is-style-eco-search-bar .wp-block-search__input::placeholder {
	color: var( --wp--preset--color--text-muted );
	opacity: 1;
}

.wp-block-search.is-style-eco-search-bar .wp-block-search__input:focus {
	outline: none;
}

.wp-block-search.is-style-eco-search-bar .wp-block-search__button {
	border-radius: 8px;
	margin-left: 0;
	padding: 0.625rem 1.25rem;
}

/* Rappel d'action de l'en-tête : contraste garanti sur fond bleu foncé. */
.eco-header-cta a {
	color: var( --wp--preset--color--base );
	text-decoration: underline;
	text-underline-offset: 2px;
}

.eco-header-cta a:hover {
	color: var( --wp--preset--color--secondary-light );
}

/* Navigation : soulignement animé au survol. */
.wp-block-navigation .wp-block-navigation-item__content {
	position: relative;
	text-decoration: none;
}

.wp-block-navigation
	.wp-block-navigation-item:not( .has-child )
	> .wp-block-navigation-item__content::after {
	background-color: currentColor;
	bottom: -5px;
	content: "";
	height: 2px;
	left: 0;
	position: absolute;
	transform: scaleX( 0 );
	transform-origin: left;
	transition: transform 0.2s ease;
	width: 100%;
}

.wp-block-navigation
	.wp-block-navigation-item:not( .has-child ):hover
	> .wp-block-navigation-item__content::after,
.wp-block-navigation .wp-block-navigation-item.current-menu-item
	> .wp-block-navigation-item__content::after {
	transform: scaleX( 1 );
}

/* Sous-menus : aspect carte. */
.wp-block-navigation .wp-block-navigation__submenu-container {
	border: 1px solid var( --wp--preset--color--outline );
	border-radius: 10px;
	box-shadow: var( --wp--preset--shadow--raised );
	overflow: hidden;
	padding: 0.375rem 0;
}

/* Menu plein écran sur mobile : fond sombre lisible. */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: clamp( 1.5rem, 5vw, 3rem );
}

/* 11. Pied de page ------------------------------------------------------- */

.eco-footer a {
	color: var( --wp--preset--color--text-on-dark );
	text-decoration: none;
}

.eco-footer a:hover,
.eco-footer a:focus {
	color: var( --wp--preset--color--base );
	text-decoration: underline;
}

.eco-footer .eco-footer-list,
.eco-footer .wp-block-list {
	list-style: none;
	margin: 0;
	padding-left: 0;
}

.eco-footer .wp-block-heading {
	color: var( --wp--preset--color--base );
}

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

.wp-block-columns.eco-equal-cards > .wp-block-column {
	display: flex;
	flex-direction: column;
}

.wp-block-columns.eco-equal-cards > .wp-block-column > .wp-block-group {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
}

/* Pousse le dernier bouton d'une carte en bas. */
.eco-push-bottom {
	margin-top: auto !important;
}

/* 13. Section chiffres clés --------------------------------------------- */

.is-style-eco-stat .wp-block-heading {
	line-height: 1;
	margin-bottom: 0.25rem;
}

/* 14. Responsive : ajustements ------------------------------------------ */

/* Tablette : les grilles à 4 colonnes passent à 2. */
@media ( min-width: 600px ) and ( max-width: 1023px ) {
	.wp-block-columns.eco-grid-4:not( .is-not-stacked-on-mobile ) {
		flex-wrap: wrap !important;
	}
	.wp-block-columns.eco-grid-4 > .wp-block-column {
		flex-basis: calc( 50% - var( --wp--style--block-gap, 1.5rem ) / 2 ) !important;
		flex-grow: 0;
	}
}

/* Mobile : les colonnes s'empilent (comportement natif) et les boutons
   deviennent assez grands pour le doigt. */
@media ( max-width: 599px ) {
	.wp-block-buttons > .wp-block-button {
		width: 100%;
	}
	.wp-block-buttons > .wp-block-button .wp-block-button__link {
		display: block;
		min-height: 48px;
		text-align: center;
	}
	.wp-block-columns.eco-keep-2-on-mobile {
		flex-wrap: wrap !important;
	}
	.wp-block-columns.eco-keep-2-on-mobile > .wp-block-column {
		flex-basis: calc( 50% - 0.5rem ) !important;
		flex-grow: 0;
	}
}

/* 15. Hero : profondeur visuelle sans image lourde ---------------------- */

.eco-hero {
	overflow: hidden;
	position: relative;
}

.eco-hero::before {
	background: radial-gradient(
			620px 320px at 82% 12%,
			rgba( 13, 121, 175, 0.45 ),
			transparent 70%
		),
		radial-gradient(
			460px 280px at 10% 95%,
			rgba( 98, 151, 36, 0.28 ),
			transparent 70%
		);
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
	z-index: 0;
}

.eco-hero > * {
	position: relative;
	z-index: 1;
}

/* 16. Contenus éditoriaux ---------------------------------------------- */

.eco-prose :where( h2, h3 ) {
	margin-top: 2em;
}

/* Fil d'Ariane (§ 25). */
.eco-breadcrumb {
	color: var( --wp--preset--color--text-muted );
	font-size: var( --wp--preset--font-size--x-small );
}

.eco-breadcrumb a {
	color: var( --wp--preset--color--text-muted );
}

.eco-breadcrumb a:hover {
	color: var( --wp--preset--color--primary );
}

/* 17. Éditeur : rien ne doit « sauter » entre l'éditeur et le site ------ */

.editor-styles-wrapper .is-style-eco-card,
.editor-styles-wrapper .is-style-eco-category-card {
	transform: none !important;
}
