/* =========================================================
   GP Gallery — Styles
   ========================================================= */

/* --- Grille --- */
.gp-gallery-wrap { font-family: inherit; }

.gp-grid {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}
.gp-cols-1 { grid-template-columns: repeat(1, 1fr); }
.gp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.gp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.gp-cols-4 { grid-template-columns: repeat(4, 1fr); }
.gp-cols-5 { grid-template-columns: repeat(5, 1fr); }
.gp-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 768px) {
    .gp-cols-3,
    .gp-cols-4,
    .gp-cols-5,
    .gp-cols-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .gp-grid { grid-template-columns: 1fr !important; }
}

/* --- Item --- */
.gp-item {
    margin: 0;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    background: #f0f0f0;
    aspect-ratio: 1;
    position: relative;
}
.gp-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.gp-item:hover img,
.gp-item:focus img {
    transform: scale(1.04);
    opacity: 0.92;
}
.gp-item:focus { outline: 3px solid #4285f4; outline-offset: 2px; }

/* --- Toolbar --- */
.gp-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.gp-item-count {
    color: #666;
    font-size: 0.9em;
}

/* --- Boutons --- */
.gp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.gp-btn-google {
    background: #4285f4;
    color: #fff;
}
.gp-btn-google:hover { background: #3367d6; color: #fff; }

.gp-btn-pick {
    background: #34a853;
    color: #fff;
}
.gp-btn-pick:hover { background: #2d8a47; }

.gp-btn-secondary {
    background: #f1f3f4;
    color: #333;
}
.gp-btn-secondary:hover { background: #e0e0e0; }

/* --- Auth prompt --- */
.gp-auth-prompt {
    text-align: center;
    padding: 32px;
    background: #fafafa;
    border: 2px dashed #ddd;
    border-radius: 8px;
}

/* --- Picker overlay --- */
.gp-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gp-picker-modal {
    background: #fff;
    border-radius: 12px;
    padding: 40px 48px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.gp-picker-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #4285f4;
    border-radius: 50%;
    animation: gp-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}
@keyframes gp-spin { to { transform: rotate(360deg); } }

.gp-picker-hint {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* --- Lightbox --- */
.gp-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gp-lb-content {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}
.gp-lb-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}
.gp-lb-caption {
    color: #ccc;
    margin-top: 12px;
    font-size: 0.9em;
}
.gp-lb-close,
.gp-lb-prev,
.gp-lb-next {
    position: absolute;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.4em;
    line-height: 1;
    transition: background 0.2s;
}
.gp-lb-close:hover,
.gp-lb-prev:hover,
.gp-lb-next:hover { background: rgba(255,255,255,0.3); }
.gp-lb-close { top: 20px; right: 20px; }
.gp-lb-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.gp-lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }

/* --- Vide --- */
.gp-empty { color: #999; font-style: italic; padding: 32px 0; }
