/* ===== Container ===== */
.gfa-container {
    --gfa-primary: #2563eb;
    --gfa-primary-hover: #1d4ed8;
    --gfa-bg: #ffffff;
    --gfa-text: #1e293b;
    --gfa-border: #e2e8f0;
    --gfa-radius: 8px;
    --gfa-gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: inherit;
    color: var(--gfa-text);
}
/* ===== Tabs ===== */
.gfa-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--gfa-border);
}
.gfa-tab {
    padding: 10px 22px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--gfa-radius) var(--gfa-radius) 0 0;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.gfa-tab:hover {
    color: var(--gfa-primary);
    background: #f1f5f9;
}
.gfa-tab-active {
    color: var(--gfa-primary);
    border-bottom-color: var(--gfa-primary);
}
/* ===== Panels ===== */
.gfa-panel {
    display: none;
    animation: gfa-fade-in 0.3s ease;
}
.gfa-panel-active {
    display: block;
}
@keyframes gfa-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* ===== Grid ===== */
.gfa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--gfa-gap);
}

/* --- FIX v1.2: enquadramento de fotos horizontais --- */
/* Alterado aspect-ratio de 1/1 para 4/3 (landscape) e
   garantido object-fit: cover com !important + display:block
   para prevenir override do tema e gaps visuais. */
.gfa-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--gfa-radius);
    aspect-ratio: 4 / 3;
    background: #1e293b;
    cursor: pointer;
}
.gfa-thumb {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    transition: transform 0.3s ease;
}
/* --- FIM FIX --- */

.gfa-item:hover .gfa-thumb {
    transform: scale(1.08);
}
/* ===== Load More ===== */
.gfa-load-more-wrap {
    text-align: center;
    padding: 28px 0 8px;
}
.gfa-load-more {
    padding: 12px 36px;
    background: var(--gfa-primary);
    color: #fff;
    border: none;
    border-radius: var(--gfa-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}
.gfa-load-more:hover {
    background: var(--gfa-primary-hover);
}
.gfa-load-more:disabled {
    opacity: 0.5;
    cursor: wait;
}
.gfa-load-more::after {
    content: '...';
    display: none;
}
.gfa-load-more:disabled::after {
    display: inline;
}
/* ===== Empty State ===== */
.gfa-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 15px;
}
/* ===== Lightbox ===== */
.gfa-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: gfa-fade-in 0.25s ease;
}
.gfa-lightbox-open {
    display: flex;
}
.gfa-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.gfa-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    z-index: 100001;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.gfa-lightbox-close:hover {
    opacity: 1;
}
.gfa-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    z-index: 100001;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0 16px;
}
.gfa-lightbox-nav:hover {
    opacity: 1;
}
.gfa-lightbox-prev { left: 0; }
.gfa-lightbox-next { right: 0; }
.gfa-lightbox-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    padding: 16px;
    font-size: 14px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    z-index: 100000;
}
.gfa-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 24px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    z-index: 100001;
}
.gfa-lightbox-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gfa-spin 0.8s linear infinite;
    position: absolute;
}
@keyframes gfa-spin {
    to { transform: rotate(360deg); }
}
/* ===== Responsive ===== */
@media (max-width: 768px) {
    .gfa-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
    .gfa-tab {
        padding: 8px 16px;
        font-size: 14px;
    }
    .gfa-lightbox-nav {
        font-size: 36px;
    }
}