/* =========================================================
   Alex Photoshow — theme argentique
   Palette : noir #111111, blanc #ffffff, gris film #3a3a3a,
             gris clair #e8e8e6, accent rouille (filtre rouge) #b5432a
   Police display : 'Fraunces' (serif contemporaine), corps : 'Inter',
   police "manuscrite" pour les dates : 'Caveat'
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600&family=Caveat:wght@500;600&display=swap');

:root {
    --noir: #111111;
    --blanc: #ffffff;
    --fond-carrousel: #4a4844;
    --gris-film: #302f2d;
    --gris-clair: #e9e7e2;
    --gris-moyen: #9a9791;
    --gris-polaroid: #38372f;
    --rouille: #a8431f;
    --rouille-clair: #d97a52;
    --ombre: rgba(17, 17, 17, 0.28);
    --font-display: 'Fraunces', Georgia, serif;
    --font-corps: 'Inter', system-ui, sans-serif;
    --font-main: 'Caveat', cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--blanc);
    color: var(--noir);
    font-family: var(--font-corps);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.reduced-motion, .no-motion * {
    animation: none !important;
    transition: none !important;
}

/* ---------- En-tete : pellicule argentique ---------- */

.site-header {
    position: relative;
    padding: 2.5rem 1rem 1.5rem;
    text-align: center;
}

.site-title-lien {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.site-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.5rem, 3.8vw, 2.3rem);
    letter-spacing: 0.02em;
    margin: 2rem 0 1.6rem;
    transition: opacity 0.2s ease;
}

.site-title-lien:hover .site-title,
.site-title-lien:focus-visible .site-title { opacity: 0.7; }

.site-title .rouille { color: var(--rouille); }

.pellicule {
    position: relative;
    z-index: 20;
    display: flex;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.pellicule::-webkit-scrollbar { display: none; }

.pellicule-bande {
    display: flex;
    flex-direction: column;
    background: var(--gris-film);
    border-radius: 4px;
    box-shadow: 0 10px 24px var(--ombre);
    padding: 0;
    overflow: hidden;
}

.perforations-horizontales {
    height: 16px;
    flex-shrink: 0;
    background-image: repeating-linear-gradient(
        to right,
        var(--blanc) 0,
        var(--blanc) 7px,
        transparent 7px,
        transparent 16px
    );
    background-position: 8px center;
    background-repeat: repeat-x;
    background-size: auto 9px;
}

.rangee-boutons {
    display: flex;
    align-items: stretch;
}

/* ---------- Photo du mois (la plus likee), en haut a gauche de l'en-tete ---------- */

.photo-du-mois {
    position: absolute;
    top: 1.3rem;
    left: 1.3rem;
    z-index: 5;
    width: 108px;
    display: block;
    cursor: pointer;
    perspective: 600px;
    animation: flottement 5s ease-in-out infinite;
}

@keyframes flottement {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.photo-du-mois-cadre {
    background: var(--blanc);
    padding: 5px;
    border-radius: 2px;
    box-shadow: 0 18px 30px rgba(0,0,0,0.32), 0 4px 10px rgba(0,0,0,0.22);
    transform: rotate(-7deg) rotateY(18deg) rotateX(3deg);
    transform-style: preserve-3d;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.photo-du-mois:hover .photo-du-mois-cadre,
.photo-du-mois:focus-visible .photo-du-mois-cadre {
    box-shadow: 0 22px 36px rgba(0,0,0,0.38), 0 6px 14px rgba(0,0,0,0.26);
    transform: rotate(-3deg) rotateY(10deg) rotateX(2deg) scale(1.08);
}
.photo-du-mois-cadre img {
    display: block;
    width: 100%;
    height: 72px;
    object-fit: cover;
    background: #ddd;
}

.photo-du-mois-coupe {
    position: absolute;
    bottom: -12px;
    right: -10px;
    width: 30px;
    height: 30px;
    fill: #d4af37;
    stroke: #a9821f;
    stroke-width: 0.4;
    transform: rotate(12deg);
    filter: drop-shadow(0 3px 4px rgba(0,0,0,0.35));
}

@media (max-width: 640px) {
    .photo-du-mois { width: 72px; top: 0.8rem; left: 0.8rem; }
    .photo-du-mois-cadre img { height: 48px; }
    .photo-du-mois-coupe { width: 22px; height: 22px; bottom: -8px; right: -7px; }
}

.negatif {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #1c1b19;
    border: none;
    border-left: 1px solid #4a4844;
    border-right: 1px solid #4a4844;
    color: var(--gris-clair);
    font-family: var(--font-corps);
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 1.3rem 1.1rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}
.negatif:hover,
.negatif:focus-visible {
    background: var(--rouille);
    color: var(--blanc);
    transform: translateY(-2px);
    outline: none;
}
.negatif.actif {
    background: var(--blanc);
    color: var(--noir);
}
.negatif.actif:hover,
.negatif.actif:focus-visible {
    background: var(--blanc);
    color: var(--noir);
    transform: translateY(-2px);
}
.negatif::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--rouille-clair);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}
.negatif:hover::after,
.negatif:focus-visible::after {
    transform: scaleX(1);
}
.negatif.actif::after { background: var(--noir); }

/* ---------- Sections texte (Qui suis-je / Expos / Contact / Me suivre) ---------- */

.section-panneau {
    max-width: 720px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
    display: none;
}
.section-panneau.visible { display: block; animation: apparition 0.5s ease; }

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

.section-panneau h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 1.6rem;
    position: relative;
    display: inline-block;
}
.section-panneau h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.4rem;
    width: 3rem;
    height: 2px;
    background: var(--rouille);
}

.bio-texte {
    font-size: 1.08rem;
    line-height: 1.75;
    color: #2a2a2a;
}

.expos-liste {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: expo;
}
.expos-liste li {
    counter-increment: expo;
    display: grid;
    grid-template-columns: 2.6rem 1fr auto;
    gap: 0.4rem 1rem;
    align-items: baseline;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--gris-clair);
}
.expos-liste li::before {
    content: counter(expo, decimal-leading-zero);
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--gris-moyen);
}
.expo-titre {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
}
.expo-lieu {
    grid-column: 2 / 3;
    color: #555;
    font-size: 0.92rem;
    font-style: italic;
}
.expo-date {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    align-self: center;
    font-family: var(--font-corps);
    color: var(--rouille);
    font-weight: 600;
}

.suivre-instagram {
    margin-bottom: 2.5rem;
}
.suivre-lien {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--noir);
    padding-bottom: 0.2rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.suivre-lien:hover { border-color: var(--rouille); color: var(--rouille); }
.suivre-lien svg { width: 26px; height: 26px; }

.abonnement-bloc {
    padding-top: 1.8rem;
    border-top: 1px solid var(--gris-clair);
}
.abonnement-bloc label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    display: block;
    margin-bottom: 0.4rem;
}
.abonnement-bloc input[type="email"] {
    width: 100%;
    max-width: 340px;
    padding: 0.75rem 0.9rem;
    border: 1px solid #cfccc5;
    border-radius: 2px;
    font-family: var(--font-corps);
    font-size: 1rem;
    background: var(--blanc);
    color: var(--noir);
    margin-bottom: 0.8rem;
}
.abonnement-bloc input[type="email"]:focus {
    outline: 2px solid var(--rouille);
    outline-offset: 1px;
}
.abonnement-boutons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}
.bouton-discret {
    background: var(--blanc);
    color: var(--noir);
    border: 1px solid var(--noir);
}
.bouton-discret:hover { background: var(--gris-clair); color: var(--noir); }

.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.contact-form label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    margin-bottom: 0.3rem;
    display: block;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #cfccc5;
    border-radius: 2px;
    font-family: var(--font-corps);
    font-size: 1rem;
    background: var(--blanc);
    color: var(--noir);
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--rouille);
    outline-offset: 1px;
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.bouton {
    align-self: flex-start;
    background: var(--noir);
    color: var(--blanc);
    border: none;
    padding: 0.85rem 1.8rem;
    font-family: var(--font-corps);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s ease;
}
.bouton:hover { background: var(--rouille); }
.message-etat { font-size: 0.9rem; margin-top: -0.4rem; }
.message-etat.ok { color: #2c6e3f; }
.message-etat.erreur { color: var(--rouille); }

/* ---------- Carrousel dynamique ---------- */

.carrousel-section {
    padding: 1rem 0 3rem;
    background: var(--fond-carrousel);
}

.carrousel-viewport {
    overflow: hidden;
    width: 100%;
}

.carrousel-piste {
    display: flex;
    align-items: flex-start;
    width: max-content;
    animation: defilement linear infinite;
    animation-duration: 60s;
}
.carrousel-piste:hover { animation-play-state: paused; }

@keyframes defilement {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.polaroid {
    background: var(--blanc);
    padding: 0.9rem 0.9rem 0;
    margin: 1.6rem 1.2rem;
    box-shadow: 0 12px 26px var(--ombre), 0 2px 6px rgba(0,0,0,0.3);
    width: 230px;
    flex: 0 0 auto;
    cursor: pointer;
    transform: rotate(var(--rot, 0deg));
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.polaroid:nth-child(3n) { --rot: -2deg; }
.polaroid:nth-child(3n+1) { --rot: 1.5deg; }
.polaroid:nth-child(3n+2) { --rot: -1deg; }
.polaroid:hover {
    transform: rotate(0deg) translateY(-6px) scale(1.02);
    box-shadow: 0 18px 32px var(--ombre), 0 4px 10px rgba(0,0,0,0.4);
}
.polaroid img {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: cover;
    background: #ddd;
}
.polaroid-date {
    font-family: var(--font-main);
    font-size: 1.5rem;
    text-align: center;
    color: var(--noir);
    background: var(--blanc);
    margin: 0.9rem -0.9rem 0;
    padding: 0.6rem 0.9rem 0.9rem;
    min-height: 2.2rem;
}

.carrousel-vide {
    text-align: center;
    color: var(--gris-moyen);
    padding: 2rem;
    font-style: italic;
}

/* ---------- Galeries : cadres musee ---------- */

.galeries-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 1rem;
}
.galeries-section h2 {
    font-family: var(--font-display);
    font-size: 1.9rem;
    text-align: center;
    margin-bottom: 0.4rem;
}
.galeries-soustitre {
    text-align: center;
    color: var(--gris-moyen);
    font-size: 0.9rem;
    margin-bottom: 2.4rem;
    letter-spacing: 0.02em;
}

.galeries-grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 2.6rem 1.8rem;
}

.cadre-musee {
    background: var(--noir);
    padding: 10px;
    cursor: pointer;
    box-shadow: 0 10px 22px var(--ombre);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cadre-musee:hover { transform: translateY(-5px); box-shadow: 0 16px 28px var(--ombre); }

.cadre-musee-interieur {
    border: 1px solid #4a4844;
    padding: 6px;
}

.cadre-musee img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #ddd;
}

.etiquette {
    background: var(--blanc);
    padding: 0.5rem;
    text-align: center;
}
.etiquette-nom {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--noir);
}
.etiquette-sous {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gris-moyen);
    margin-top: 0.15rem;
}

/* galerie privee */
.galerie-privee .cadre-musee img { filter: blur(14px) brightness(0.9); }
.galerie-privee .etiquette-nom::before {
    content: "\1F512";
    margin-right: 0.4rem;
    font-size: 0.8rem;
}

.deverrouillage {
    display: none;
    padding: 0.7rem 0.5rem 0.2rem;
    gap: 0.5rem;
    align-items: center;
    background: var(--blanc);
}
.deverrouillage.ouvert { display: flex; }
.deverrouillage input[type="password"] {
    flex: 1;
    padding: 0.45rem 0.6rem;
    border: 1px solid #cfccc5;
    font-size: 0.85rem;
    border-radius: 2px;
    background: var(--blanc);
    color: var(--noir);
}
.deverrouillage button {
    background: var(--noir);
    color: var(--blanc);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}
.deverrouillage button:hover { background: var(--rouille); }
.deverrouillage-erreur {
    font-size: 0.75rem;
    color: var(--rouille);
    padding: 0 0.5rem 0.4rem;
    display: none;
}

/* ---------- Lightbox generique (carrousel + galerie image unique) ---------- */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.94);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}
.lightbox.ouverte { display: flex; }
.lightbox img {
    max-width: min(90vw, 1100px);
    max-height: 82vh;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.lightbox-legende {
    position: absolute;
    bottom: 2.2rem;
    left: 0;
    right: 0;
    text-align: center;
    color: #eee;
    font-family: var(--font-main);
    font-size: 1.4rem;
}
.lightbox-fermer,
.lightbox-suivant,
.lightbox-precedent {
    position: absolute;
    background: transparent;
    border: none;
    color: var(--blanc);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}
.lightbox-fermer:hover,
.lightbox-suivant:hover,
.lightbox-precedent:hover { opacity: 1; }
.lightbox-fermer { top: 1rem; right: 1.2rem; font-size: 2.2rem; }
.lightbox-precedent { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-suivant { right: 0.5rem; top: 50%; transform: translateY(-50%); }

/* ---------- Pied de page ---------- */

.site-footer {
    text-align: center;
    padding: 2.5rem 1rem 3rem;
    color: var(--gris-moyen);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

/* ---------- Lien de galerie (accueil) ---------- */

.galerie-lien {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ---------- Page galerie dediee ---------- */

.galerie-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}
.galerie-titre {
    font-family: var(--font-display);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.3rem;
}
.galerie-compte {
    text-align: center;
    color: var(--gris-moyen);
    font-size: 0.9rem;
    margin-bottom: 2.4rem;
}
.galerie-intro {
    max-width: 620px;
    margin: 0 auto 3rem;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.25rem;
    line-height: 1.7;
    color: #333;
    font-style: italic;
}
.galerie-message {
    text-align: center;
    color: #555;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}
.galerie-retour {
    text-align: center;
}
.galerie-retour a {
    color: var(--noir);
    text-decoration: none;
    border-bottom: 2px solid var(--noir);
    padding-bottom: 0.1rem;
}
.galerie-retour a:hover { color: var(--rouille); border-color: var(--rouille); }
.galerie-mdp-form {
    max-width: 340px;
    margin: 0 auto;
}

/* ---------- Carte photo individuelle (page galerie) : meme cadre musee + actions (like/commentaire) ---------- */

.photo-carte {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.photo-carte .cadre-musee {
    width: 100%;
    cursor: pointer;
}
.actions-photo {
    margin-top: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.commentaire-icone,
.like-icone {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #cfccc5;
    background: var(--blanc);
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.commentaire-icone svg,
.like-icone svg { width: 17px; height: 17px; }
.commentaire-icone:hover {
    background: var(--noir);
    color: var(--blanc);
    transform: translateY(-2px);
}

.like-icone {
    position: relative;
    width: 34px;
    padding: 0;
}
.like-icone:hover {
    border-color: var(--rouille);
    color: var(--rouille);
    transform: translateY(-2px);
}
.like-icone.actif {
    border-color: #e0303f;
    color: #e0303f;
    background: #fff5f6;
}
.like-icone.actif svg { fill: #e0303f; }
.like-icone.actif:hover { transform: none; cursor: default; }

/* ---------- Overlay de commentaire ---------- */

.commentaire-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 1.5rem;
}
.commentaire-overlay.ouverte { display: flex; }
.commentaire-carte {
    position: relative;
    background: var(--blanc);
    color: var(--noir);
    max-width: 420px;
    width: 100%;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.commentaire-carte h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin: 0 0 1.2rem;
}
.commentaire-fermer {
    position: absolute;
    top: 0.7rem;
    right: 0.9rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
}
.commentaire-fermer:hover { color: var(--rouille); }

/* ---------- Bouton diaporama (lightbox) ---------- */

.lightbox-diaporama {
    position: absolute;
    bottom: 1.6rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.4);
    color: var(--blanc);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.85;
    transition: background 0.2s ease, opacity 0.2s ease;
}
.lightbox-diaporama:hover { opacity: 1; background: rgba(255,255,255,0.22); }
.lightbox-diaporama .icone-pause { display: none; font-size: 0.75rem; letter-spacing: 1px; }
.lightbox-diaporama .icone-lecture { font-size: 0.85rem; }
.lightbox-diaporama.actif .icone-lecture { display: none; }
.lightbox-diaporama.actif .icone-pause { display: inline; }
.lightbox-diaporama.actif { background: var(--rouille); border-color: var(--rouille); }
.lightbox-legende { bottom: 2.6rem; }

/* ---------- Toast (confirmation en bas d'ecran) ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%) translateY(20px);
    background: var(--noir);
    color: var(--blanc);
    padding: 0.9rem 1.6rem;
    border-radius: 4px;
    font-size: 0.92rem;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1200;
    max-width: calc(100vw - 3rem);
    text-align: center;
}
.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- Accessibilite : focus clavier visible partout ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.cadre-musee:focus-visible,
.polaroid:focus-visible {
    outline: 2px solid var(--rouille);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .carrousel-piste { animation: none; }
    .section-panneau.visible { animation: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
    .negatif { padding: 1rem 0.8rem; font-size: 0.7rem; }
    .polaroid { width: 175px; }
    .polaroid img { height: 155px; }
    .expos-liste li { grid-template-columns: 2rem 1fr; }
    .expo-date { grid-column: 1 / 3; grid-row: 3; justify-self: start; }
}
