/*
Theme Name: La Lune et le Chaudron
Theme URI: https://laluneetlechaudron.com/
Description: Thème enfant de Extendable pour La Lune et le Chaudron. Direction artistique, design system et styles globaux de la boutique.
Author: La Lune et le Chaudron
Template: extendable
Version: 0.1.3
Text Domain: la-lune-et-le-chaudron
Requires at least: 6.6
Requires PHP: 7.4
*/

/*
 * La Lune et le Chaudron — Design System v0.1.3
 * Principe : le maximalisme appartient au décor, la simplicité aux fonctions.
 */

:root {
  --llc-shadow-soft: 0 12px 36px rgba(35, 32, 36, 0.08);
  --llc-shadow-hover: 0 18px 46px rgba(35, 32, 36, 0.13);
  --llc-border-soft: rgba(35, 32, 36, 0.16);
  --llc-surface: rgba(255, 255, 255, 0.36);
  --llc-surface-strong: rgba(255, 255, 255, 0.58);
  --llc-transition: 180ms ease;
}

html {
  scroll-behavior: smooth;
}

html {
  background-color: var(--wp--preset--color--parchemin-ancien);
}

body {
  background-color: var(--wp--preset--color--parchemin-ancien) !important;
  color: var(--wp--preset--color--encre-de-corbeau);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background-image: url("assets/images/parchment-organic.jpg") !important;
  background-repeat: repeat !important;
  background-size: 1200px 1200px !important;
  background-position: top left !important;
}

/* Extendable peut peindre sa propre ambiance sur les wrappers racine.
 * On neutralise uniquement ces couches structurelles pour laisser apparaître notre parchemin. */
body::before,
body::after,
.wp-site-blocks::before,
.wp-site-blocks::after,
.wp-site-blocks > header::before,
.wp-site-blocks > header::after,
.wp-site-blocks > main::before,
.wp-site-blocks > main::after,
.wp-site-blocks > footer::before,
.wp-site-blocks > footer::after {
  background-image: none !important;
}

.wp-site-blocks,
.wp-site-blocks > header,
.wp-site-blocks > main,
.wp-site-blocks > footer {
  background: transparent !important;
  background-image: none !important;
}

::selection {
  background: var(--wp--preset--color--rose-ancien);
  color: var(--wp--preset--color--encre-de-corbeau);
}

:where(h1, h2, h3, h4, h5, h6) {
  text-wrap: balance;
}

:where(p, li) {
  text-wrap: pretty;
}

/* Liens : jamais de pointillés hérités du thème parent. */
a:not(.wp-element-button):not(.wp-block-button__link) {
  text-decoration-line: underline;
  text-decoration-style: solid !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(90, 47, 69, 0.48);
  transition: color var(--llc-transition), text-decoration-color var(--llc-transition);
}

a:not(.wp-element-button):not(.wp-block-button__link):hover {
  color: var(--wp--preset--color--prune-du-crepuscule);
  text-decoration-style: solid !important;
  text-decoration-color: var(--wp--preset--color--rose-ancien);
}

/* Titres cliquables : on neutralise totalement l’indicateur d’état hérité d’Extendable. */
.wp-block-post-title a,
.wp-block-query .wp-block-post-title a {
  position: relative;
  display: inline-block;
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
  outline-style: none;
}

.wp-block-post-title a::after,
.wp-block-query .wp-block-post-title a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.08em;
  width: 100%;
  height: 2px;
  background: var(--wp--preset--color--rose-ancien);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms ease;
}

.wp-block-post-title a:hover,
.wp-block-query .wp-block-post-title a:hover {
  color: var(--wp--preset--color--prune-du-crepuscule);
  text-decoration: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

.wp-block-post-title a:hover::after,
.wp-block-query .wp-block-post-title a:hover::after,
.wp-block-post-title a:focus-visible::after,
.wp-block-query .wp-block-post-title a:focus-visible::after {
  transform: scaleX(1);
}

/* Titres produits : même principe, mais sans pseudo-élément pour éviter de perturber WooCommerce. */
.woocommerce ul.products li.product a .woocommerce-loop-product__title,
.wc-block-components-product-name {
  text-decoration: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

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

.wp-element-button,
.wp-block-button__link,
.wc-block-components-button,
.woocommerce :where(button.button, a.button, input.button) {
  border: 1px solid var(--wp--preset--color--velours-de-minuit);
  border-radius: 4px;
  box-shadow: none;
  font-weight: 700;
  letter-spacing: 0.015em;
  transition: background-color var(--llc-transition), color var(--llc-transition), border-color var(--llc-transition), transform var(--llc-transition), box-shadow var(--llc-transition);
}

.wp-element-button:hover,
.wp-block-button__link:hover,
.wc-block-components-button:hover,
.woocommerce :where(button.button, a.button, input.button):hover {
  background-color: var(--wp--preset--color--mousse-des-sous-bois);
  border-color: var(--wp--preset--color--mousse-des-sous-bois);
  color: var(--wp--preset--color--parchemin-ancien);
  transform: translateY(-1px);
  box-shadow: var(--llc-shadow-soft);
}

:where(input:not([type='checkbox']):not([type='radio']):not([type='submit']), select, textarea) {
  background: var(--llc-surface-strong);
  border: 1px solid var(--llc-border-soft);
  border-radius: 4px;
  color: var(--wp--preset--color--encre-de-corbeau);
  min-height: 46px;
}

:where(input, select, textarea)::placeholder {
  color: rgba(35, 32, 36, 0.58);
}

hr,
.wp-block-separator {
  border-color: var(--wp--preset--color--pierre-de-lune);
  opacity: 0.75;
}

.wp-block-quote {
  border-inline-start: 3px solid var(--wp--preset--color--or-ancien);
  margin-inline: 0;
  padding-inline-start: var(--wp--preset--spacing--40);
}

/* Surface réutilisable pour les futurs blocs éditoriaux et cartes. */
.llc-surface {
  background: var(--llc-surface);
  border: 1px solid var(--llc-border-soft);
  box-shadow: var(--llc-shadow-soft);
}

/* Les images restent nettes et naturelles : aucun filtre global. */
img {
  height: auto;
}

/* WooCommerce : harmonisation minimale sans modifier la logique métier. */
.wc-block-components-totals-wrapper,
.wc-block-components-sidebar-layout,
.wc-block-components-order-summary,
.woocommerce-order-details,
.woocommerce-customer-details address {
  border-color: var(--llc-border-soft);
}

.wc-block-components-radio-control-accordion-option,
.wc-block-components-totals-coupon__form,
.wc-block-components-address-card {
  background-color: transparent;
}

/* Réduction du mouvement pour les personnes qui le demandent. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
