/**
 * Main custom styles — reset, typographie, container, helpers.
 * Toutes les couleurs viennent des variables CSS définies dans style.css (:root).
 */

/* --- Reset léger --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body.storefront-child {
    background-color: var(--color-cream);
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover,
a:focus {
    color: var(--color-accent);
}

/* --- Typographie --- */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.2;
    margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
h4 { font-size: 1.125rem; }

.script {
    font-family: var(--font-script);
    font-weight: 400;
    font-size: 1.25em;
}

.eyebrow {
    font-family: var(--font-body);
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: 1rem;
    display: inline-block;
}

/* --- Suppression sidebar : pleine largeur du contenu --- */
.site-content #primary,
.site-content .content-area {
    width: 100%;
    float: none;
    margin-right: 0;
}

#secondary,
.widget-area {
    display: none !important;
}

/* --- Container & sections --- */

.sfc-container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 24px;
}

.sfc-section {
    padding-block: var(--space-section-desktop);
}

.sfc-section--cream { background-color: var(--color-cream); }
.sfc-section--sand  { background-color: var(--color-secondary); }
.sfc-section--navy  { background-color: var(--color-white); color: var(--color-primary); }
.sfc-section--white { background-color: var(--color-white); }

.sfc-section--navy h1,
.sfc-section--navy h2,
.sfc-section--navy h3 {
    color: var(--color-primary);
}

.sfc-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.sfc-section-header p {
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto;
}

/* --- Boutons --- */

.sfc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 18px 40px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid var(--color-gold);
    border-radius: var(--radius-ui);
    background: transparent;
    color: var(--color-gold);
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
}

.sfc-btn:hover,
.sfc-btn:focus-visible {
    background: var(--color-gold);
    color: var(--color-white);
}

.sfc-btn--primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
}

.sfc-btn--primary:hover,
.sfc-btn--primary:focus-visible {
    background: var(--color-gold);
    border-color: var(--color-gold);
    color: var(--color-white);
}

.sfc-btn--accent {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
}

.sfc-btn--accent:hover,
.sfc-btn--accent:focus-visible {
    background: var(--color-gold);
    border-color: var(--color-gold);
    color: var(--color-white);
}

/* --- Helpers --- */

.sfc-text-center { text-align: center; }
.sfc-mb-0 { margin-bottom: 0 !important; }
.sfc-mb-1 { margin-bottom: 0.5rem !important; }
.sfc-mb-2 { margin-bottom: 1rem !important; }
.sfc-mb-3 { margin-bottom: 1.5rem !important; }
.sfc-mb-4 { margin-bottom: 2rem !important; }

.sfc-grid {
    display: grid;
    gap: 2rem;
}
.sfc-grid--2 { grid-template-columns: repeat(2, 1fr); }
.sfc-grid--3 { grid-template-columns: repeat(3, 1fr); }
.sfc-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* --- Accessibilité --- */

.sfc-sr-only {
    position: absolute !important;
    clip: rect(1px,1px,1px,1px);
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    word-wrap: normal !important;
}

:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 3px;
}

/* --- Animations (utilisées par main.js) --- */

.sfc-fade-in {
    transition: opacity 600ms ease-out, transform 600ms ease-out;
    will-change: opacity, transform;
}

/* Activé seulement quand JS est dispo : sinon le contenu est visible d'emblée. */
html.sfc-js .sfc-fade-in {
    opacity: 0;
    transform: translateY(20px);
}

html.sfc-js .sfc-fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    html.sfc-js .sfc-fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* --- Reveal au scroll (.sfc-reveal[data-reveal], observer dans main.js) ---
   Base GLOBALE : utilisable sur toutes les pages (formations, prestations,
   notre-histoire…). Les variantes home restent dans homepage-animations.css. */
html.sfc-js .sfc-reveal[data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 650ms ease-out, transform 650ms cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
}

html.sfc-js .sfc-reveal[data-reveal="left"]  { transform: translateX(-32px); }
html.sfc-js .sfc-reveal[data-reveal="right"] { transform: translateX(32px); }
html.sfc-js .sfc-reveal[data-reveal="zoom"]  { transform: scale(0.96); }
html.sfc-js .sfc-reveal[data-reveal="3d"]    { transform: perspective(1100px) rotateY(-10deg) translateY(22px) scale(0.97); }

html.sfc-js .sfc-reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html.sfc-js .sfc-reveal[data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* --- Tilt 3D des cartes (.sfc-tilt, piloté par tilt.js) ---
   La classe est posée par JS (desktop pointeur fin uniquement) :
   sans JS ou sur tactile, rien ne change. */
.sfc-tilt {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 320ms ease;
}

/* Pendant le suivi souris : transition courte pour un mouvement fluide ;
   au repos, la transition existante de la carte gère le retour en douceur. */
.sfc-tilt.is-tilting {
    transition: transform 90ms ease-out, box-shadow 320ms ease;
    will-change: transform;
}

/* Reflet radial qui suit le curseur (variables posées par tilt.js). */
.sfc-tilt::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(
        420px circle at var(--sfc-glare-x, 50%) var(--sfc-glare-y, 50%),
        rgba(255, 255, 255, 0.28) 0%,
        rgba(248, 232, 216, 0.10) 35%,
        transparent 65%
    );
    transition: opacity 260ms ease;
}

.sfc-tilt.is-tilting::after {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .sfc-tilt.is-tilting {
        transition: none;
        transform: none !important;
    }
    .sfc-tilt::after {
        display: none;
    }
}

/* --- Mobile / tactile : feedback « press » + éclat au reveal ---
   Équivalents tactiles du tilt 3D desktop (tilt.js ne s'active pas ici). */
@media (hover: none) {

    /* 1. Press : la carte s'enfonce sous le doigt puis rebondit.
       Placé APRÈS les règles .sfc-reveal pour gagner à spécificité égale. */
    html.sfc-js .sfc-fcard,
    html.sfc-js .sfc-featured__card,
    html.sfc-js .woocommerce ul.products li.product {
        transition: transform 140ms ease, box-shadow 140ms ease;
    }
    html.sfc-js .sfc-fcard:active,
    html.sfc-js .sfc-featured__card:active,
    html.sfc-js .woocommerce ul.products li.product:active {
        transform: scale(0.98);
        box-shadow: 0 4px 12px rgba(34, 34, 34, 0.08);
    }

    /* 2. Éclat lumineux : un reflet traverse la carte une seule fois,
       au moment où elle apparaît dans la cascade de scroll (.is-visible).
       Animé en background-position : aucun débordement possible. */
    html.sfc-js .sfc-fcard.sfc-reveal::after,
    html.sfc-js .sfc-featured__card.sfc-reveal::after,
    html.sfc-js .woocommerce ul.products li.product.sfc-reveal::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 3;
        pointer-events: none;
        opacity: 0;
        background: linear-gradient(115deg,
            transparent 38%,
            rgba(255, 255, 255, 0.45) 48%,
            rgba(248, 232, 216, 0.30) 52%,
            transparent 62%);
        background-size: 260% 100%;
        background-position: 130% 0;
        background-repeat: no-repeat;
    }
    html.sfc-js .sfc-fcard.sfc-reveal.is-visible::after,
    html.sfc-js .sfc-featured__card.sfc-reveal.is-visible::after,
    html.sfc-js .woocommerce ul.products li.product.sfc-reveal.is-visible::after {
        animation: sfc-shine 950ms ease-out 300ms 1 both;
    }

    /* Les cartes hôtes doivent porter le pseudo-élément. */
    html.sfc-js .sfc-fcard.sfc-reveal,
    html.sfc-js .sfc-featured__card.sfc-reveal,
    html.sfc-js .woocommerce ul.products li.product.sfc-reveal {
        position: relative;
    }
}

@keyframes sfc-shine {
    0%   { opacity: 1; background-position: 130% 0; }
    99%  { opacity: 1; background-position: -30% 0; }
    100% { opacity: 0; background-position: -30% 0; }
}

/* --- Soulignement calligraphique des titres de section (.is-underlined, main.js) --- */
.sfc-section-header h2::after,
.sfc-formations__section-title::after {
    content: '';
    display: block;
    width: 76px;
    height: 3px;
    margin: 16px auto 0;
    background: linear-gradient(90deg, var(--color-gold), var(--al-orange-light));
    border-radius: 999px;
    transform: scaleX(0);
    transition: transform 800ms cubic-bezier(0.22, 0.61, 0.36, 1) 250ms;
}

.sfc-section-header h2.is-underlined::after,
.sfc-formations__section-title.is-underlined::after {
    transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
    .sfc-section-header h2::after,
    .sfc-formations__section-title::after {
        transform: scaleX(1);
        transition: none;
    }
}

/* --- Fly-to-cart (clone volant + pulse du badge, fly-to-cart.js) --- */
.sfc-fly-clone {
    position: fixed;
    z-index: 9999;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(247, 99, 9, 0.35);
    pointer-events: none;
    opacity: 1;
    transition: transform 760ms cubic-bezier(0.3, 0.7, 0.3, 1), opacity 760ms ease;
    will-change: transform, opacity;
}

.sfc-cart-pulse {
    animation: sfc-cart-pulse 620ms cubic-bezier(0.22, 0.61, 0.36, 1) 1;
}

@keyframes sfc-cart-pulse {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.55); background-color: var(--color-gold); }
    100% { transform: scale(1); }
}

@media (hover: none) and (prefers-reduced-motion: reduce) {
    html.sfc-js .sfc-fcard:active,
    html.sfc-js .sfc-featured__card:active,
    html.sfc-js .woocommerce ul.products li.product:active {
        transform: none;
        transition: none;
    }
    html.sfc-js .sfc-fcard.sfc-reveal::after,
    html.sfc-js .sfc-featured__card.sfc-reveal::after,
    html.sfc-js .woocommerce ul.products li.product.sfc-reveal::after {
        display: none;
    }
}

/* ============================================================
   Page Notre histoire / Our story — typographie éditoriale
   ============================================================ */

.sfc-story__body {
    max-width: 760px;
    margin-inline: auto;
    font-size: 17px;
    line-height: 1.75;
    color: var(--color-text);
}

.sfc-story__body > p:first-child,
.sfc-story__body .sfc-story__lead {
    font-family: var(--font-heading);
    font-size: 22px;
    font-style: italic;
    line-height: 1.55;
    color: var(--color-primary);
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(248, 152, 80, 0.35);
}

.sfc-story__body h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 3rem;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.25rem;
}

.sfc-story__body h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 14px;
    height: 1px;
    background: var(--color-gold);
}

.sfc-story__body p + p {
    margin-top: 1.25rem;
}

.sfc-story__body .sfc-story__signature {
    margin-top: 3rem;
    font-family: var(--font-script);
    font-size: 32px;
    color: var(--color-gold);
    text-align: right;
}

.sfc-cta-final__row {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (max-width: 640px) {
    .sfc-story__body { font-size: 16px; }
    .sfc-story__body > p:first-child,
    .sfc-story__body .sfc-story__lead { font-size: 19px; }
    .sfc-story__body h2 { font-size: 24px; padding-left: 0; }
    .sfc-story__body h2::before { display: none; }
}

/* ============================================================
   Page Prestation traiteur — featured image (couverture)
   Cadre éditorial pleine largeur (fond crème), image au format
   naturel centrée, plafonnée en hauteur. S'adapte à toute
   orientation (portrait ou paysage).
   ============================================================ */

.sfc-prestation__cover {
    margin: 0;
    width: 100%;
    background: var(--color-cream);
    padding-block: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sfc-prestation__cover-img {
    max-width: min(100%, 1200px);
    max-height: 70vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    box-shadow: 0 20px 40px rgba(34, 34, 34, 0.12);
    transition: transform 600ms ease;
}

.sfc-prestation__cover:hover .sfc-prestation__cover-img {
    transform: translateY(-4px);
    box-shadow: 0 28px 50px rgba(34, 34, 34, 0.18);
}

@media (max-width: 768px) {
    .sfc-prestation__cover {
        padding-block: 1.5rem;
    }
    .sfc-prestation__cover-img {
        max-height: 60vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sfc-prestation__cover-img,
    .sfc-prestation__cover:hover .sfc-prestation__cover-img {
        transition: none;
        transform: none;
    }
}

/* Masquer le bouton flottant « revisit » de CookieYes (affiché une fois le choix cookies fait). */
.cky-btn-revisit-wrapper,
.cky-revisit-bottom-left {
    display: none !important;
}

/* ============================================================
 * BANDEAU PHOTO DE PAGE (2.3.0)
 * Utilisé par les templates Prestations et Formations, entre le hero et le
 * premier bloc de contenu. Pleine largeur, hauteur bornée.
 * ============================================================ */
.sfc-page-cover {
    margin: 0 0 clamp(32px, 4vw, 56px);
    overflow: hidden;
}

/* Les sources sont majoritairement des portraits (photos smartphone) : un
   bandeau trop panoramique n'en garderait qu'une fine bande. On recadre donc
   en 16/9 et on remonte le point d'intérêt (les visages, pas les mentons). */
.sfc-page-cover__img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 60vh;
    object-fit: cover;
    object-position: center 32%;
}

@media (max-width: 700px) {
    .sfc-page-cover__img {
        aspect-ratio: 4 / 3;
    }
}
