@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap');

/*
 * book-nook.css — Le Grimoire
 * Expérience immersive "manuscrit ancien" pour le logement Book Nook.
 * Dépend des variables globales : --color-bg, --color-gold, --font-accent,
 * --font-body, --color-text, --color-border.
 *
 * @package Clos_du_Rempart
 */

/* ============================================================
   Variables locales + reset body
   ============================================================ */
.bn-grimoire {
    --bn-void:      #07050A;
    --bn-leather:   #2C1510;
    --bn-parchment: #EDE0C4;
    --bn-gold:      #D4A355;
    --bn-ember:     #6B2D0D;
    --bn-ink:       #1A0D06;
}

body.logement-book-nook {
    background: #07050A;
    color: var(--bn-parchment);
}

body.logement-book-nook #site-header {
    background: transparent;
    border-bottom: none;
}

/* ============================================================
   Canvas poussière
   ============================================================ */
#bn-dust-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.7;
}

/* ============================================================
   Conteneur — pas de perspective CSS globale.
   GSAP injecte transformPerspective par élément pour éviter
   le conflit preserve-3d + overflow:hidden lors du pinning.
   ============================================================ */
.bn-book-container {
    position: relative;
}

/* ============================================================
   Pages — base
   ============================================================ */
.bn-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: var(--bn-void);
    will-change: transform, opacity, filter;
}

/* Z-index décroissant — les pages se superposent dans l'ordre */
.bn-page--hero    { z-index: 50; }
.bn-page--story   { z-index: 40; }
.bn-page--gallery { z-index: 30; }
.bn-page--details { z-index: 20; }

/* ── Fond parchemin (pages II et IV) ── */
.bn-page-inner--parchment {
    min-height: 100vh;
    background: var(--bn-parchment);
    position: relative;
}

/* Texture noise subtile sur les pages parchemin */
.bn-page-inner--parchment::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: multiply;
}

/* ── Inner wrapper centré ── */
.bn-page-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8rem 4rem;
    position: relative;
    z-index: 3;
}

/* ============================================================
   PAGE I — HÉROS
   ============================================================ */
.bn-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    transform-origin: center center;
    /* État initial FOUC : GSAP animera circle(0%) → circle(150%) au load */
    clip-path: circle(0% at 50% 50%);
    will-change: clip-path, transform;
}

.bn-hero-vignette {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(circle at center, rgba(7, 5, 10, 0.3) 0%, rgba(7, 5, 10, 0.8) 100%);
}

.bn-hero-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 6rem 2rem 8rem;
    gap: 1.5rem;
}

/* Eyebrow — labels de section et héros */
.bn-eyebrow {
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--bn-gold);
}

/* Titre héros */
.bn-hero-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 0.25em;
    font-family: var(--font-accent, 'Cormorant Garamond', serif);
    font-size: clamp(4rem, 10vw, 9rem);
    font-weight: 300;
    line-height: 1;
    color: var(--bn-parchment);
    margin: 0;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.7);
}

.bn-title-line {
    display: inline-block;
}

.bn-hero-accroche {
    font-family: var(--font-accent, 'Cormorant Garamond', serif);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-style: italic;
    color: rgba(237, 224, 196, 0.8);
    max-width: 520px;
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
}

/* Meta capacité / superficie */
.bn-hero-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
    align-items: center;
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: rgba(237, 224, 196, 0.65);
}

.bn-hero-meta li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bn-hero-meta svg {
    opacity: 0.7;
    flex-shrink: 0;
}

/* ── Scroll hint ── */
.bn-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
}

.bn-scroll-line {
    display: block;
    width: 1px;
    height: 52px;
    background: var(--bn-gold);
    transform-origin: top center;
    opacity: 0.7;
}

.bn-scroll-label {
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(212, 163, 85, 0.7);
}

/* ============================================================
   PAGE II — HISTOIRE
   ============================================================ */
.bn-story-layout {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 4rem;
    align-items: start;
    position: relative;
}

.bn-story-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bn-chapter-number {
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--bn-ember);
    margin: 0;
}

/* Titres de section — pages dark */
.bn-section-title {
    font-family: var(--font-accent, 'Cormorant Garamond', serif);
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 300;
    line-height: 1.05;
    margin: 0;
    color: var(--bn-parchment);
}

/* Pages parchemin — titre sombre */
.bn-page--story  .bn-section-title,
.bn-page--details .bn-section-title {
    color: var(--bn-ink);
}

.bn-story-text {
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 1rem;
    line-height: 1.85;
    color: var(--bn-ink);
    max-width: 60ch;
}

.bn-story-text p {
    margin: 0 0 1.2em;
}

/* Eyebrow sur pages parchemin */
.bn-page--story  .bn-eyebrow,
.bn-page--details .bn-eyebrow {
    color: var(--bn-ember);
}

/* ── Lettrine (Dropcap) ── */
.bn-dropcap {
    float: left;
    font-family: var(--font-accent, 'Cormorant Garamond', serif);
    font-size: 5.4em;
    font-weight: 600;
    line-height: 0.72;
    color: var(--bn-gold);
    margin-right: 0.07em;
    margin-top: 0.08em;
    padding-right: 0.04em;
    /* GSAP contrôle visibility — état initial rendu lisible en mobile fallback */
}

/* ── Marginalia — notes manuscrites ── */
.bn-marginalia {
    position: absolute;
    font-family: 'Great Vibes', 'Brush Script MT', cursive;
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--bn-gold);
    max-width: 155px;
    pointer-events: none;
    z-index: 5;
    /* Opacity finale gérée par GSAP : autoAlpha: 0.4 */
}

.bn-marginalia--left {
    left: 2.2rem;
    top: 42%;
    transform: rotate(-6deg);
    text-align: left;
}

.bn-marginalia--right {
    right: 2.2rem;
    bottom: 30%;
    transform: rotate(-4deg);
    text-align: right;
}

/* ── Ornement éditorial — livre ouvert SVG ── */
.bn-story-ornament {
    position: absolute;
    right: 5%;
    top: 12%;
    width: min(280px, 30vw);
    height: auto;
    color: var(--bn-gold);
    opacity: 0.07;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 2;
}

/* ── Citation marginale ── */
.bn-marginal {
    position: sticky;
    top: 35vh;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-family: var(--font-accent, 'Cormorant Garamond', serif);
    font-size: 0.75rem;
    font-style: italic;
    color: var(--bn-gold);
    line-height: 1.4;
    opacity: 0.8;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow: hidden;
    border: none;
    quotes: none;
    align-self: start;
    margin-top: 5rem;
}

/* ============================================================
   PAGE III — BUREAU DE L'ÉCRIVAIN
   ============================================================ */

/* Label de chapitre flottant en haut à gauche */
.bn-gallery-eyebrow {
    position: absolute;
    top: 3.5rem;
    left: 4rem;
    z-index: 20;
    font-family: var(--font-body);
    font-size: 0.62rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--bn-gold);
    opacity: 0.8;
}

/* Le bureau — zone de jeté des photos, centrée dans la page */
.bn-scatter-desk {
    position: relative;
    height: 90vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tirage physique — effet Polaroid/bordure labo photo */
.bn-photo-print {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Pas de transform CSS : GSAP prend le contrôle total */
    visibility: hidden;    /* GSAP autoAlpha au reveal */

    background: var(--bn-parchment);
    padding: 12px 12px 42px 12px;
    box-shadow:
        0 2px  4px  rgba(0, 0, 0, 0.25),
        0 8px  16px rgba(0, 0, 0, 0.35),
        0 20px 45px rgba(0, 0, 0, 0.55);
    cursor: pointer;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
}

/* Variations de taille organiques — base 35vw avec déclinaisons */
.bn-photo-print:nth-child(1)    { width: 35vw; }
.bn-photo-print:nth-child(2)    { width: 29vw; }
.bn-photo-print:nth-child(3)    { width: 33vw; }
.bn-photo-print:nth-child(4)    { width: 27vw; }
.bn-photo-print:nth-child(5)    { width: 31vw; }
.bn-photo-print:nth-child(6)    { width: 28vw; }
.bn-photo-print:nth-child(n+7)  { width: 30vw; }

.bn-photo-print img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    filter: sepia(14%) contrast(1.04) brightness(0.96);
    transition: filter 0.5s ease;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Légende en bas du tirage (léger reflet papier) */
.bn-photo-print::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 42px;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.08) 100%
    );
    pointer-events: none;
}

/* Hover — piloté par GSAP, pas par CSS (évite les conflits de transform) */
.bn-photo-print:hover img {
    filter: sepia(0%) contrast(1.06) brightness(1);
}

.bn-section-header {
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ============================================================
   PAGE IV — DÉTAILS & RÉSERVATION
   ============================================================ */
.bn-details-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 5rem;
    align-items: start;
    margin-top: 3rem;
}

/* ── Liste équipements ── */
.bn-amenities-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.bn-amenity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(26, 13, 6, 0.15);
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 0.9rem;
    color: var(--bn-ink);
}

.bn-amenity-item:last-child {
    border-bottom: none;
}

.bn-amenity-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
}

.bn-amenity-label {
    line-height: 1.4;
}

/* ── Booking card ── */
.bn-booking-card {
    position: sticky;
    top: 6rem;
}

.bn-booking-card-inner {
    background: var(--bn-leather);
    border: 1px solid rgba(212, 163, 85, 0.25);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 20px 60px rgba(7, 5, 10, 0.5);
}

.bn-booking-eyebrow {
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--bn-gold);
    margin: 0;
}

.bn-booking-price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.bn-price-amount {
    font-family: var(--font-accent, 'Cormorant Garamond', serif);
    font-size: 3rem;
    font-weight: 300;
    color: var(--bn-parchment);
    line-height: 1;
}

.bn-price-unit {
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 0.8rem;
    color: rgba(237, 224, 196, 0.6);
    letter-spacing: 0.05em;
}

.bn-booking-note {
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 0.8rem;
    color: rgba(237, 224, 196, 0.55);
    line-height: 1.6;
    margin: 0;
}

.bn-booking-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Boutons ── */
.bn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.8rem;
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1;
}

.bn-btn--primary {
    background: var(--bn-gold);
    color: var(--bn-ink);
    border-color: var(--bn-gold);
}

.bn-btn--primary:hover {
    background: transparent;
    color: var(--bn-gold);
    border-color: var(--bn-gold);
}

.bn-btn--ghost {
    background: transparent;
    color: rgba(237, 224, 196, 0.75);
    border-color: rgba(237, 224, 196, 0.4);
}

.bn-btn--ghost:hover {
    background: rgba(237, 224, 196, 0.08);
    color: var(--bn-parchment);
    border-color: rgba(237, 224, 196, 0.6);
}

/* ── Lien retour ── */
.bn-back-link {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(26, 13, 6, 0.12);
}

.bn-link-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body, 'Jost', sans-serif);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bn-ember);
    text-decoration: none;
    transition: gap 0.3s ease, opacity 0.3s ease;
}

.bn-link-back:hover {
    opacity: 0.75;
    gap: 0.25rem;
}

/* ============================================================
   Titres de section — pages dark (gallery)
   ============================================================ */
.bn-page--gallery .bn-section-title {
    color: var(--bn-parchment);
}

/* ============================================================
   Lightbox
   ============================================================ */
.bn-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;             /* GSAP bascule display:flex */
    align-items: center;
    justify-content: center;
    background: rgba(7, 5, 10, 0.96);
    cursor: zoom-out;
    padding: 2rem;
}

.bn-lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    box-shadow:
        0 4px  12px rgba(0, 0, 0, 0.5),
        0 24px 60px rgba(0, 0, 0, 0.7);
    cursor: default;
    will-change: transform, filter;
}

.bn-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.6rem;
    height: 2.6rem;
    background: transparent;
    border: 1px solid rgba(212, 163, 85, 0.35);
    border-radius: 50%;
    color: var(--bn-gold);
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease;
    padding: 0;
}

.bn-lightbox-close:hover,
.bn-lightbox-close:focus-visible {
    background: rgba(212, 163, 85, 0.12);
    border-color: var(--bn-gold);
    outline: none;
}

/* Curseur magnétique sur les tirages */
.bn-photo-print {
    cursor: zoom-in;
}

/* ============================================================
   Reveals animés (GSAP autoAlpha)
   ============================================================ */
.bn-reveal {
    visibility: hidden;
}

/* ============================================================
   Responsive — tablette (< 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .bn-page-inner {
        padding: 6rem 2.5rem;
    }

    .bn-details-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .bn-booking-card {
        position: static;
    }

    .bn-story-layout {
        grid-template-columns: 1fr;
    }

    .bn-marginal {
        display: none;
    }

    .bn-marginalia {
        display: none;
    }

    .bn-story-ornament {
        display: none;
    }
}

/* ============================================================
   Responsive — mobile (< 768px)
   ============================================================ */
@media (max-width: 768px) {
    /* Fallback si GSAP/ScrollTrigger ne se déclenche pas : rendre visible */
    .bn-reveal {
        visibility: visible;
    }

    .bn-page-inner {
        padding: 5rem 1.25rem;
    }

    /* Désactiver perspective et 3D sur mobile */
    .bn-book-container {
        perspective: none;
    }

    .bn-page {
        transform-style: flat;
    }

    /* Galerie mobile : colonne centrée, pas d'éparpillement */
    .bn-gallery-eyebrow {
        left: 1.25rem;
        top: 2rem;
    }

    .bn-scatter-desk {
        min-height: unset;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 4.5rem 1.25rem 3rem;
        overflow: hidden;
    }

    .bn-photo-print {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: 55vw !important;
        visibility: visible;
        opacity: 1 !important;
        transform: none !important;
    }

    /* Limiter à 4 photos en mobile pour éviter un scroll trop long */
    .bn-photo-print:nth-child(n+5) {
        display: none;
    }

    .bn-hero-title {
        font-size: clamp(3.5rem, 14vw, 6rem);
    }

    .bn-section-title {
        font-size: clamp(2.4rem, 9vw, 4rem);
    }

    .bn-hero-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .bn-details-grid {
        grid-template-columns: 1fr;
    }
}
