/* Custom CSS L'Atelier de Cyndie - The Artisanal Editorial */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Glassmorphism pour modale */
.glass {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(252, 249, 244, 0.6); /* surface ivory avec opacité */
}

/* The Ghost Border - Subtle boundary */
.ghost-border {
    border: 1px solid rgba(214, 195, 182, 0.4); /* outline-variant #d6c3b6 à 20-40% */
}

/* The Watermark Gradient - Silk sheen */
.sheen-gradient {
    background: linear-gradient(135deg, #7b4a1e, #5f3308);
}

/* Custom dashed stitching line */
.stitching-line {
    border-top: 2px dashed #C8A96E; /* Muted gold */
    opacity: 0.6;
}

.stitch-divider {
    background-image: linear-gradient(to right, #847469 33%, rgba(255, 255, 255, 0) 0%);
    background-position: bottom;
    background-size: 8px 1px;
    background-repeat: repeat-x;
}

.stitch-divider-v {
    background-image: linear-gradient(to bottom, #847469 33%, rgba(255, 255, 255, 0) 0%);
    background-position: right;
    background-size: 1px 8px;
    background-repeat: repeat-y;
}

.atelier-glass {
    backdrop-filter: blur(20px);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==========================================
   PORTFOLIO GRID - Effet Polaroid & Animation
   ========================================== */

/* État initial (masqué, légèrement décalé vers le bas) */
.card-item {
    opacity: 0;
    transform: translateY(30px) rotate(0deg);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: opacity, transform;
    position: relative;
    z-index: 1;
}

/* État visible : impairs penchent à gauche */
.card-item.is-visible:nth-child(odd) {
    opacity: 1;
    transform: translateY(0) rotate(-2deg);
}

/* État visible : pairs penchent à droite */
.card-item.is-visible:nth-child(even) {
    opacity: 1;
    transform: translateY(0) rotate(2deg);
}

/* Redressement au hover sur desktop */
@media (hover: hover) {
    .card-item.is-visible:hover {
        transform: rotate(0deg) scale(1.02) !important;
        z-index: 10;
    }
}

/* Accessibilité : désactiver les animations si prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .card-item {
        transition: none !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    .card-item:nth-child(odd) { transform: rotate(-2deg) !important; }
    .card-item:nth-child(even) { transform: rotate(2deg) !important; }
}

/* Troncature CSS pour les légendes (2 lignes max) */
.card-caption {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ==========================================
   DESKTOP LAYOUT (≥900px)
   ========================================== */
@media (min-width: 900px) {
    /* Grille portfolio : CSS Grid fluide */
    .portfolio-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        max-width: 1200px;
        margin: 0 auto;
        gap: 40px;
    }
    /* Annule le margin-top de space-y-12 (inutile en grid) */
    .portfolio-grid > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0;
    }

    /* Réduire l'inclinaison sur grands écrans (moins extrême) */
    .card-item.is-visible:nth-child(odd) {
        transform: translateY(0) rotate(-1.5deg);
    }
    .card-item.is-visible:nth-child(even) {
        transform: translateY(0) rotate(1.5deg);
    }

    /* Lightbox immersive : 90vw × 90vh, centrée (padding dynamique via JS selon nav) */
    #lightbox {
        align-items: center;
    }
    #lightbox-content {
        width: 90vw;
        height: 90vh;
        max-width: 1400px;
        margin-bottom: 0;
        overflow: hidden;
    }
    /* Image : 65%, couvre tout son côté */
    #lightbox-content > div:first-of-type {
        width: 65%;
        flex: none;
        min-height: 100%;
    }
    #lightbox-content > div:first-of-type #lb-image {
        object-fit: cover;
    }
    /* Texte : 35%, padding généreux, centré verticalement */
    #lightbox-content > div:last-of-type {
        width: 35%;
        flex: none;
        padding: 60px 40px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow-y: auto;
    }

    /* Logo agrandi sur desktop */
    #header-logo {
        width: 250px;
        height: 250px;
    }

    /* Bouton contact : rouge coquelicot (rappel identité logo) */
    .contact-submit-btn {
        background-color: #C0392B;
    }
    .contact-submit-btn:hover {
        background-color: #a53125;
    }

    /* Formulaire contact : Nom + Email en grille côte à côte */
    .contact-name-email {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .contact-name-email > div {
        margin-top: 0 !important;
    }
}

/* ==========================================
   PROSE ATELIER — Rendu Markdown (portfolio intro)
   ========================================== */
.prose-atelier { color: #5C3A21; line-height: 1.75; }
.prose-atelier h1, .prose-atelier h2, .prose-atelier h3 {
    font-family: 'Noto Serif', serif;
    color: #5C3A21;
    font-weight: 500;
    margin-top: 1.25em;
    margin-bottom: 0.4em;
}
.prose-atelier h1 { font-size: 1.5rem; }
.prose-atelier h2 { font-size: 1.2rem; }
.prose-atelier h3 { font-size: 1rem; }
.prose-atelier p  { margin-bottom: 0.75em; }
.prose-atelier ul { list-style: disc; padding-left: 1.5em; margin-bottom: 0.75em; text-align: left; display: inline-block; }
.prose-atelier ol { list-style: decimal; padding-left: 1.5em; margin-bottom: 0.75em; text-align: left; display: inline-block; }
.prose-atelier li { margin-bottom: 0.25em; }
.prose-atelier strong { font-weight: 600; }
.prose-atelier em    { font-style: italic; color: #938676; }
.prose-atelier hr    { border: none; border-top: 1px dashed #E0D6CC; margin: 1.5em 0; }
.prose-atelier a     { color: #5C3A21; text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================
   LIGHTBOX — Bloquer la sélection de texte pendant les swipes
   ========================================== */
#lightbox-content {
    -webkit-user-select: none;
    user-select: none;
}

/* ==========================================
   MOBILE NAV — Position stable + Safe area iPhone
   ========================================== */
.mobile-nav {
    /* dvb ancre la nav sur le viewport dynamique (barre adresse incluse/exclue) */
    bottom: max(0.75rem, env(safe-area-inset-bottom));
}

body {
    /* dvh = viewport dynamique : cohérent entre pages quelle que soit la barre navigateur */
    min-height: 100dvh;
}

/* Custom scrollbar for modal description */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(123, 74, 30, 0.2);
    border-radius: 4px;
}
