/* ============================
   RESET & BASE
   ============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:         #000;
    --surface:    #141414;
    --border:     #2a2a2a;
    --text:       #f0f0f0;
    --text-muted: #888;
    --accent:     #c8a96e;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans:  'Inter', system-ui, sans-serif;
    --panel-w:    360px;
    --header-h:   65px;
}

html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
}

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

/* ============================
   HEADER
   ============================ */
.site-header {
    padding: 2rem 2rem 1.2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.site-header--over-hero {
    position: absolute;
    top: 0; left: 0; right: 0;
    border-bottom: none;
    background: transparent;
    z-index: 10;
    padding: 1.5rem 2rem;
}

/* ============================
   NAVIGATION
   ============================ */
.site-nav {
    margin-left: auto;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.site-nav-link {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.2s;
    text-decoration: none;
}

.site-nav-link:hover,
.site-nav-link.active { color: var(--accent); }

.site-title {
    display: flex;
    align-items: baseline;
    gap: 0.4em;
    line-height: 1;
    text-decoration: none;
}

.site-title-first {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 300;
    font-style: italic;
    color: var(--text);
    letter-spacing: 0.01em;
}

.site-title-last {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
}

.site-title-section {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-left: 0.8em;
    border-left: 1px solid var(--border);
    margin-left: 0.2em;
}

.site-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ============================
   HERO
   ============================ */
.hero {
    position: relative;
    height: 100vh;
    background-image: url('https://live.staticflickr.com/65535/52980002248_92286902d2_o.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.25) 0%,
        rgba(0,0,0,0.1)  40%,
        rgba(0,0,0,0.5)  100%
    );
}

.hero-identity {
    position: relative;
    z-index: 1;
    text-align: center;
    user-select: none;
}

.hero-name-first {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 300;
    font-style: italic;
    color: #fff;
    letter-spacing: 0.04em;
    line-height: 1;
    text-shadow: 0 2px 40px rgba(0,0,0,0.8), 0 0 80px rgba(0,0,0,0.5);
}

.hero-name-last {
    font-family: var(--font-sans);
    font-size: clamp(1rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin-top: 0.3em;
    text-shadow: 0 2px 20px rgba(0,0,0,0.9);
}

.hero-tagline {
    font-family: var(--font-sans);
    font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    font-weight: 400;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 1.2em;
    text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    color: rgba(255,255,255,0.4);
    font-size: 1.2rem;
    animation: heroScrollBounce 2s ease-in-out infinite;
}

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

/* ============================
   NAVIGATION
   ============================ */
.breadcrumb {
    padding: 0.9rem 2rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }

.site-back {
    font-size: 0.85rem;
    color: var(--accent);
    margin-right: 0.5rem;
    transition: opacity 0.2s;
}
.site-back:hover { opacity: 0.7; }

/* ============================
   CONTAINER
   ============================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.page-heading {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 0.3rem;
}

.page-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ============================
   GRILLE COLLECTIONS/ALBUMS
   ============================ */
.galleries-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.gallery-card {
    position: relative;
    background: var(--surface);
    overflow: hidden;
    cursor: pointer;
    display: block;
    transition: transform 0.25s ease;
}

.gallery-card:hover { transform: translateY(-3px); }

.gallery-card-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.gallery-card-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 1.2rem 1rem 0.9rem;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
}

.gallery-card-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-card-count {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.05em;
}

.gallery-card-no-cover {
    background: var(--surface);
    aspect-ratio: 4 / 3;
}

/* ============================
   GRILLE PHOTOS (masonry)
   ============================ */
.photos-masonry {
    columns: 4;
    column-gap: 4px;
}

.photo-item {
    break-inside: avoid;
    margin-bottom: 4px;
    cursor: pointer;
    overflow: hidden;
    display: block;
}

.photo-item img {
    width: 100%;
    display: block;
    transition: filter 0.3s ease;
}

.photo-item:hover img { filter: brightness(1.08); }

/* ============================
   LIGHTBOX — OVERLAY
   ============================ */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lightbox-overlay.active  { display: block; }
.lightbox-overlay.visible { opacity: 1; }

/* Zone image — prend tout l'écran sauf si panneau ouvert */
.lightbox-img-wrap {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: right 0.3s ease;
}

.lightbox-overlay.panel-open .lightbox-img-wrap {
    right: var(--panel-w);
}

.lightbox-img {
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    user-select: none;
}

/* ============================
   LIGHTBOX — BOUTONS
   ============================ */
.lightbox-close,
.lightbox-info,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    transition: background 0.2s;
}

.lightbox-close {
    top: 1rem; right: 1rem;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
}

.lightbox-info {
    bottom: 1rem; right: 1rem;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-serif);
    letter-spacing: 0;
}

.lightbox-info.active-info {
    background: var(--accent);
    color: #000;
}

.lightbox-prev,
.lightbox-next {
    top: 50%; transform: translateY(-50%);
    width: 48px; height: 72px;
    border-radius: 4px;
    font-size: 1.3rem;
}

.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }

.lightbox-overlay.panel-open .lightbox-next {
    right: calc(var(--panel-w) + 0.75rem);
}

.lightbox-overlay.panel-open .lightbox-info {
    right: calc(var(--panel-w) + 1rem);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.15); }

/* ============================
   LIGHTBOX — PANNEAU INFOS
   ============================ */
.lightbox-panel {
    position: fixed;
    top: 0; right: 0;
    width: var(--panel-w);
    height: 100%;
    background: var(--surface);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1005;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lightbox-panel.open { transform: translateX(0); }

.lightbox-panel-header {
    padding: 1.2rem 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.lightbox-panel-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.lightbox-panel-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.lightbox-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Tags */
.lightbox-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.lightbox-tag {
    font-size: 0.7rem;
    padding: 0.18rem 0.45rem;
    border: 1px solid var(--border);
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

/* EXIF */
.lightbox-exif-loading {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.lightbox-exif-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.lightbox-exif-table td {
    padding: 0.18rem 0;
    vertical-align: top;
}

.exif-key {
    color: var(--text-muted);
    width: 110px;
    padding-right: 0.5rem;
    white-space: nowrap;
}

.exif-val { color: var(--text); }

/* Carte */
.lightbox-map {
    width: 100%;
    height: 200px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* ============================
   FOOTER
   ============================ */
.site-footer {
    margin-top: 4rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.site-footer-copy {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* ============================
   CARTE
   ============================ */
.map-fullscreen {
    height: calc(100vh - var(--header-h));
    width: 100%;
    position: relative;
}

.map-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 1000;
    background: var(--bg);
}

.map-fullscreen .leaflet-popup-content-wrapper {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 2px;
    box-shadow: none;
    padding: 0;
}

.map-fullscreen .leaflet-popup-content {
    margin: 0;
}

.map-fullscreen .leaflet-popup-tip-container .leaflet-popup-tip {
    background: var(--surface);
}

.map-popup img {
    width: 200px;
    height: 133px;
    object-fit: cover;
    display: block;
}

.map-popup-info {
    padding: 0.6rem 0.75rem 0.75rem;
}

.map-popup-title {
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.map-popup a {
    font-size: 0.72rem;
    color: var(--accent);
    text-decoration: none;
}

.map-popup a:hover { text-decoration: underline; }

/* Hero nav overlay */
.hero-nav {
    position: absolute;
    top: 0; right: 0;
    z-index: 10;
    padding: 1.5rem 2rem;
}

.hero-nav .site-nav-link {
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}

.hero-nav .site-nav-link:hover {
    color: var(--accent);
}

/* ============================
   ERREUR
   ============================ */
.error-box {
    background: var(--surface);
    border: 1px solid #5c2020;
    padding: 2rem;
    color: #e08080;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 2rem 0;
}
.error-box strong { color: #e8a0a0; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1024px) {
    .galleries-grid { grid-template-columns: repeat(2, 1fr); }
    .photos-masonry { columns: 3; }
}

@media (max-width: 768px) {
    .galleries-grid { grid-template-columns: 1fr; }
    .photos-masonry { columns: 2; }
}

@media (max-width: 600px) {
    :root { --panel-w: 100vw; }

    .lightbox-overlay.panel-open .lightbox-img-wrap,
    .lightbox-overlay.panel-open .lightbox-next,
    .lightbox-overlay.panel-open .lightbox-info {
        right: 0;
    }
}

@media (max-width: 480px) {
    .photos-masonry { columns: 1; }
}
