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

:root {
    --fiche-anim-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --vert: #1D9E75;
    --vert-clair: #E1F5EE;
    --vert-fonce: #0F6E56;
    --rouge: red;
    --rouge-clair: #FDECEA;
    --noir: black;
    --noir-clair: #EBEBEB;
    --gris-border: #E8E8E4;
    --gris-bg: #F7F7F5;
    --texte: #1a1a18;
    --texte-sec: #5a5a56;
    --texte-ter: #9a9a94;
    /*--font-titre: 'Cormorant Garamond', serif;*/
    --font-titre: serif;
    --font-corps: 'DM Sans', sans-serif;
    --radius: 10px;
    --radius-lg: 14px;
    --card-shadow: 0 10px 30px rgba(0,0,0,.06);
}

html {
    scroll-behavior: smooth; 
}

body {
    font-family: var(--font-corps);
    background: #fff;
    color: var(--texte);
    line-height: 1.7;
    font-size: 16px;
    opacity: 1;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

body.fade-out {
  opacity: 0;
}

a {
    color: inherit;
    text-decoration: none; 
}

.container {
    width: 100%;
    background: #FFFFFF;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem clamp(1rem, 8vw, 10rem);
    border-bottom: 1px solid var(--gris-border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo img{
    width:90px; 
    height:90px; 
    border-radius: 15px;
    object-fit:contain;
}

.nav-logo-texte {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-logo-nom {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--vert);
  line-height: 1.2;
}

.nav-logo-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--texte-ter);
}

.nav-links { 
    display: flex; 
    gap: 1rem;
}

.nav-links a {
    font-size: 15px;
    border: 1px solid transparent;
    padding: 2px 10px;
    border-radius: 5px;
    font-weight: 500;
    color: var(--texte-sec);
    transition: border-color 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus { 
    border-color: var(--vert);
    color: var(--vert); 
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

.fil-ariane {
    max-width: 1250px;
    margin: 0 auto;
    padding: 1.5rem clamp(1rem, 5vw, 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--texte-ter);
    border-bottom: 2px solid var(--gris-border);
}

.fil-ariane span {
    user-select: none;
}

.split-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 5rem;
    max-width: 1350px;
    margin: 0 auto;
    padding: 2rem clamp(1rem, 8vw, 10rem) 3rem;
    align-items: start;
    border-bottom: 2px solid var(--gris-border);
}

.layout-left {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 300px;
}

.fiche-couverture {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding-top: 14px;
}

.couverture-container {
    position: relative;
    cursor: pointer;
    width: 100%;
    animation: coverIn 0.8s var(--fiche-anim-ease) both;
}

.couverture-container::before,
.couverture-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-lg);
    z-index: -1;
}

.couverture-container::before {
    transform: translate(5px, 6px) rotate(1.1deg);
    background: #F7F6F2;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.couverture-container::after {
    transform: translate(9px, 11px) rotate(2.1deg);
    background: #EDEBE3;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.07);
}

.couverture-img {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow:
        0 18px 32px rgba(0, 0, 0, 0.1),
        0 6px 14px rgba(0, 0, 0, 0.05);
    display: block;
    transition: transform 0.4s var(--fiche-anim-ease), box-shadow 0.4s ease;
}

.couverture-container:hover .couverture-img,
.couverture-container:focus .couverture-img {
    box-shadow:
        0 26px 44px rgba(0, 0, 0, 0.14),
        0 10px 20px rgba(0, 0, 0, 0.07);
}

.signet {
    position: absolute;
    top: -14px;
    right: 22px;
    width: 30px;
    height: 88px;
    background: var(--vert);
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 9px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    animation: signetIn 0.6s var(--fiche-anim-ease) 0.35s both;
    transform-origin: top center;
}

.signet::after {
    content: "";
    position: absolute;
    bottom: -11px;
    left: 0;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 10px solid var(--vert);
}

.signet span {
    writing-mode: vertical-rl;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
}

@keyframes coverIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes signetIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.left-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.btn-acheter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    padding: 14px 28px;
    border-radius: var(--radius);
    background: var(--vert);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(29, 158, 117, 0.25);
}

.btn-acheter svg {
    transition: transform 0.3s ease;
}

.btn-acheter:hover,
.btn-acheter:focus {
    background: var(--vert-fonce);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(15, 110, 86, 0.35);
}

.btn-acheter:hover svg,
.btn-acheter:focus svg {
    transform: scale(1.1) rotate(5deg);
}

.btn-acheter:active {
    transform: translateY(-0.5px);
}

.layout-right {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.fiche-infos {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.fiche-titre {
    font-family: var(--font-titre);
    font-size: clamp(32px, 4.5vw, 46px);
    font-weight: 500;
    color: var(--texte);
    line-height: 1.18;
    margin: 0;
    animation: fadeUp 0.7s var(--fiche-anim-ease) 0.08s both;
}

.fiche-auteur {
    font-size: 18px;
    color: var(--texte-sec);
    font-weight: 500;
    font-style: italic;
    opacity: 0.95;
    animation: fadeUp 0.7s var(--fiche-anim-ease) 0.16s both;
}

.fiche-separateur {
    width: 0;
    height: 3px;
    background: var(--vert);
    border-radius: 99px;
    margin: 6px 0;
    animation: growLine 0.7s var(--fiche-anim-ease) 0.3s both;
}

.fiche-description {
    font-size: 17.5px;
    color: var(--texte-sec);
    line-height: 1.85;
    text-align: initial;
    animation: fadeUp 0.7s var(--fiche-anim-ease) 0.38s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes growLine {
    from { width: 0; }
    to { width: 60px; }
}

.fiche-extrait-section {
    width: 100%;
}

.fiche-extrait-section .section-label{
    color: var(--vert-fonce);
    font-weight: 600;
}

.fiche-extrait-section .section-titre{
    font-size: 22px;
}

.extrait-wrapper {
    position: relative;
    margin-top: 1.3rem;
    background: #f5f4f0;
    border: 1px solid rgba(210, 204, 190, 0.65);
    border-radius: var(--radius-lg);
    padding: 0rem clamp(1.5rem, 4vw, 3.5rem) 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03), inset 0 0 30px rgba(0, 0, 0, 0.01);
    background-image: radial-gradient(rgba(29, 158, 117, 0.04) 0.6px, transparent 0.6px);
    background-size: 14px 14px;
}

.extrait-contenu {
    max-height: 330px;
    overflow: hidden;
    transition: max-height 0.8s var(--fiche-anim-ease);
}

.extrait-contenu.ouvert {
    max-height: 20000px;
}

.extrait-contenu p {
    font-family: var(--font-titre);
    font-size: 19px;
    line-height: 1.95;
    color: #3C3C38;
    margin-bottom: 0.3rem;
}

.extrait-contenu p.titre {
    font-family: var(--font-titre);
    font-size: 22px;
    font-weight: 700;
    color: #3C3C38;
    margin-top: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.drop-cap {
    font-family: var(--font-titre);
    font-size: 3rem;
    float: left;
    line-height: 0.8;
    margin-top: 0.12em;
    margin-right: 0.12em;
    font-weight: 500;
    color: var(--vert);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.06);
}

.extrait-fondu {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, rgba(251, 249, 243, 0) 0%, #f6f3e9 90%);
    pointer-events: none;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.btn-extrait {
    display: block;
    margin: 1.6rem auto 0;
    font-size: 14.5px;
    font-weight: 500;
    padding: 12px 28px;
    border-radius: var(--radius);
    border: 1.5px solid rgba(29, 158, 117, 0.25);
    background: #fff;
    color: var(--vert-fonce);
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.btn-extrait:hover,
.btn-extrait:focus {
    border-color: var(--vert);
    background: var(--vert-clair);
    color: var(--vert-fonce);
    transform: translateY(-1px);
}

.btn-extrait:active {
    transform: translateY(0);
}

.fiche-messages-section {
    width: 100%;
}

.fiche-messages-section .section-label{
    color: var(--vert-fonce);
    font-weight: 600;
}

.fiche-messages-section .section-titre{
    font-size: 22px;
}

.messages-wrapper {
    margin-top: 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#messagesSurLeLivre {
    width: 100%;
    min-height: 300px;
    border-radius: var(--radius-lg) !important;
    border: 1px solid rgba(220, 215, 205, 0.8) !important;
    padding: 2.2rem 2.5rem 0rem !important;
    font-family: var(--font-titre) !important;
    font-size: 17.5px !important;
    color: #181818 !important;
    outline: none !important;
    resize: none !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
    background-color: #F7FAF8 !important;
    background-image: linear-gradient(rgba(29, 158, 117, 0.07) 1px, transparent 1px) !important;
    background-size: 100% 2.4rem !important;
    line-height: 2.4rem !important;
}

#messagesSurLeLivre:focus {
    border-color: var(--vert) !important;
    box-shadow:
        0 4px 20px rgba(29, 158, 117, 0.06),
        0 0 0 3px rgba(29, 158, 117, 0.05) !important;
}

.messages-invite {
    margin-top: 0.5rem;
    margin-bottom: 0.8rem;
    font-size: 16px;
    color: var(--texte-sec);
    opacity: 0.90;
}

.messages-actions {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    align-items: center;
}

.messages-actions button {
    font-size: 14.5px;
    font-weight: 500;
    padding: 11px 24px;
    border-radius: var(--radius);
    border: 1.5px solid var(--gris-border);
    background: #fff;
    color: var(--texte-sec);
    cursor: pointer;
    transition: all 0.25s ease;
}

.messages-actions button:hover,
.messages-actions button:focus {
    border-color: var(--vert);
    color: var(--vert-fonce);
    background: var(--vert-clair);
}

.messages-actions #btn-envoyer {
    background: var(--vert);
    color: #fff;
    border-color: var(--vert);
    box-shadow: 0 4px 10px rgba(29, 158, 117, 0.15);
}

.messages-actions #btn-envoyer:hover,
.messages-actions #btn-envoyer:focus {
    background: var(--vert-fonce);
    border-color: var(--vert-fonce);
    box-shadow: 0 6px 15px rgba(15, 110, 86, 0.25);
    transform: translateY(-1px);
}

.messages-actions #btn-envoyer:active {
    transform: translateY(0);
}

.messages-actions #btn-retirer {
    color: #c0392b;
    border-color: #fadbd8;
    background: #fdf2f2;
}

.messages-actions #btn-retirer:hover,
.messages-actions #btn-retirer:focus {
    border-color: #c0392b;
    background: #fadbd8;
}

.btn-auth {
    border-color: var(--vert-fonce) !important;
    color: var(--vert-fonce) !important;
    margin-left: auto;
}

.btn-auth:hover,
.btn-auth:focus {
    background: var(--vert-fonce) !important;
    color: #fff !important;
}

.livres-carousel-section {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 3.5rem clamp(1rem, 8vw, 10rem) 2rem;
}

.carousel-viewport {
    position: relative;
}

.carousel-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 4px 4px 1.2rem;
    margin: -4px -4px -1.2rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-fade {
    position: absolute;
    top: 0;
    bottom: 1.2rem;
    width: 50px;
    pointer-events: none;
    z-index: 2;
}

.carousel-fade-left {
    left: -4px;
    background: linear-gradient(to right, #FFFFFF, rgba(255, 255, 255, 0));
}

.carousel-fade-right {
    right: -4px;
    background: linear-gradient(to left, #FFFFFF, rgba(255, 255, 255, 0));
}

.carousel-card {
    flex: 0 0 auto;
    width: 225px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    scroll-snap-align: start;
    padding: 10px 16px 10px 10px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(210, 204, 190, 0.7);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition:
        border-color .3s ease,
        background .3s ease,
        transform .25s var(--fiche-anim-ease),
        box-shadow .3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.carousel-card:hover,
.carousel-card:focus {
    border-color: var(--vert-fonce);
    background: var(--vert-clair);
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.05);
}

.carousel-cover {
    width: 48px;
    height: 66px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 5px;
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform .3s ease;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.carousel-card:hover .carousel-cover,
.carousel-card:focus .carousel-cover {
    transform: scale(1.04);
}

.carousel-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    pointer-events: none;
}

.carousel-eyebrow {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--vert-fonce);
}

.carousel-card[data-categorie="finances"] .carousel-eyebrow,
.carousel-card[data-categorie="amour"] .carousel-eyebrow,
.carousel-card[data-categorie="psychologie"] .carousel-eyebrow {
    color: var(--vert-fonce);
}

.carousel-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--texte);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-author {
    font-size: 12px;
    font-style: italic;
    color: var(--texte-sec);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-empty {
    font-size: 14px;
    font-style: italic;
    color: var(--texte-ter);
    padding: 1.5rem 0;
}

.retour-bas {
    text-transform: uppercase;
    width: 240px;
    display: block;
    text-align: center;
    margin: 3rem auto 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--texte-sec);
    text-decoration: none;
    border-bottom: 2px solid var(--gris-border);
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

.retour-bas:hover,
.retour-bas:focus {
    color: var(--vert);
    border-bottom: 2px solid var(--vert);
}

footer {
    background-color: var(--texte);
    padding: 3rem 2rem;
    text-align: center;
    font-size: 15px;
    color: var(--texte-ter);
}

footer a { 
    color: var(--texte-ter); 
    text-decoration: underline; 
    transition: color 0.2s;
}

footer a:hover,
footer a:focus { 
    color: var(--vert-fonce); 
}

@media (max-width: 1100px){
    .messages-actions {
        gap: 12px;
    }

    .messages-actions button {
        font-size: 14px;
        padding: 11px 14px;
    }
}

@media (max-width: 1000px) {
    .nav-links{
        gap: 0.3rem;
    }
    .split-layout {
        gap: 1rem;
    }
    .layout-left {
        width: 250px;
    }
    .fiche-couverture {
        max-width: 250px;
    }
    .retour-bas{
        font-size: 15px;
    }
}

@media (max-width: 890px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 2.6rem;
    }
    .layout-left {
        position: static;
        width: 100%;
        align-items: center;
        text-align: center;
        gap: 1.6rem;
    }
    .fiche-couverture {
        max-width: 280px;
    }
    .left-actions {
        align-items: center;
        max-width: 320px;
        margin: 0 auto;
    }
    .fiche-infos {
        align-items: center;
        text-align: center;
    }
    .fiche-categorie {
        margin: 0 auto;
    }
    .fiche-separateur {
        margin: 6px auto;
    }
    .fiche-description {
        margin-top: 1rem;
    }
    #messagesSurLeLivre {
        font-size: 18px !important;
    }
    .carousel-card {
        width: 210px;
    }
}

@media (max-width: 780px) {
    nav { 
        padding: 1rem; 
    }
    nav .nav-logo-texte{
        flex-wrap: wrap;
    }
    nav .nav-links .biblio{
        display: none;
    }
    nav .nav-links a{
        padding: 2px 5px;
    }
    .nav-logo img {
        width: 70px;
        height: 70px;
    }
    .split-layout {
        padding: 2.5rem;
    }
}

@media (max-width: 580px) {
    nav .nav-logo-texte{
        width: 150px;
    }
    nav .nav-logo-texte .nav-logo-sub{
        display: none;
    }
    .fil-ariane span.nom{
        display: none;
    }
    .fiche-couverture {
        max-width: 230px;
    }
    .fiche-extrait-section .section-titre{
        font-size: 20px;
    }
    .fiche-messages-section .section-titre{
        font-size: 20px;
    }
    .extrait-wrapper {
        padding: 0rem 1rem 1rem;
    }
    #messagesSurLeLivre {
        padding: 2.2rem 1rem 0rem !important;
    }
    .messages-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .btn-auth {
        margin-top: 2rem;
        margin-left: 0;
    }
    .drop-cap {
        font-size: 2.5rem;
    }
    .carousel-card {
        width: 190px;
    }
}

@media (max-width: 480px) {
    nav { 
        padding: 0.5rem; 
    }
    .nav-logo img {
        width: 60px;
        height: 60px;
    }
    nav .nav-logo-nom{
        font-size: 14px;
    }
    .fil-ariane {
        font-size: 12.5px;
        flex-wrap: wrap;
        padding: 1rem 1.5rem;
    }
    .split-layout {
        padding: 0.8rem;
    }
    .signet {
        top: -23px;
        right: 3px;
        height: 74px;
    }
    .signet::after {
        bottom: -11px;
    }
    .signet span {
        font-size: 8px;
    }
    .fiche-extrait-section .section-titre{
        font-size: 18px;
    }
    .fiche-messages-section .section-titre{
        font-size: 18px;
    }
    .fiche-description {
        font-size: 17px;
    }
    .fiche-couverture {
        max-width: 170px;
    }
    .extrait-contenu p {
        font-size: 17px;
        line-height: 1.85;
    }
    .extrait-contenu p.titre {
        font-size: 17.5px;
    }
    #messagesSurLeLivre {
        font-size: 17px !important;
    }
    .retour-bas{
        width: 193px;
        font-size: 13px;
    }
    .carousel-card {
        width: 180px;
        padding: 2px 10px;
    }
}