/* Photo Gallery styles - inherits the site's classic-cars theme variables */

/* ---- Gallery overview (galeria.php) ---- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    text-align: left;
}

.gallery-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gallery-card a.gallery-card-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-card .cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--beige);
    position: relative;
}

.gallery-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.4s ease;
}

.gallery-card:hover .cover img {
    transform: scale(1.05);
}

.gallery-card .cover.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-warm);
    font-size: 2.5rem;
}

.gallery-card .photo-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(27, 44, 65, 0.85);
    color: #fff;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gallery-card .info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.gallery-card .info h3 {
    color: var(--navy-main);
    font-size: 1.2rem;
    margin: 0;
}

.gallery-card .info .date {
    color: var(--gold-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.gallery-card .info .excerpt {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ---- Year filter (reuses sidebar archive look) ---- */
.gallery-archive-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gallery-archive-links a {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.gallery-archive-links a:hover,
.gallery-archive-links a.active {
    background: var(--navy-main);
    color: #fff;
}

/* ---- Single gallery view (gallery_view.php) ---- */
.gallery-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.gallery-header .meta {
    color: var(--text-secondary);
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.gallery-header .meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-header .meta i {
    color: var(--gold);
}

.gallery-header .description {
    max-width: 720px;
    margin: 1rem auto 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 2rem;
}

.thumb-grid a.thumb {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: var(--beige);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    position: relative;
}

.thumb-grid a.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s ease;
    display: block;
}

.thumb-grid a.thumb:hover img {
    transform: scale(1.08);
}

.thumb-grid a.thumb::after {
    content: "\f00e";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(27, 44, 65, 0);
    opacity: 0;
    transition: all 0.25s ease;
    font-size: 1.5rem;
}

.thumb-grid a.thumb:hover::after {
    background: rgba(27, 44, 65, 0.35);
    opacity: 1;
}

.gallery-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.load-more-wrap {
    text-align: center;
    margin-top: 2rem;
}

#loadMoreBtn {
    background: var(--navy-main);
    color: #fff;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

#loadMoreBtn:hover {
    background: var(--navy-dark);
}

.back-to-galleries {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--navy-main);
    font-weight: 600;
}

.back-to-galleries:hover {
    color: var(--gold);
}

/* ---- Themed GLightbox (navy/gold instead of default black) ---- */
.glightbox-clean .gslide-description { background: var(--navy-dark); }
.glightbox-clean .gslide-title { color: #fff; font-family: 'Open Sans', Arial, sans-serif; }
.glightbox-clean .gslide-desc { color: rgba(255, 255, 255, 0.85); }
.gbtn.gclose, .gnext, .gprev { background-color: rgba(27, 44, 65, 0.7) !important; }
.gbtn.gclose:hover, .gnext:hover, .gprev:hover { background-color: var(--gold) !important; }
.gslide-media .gallery-download {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(27, 44, 65, 0.75);
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}
.gslide-media .gallery-download:hover { background: var(--gold); }

@media (max-width: 1000px) {
    .gallery-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
    .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
}
