/* =========================================================
   GALLERY.CSS — Spécifique à la galerie photos
   Charge en complément de style.css uniquement.
   Ne pas redéfinir : h1/h2/h3, .hero, .pagination, .search
========================================================= */

/* ======================
   GRID MASONRY
====================== */

.gallery-grid {
    column-count: 4;
    column-gap: 15px;
    width: 100%;
    margin: 20px auto;
}

@media (max-width: 1000px) { .gallery-grid { column-count: 3; } }
@media (max-width: 700px)  { .gallery-grid { column-count: 2; } }
@media (max-width: 500px)  { .gallery-grid { column-count: 1; } }

/* ======================
   ITEM
====================== */

.gallery-item {
    break-inside: avoid;
    background: #fff;
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

.gallery-item img {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: transform .35s ease, filter .35s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
    filter: brightness(0.88);
}

/* ======================
   CAPTION
====================== */

.gallery-caption {
    padding: 10px;
}

.gallery-caption h3 {
    font-size: 16px;
    color: #5c4452;
    margin-bottom: 4px;
}

.gallery-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* ======================
   MODAL IMAGE (FULLSCREEN)
====================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn .2s ease-in-out;
}

#modalImage {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    cursor: zoom-out;
    user-select: none;
    -webkit-user-drag: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

body.modal-open {
    overflow: hidden;
}

/* ======================
   MODAL TEXTE
====================== */

#textModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#textModal .modal-box {
    width: 100%;
    max-width: 850px;
    max-height: 90vh;
    background: #fff;
    color: #222;
    border-radius: 14px;
    padding: 25px;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    position: relative;
}

#modalTitle {
    font-size: 22px;
    font-weight: 600;
    color: #5c4452;
    margin-bottom: 15px;
}

#modalBody {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    white-space: pre-line;
}

#modalBody p {
    margin: 0 0 12px;
}

#modalBody a {
    color: #b57aa1;
    text-decoration: underline;
    word-break: break-word;
    transition: color .2s ease;
}

#modalBody a:hover {
    color: #8f4f7a;
}

#modalBody ul,
#modalBody ol {
    margin: 0 0 12px 22px;
}

#modalBody li {
    margin-bottom: 6px;
}

#modalBody strong {
    font-weight: bold;
}

#modalBody em {
    font-style: italic;
}

.close-btn {
    position: fixed;
    top: 18px;
    left: 18px;
    background: #fff;
    color: #000;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: background .2s;
}

.close-btn:hover {
    background: #f0f0f0;
}
