/* -----------------------------------
   STYLE GLOBAL – GALERIE PREMIUM
------------------------------------ */
:root {
    --beige-light: #f3e7d3;
    --beige: #e7dac2;
    --beige-dark: #d6c8ac;

    --card-bg: #fff;
    --border: #ddd;
    --text: #222;
}

/* Mode sombre */
body.dark {
    --card-bg: #1f1f1f;
    --border: #333;
    --text: #f0f0f0;
}

/* Bouton ajouter image */
.gallery-add-wrapper {
    text-align: right;
    margin-bottom: 18px;
}

.btn-add-image {
    background: var(--green);
    color: #000;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    transition: 0.25s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-add-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 16px rgba(0,0,0,0.25);
}

/* -----------------------------------
   GRILLE DE MINIATURES
------------------------------------ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

/* Carte */
.gallery-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 340px; /* <-- Hauteur uniforme */
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: 0.25s;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

/* Miniature image crop uniformisé */
.gallery-card img {
    width: 100%;
    height: 180px;       /* <-- Taille fixe */
    object-fit: cover;   /* <-- Uniformise totalement */
    display: block;
    background: #ddd;
}

/* Infos sous miniature */
.gallery-card-info {
    padding: 12px 15px 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 120px; /* <-- pour tout aligner */
}

.gallery-card-info h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
}

.gallery-user {
    margin: 6px 0 0;
    opacity: .7;
    font-size: 0.9rem;
}

.gallery-views {
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--text);
}

/* -----------------------------------
   FILTRES
------------------------------------ */
.gallery-filters .field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.gallery-filters .field-group {
    flex: 1 1 220px;
}

/* -----------------------------------
   LIGHTBOX PREMIUM
------------------------------------ */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 15000;
    display: none;
}

.glb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(3px);
}

.glb-content {
    position: relative;
    margin: auto;
    top: 50%;
    transform: translateY(-50%);
    max-width: 90%;
    width: 900px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    color: var(--text);
    box-shadow: 0 0 30px rgba(0,0,0,0.35);
}

.glb-close {
    position: absolute;
    right: 15px;
    top: 15px;
    background: var(--gold);
    border-radius: 50%;
    border: none;
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    cursor: pointer;
}

.glb-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.glb-prev,
.glb-next {
    background: transparent;
    border: none;
    font-size: 2.4rem;
    color: var(--text);
    cursor: pointer;
}

.glb-image-wrapper {
    max-width: 100%;
    max-height: 70vh;
}

#glb-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 10px;
    transition: .3s;
}

#glb-image.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}

.glb-caption {
    text-align: center;
    margin-top: 8px;
}

.glb-zoom {
    margin: 12px auto 0;
    display: block;
    padding: 8px 18px;
    background: var(--green);
    border-radius: 8px;
    border: none;
}

/* -----------------------------------
   MODE NUIT COMPLET
------------------------------------ */
body.dark .gallery-card {
    background: #1d1d1d !important;
    border-color: #333 !important;
}

body.dark .gallery-card-info h3,
body.dark .gallery-user,
body.dark .gallery-views {
    color: #eee !important;
}

body.dark .gallery-card img {
    background: #2b2b2b;
}

body.dark .glb-content {
    background: #1a1a1a;
}

body.dark input,
body.dark select {
    background: #333;
    border-color: #555;
    color: #eee;
}

.pagination {
    text-align:center;
    margin-top:25px;
}
.page-link {
    padding:8px 14px;
    background:var(--card-bg);
    border:1px solid var(--border);
    margin:0 4px;
    border-radius:8px;
    text-decoration:none;
    color:var(--text);
}
.page-link.active {
    background:var(--green);
    color:#000;
    font-weight:bold;
}
.page-link:hover {
    filter:brightness(1.15);
}

/* ------------------------------
   FORMULAIRE PREMIUM GALLERY
-------------------------------*/

.gallery-form {
    background: var(--beige-light, #ede8d5);
    padding: 25px;
    border-radius: 16px;
    margin-top: 20px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.gallery-form label {
    display: block;
    font-size: 16px;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.gallery-form input[type="text"],
.gallery-form textarea,
.gallery-form select,
.gallery-form input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #ccc;
    background: #faf8f0;
    font-size: 15px;
    margin-bottom: 15px;
    transition: 0.25s ease;
}

.gallery-form input[type="text"]:focus,
.gallery-form textarea:focus,
.gallery-form select:focus,
.gallery-form input[type="file"]:focus {
    border-color: var(--green, #9efd38);
    outline: none;
    background: #fffdf5;
}

/* bouton envoyer */
.gallery-form button,
.gallery-form input[type="submit"] {
    background: var(--green, #9efd38);
    color: #000;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
    display: inline-block;
    margin-top: 10px;
}

.gallery-form button:hover,
.gallery-form input[type="submit"]:hover {
    background: #7ad82d;
}

.gallery-form input,
.gallery-form textarea,
.gallery-form select,
.gallery-form input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #ccc;
    background: #f6f2e7;
    margin-bottom: 15px;
    font-size: 15px;
    transition: .25s;
}

.gallery-form button {
    background: var(--green);
    padding: 12px 22px;
    border-radius: 10px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 25px 0 40px;
    flex-wrap: wrap;
}

.page-number,
.page-btn {
    padding: 9px 16px;
    background: #eee;
    color: #444;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: .2s;
}

.page-number:hover,
.page-btn:hover {
    background: var(--green);
    color: #000;
}

.page-number.active {
    background: var(--gold);
    color: #000;
}
