/* =========================================================
   Camila — styles de base, communs à toutes les pages
   ========================================================= */

/* Polices hébergées dans le thème (sous-ensemble latin : tout le français) */

/* Titres */
@font-face {
    font-family: "Lilita One";
    src: url("../fonts/lilita-one-latin.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Texte : police variable, toutes les graisses (gras compris) dans un seul fichier */
@font-face {
    font-family: "Sour Gummy";
    src: url("../fonts/sour-gummy-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Couleurs (reprises du logo et du formulaire Brevo) */
    --c-bg: #fef5f6;
    --c-surface: #ffffff;
    --c-text: #3c4858;
    --c-text-soft: #687484;
    --c-accent: #ce5741;      /* terracotta du logo : grands titres uniquement */
    --c-accent-ink: #b54a34;  /* terracotta plus soutenu : liens, boutons, petits textes (contraste AA) */
    --c-accent-dark: #963b29;

    /* Polices : Lilita One pour les titres, Sour Gummy pour le texte, police du système en secours */
    --f-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --f-text: "Sour Gummy", var(--f-sans);
    --f-title: "Lilita One", "Arial Rounded MT Bold", var(--f-sans);

    /* Mise en page */
    --container: 1200px;
    --gutter: clamp(16px, 4vw, 32px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font: 400 1rem/1.6 var(--f-text);
    overflow-wrap: break-word; /* mot trop long (adresse, nom de cookie…) : coupé plutôt que de déborder */
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure {
    margin: 0;
}

/* Titres : Lilita One terracotta, 40px sur desktop → 28px sur mobile.
   La classe .title donne le même style à un élément qui n'est pas un titre HTML. */
h1, h2, .title {
    color: var(--c-accent);
    font-family: var(--f-title);
    font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);
    font-weight: 400; /* Lilita One n'a qu'une graisse : évite un faux gras */
    line-height: 1.15;
}

img,
svg,
iframe {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: var(--c-accent-ink);
    text-underline-offset: .18em;
}

a:hover {
    color: var(--c-accent-dark);
}

:focus-visible {
    outline: 2px solid var(--c-accent-ink);
    outline-offset: 3px;
}

/* ---------- Mise en page ---------- */

.container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- Boutons ---------- */

/* Survol : le fond rose se répand comme une goutte depuis le point d'entrée de la
   souris et se retire vers son point de sortie ; au clic, une onde part du point
   cliqué. Les cercles sont placés par assets/js/button.js (--x, --y : centre,
   --d : diamètre). Sans JS ou au clavier, le remplissage part du centre.
   Un bouton peut changer ses couleurs avec --btn-fill, --btn-fill-ink et --btn-wave. */
.btn {
    --btn-fill: #fed1d1;                   /* rose de la vague des titres */
    --btn-fill-ink: var(--c-accent-dark);  /* texte sur le rose (contraste 5,2:1) */
    --btn-wave: rgba(255, 255, 255, .85);  /* onde du clic sur le fond terracotta */
    --x: 50%;
    --y: 50%;
    --d: 250%;
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    gap: .6em;
    overflow: hidden;
    padding: .9em 1.6em;
    border-radius: 8px;
    background: var(--c-accent-ink);
    color: #fff;
    font-size: .9375rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
    transition: color .45s ease, background-color .2s;
}

.btn::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: var(--y);
    left: var(--x);
    width: var(--d);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--btn-fill);
    transform: translate(-50%, -50%) scale(0);
    transition: transform .6s cubic-bezier(.22, .61, .36, 1);
}

.btn:focus-visible:not(:disabled) {
    color: var(--btn-fill-ink);
}

.btn:focus-visible:not(:disabled)::before {
    transform: translate(-50%, -50%) scale(1);
}

/* Pas de survol sur écran tactile : le bouton resterait rempli après le toucher */
@media (hover: hover) {
    .btn:hover:not(:disabled) {
        --btn-wave: var(--btn-fill-ink);
        color: var(--btn-fill-ink);
    }

    .btn:hover:not(:disabled)::before {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Onde du clic : deux cercles concentriques qui s'agrandissent en s'effaçant */
.btn-drop {
    position: absolute;
    z-index: -1;
    border: 2px solid var(--btn-wave);
    border-radius: 50%;
    pointer-events: none;
    animation: btn-drop .75s cubic-bezier(.2, .6, .35, 1) forwards;
}

.btn-drop::after {
    content: "";
    position: absolute;
    inset: 22%;
    border: inherit;
    border-radius: inherit;
    opacity: .6;
}

@keyframes btn-drop {
    0% {
        opacity: .9;
        transform: scale(0);
    }

    60% {
        opacity: .6;
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* ---------- Messages de WooCommerce (ajouté au panier, stock insuffisant…) ----------
   Dans un bloc .notices, et partout dans Mon compte (.account), où WooCommerce les place lui-même */

.notices {
    margin-bottom: 2rem;
}

:is(.notices, .account) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin: 0 0 .75rem;
    padding: .8rem 1.1rem;
    border-left: 4px solid #2e7d32;
    border-radius: 6px;
    background: var(--c-surface);
    color: #000;
    font-size: .9375rem;
    list-style: none;
}

:is(.notices, .account) .woocommerce-info {
    border-color: var(--c-accent-ink);
}

:is(.notices, .account) .woocommerce-error {
    border-color: #b3261e;
}

:is(.notices, .account) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) .button {
    order: 2;
    margin-left: auto;
    font-weight: 700;
}

/* ---------- Pied de page ---------- */

.site-footer {
    padding: 28px 0;
    color: var(--c-text-soft);
    font-size: .875rem;
    text-align: center;
}

/* ---------- Refus des statistiques (shortcode [matomo_opt_out], politique de confidentialité) ---------- */

form:has(> #matomo_optout_checkbox) {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid color-mix(in srgb, var(--c-accent) 35%, transparent);
    border-radius: 12px;
}

#matomo_optout_checkbox {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin: .15em 0 0;
    accent-color: var(--c-accent-ink);
    cursor: pointer;
}

#matomo_optout_checkbox + label {
    cursor: pointer;
}

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