/* ============================================================
   Google Drive Gallery — Frontend Styles
   ============================================================ */

.gdg-gallery {
    display: grid;
    gap: 12px;
    margin: 1.5em 0;
}

/* Column variants */
.gdg-cols-1 { grid-template-columns: 1fr; }
.gdg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.gdg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.gdg-cols-4 { grid-template-columns: repeat(4, 1fr); }
.gdg-cols-5 { grid-template-columns: repeat(5, 1fr); }
.gdg-cols-6 { grid-template-columns: repeat(6, 1fr); }

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

@media (max-width: 480px) {
    .gdg-gallery { grid-template-columns: 1fr !important; }
}

/* Item */
.gdg-item {
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: transform .2s ease, box-shadow .2s ease;
}

.gdg-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.gdg-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Image wrapper */
.gdg-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #e8e8e8;
}

.gdg-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.gdg-item:hover .gdg-img-wrap img {
    transform: scale(1.06);
}

/* Overlay */
.gdg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s ease;
}

.gdg-item:hover .gdg-overlay {
    opacity: 1;
}

.gdg-zoom {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}

/* Caption */
.gdg-item figcaption {
    padding: 8px 10px;
    font-size: .82em;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
}

/* Error / empty */
.gdg-error,
.gdg-empty {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: .95em;
}

.gdg-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.gdg-empty {
    background: #f8f9fa;
    border: 1px dashed #ccc;
    color: #666;
}

/* ============================================================
   Lightbox Modal
   ============================================================ */

.gdg-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.92);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: gdgFadeIn .2s ease;
}

.gdg-modal.gdg-open {
    display: flex;
}

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

.gdg-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gdg-modal-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 60px rgba(0,0,0,.6);
    display: block;
}

.gdg-modal-caption {
    color: rgba(255,255,255,.8);
    font-size: .9em;
    margin: 10px 0 0;
    text-align: center;
}

/* Close button */
.gdg-modal-close {
    position: fixed;
    top: 16px;
    right: 20px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: background .15s;
    z-index: 100001;
}

.gdg-modal-close:hover { background: rgba(255,255,255,.25); }

/* Prev / Next */
.gdg-modal-prev,
.gdg-modal-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    transition: background .15s;
    z-index: 100001;
}

.gdg-modal-prev { left: 16px; }
.gdg-modal-next { right: 16px; }

.gdg-modal-prev:hover,
.gdg-modal-next:hover { background: rgba(255,255,255,.25); }

/* Loader / Spinner */
.gdg-modal-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gdg-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255,255,255,.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gdgSpin .8s linear infinite;
}

@keyframes gdgSpin {
    to { transform: rotate(360deg); }
}
