/* Compat contenu classique (articles écrits hors éditeur de blocs)
   + finitions magazine que theme.json ne couvre pas. */

/* --- Contenu classique --- */
.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.entry-content > blockquote,
.entry-content > table {
	margin-block: 1.1em;
}

.entry-content > h2,
.entry-content > h3,
.entry-content > h4 {
	font-family: var(--wp--preset--font-family--heading);
	line-height: 1.2;
	margin-block: 1.6em 0.6em;
}

.entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--wp--custom--radius, 4px);
}

.entry-content > blockquote {
	border-left: 4px solid var(--wp--preset--color--secondary);
	padding-left: 1.25rem;
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	color: var(--wp--preset--color--contrast-2);
}

.entry-content > table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
}

.entry-content > table td,
.entry-content > table th {
	border: 1px solid var(--wp--preset--color--base-2);
	padding: 0.5rem 0.75rem;
}

.entry-content a {
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

/* --- Finitions magazine --- */

/* Kicker de rubrique au-dessus des titres de cartes */
.ecomag-kicker a {
	text-decoration: none;
}

/* Images des cartes : léger zoom au survol */
.ecomag-card .wp-block-post-featured-image img {
	transition: transform 0.35s ease;
}

.ecomag-card:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

.ecomag-card .wp-block-post-featured-image {
	overflow: hidden;
	border-radius: var(--wp--custom--radius, 4px);
}

/* Ticker défilant (pattern post-ticker) */
.ecomag-ticker-bar {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--wp--preset--color--base-2);
	border-radius: var(--wp--custom--radius, 4px);
	overflow: hidden;
}

.ecomag-ticker-bar__label {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	padding: 0.5rem 1rem;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.ecomag-ticker {
	overflow: hidden;
	white-space: nowrap;
	display: flex;
	align-items: center;
}

.ecomag-ticker__track {
	display: inline-flex;
	gap: 3rem;
	padding: 0.5rem 1.5rem;
	animation: ecomag-ticker-scroll 45s linear infinite;
}

.ecomag-ticker:hover .ecomag-ticker__track {
	animation-play-state: paused;
}

.ecomag-ticker__item {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
}

.ecomag-ticker__item:hover {
	color: var(--wp--preset--color--accent);
}

@keyframes ecomag-ticker-scroll {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
	.ecomag-ticker__track {
		animation: none;
	}
	.ecomag-card .wp-block-post-featured-image img {
		transition: none;
	}
}

/* Box auteur (pattern author-box) — bandeau pleine largeur */
.ecomag-author-band {
	background: var(--wp--preset--color--base-2);
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 8%, transparent);
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 8%, transparent);
}

.ecomag-author-box {
	display: flex;
	gap: 1.5rem;
	align-items: flex-start;
	max-width: 1200px;
	margin-inline: auto;
	padding: 2.25rem clamp(1rem, 3vw, 1.5rem);
}

.ecomag-author-box__avatar {
	border-radius: 50%;
	flex-shrink: 0;
}

.ecomag-author-box__body p {
	margin: 0 0 0.4rem;
}

.ecomag-author-box__label {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--accent);
}

.ecomag-author-box__name {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.4rem;
	font-weight: 700;
}

.ecomag-author-box__bio {
	color: var(--wp--preset--color--contrast-2);
	font-size: 0.95rem;
}

.ecomag-author-box__link {
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--primary);
}

@media (max-width: 600px) {
	.ecomag-author-box {
		flex-direction: column;
	}
}

/* Cartes de rubriques (pattern category-strip) */
.ecomag-cat-strip {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 1rem;
}

.ecomag-cat-card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 0.15rem;
	min-height: 120px;
	padding: 1rem;
	border-radius: var(--wp--custom--radius, 4px);
	background: var(--wp--preset--color--primary) center/cover no-repeat;
	color: var(--wp--preset--color--base);
	text-decoration: none;
	overflow: hidden;
	transition: transform 0.25s ease;
}

.ecomag-cat-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.05) 65%);
}

.ecomag-cat-card:hover {
	transform: translateY(-3px);
}

.ecomag-cat-card__name,
.ecomag-cat-card__count {
	position: relative;
}

.ecomag-cat-card__name {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.15rem;
	font-weight: 700;
}

.ecomag-cat-card__count {
	font-size: 0.8rem;
	opacity: 0.85;
}

/* Page-list inline (footer minimal) */
.ecomag-footer-inline {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

/* Topbar (header) */
.ecomag-topbar-search.wp-block-search {
	margin: 0;
}

.ecomag-topbar-search .wp-block-search__input {
	padding: 0.25rem 0.6rem;
	font-size: 0.85rem;
	border: none;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	color: var(--wp--preset--color--base);
	width: 170px;
	transition: background 0.2s ease, width 0.2s ease;
}

.ecomag-topbar-search .wp-block-search__input::placeholder {
	color: rgba(255, 255, 255, 0.75);
}

.ecomag-topbar-search .wp-block-search__input:focus {
	background: rgba(255, 255, 255, 0.28);
	outline: none;
	width: 210px;
}

.ecomag-topbar-search .wp-block-search__inside-wrapper {
	border: none;
	padding: 0;
}

.ecomag-topbar-search .wp-block-search__button {
	background: transparent;
	border: none;
	color: var(--wp--preset--color--base);
	padding: 0 0.4rem;
	cursor: pointer;
}

/* Pas de gap racine entre les grandes sections (header / hero / main / footer) :
   chaque section gère son propre espacement. */
.wp-site-blocks > * {
	margin-block-start: 0;
}

/* Neutralise le blockGap hérité du conteneur parent (sections full-bleed collées) */
.ecomag-flush {
	margin-block-start: 0 !important;
}

/* Trait de séparation léger sous le header (sans margin ni padding ajoutés) */
.ecomag-header-sep {
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 14%, transparent);
}

/* Ligne header : centrage vertical strict logo / titre / navigation */
.ecomag-header-row {
	align-items: center !important;
}

.ecomag-header-row .wp-block-navigation,
.ecomag-header-row .wp-block-navigation__container {
	align-items: center;
}

.ecomag-brand {
	align-items: center !important;
}

.ecomag-brand .wp-block-site-logo {
	display: flex;
	margin: 0;
}

.ecomag-brand .wp-block-site-logo img {
	display: block;
}

.ecomag-brand .wp-block-site-title {
	line-height: 1;
	margin: 0;
}

/* Hero cover d'accueil (pattern hero-cover) */
.ecomag-hero {
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	min-height: clamp(480px, 72vh, 760px);
	background: var(--wp--preset--color--contrast);
}

.ecomag-hero__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background-size: cover;
	background-position: center;
}

.ecomag-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(to top, rgba(12, 22, 18, 0.78) 0%, rgba(12, 22, 18, 0.32) 45%, rgba(12, 22, 18, 0.25) 100%);
}

.ecomag-hero__inner {
	position: relative;
	z-index: 1;
	width: min(1200px, 100% - 3rem);
	margin-inline: auto;
	padding-block: clamp(2rem, 5vh, 3.5rem);
	display: flex;
	flex-direction: column;
	gap: clamp(1.5rem, 4vh, 2.75rem);
}

.ecomag-hero__top.has-face {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(240px, 1fr);
	gap: 1rem;
	align-items: stretch;
}

.ecomag-hero-spotlight {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	padding: 1rem 1.25rem 1.4rem;
	border-radius: 6px;
	background: color-mix(in srgb, var(--wp--preset--color--accent) 72%, var(--wp--preset--color--contrast));
	color: #fff;
	text-align: center;
}

.ecomag-hero-spotlight__photo {
	height: clamp(150px, 24vh, 210px);
	border-radius: 4px;
	background-size: cover;
	background-position: center 25%;
	border: 2px solid rgba(255, 255, 255, 0.3);
}

.ecomag-hero-spotlight__name {
	margin: 0.35rem 0 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.45rem;
	font-weight: 700;
	line-height: 1.15;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.ecomag-hero-spotlight__desc {
	margin: 0;
	font-size: 0.88rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.88);
}

.ecomag-hero-spotlight__btn {
	align-self: center;
	margin-top: 0.4rem;
	display: inline-block;
	padding: 0.55rem 1.4rem;
	background: rgba(255, 255, 255, 0.96);
	color: var(--wp--preset--color--contrast);
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-decoration: none;
	border-radius: 999px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ecomag-hero-spotlight__btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

@media (max-width: 781px) {
	.ecomag-hero__top.has-face {
		grid-template-columns: 1fr;
	}
}

.ecomag-hero__intro {
	max-width: 720px;
	background: rgba(250, 247, 240, 0.92);
	border-left: 6px solid var(--wp--preset--color--secondary);
	border-radius: 6px;
	padding: clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 3.5vw, 2.5rem);
	backdrop-filter: blur(3px);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.75rem;
}

.ecomag-hero__quote-row {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	margin-top: 0.5rem;
}

.ecomag-hero__quote-avatar {
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: 3px solid var(--wp--preset--color--secondary);
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.ecomag-hero__punchline {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	font-size: clamp(1.05rem, 1.8vw, 1.25rem);
	line-height: 1.35;
	color: var(--wp--preset--color--primary);
}

.ecomag-hero__quote-author {
	margin: 0.2rem 0 0;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--wp--preset--color--contrast-2);
}

.ecomag-hero__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.7rem, 4vw, 2.8rem);
	line-height: 1.12;
	margin: 0 0 0.6rem;
	color: var(--wp--preset--color--contrast);
}

.ecomag-hero__text {
	font-size: clamp(0.98rem, 1.5vw, 1.1rem);
	line-height: 1.55;
	margin: 0;
	color: var(--wp--preset--color--contrast-2);
}

.ecomag-hero__cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 1rem;
}

.ecomag-hero-card {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1.25rem 1.4rem;
	border-radius: 6px;
	color: #fff;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ecomag-hero-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

.ecomag-hero-card--primary { background: color-mix(in srgb, var(--wp--preset--color--primary) 88%, transparent); }
.ecomag-hero-card--secondary { background: color-mix(in srgb, var(--wp--preset--color--secondary) 90%, transparent); color: var(--wp--preset--color--contrast); }
.ecomag-hero-card--accent { background: color-mix(in srgb, var(--wp--preset--color--accent) 88%, transparent); }
.ecomag-hero-card--contrast { background: color-mix(in srgb, var(--wp--preset--color--contrast) 82%, transparent); }

.ecomag-hero-card__kicker {
	margin: 0;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	opacity: 0.8;
}

.ecomag-hero-card__name {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.15;
}

.ecomag-hero-card__desc {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.45;
	opacity: 0.9;
}

.ecomag-hero-card__btn {
	margin-top: auto;
	align-self: flex-start;
	display: inline-block;
	padding: 0.5rem 1.1rem;
	background: rgba(255, 255, 255, 0.96);
	color: var(--wp--preset--color--contrast);
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-decoration: none;
	border-radius: var(--wp--custom--radius, 4px);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ecomag-hero-card__btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.ecomag-hero-card--secondary .ecomag-hero-card__btn {
	background: var(--wp--preset--color--contrast);
	color: #fff;
}

.ecomag-hero-card {
	padding-bottom: 1.5rem;
}

.ecomag-hero-card .ecomag-hero-card__desc {
	margin-bottom: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
	video.ecomag-hero__media {
		display: none;
	}
}

@media (max-width: 781px) {
	.ecomag-hero {
		min-height: 0;
	}
	.ecomag-hero__cards {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 480px) {
	.ecomag-hero__cards {
		grid-template-columns: 1fr;
	}
}

/* Icônes réseaux sociaux du header */
.ecomag-social .wp-block-social-link a {
	padding: 0;
}

.ecomag-social .wp-social-link svg {
	width: 20px;
	height: 20px;
}

.ecomag-social .wp-social-link {
	transition: transform 0.2s ease;
}

.ecomag-social .wp-social-link:hover {
	transform: translateY(-2px);
}

/* Variante pastilles aux couleurs officielles des réseaux (topbar) */
.ecomag-social-colored .wp-block-social-link a {
	padding: 5px;
}

.ecomag-social-colored .wp-social-link svg {
	width: 15px;
	height: 15px;
}

.ecomag-social-colored .wp-social-link {
	transition: transform 0.2s ease;
}

.ecomag-social-colored .wp-social-link:hover {
	transform: translateY(-2px);
}

/* X (noir) : liseré clair pour rester visible sur topbar sombre */
.ecomag-social-colored .wp-social-link-x {
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
	border-radius: 9999px;
}

/* Bandeau Outil (pattern widget-slot) — règle : chaque widget utilitaire est mis
   en scène en pleine largeur : photo | icône + kicker + titre + usage + outil. */
.ecomag-utility {
	display: grid;
	grid-template-columns: minmax(280px, 42%) 1fr;
	background:
		linear-gradient(120deg, color-mix(in srgb, var(--wp--preset--color--contrast) 96%, var(--wp--preset--color--primary)) 0%, color-mix(in srgb, var(--wp--preset--color--contrast) 72%, var(--wp--preset--color--primary)) 100%);
	border-top: 4px solid var(--wp--preset--color--secondary);
	border-bottom: 4px solid var(--wp--preset--color--secondary);
	overflow: hidden;
}

.ecomag-utility__photo {
	background-size: cover;
	background-position: center;
	min-height: 320px;
	clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
}

.ecomag-utility__body {
	padding: clamp(2rem, 4vw, 3.5rem);
	color: #fff;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	max-width: 640px;
}

.ecomag-utility__head {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.ecomag-utility__icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--contrast);
}

.ecomag-utility__icon svg {
	width: 30px;
	height: 30px;
}

.ecomag-utility__kicker {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--wp--preset--color--secondary);
}

.ecomag-utility__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.4rem, 2.6vw, 1.9rem);
	font-weight: 700;
	line-height: 1.15;
}

.ecomag-utility__desc {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.85);
}

.ecomag-utility__tool .ecomag-converter {
	margin-inline: 0;
	text-align: left;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

/* Le bandeau porte déjà le titre et la description : pas de doublon dans l'outil */
.ecomag-utility__tool .ecomag-converter__title {
	display: none;
}

.ecomag-utility__tool .ecomag-converter__row {
	justify-content: flex-start;
}

@media (max-width: 781px) {
	.ecomag-utility {
		grid-template-columns: 1fr;
	}
	.ecomag-utility__photo {
		min-height: 200px;
		clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
	}
}

/* Convertisseur de devises (block ecomag/convertisseur-reais) */
.ecomag-converter {
	max-width: 480px;
	margin-inline: auto;
	background: var(--wp--preset--color--base-2);
	border-radius: 6px;
	padding: 1.5rem;
	text-align: center;
}

.ecomag-converter__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.2rem;
	font-weight: 700;
	margin: 0 0 1rem;
}

.ecomag-converter__row {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 0.75rem;
}

.ecomag-converter__row label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.8rem;
	color: var(--wp--preset--color--contrast-2);
	text-align: left;
}

.ecomag-converter__row input {
	width: 130px;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--wp--preset--color--contrast-2);
	border-radius: var(--wp--custom--radius, 4px);
	font-size: 1rem;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.ecomag-converter__swap {
	padding-bottom: 0.55rem;
	color: var(--wp--preset--color--accent);
	font-weight: 700;
}

.ecomag-converter__note {
	margin: 0.75rem 0 0;
	font-size: 0.8rem;
	color: var(--wp--preset--color--contrast-2);
}

.ecomag-converter__row select {
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--wp--preset--color--contrast-2);
	border-radius: var(--wp--custom--radius, 4px);
	font-size: 1rem;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	min-width: 160px;
}

.ecomag-tailles__result {
	margin: 0.85rem 0 0;
	font-size: 1.05rem;
}

/* Séparateur de section façon presse */
.ecomag-section-title {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.ecomag-section-title::after {
	content: "";
	flex: 1;
	height: 3px;
	background: var(--wp--preset--color--primary);
}
