/**
 * Inspirations Vintage - Custom CSS
 * Styles avancés impossibles via theme.json :
 * textures, effets hover, ornements, animations, responsive.
 */

/* === GLOBAL === */

html {
	scroll-behavior: smooth;
}

::selection {
	background: var(--wp--preset--color--sepia);
	color: var(--wp--preset--color--blanc);
}

/* === TEXTURES DE FOND === */

.has-vintage-paper-background {
	background-image: url('../images/texture-paper.webp');
	background-repeat: repeat;
	background-size: 300px;
	background-blend-mode: multiply;
}

.has-vintage-linen-background {
	background-image: url('../images/texture-linen.webp');
	background-repeat: repeat;
	background-size: 400px;
	background-blend-mode: soft-light;
}

/* === HEADER === */

.iv-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	background: #fff !important;
	transition: box-shadow 0.3s ease;
	box-shadow: 0 1px 4px rgba(44, 24, 16, 0.04);
}

/* Three-zone layout: logo | nav | icons */
.iv-header-left {
	flex: 1 1 0 !important;
	min-width: 0;
}

.iv-header-right {
	flex: 1 1 0 !important;
	min-width: 0;
}

/* Logo */
.iv-header-logo {
	margin: 0 !important;
	max-width: 160px !important;
}

.iv-header-logo img,
.iv-site-header .iv-header-logo img {
	height: 100px !important;
	width: auto !important;
	max-height: 100px !important;
	object-fit: contain;
}

/* Right zone: account + cart */
.iv-header-right p {
	margin: 0;
	white-space: nowrap;
}

.iv-header-right a {
	text-decoration: none;
	color: var(--wp--preset--color--texte-secondaire);
	transition: color 0.2s ease;
}

.iv-header-right a:hover {
	color: var(--wp--preset--color--bordeaux);
}

/* Customer account */
.iv-header-right .wc-block-customer-account-link {
	font-family: var(--wp--preset--font-family--playfair);
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--texte-secondaire);
	transition: color 0.2s ease;
}

.iv-header-right .wc-block-customer-account-link:hover {
	color: var(--wp--preset--color--bordeaux);
}

/* Hide any duplicate account icons outside our header-right */
.iv-site-header .wp-block-navigation .wc-block-customer-account-link,
.iv-site-header .wp-block-woocommerce-customer-account:not(.iv-header-right .wp-block-woocommerce-customer-account) {
	display: none !important;
}

/* Mini-cart icon */
.iv-header-right .wc-block-mini-cart__button {
	padding: 0;
	background: transparent;
	border: none;
	color: var(--wp--preset--color--texte-secondaire);
	transition: color 0.2s ease;
}

.iv-header-right .wc-block-mini-cart__button:hover {
	color: var(--wp--preset--color--bordeaux);
}

/* === NAVIGATION === */

.wp-block-navigation .wp-block-navigation-item a {
	position: relative;
	padding-bottom: 4px;
}

.wp-block-navigation .wp-block-navigation-item a::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 0;
	height: 1px;
	background: var(--wp--preset--color--bordeaux);
	transition: width 0.3s ease, left 0.3s ease;
}

.wp-block-navigation .wp-block-navigation-item a:hover::after {
	width: 100%;
	left: 0;
}

/* === CARTES PRODUITS === */

.iv-product-card {
	transition: box-shadow 0.3s ease, transform 0.3s ease;
	overflow: hidden;
}

.iv-product-card:hover {
	box-shadow: 0 6px 20px rgba(44, 24, 16, 0.12);
	transform: translateY(-3px);
}

.iv-product-card .wc-block-grid__product-image img,
.iv-product-card .wc-block-components-product-image img,
.iv-product-card img {
	filter: sepia(8%) saturate(92%);
	transition: filter 0.4s ease, transform 0.4s ease;
}

.iv-product-card:hover .wc-block-grid__product-image img,
.iv-product-card:hover .wc-block-components-product-image img,
.iv-product-card:hover img {
	filter: sepia(0%) saturate(100%);
	transform: scale(1.03);
}

/* === CARTES ARTICLES === */

.iv-post-card {
	transition: box-shadow 0.3s ease, transform 0.3s ease;
	overflow: hidden;
}

.iv-post-card:hover {
	box-shadow: 0 6px 20px rgba(44, 24, 16, 0.1);
	transform: translateY(-2px);
}

.iv-post-card .wp-block-post-featured-image img {
	transition: transform 0.5s ease;
}

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

/* === CARTES CATÉGORIES === */

.iv-category-card {
	transition: transform 0.3s ease;
	overflow: hidden;
}

.iv-category-card:hover {
	transform: scale(1.02);
}

/* === BOUTONS === */

.wp-block-button__link {
	transition: all 0.3s ease;
}

.is-style-outline .wp-block-button__link {
	border-width: 1px;
	border-style: solid;
	border-color: var(--wp--preset--color--bordeaux);
}

.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--bordeaux) !important;
	color: var(--wp--preset--color--creme) !important;
}

/* === BOUTON AFFILIATION === */

.iv-affiliate-button .wp-block-button__link,
.iv-affiliate-button .wc-block-components-product-button__button {
	background: var(--wp--preset--color--bordeaux);
	color: var(--wp--preset--color--creme);
	border: 1px solid var(--wp--preset--color--bordeaux);
	font-family: var(--wp--preset--font-family--playfair);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.6rem 1.5rem;
	width: 100%;
	text-align: center;
	transition: all 0.3s ease;
}

.iv-affiliate-button .wp-block-button__link:hover,
.iv-affiliate-button .wc-block-components-product-button__button:hover {
	background: transparent;
	color: var(--wp--preset--color--bordeaux);
}

/* === SÉPARATEUR ORNEMENTAL === */

.iv-ornament-divider {
	border: none !important;
	background: none !important;
	text-align: center;
	overflow: visible;
}

.iv-ornament-divider::before {
	content: '✦  ✦  ✦';
	display: block;
	font-family: var(--wp--preset--font-family--cormorant);
	color: var(--wp--preset--color--sepia);
	font-size: 1rem;
	letter-spacing: 0.5em;
}

/* === CITATIONS === */

.wp-block-quote {
	position: relative;
	padding-left: 2rem;
}

.wp-block-quote::before {
	content: '\201C';
	position: absolute;
	top: -0.5rem;
	left: -0.5rem;
	font-family: var(--wp--preset--font-family--cormorant);
	font-size: 4rem;
	color: var(--wp--preset--color--sepia);
	opacity: 0.3;
	line-height: 1;
}

/* === IMAGES DANS LES ARTICLES === */

.wp-block-post-content img {
	border-radius: 2px;
}

.wp-block-post-content .wp-block-image figcaption {
	font-family: var(--wp--preset--font-family--cormorant);
	font-style: italic;
	color: var(--wp--preset--color--texte-secondaire);
	font-size: 0.9rem;
	text-align: center;
	margin-top: 0.5rem;
}

/* === PAGINATION === */

.wp-block-query-pagination {
	gap: 0.5rem;
}

.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.5rem;
	font-family: var(--wp--preset--font-family--cormorant);
	font-size: 1rem;
	color: var(--wp--preset--color--texte-principal);
	border: 1px solid var(--wp--preset--color--beige);
	border-radius: 2px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.wp-block-query-pagination .page-numbers:hover,
.wp-block-query-pagination-numbers .page-numbers:hover {
	background: var(--wp--preset--color--bordeaux);
	color: var(--wp--preset--color--creme);
	border-color: var(--wp--preset--color--bordeaux);
}

.wp-block-query-pagination .page-numbers.current,
.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--wp--preset--color--bordeaux);
	color: var(--wp--preset--color--creme);
	border-color: var(--wp--preset--color--bordeaux);
}

/* === FORMULAIRE DE RECHERCHE === */

.wp-block-search__inside-wrapper {
	border-color: var(--wp--preset--color--beige) !important;
}

.wp-block-search__button {
	background: var(--wp--preset--color--bordeaux) !important;
	color: var(--wp--preset--color--creme) !important;
	border: none;
	font-family: var(--wp--preset--font-family--playfair);
	font-size: 0.8rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	transition: background 0.3s ease;
}

.wp-block-search__button:hover {
	background: var(--wp--preset--color--bordeaux-fonce) !important;
}

/* === COVER (HERO) === */

.wp-block-cover {
	overflow: hidden;
}

.wp-block-cover img {
	filter: sepia(15%) saturate(85%);
}

/* === FOOTER === */

.wp-block-group.has-bordeaux-fonce-background-color a {
	color: var(--wp--preset--color--beige);
	text-decoration: none;
	transition: color 0.2s ease;
}

.wp-block-group.has-bordeaux-fonce-background-color a:hover {
	color: var(--wp--preset--color--or-antique);
}

.wp-block-group.has-bordeaux-fonce-background-color ul {
	list-style: none;
	padding-left: 0;
}

/* === LISTES DANS LE FOOTER === */

.wp-block-group.has-bordeaux-fonce-background-color .wp-block-list {
	list-style: none;
	padding-left: 0;
}

/* === ANIMATIONS SUBTILES === */

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.wp-block-cover__inner-container {
	animation: fadeInUp 0.8s ease-out;
}

/* === RESPONSIVE === */

@media (max-width: 1024px) {
	.iv-product-grid .wp-block-woocommerce-product-template {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 782px) {
	.iv-site-header {
		position: relative;
	}

	.wp-block-cover {
		min-height: 60vh !important;
	}

	.iv-product-card:hover,
	.iv-post-card:hover {
		transform: none;
	}
}

@media (max-width: 480px) {
	.iv-product-grid .wp-block-woocommerce-product-template {
		grid-template-columns: 1fr !important;
	}
}
