/* SkinZenitude — Boutique numérique FR */
:root {
    --sz-cream: #f5efe5;
    --sz-paper: rgba(255, 253, 248, .78);
    --sz-glass: rgba(239, 241, 224, .72);
    --sz-sage: #879477;
    --sz-sage-dark: #53634b;
    --sz-ink: #3f4739;
    --sz-muted: #74796b;
    --sz-line: rgba(93, 105, 79, .22);
    --sz-radius: 25px;
    --sz-shadow: 0 12px 34px rgba(73, 72, 53, .09);
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body {
    margin: 0;
    color: var(--sz-ink);
    background:
        radial-gradient(ellipse at 15% 8%, rgba(215, 218, 192, .36), transparent 34%),
        radial-gradient(ellipse at 88% 85%, rgba(221, 207, 181, .34), transparent 38%),
        var(--sz-cream);
    font-family: Georgia, "Times New Roman", serif;
}
a { color: inherit; }
.sz-library {
    width: min(1540px, 96vw);
    margin: 0 auto;
    padding: clamp(18px, 3vw, 42px) 0 24px;
}
.library-heading {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(0, 1.5fr);
    align-items: center;
    gap: 28px;
    margin: 0 0 28px;
    padding: 0 clamp(8px, 2vw, 28px);
}
.library-brand {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    column-gap: 8px;
    text-decoration: none;
    color: var(--sz-sage-dark);
}
.brand-leaf { grid-row: span 2; font-size: 3.2rem; line-height: 1; }
.brand-name { font-size: clamp(1.6rem, 2.4vw, 2.45rem); }
.brand-tagline { font-size: .88rem; letter-spacing: .08em; color: var(--sz-muted); }
.heading-title { text-align: center; }
.heading-title h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 3.7rem);
    font-weight: 400;
    font-style: italic;
    color: #745b43;
}
.heading-title p { margin: 8px 0 0; color: var(--sz-muted); font-size: 1rem; }
.heading-ornament { color: #9a9a75; font-size: 1.5rem; }

.library-layout {
    display: grid;
    grid-template-columns: minmax(590px, 1.02fr) minmax(0, 1.8fr);
    gap: clamp(20px, 2.4vw, 36px);
    align-items: start;
}
.amaya-side {
    position: sticky;
    top: 18px;
    display: grid;
    grid-template-columns: 360px minmax(230px, 1fr);
    min-height: min(760px, calc(100vh - 36px));
    overflow: hidden;
    border: 1px solid var(--sz-line);
    border-radius: var(--sz-radius);
    background: rgba(255, 255, 255, .2);
    box-shadow: var(--sz-shadow);
}
.amaya-portrait {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(219, 224, 204, .22), rgba(239, 228, 208, .2));
}
.amaya-portrait img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 2 / 3;
    object-fit: contain;
    object-position: center bottom;
}
.amaya-glass {
    align-self: stretch;
    padding: clamp(17px, 1.8vw, 28px);
    background: var(--sz-glass);
    -webkit-backdrop-filter: blur(13px);
    backdrop-filter: blur(13px);
    border-left: 1px solid rgba(255,255,255,.7);
}
.amaya-greeting { margin: 0 0 15px; font-size: 1.12rem; }
.amaya-greeting span {
    display: block;
    margin-top: 2px;
    color: var(--sz-sage-dark);
    font-size: 2.1rem;
    font-style: italic;
}
.amaya-glass h2 {
    margin: 0 0 16px;
    font-size: clamp(1.12rem, 1.45vw, 1.48rem);
    line-height: 1.3;
    font-weight: 500;
}
.amaya-intro { margin: 0 0 22px; color: #555c4e; line-height: 1.55; }
.amaya-instruction {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    padding: 12px 10px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 17px;
    background: rgba(255,255,255,.38);
}
.instruction-icon { color: var(--sz-sage-dark); font-size: 1.65rem; text-align: center; }
.amaya-instruction p { margin: 0; font-size: .92rem; line-height: 1.4; }
.amaya-signoff {
    margin: 22px 0 0;
    color: var(--sz-sage-dark);
    font-size: 1.55rem;
    font-style: italic;
    text-align: center;
}
.catalogue {
    padding: clamp(15px, 2vw, 27px);
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 30px;
    background: rgba(255, 253, 248, .47);
    box-shadow: var(--sz-shadow);
}
.catalogue-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    margin: 0 0 18px;
    padding: 0 6px 14px;
    border-bottom: 1px solid var(--sz-line);
}
.catalogue-head h2 {
    margin: 0;
    font-size: clamp(1.05rem, 1.5vw, 1.4rem);
    font-weight: 400;
    text-align: center;
}
.catalogue-head h2 span { margin-right: 7px; color: #8a906f; }
.publication-list { display: grid; gap: 17px; }
.publication-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    min-height: 180px;
}
.publication-summary,
.publication-description {
    min-width: 0;
    border: 1px solid var(--sz-line);
    border-radius: 21px;
    background: var(--sz-paper);
    box-shadow: 0 7px 20px rgba(73,72,53,.055);
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.publication-summary:hover,
.publication-description:hover,
.publication-summary:focus-visible,
.publication-description:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(83,99,75,.48);
    box-shadow: 0 12px 25px rgba(73,72,53,.11);
    outline: none;
}
.publication-summary {
    display: grid;
    grid-template-columns: minmax(86px,  .46fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: 7px 17px;
    padding: 14px;
}
.publication-cover {
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    width: 100%;
    min-height: 145px;
    padding: 12px;
    border: 1px solid rgba(106, 111, 83, .2);
    background: linear-gradient(145deg, #e9e5d5, #f8f1e4);
    box-shadow: 3px 5px 10px rgba(60, 58, 44, .15);
    text-align: center;
}
.publication-cover img { display: block; width: 100%; height: 100%; max-height: 180px; object-fit: contain; }
.cover-mark { color: var(--sz-sage-dark); font: .62rem Arial, sans-serif; letter-spacing: .14em; }
.cover-title { font-size: 1.05rem; line-height: 1.2; }
.cover-leaf { color: #929b7a; font-size: 1.4rem; }
.publication-title {
    align-self: end;
    font-size: clamp(1.05rem, 1.45vw, 1.45rem);
    line-height: 1.24;
    color: #394532;
}
.publication-link-hint {
    align-self: start;
    color: var(--sz-muted);
    font: .78rem Arial, sans-serif;
}
.publication-link-hint span { color: var(--sz-sage-dark); }
.publication-description {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: clamp(18px, 2vw, 28px);
    color: #55594e;
    font-size: clamp(.94rem, 1.1vw, 1.08rem);
    line-height: 1.65;
}
.description-arrow {
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--sz-line);
    border-radius: 50%;
    color: var(--sz-sage-dark);
    font: 1.7rem Arial, sans-serif;
}
.library-empty {
    padding: 30px;
    border: 1px solid var(--sz-line);
    border-radius: 20px;
    background: var(--sz-paper);
    color: var(--sz-muted);
}
.library-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 10px 0;
    color: var(--sz-muted);
    font-size: .84rem;
}

@media (max-width: 1050px) {
    .library-layout { grid-template-columns: 1fr; }
    .amaya-side {
        position: relative;
        top: auto;
        min-height: 540px;
        max-height: none;
        grid-template-columns: 360px minmax(230px, 1fr);
    }
    .amaya-portrait img { width: 100%; height: auto; min-height: 0; aspect-ratio: 2 / 3; object-fit: contain; object-position: center bottom; }
    .amaya-glass { padding: 22px; }
    .amaya-instruction { display: inline-grid; width: calc(50% - 8px); vertical-align: top; }
}
@media (max-width: 650px) {
    .sz-library { width: 94vw; padding-top: 14px; }
    .library-heading { grid-template-columns: 1fr; gap: 16px; margin-bottom: 18px; }
    .library-brand { justify-self: center; }
    .heading-title h1 { font-size: 2.35rem; }
    .amaya-side {
        grid-template-columns: 1fr;
        min-height: 0;
        max-height: none;
    }
    .amaya-portrait { width: min(100%, 360px); margin: 0 auto; }
    .amaya-portrait img { width: 100%; height: auto; min-height: 0; aspect-ratio: 2 / 3; object-fit: contain; }
    .amaya-glass { padding: 14px 12px; }
    .amaya-greeting { font-size: .92rem; margin-bottom: 8px; }
    .amaya-greeting span { font-size: 1.65rem; }
    .amaya-glass h2 { font-size: 1rem; margin-bottom: 9px; }
    .amaya-intro { font-size: .86rem; line-height: 1.4; margin-bottom: 10px; }
    .amaya-instruction { width: 100%; display: grid; margin: 8px 0; padding: 8px; }
    .amaya-instruction p { font-size: .8rem; }
    .amaya-signoff { font-size: 1.2rem; margin-top: 12px; }
    .catalogue { padding: 12px; border-radius: 22px; }
    .catalogue-head { display: none; }
    .publication-list { gap: 13px; }
    .publication-row { grid-template-columns: 1fr; gap: 8px; }
    .publication-summary { min-height: 145px; grid-template-columns: 105px 1fr; padding: 10px; }
    .publication-cover { min-height: 120px; }
    .publication-description { padding: 13px 15px; font-size: .9rem; }
    .library-footer { flex-direction: column; align-items: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Correctif de composition Amaya — image à taille constante, alignée en haut.
   Le panneau de texte reste à droite ; aucun recadrage ni réduction de l'image. */
.amaya-side {
    grid-template-columns: 360px minmax(230px, 1fr);
    min-height: 0;
    height: auto;
    align-items: stretch;
}
.amaya-portrait {
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 0;
    height: auto;
}
.amaya-portrait > img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: top center;
}
@media (max-width: 1050px) {
    .amaya-side {
        min-height: 0;
        height: auto;
        grid-template-columns: 360px minmax(230px, 1fr);
    }
    .amaya-portrait {
        min-height: 0;
        align-items: flex-start;
    }
    .amaya-portrait > img {
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        object-fit: contain;
        object-position: top center;
    }
}
@media (max-width: 650px) {
    .amaya-side {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .amaya-portrait {
        width: min(100%, 360px);
        margin: 0 auto;
        min-height: 0;
        align-items: flex-start;
    }
    .amaya-portrait > img {
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        object-fit: contain;
        object-position: top center;
    }
}


/* ==========================================================================
   AVA — LOTUS ANCRE DANS LA PAUME D'AMAYA (BOUTIQUE)
   Le JavaScript calcule la position depuis .amaya-portrait.
========================================================================== */
.amaya-side {
    position: relative;
    z-index: 5;
    overflow: visible;
}
.amaya-portrait {
    position: relative;
    z-index: 6;
    overflow: visible;
}
.amaya-portrait #ava {
    position: absolute;
    left: 84%;
    top: 23%;
    width: 16%;
    height: auto;
    z-index: 80;
    transform: translate(-50%, -50%) scale(.82);
    transform-origin: center center;
}
.amaya-portrait #ava.ava-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.amaya-portrait #ava .ava-child {
    z-index: 90;
}
@media (max-width: 650px) {
    .amaya-portrait #ava {
        width: 18%;
    }
}


/* ==========================================================================
   AJUSTEMENTS VISUELS — PANNEAU AMAYA
   Coins arrondis cohérents avec le catalogue et alignement supérieur.
   Le conteneur portrait reste overflow:visible pour ne pas couper le menu Ava.
========================================================================== */
.amaya-side {
    position: relative;
    top: auto;
    align-self: start;
    margin-top: 0;
    border-radius: var(--sz-radius);
}

/* Coins gauches de l'image : ils suivent le contour du panneau. */
.amaya-portrait {
    overflow: visible;
    border-radius: var(--sz-radius) 0 0 var(--sz-radius);
}

.amaya-portrait > img {
    border-radius: var(--sz-radius) 0 0 var(--sz-radius);
}

/* Coins droits du panneau de présentation. */
.amaya-glass {
    border-radius: 0 var(--sz-radius) var(--sz-radius) 0;
}

/* Les deux panneaux commencent sur la même ligne. */
.library-layout {
    align-items: start;
}

.catalogue {
    align-self: start;
}

/* Sur mobile, le panneau devient une seule colonne : arrondir les quatre coins
   du haut de l'image et les quatre coins du panneau extérieur. */
@media (max-width: 650px) {
    .amaya-side {
        border-radius: var(--sz-radius);
    }

    .amaya-portrait,
    .amaya-portrait > img {
        border-radius: var(--sz-radius) var(--sz-radius) 0 0;
    }

    .amaya-glass {
        border-radius: 0 0 var(--sz-radius) var(--sz-radius);
    }
}

/* ======================================================================
   VERSION MOBILE — ajustements ciblés sans modifier le rendu ordinateur
   ====================================================================== */
@media (max-width: 650px) {
    .sz-library {
        width: min(94vw, 520px);
        padding-right: 0;
        padding-left: 0;
    }

    /* Amaya reste entière, mais prend moins de hauteur sur téléphone. */
    .amaya-portrait {
        width: min(100%, 300px);
    }

    .amaya-portrait > img {
        width: 100%;
        height: auto;
    }

    /* Ava conserve son ancrage et sa proportion dans l'image. */
    .amaya-portrait #ava {
        width: 18%;
    }

    /* Texte plus confortable à lire au toucher. */
    .amaya-glass {
        padding: 16px 15px;
    }

    .amaya-glass h2 {
        font-size: 1.08rem;
        line-height: 1.35;
    }

    .amaya-intro,
    .amaya-instruction p {
        font-size: .92rem;
        line-height: 1.5;
    }

    .amaya-instruction {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
    }

    /* Chaque publication reste facile à sélectionner sans zoom. */
    .publication-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .publication-summary {
        grid-template-columns: 96px minmax(0, 1fr);
        min-height: 138px;
        gap: 7px 12px;
        padding: 10px;
    }

    .publication-cover {
        min-height: 118px;
        padding: 8px;
    }

    .publication-title {
        font-size: 1.02rem;
        overflow-wrap: anywhere;
    }

    .publication-link-hint {
        font-size: .8rem;
    }

    .publication-description {
        min-width: 0;
        padding: 13px;
        font-size: .92rem;
        line-height: 1.5;
    }

    .publication-description > span:first-child {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .publication-summary:hover,
    .publication-description:hover {
        transform: none;
    }
}

@media (max-width: 360px) {
    .sz-library { width: 93vw; }
    .heading-title h1 { font-size: 2.05rem; }
    .publication-summary { grid-template-columns: 86px minmax(0, 1fr); }
    .publication-cover { min-height: 108px; }
    .publication-title { font-size: .96rem; }
}


/* ======================================================================
   CORRECTIONS MOBILE FINALES — boutique FR
   Les règles ci-dessous ne s'appliquent qu'aux écrans de 650 px ou moins.
   Le rendu ordinateur reste inchangé.
   ====================================================================== */
@media (max-width: 650px) {
    .sz-library {
        width: min(94vw, 520px);
        padding-top: 14px;
        padding-bottom: 20px;
    }

    .library-heading {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 18px;
        padding: 0 4px;
    }

    .library-brand { justify-self: center; }
    .heading-title h1 { font-size: clamp(2rem, 9vw, 2.5rem); }
    .heading-title p { font-size: clamp(.95rem, 4vw, 1.12rem); line-height: 1.35; }

    .library-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }

    .amaya-side {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
        min-height: 0;
        height: auto;
        overflow: visible;
    }

    .amaya-portrait {
        width: min(100%, 360px);
        min-width: 0;
        min-height: 0;
        height: auto;
        margin: 0 auto;
        align-items: flex-start;
        justify-content: center;
    }

    .amaya-portrait > img {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: auto;
        object-fit: contain;
        object-position: top center;
    }

    .amaya-glass {
        min-width: 0;
        padding: 17px 16px;
        border-left: 0;
        border-top: 1px solid rgba(255,255,255,.7);
    }

    .amaya-greeting { font-size: 1rem; margin-bottom: 8px; }
    .amaya-greeting span { font-size: 1.8rem; }
    .amaya-glass h2 { font-size: 1.12rem; line-height: 1.35; margin-bottom: 12px; }
    .amaya-intro { font-size: .98rem; line-height: 1.5; margin-bottom: 14px; }

    .amaya-instruction {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr);
        width: 100%;
        gap: 8px;
        margin: 9px 0;
        padding: 10px;
    }
    .amaya-instruction p { font-size: .9rem; line-height: 1.45; }
    .amaya-signoff { font-size: 1.25rem; margin-top: 14px; }

    /* Ava reste ancrée relativement au portrait.
       Ajuster left/top ici si son lotus n'arrive pas exactement dans la paume. */
    .amaya-portrait #ava {
        left: 84%;
        top: 23%;
        width: 18%;
    }

    .catalogue { min-width: 0; padding: 12px; border-radius: 22px; }
    .catalogue-head { display: none; }
    .publication-list { gap: 13px; }
    .publication-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }

    .publication-summary {
        grid-template-columns: 96px minmax(0, 1fr);
        min-height: 138px;
        gap: 7px 12px;
        padding: 10px;
    }
    .publication-cover { min-height: 118px; padding: 8px; }
    .publication-title { font-size: 1rem; overflow-wrap: anywhere; }
    .publication-link-hint { font-size: .8rem; }
    .publication-description { min-width: 0; padding: 13px; font-size: .92rem; line-height: 1.5; }
    .publication-description > span:first-child { min-width: 0; overflow-wrap: anywhere; }

    .publication-summary:hover,
    .publication-description:hover { transform: none; }

    .amaya-portrait,
    .amaya-portrait > img {
        border-radius: var(--sz-radius) var(--sz-radius) 0 0;
    }
    .amaya-glass { border-radius: 0 0 var(--sz-radius) var(--sz-radius); }
}

@media (max-width: 380px) {
    .sz-library { width: 93vw; }
    .heading-title h1 { font-size: 2rem; }
    .publication-summary { grid-template-columns: 86px minmax(0, 1fr); }
    .publication-cover { min-height: 108px; }
    .publication-title { font-size: .94rem; }
}
