/* TopArt&Cie — identité visuelle et défilement */
:root {
    --primary: #14283f;
    --secondary: #a07843;
    --background: #fff;
    --light: #f7f4ef;
    --text: #333;
    --white: #fff;
    --radius: 18px;
    --font: Arial, Helvetica, sans-serif;
    --font-title: Georgia, 'Times New Roman', serif;
    --page-height: 100svh;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--background); line-height: 1.7; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--secondary); outline-offset: 5px; }
img { display: block; max-width: 100%; height: auto; }
p { margin-bottom: 1em; }
h2 { font-family: var(--font-title); font-weight: 400; font-size: clamp(32px, 4vw, 56px); color: var(--primary); line-height: 1.15; margin-bottom: 24px; }
/* Accueil : logo et slogan */
header { min-height: var(--page-height); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 24px; padding: 50px 6%; background: white; scroll-snap-align: start; }
header > img { width: clamp(240px, 42vw, 480px); max-width: 100%; object-fit: contain; }
header > p { font-family: var(--font-title); font-style: italic; font-size: clamp(26px, 3.5vw, 46px); line-height: 1.3; color: var(--primary); margin: 0; }
.scroll-next { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 28px; color: var(--secondary); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
.scroll-next::after { content: ''; width: 14px; height: 14px; border-right: 1px solid; border-bottom: 1px solid; transform: rotate(45deg); }
/* Une section = une page, sans couper les contenus longs */
.section { min-height: var(--page-height); padding: clamp(40px, 7vh, 85px) 6%; display: grid; align-items: center; scroll-snap-align: start; background: var(--background); }
.container { width: 100%; max-width: 1200px; margin: auto; min-width: 0; }
.bg-light { background: var(--light); }
.subtitle { display: inline-block; color: var(--secondary); text-transform: uppercase; font-size: 12px; font-weight: bold; letter-spacing: 3px; margin-bottom: 16px; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: clamp(30px, 6vw, 85px); }
.two-columns img { width: 100%; max-height: 66svh; object-fit: contain; border-radius: var(--radius); }
.section-text p { font-size: clamp(15px, 1.25vw, 18px); }
.section-text a, .mailto { color: var(--secondary); text-decoration: underline; text-underline-offset: 4px; }
.section-heading { text-align: center; max-width: 780px; margin: 0 auto 30px; }
/* Valeurs */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { padding: clamp(18px, 2.4vw, 30px); border: 1px solid #e8dfd3; border-radius: var(--radius); background: #fff; transition: transform .3s, box-shadow .3s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px #14283f12; }
.number { font-family: var(--font-title); font-size: 30px; color: var(--secondary); }
.card h3 { color: var(--primary); font-size: 18px; line-height: 1.35; margin: 8px 0 12px; }
.card p { font-size: 15px; margin: 0; line-height: 1.6; }
/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.gallery img, .photo-placeholder { width: 100%; height: clamp(150px, 24vh, 260px); object-fit: cover; border-radius: var(--radius); }
.photo-placeholder { display: grid; place-items: center; background: #fff; border: 1px dashed #c9bba8; color: #75634e; text-align: center; padding: 15px; }
.onlineshop { text-align: center; margin-top: 25px; }
/* Contact et pied de page */
.contact { padding: 70px 6%; background: var(--primary); color: white; text-align: center; }
.btn { display: inline-block; padding: 15px 30px; background: #876336; color: white; border-radius: 40px; font-weight: bold; transition: transform .3s; }
.btn:hover { transform: translateY(-3px); }
footer { background: #0c1928; color: #ddd; text-align: center; padding: 25px; font-size: 13px; }
footer p { margin: 0; }
/* Accueil rétractable et empilement */
:root { --header-height: 150px; --stack-step: 9px; }
html { scroll-snap-type: none; scroll-padding-top: calc(var(--header-height) + 35px); }

.intro { height: 100svh; background: white; }
header { position: fixed; inset: 0 0 auto; z-index: 20; height: 100svh; min-height: 0; padding: 12px 5%; gap: 24px; }
header > img { width: auto; height: min(36svh, 330px); max-width: 90%; object-fit: contain; }
header > p { font-size: clamp(24px, 3.5vw, 46px); }
.scroll-next { margin-top: 20px; }
.page-stack { width: 99%; margin: 0 auto 28px; }
.page-stack > .section { position: sticky; top: calc(var(--header-height) + var(--layer) * var(--stack-step)); z-index: calc(1 + var(--layer)); min-height: calc(100svh - var(--header-height) - 36px); margin-bottom: 24px; padding: clamp(24px, 4vw, 55px); border: 1px solid #dcd4c8; border-radius: 22px 22px 12px 12px; box-shadow: 0 -3px 14px #14283f14; scroll-snap-align: none; }
.page-stack > .section:nth-child(1) { --layer: 0; }
.page-stack > .section:nth-child(2) { --layer: 1; }
.page-stack > .section:nth-child(3) { --layer: 2; }
.page-stack > .section:nth-child(4) { --layer: 3; }
.page-stack > .section:last-child { margin-bottom: 0; }
.container { max-width: 1500px; }
.two-columns img { max-height: 48svh; }
.gallery img, .photo-placeholder { height: clamp(100px, 15vh, 180px); }
.contact, footer { position: relative; z-index: 10; }
footer a { text-decoration: underline; }
footer p { margin-bottom: 8px; }
/* Sans JavaScript, l'accueil reste une page normale. */
html:not(.enhanced) header { position: relative; }
html:not(.enhanced) .page-stack > .section { top: calc(var(--layer) * var(--stack-step)); }
.page-stack > .section.overflowing { position: relative; top: auto; }
@media (max-width: 900px) { .cards, .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px), (max-height: 550px) {
 :root { --header-height: 115px; }
 .page-stack > .section { position: relative; top: auto; min-height: auto; padding: 30px 5%; }
 .two-columns { grid-template-columns: 1fr; gap: 25px; }
 #histoire .section-text { grid-row: 1; }
}
@media (max-width: 480px) { .cards, .gallery { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .page-stack > .section { position: relative; top: auto; } }

/* V5 : transition prolongée et traces de pattes */
:root { --intro-travel: 145svh; --paw-color: #b68b50; }
html.enhanced .intro { height: var(--intro-travel); }
header { overflow: hidden; }
header > img, header > p, header > a { position: relative; z-index: 1; }
.paw-trail { position: absolute; inset: 0 auto 0 2%; width: 23%; pointer-events: none; }
.dog-trail { left: auto; right: 2%; }
.paw-trail svg { position: absolute; width: clamp(18px, 3vw, 44px); height: auto; fill: var(--paw-color); opacity: 0; }
.dog-trail svg { width: clamp(23px, 3.8vw, 55px); }

#galerie { min-height: calc(100svh - var(--header-height) - 36px); }
#galerie .section-heading { margin-bottom: 15px; }
#galerie .gallery { gap: 12px; }
#galerie .gallery img, #galerie .photo-placeholder { height: clamp(70px, 11vh, 135px); }
#galerie .onlineshop { margin-top: 15px; }
@media (min-width: 769px) and (min-height: 551px) { #galerie { padding-block: 20px; } }
@media (max-width: 768px) { :root { --intro-travel: 115svh; } .paw-trail { width: 12%; } .paw-trail svg { width: 18px; } .dog-trail svg { width: 22px; } }
@media (prefers-reduced-motion: reduce) { .paw-trail { display: none; } :root { --intro-travel: 100svh; } }

/* Trajectoire commune en cœur */
.cat-trail { inset: 0; width: 100%; }
.dog-trail { display: none; }


/* V8 : image originale découpée en empreintes, révélées dans l’ordre. */

.cat-trail > img { position: absolute; display: block; opacity: 0; max-width: none; object-fit: fill; }


/* V9 : empreintes derrière la marque, dans les espaces libres. */
.cat-trail { inset: 0; transform: none; z-index: 0; opacity: .48; }
header > img, header > p, header > a { z-index: 2; }


/* V11 : hauteur finale conforme à la capture */
@media (min-width: 769px) and (min-height: 551px) { :root { --header-height: 220px; } }

/* V13 — responsive : les variables sont aussi lues par scroll.js. */
:root { --header-height: 220px; --logo-compact: 100px; --slogan-compact: 28px; --paw-size: 1.6%; }
header > p { max-width: 100%; }
header > img { flex-shrink: 0; }
.cat-trail { display: block; }
@media (max-width: 1199px) {
 :root { --header-height: 180px; --logo-compact: 85px; --slogan-compact: 24px; --paw-size: 1.6%; }
 .page-stack > .section { padding: 32px 4%; }
 .two-columns { gap: 30px; }
}
@media (max-width: 991px) {
 .cards, .gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .page-stack > .section { position: relative; top: auto; min-height: auto; }
}
@media (max-width: 767px) {
 :root { --header-height: 120px; --logo-compact: 54px; --slogan-compact: 17px; --paw-size: 2%; --intro-travel: 115svh; }
 header { padding: 8px 4%; }
 .cat-trail { opacity: .35; }
 .page-stack { width: 98%; }
 .page-stack > .section { padding: 26px 5%; border-radius: 16px; }
 .two-columns, .cards, .gallery { grid-template-columns: minmax(0,1fr); }
 .two-columns img { max-height: 45svh; }
 #galerie .gallery img, #galerie .photo-placeholder { height: clamp(150px,30vh,250px); }
 h2 { font-size: clamp(27px,7vw,36px); }
 .contact { padding: 40px 5%; overflow-wrap: anywhere; }
 footer { padding: 20px 5%; overflow-wrap: anywhere; }
}
@media (max-height: 550px) and (orientation: landscape) {
 :root { --header-height: 100px; --logo-compact: 43px; --slogan-compact: 17px; }
 .page-stack > .section { position: relative; top: auto; min-height: auto; }
}
@media (prefers-reduced-motion: reduce) { .cat-trail { display: none; } }

/* V14 — raccord blanc et empilement continu, même pour les cartes longues. */
body, .intro { background: #fff; }
.page-stack { padding-bottom: 0; margin-bottom: 0; }
.page-stack > .section { background-color: #fff; isolation: isolate; }
.page-stack > .section.bg-light { background-color: #f7f4ef; }
@media (min-width: 769px) and (min-height: 551px) and (prefers-reduced-motion: no-preference) {
 .page-stack > .section, .page-stack > .section.overflowing {
   position: sticky;
   top: min(calc(var(--header-height) + var(--layer) * var(--stack-step)), calc(100dvh - var(--card-height, 0px)));
   min-height: calc(100svh - var(--header-height) - 36px);
   margin-bottom: 24px;
 }
 .page-stack > .section:last-child { margin-bottom: 0; }
 /* Masque opaque entre les cartes, y compris dans les coins arrondis. */
 .page-stack > .section::before { content: ''; position: absolute; inset: 0 -1px -24px; background: inherit; border-radius: inherit; z-index: -1; }
 .page-stack > .section:last-child::before { bottom: 0; }
}
.contact, footer { background-clip: border-box; }

/* V15 : toutes les cartes ont le même point d'accroche ; réserve invisible finale. */
.stack-tail { display: none; }
@media (min-width: 769px) and (min-height: 551px) and (prefers-reduced-motion: no-preference) {
 html.enhanced .page-stack > .section {
   top: calc(var(--header-height) + var(--layer) * var(--stack-step));
   min-height: calc(100dvh - var(--header-height) - var(--layer) * var(--stack-step));
   padding-block: clamp(16px, 2.5vh, 30px);
   margin-bottom: 0;
 }
 html.enhanced .page-stack > .section::before { content: none; }
 html.enhanced #activites .section-heading { margin-bottom: 12px; }
 html.enhanced #activites h2 { margin-bottom: 8px; }
 html.enhanced #activites .subtitle { margin-bottom: 6px; }
 html.enhanced #activites .cards { gap: 10px; }
 html.enhanced #activites .card { padding: clamp(10px, 1.4vh, 18px); }
 html.enhanced #activites .card h3 { margin: 3px 0 5px; }
 html.enhanced #activites .card p { font-size: 14px; line-height: 1.4; }
 html.enhanced #activites .number { font-size: 24px; line-height: 1.1; }
 html.enhanced .stack-tail { display: block; height: calc(100dvh - var(--header-height)); pointer-events: none; }
 html.enhanced .page-stack { margin-bottom: calc(-100dvh + var(--header-height)); }
 html.enhanced .contact { z-index: 10; }
}

/* V16 : coins visibles et fin de page entièrement opaque. */
.page-stack > .section { border-radius: 22px; }
.page-stack > .section::before { content: none; }
.contact { background: linear-gradient(180deg, #14283f 0%, #0c1928 100%); }
footer { background: #0c1928; }
@media (min-width: 769px) and (min-height: 551px) and (prefers-reduced-motion: no-preference) {
 html.enhanced .contact { min-height: calc(100dvh - var(--header-height)); display: grid; align-items: center; }
}
@media (max-width: 767px) { .page-stack > .section { border-radius: 16px; } }

/* V18 : état final inspiré de la capture V16. */
@media (min-width: 1200px) and (min-height: 700px) {
 :root { --header-height: 285px; --logo-compact: 120px; --slogan-compact: 30px; }
}
.cat-trail > img { filter: none; }

/* V21 — galerie en éventail, indépendante du scroll vertical. */
.fan-gallery { width:100%; max-width:900px; margin:0 auto; }
.fan-stage { position:relative; height:clamp(170px,35dvh,350px); perspective:1000px; overflow:hidden; touch-action:pan-y; }
.fan-photo { position:absolute; left:50%; top:50%; width: min(45%, 390px); height:90%; padding:6px; border:1px solid #d9cdbd; border-radius:14px; background:#fff; box-shadow:0 6px 18px #14283f25; cursor:pointer; transition:transform .45s ease, opacity .45s ease; transform:translate(-50%,-50%); }
.fan-photo img { width:100%; height:100%; object-fit:contain; border-radius:9px; display:block; pointer-events:none; }
.fan-controls { display:flex; justify-content:center; align-items:center; gap:20px; margin-top:5px; }
.fan-controls button { border:1px solid #c9b79e; border-radius:50%; width:38px; height:38px; background:white; color:#14283f; font-size:26px; line-height:1; cursor:pointer; }
.fan-count { font-size:14px; color:#14283f; }
.fan-photo:focus-visible,.fan-controls button:focus-visible { outline:2px solid #a07843; outline-offset:2px; }
@media(max-width:767px){ .fan-stage { height:clamp(210px,42svh,340px); } .fan-photo { width:64%; } }
@media(prefers-reduced-motion:reduce){ .fan-photo { transition:none; } }
/* =========================================
   EMPILEMENT PARTIEL SUR MOBILE
   ========================================= */

@media (max-width: 768px) {

        footer {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .contact {
        padding-top: 15px;
        padding-bottom: 0px;
        min-height: auto;
    }

    :root {
        --stack-step: 2px;
    }

    /* Première image après le logo */
    #presentation .two-columns img {
        width: 100%;
        height: auto;
        max-width: 100%;
        max-height: none;
        object-fit: contain;
        margin: 0 auto;
    }

    /* Apparence commune des cartes */
    html.enhanced .page-stack > .section {
        border-radius: 16px;
        border: 1px solid #dcd4c8;
        box-shadow: 0 -3px 14px #14283f14;
    }

    /* Empilement des deux premières cartes */
    html.enhanced .page-stack > #presentation,
    html.enhanced .page-stack > #histoire {
        position: sticky;
        top: min(
            calc(var(--header-height) + var(--layer) * var(--stack-step)),
            calc(100dvh - var(--card-height, 0px))
        );
        min-height: calc(100dvh - var(--header-height));
        margin-bottom: 0;
    }

    /* Défilement normal des deux dernières cartes */
    html.enhanced .page-stack > #activites,
    html.enhanced .page-stack > #galerie {
        position: relative;
        top: auto;
        height: auto;
        min-height: auto;
        margin-bottom: 0;
    }

    /* Masque discret derrière les coins arrondis */
    html.enhanced .page-stack > #activites::before,
    html.enhanced .page-stack > #galerie::before {
        content: "";
        position: absolute;
        inset: 0;
        background: inherit;
        z-index: -1;
        border-radius: 0;
    }

    /* Fin de l'empilement */
    html.enhanced .stack-tail {
        display: none;
    }

    html.enhanced .page-stack {
        margin-bottom: 0;
    }

    html.enhanced .contact {
        position: relative;
        z-index: 10;
    }
    
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    html.enhanced .page-stack > #presentation,
    html.enhanced .page-stack > #histoire {
        position: relative;
        top: auto;
    }
    
}
/* Barre de retour en haut style iPhone */

.back-to-top {
    display: block;
    width: 100px;
    height: 5px;
    margin: 4px auto 5px;
    padding: 0;
    background: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    transition: opacity 0.3s ease;
}

/* Agrandir la zone cliquable */
.back-to-top::after {
    content: "";
    position: absolute;
    inset: -12px 0;
}

.back-to-top:hover {
    opacity: 0.6;
}

/* Empreintes blanches du pied de page */
.footer-scene { position: relative; isolation: isolate; z-index: 10; background: linear-gradient(180deg,#14283f,#0c1928); }
.footer-scene > .contact, .footer-scene > footer { background: transparent; z-index: 2; }
.footer-trail { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; opacity: .35; }
.footer-trail img { position: absolute; display: block; max-width: none; height: auto; }


/* Mobile : empreintes visibles sur le bouton, sans bloquer les clics. */
@media (max-width: 767px) {
  .footer-scene .footer-trail { z-index: 11; opacity: .23; pointer-events: none; }
}

/* Image de présentation : le cadre épouse la photo, sans bandes latérales. */
#presentation .two-columns img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 48svh;
    justify-self: center;
    border-radius: 30px;
    object-fit: cover;
}
@media (max-width: 768px) {
    #presentation .two-columns img {
        width: 100%;
        max-height: none;
        border-radius: 22px;
    }
}
