/* G-Photos Gallery Plugin - Production Styles */

/* --- Grid Layout --- */
.gphotos-grid {
    column-count: 1;
    column-gap: 1rem;
    width: 100%;
}

@media (min-width: 640px) { .gphotos-grid { column-count: 2; } }
@media (min-width: 768px) { .gphotos-grid { column-count: 3; } }
@media (min-width: 1024px) { .gphotos-grid { column-count: 4; } }
@media (min-width: 1280px) { .gphotos-grid { column-count: 5; } }

/* Explicit column overrides via style attribute are handled in JS, 
   but these classes map to standard breakpoints */

.gphotos-item {
    position: relative;
    break-inside: avoid; /* Prevents item from splitting across columns */
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #e5e7eb; /* gray-200 */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gphotos-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.gphotos-item img,
.gphotos-item video {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Hover Overlay for Images */
.gphotos-overlay {
    position: absolute;
    inset: 0;
    background-color: transparent;
    transition: background-color 0.3s ease;
    pointer-events: none;
}

.gphotos-item:hover .gphotos-overlay {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Video specific styling */
.gphotos-item[data-type="video"] {
    background-color: #111827; /* gray-900 */
}

/* --- Loader & Errors --- */
.gphotos-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #6b7280;
}

.gphotos-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6; /* blue-500 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

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

.gphotos-error {
    padding: 1.5rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 0.5rem;
}

/* --- Lightbox --- */
.gphotos-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gphotos-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.gphotos-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gphotos-lightbox-media {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Lightbox Controls */
.gphotos-btn {
    position: absolute;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    border-radius: 50%;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gphotos-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.gphotos-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gphotos-close { top: 1rem; right: 1rem; }
.gphotos-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.gphotos-next { right: 1rem; top: 50%; transform: translateY(-50%); }

.gphotos-counter {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-family: sans-serif;
}

/* Icons (using basic CSS shapes or SVG in JS) */
.gphotos-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}