/* 
   Lohnunternehmen Carrier - Hofgeismar, Nordhessen
   Bildergalerie Stylesheet
   High-performance, modern and beautiful gallery layout
*/

/* --- Gallery Hero / Header --- */
.gallery-hero {
    padding: 8rem 0 4rem 0;
    background: linear-gradient(135deg, rgba(30, 63, 32, 0.95) 0%, rgba(15, 35, 17, 0.98) 100%),
                url('../assets/Profil.webp') center/cover no-repeat;
    color: var(--color-text-light);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--color-accent) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.08;
    pointer-events: none;
}

.gallery-hero .badge {
    background-color: rgba(212, 163, 115, 0.15);
    color: var(--color-accent);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(212, 163, 115, 0.25);
}

.gallery-hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.gallery-hero h1 span {
    color: var(--color-accent);
    font-style: italic;
}

.gallery-hero p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .gallery-hero {
        padding: 7rem 0 3rem 0;
    }
    .gallery-hero h1 {
        font-size: 2.2rem;
    }
    .gallery-hero p {
        font-size: 1rem;
    }
}

/* --- Filtering Tabs --- */
.gallery-filters-container {
    background-color: var(--color-bg-alt);
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: var(--header-height);
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(245, 239, 235, 0.9);
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-filters .filter-btn {
    background-color: var(--color-bg-card);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.gallery-filters .filter-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.gallery-filters .filter-btn.active {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

@media (max-width: 991px) {
    .gallery-filters-container {
        top: 70px; /* Header scrolls to 70px height */
        padding: 1rem 0.5rem;
    }
    .gallery-filters {
        gap: 0.5rem;
    }
    .gallery-filters .filter-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
}

/* --- Gallery Grid --- */
.gallery-section {
    background-color: var(--color-bg-base);
    padding: 4rem 0 6rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
}

/* --- Gallery Card & Hover Effects --- */
.gallery-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4/3;
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(0);
}

.gallery-card.hidden {
    display: none;
}

/* Entrance Animations */
.gallery-card {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover overlay and details */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, 
                                rgba(30, 63, 32, 0.95) 0%, 
                                rgba(30, 63, 32, 0.6) 50%, 
                                transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.gallery-card-content {
    transform: translateY(15px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

.gallery-card-info {
    flex-grow: 1;
    padding-right: 1rem;
}

.gallery-card-category {
    font-size: 0.75rem;
    color: var(--color-accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
    display: block;
}

.gallery-card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--color-text-light);
    font-weight: 700;
    line-height: 1.3;
}

.gallery-zoom-icon {
    width: 44px;
    height: 44px;
    background-color: var(--color-accent);
    color: var(--color-text-main);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.gallery-zoom-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Hover triggers */
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

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

.gallery-card:hover .gallery-overlay {
    opacity: 1;
    pointer-events: auto;
}

.gallery-card:hover .gallery-card-content {
    transform: translateY(0);
}

.gallery-card:hover .gallery-zoom-icon {
    background-color: var(--color-text-light);
    color: var(--color-primary);
    transform: scale(1.05);
}

/* --- Interactive Lightbox --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 30, 16, 0.98); /* Deep slate forest green */
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease-in-out;
}

.lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

/* Lightbox header area (close button) */
.lightbox-header {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    z-index: 2010;
}

.lightbox-close {
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-close svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.lightbox-close:hover {
    background-color: var(--color-accent);
    color: var(--color-text-main);
    border-color: var(--color-accent);
}

.lightbox-close:hover svg {
    transform: rotate(90deg);
}

/* Lightbox main wrapper with navigation */
.lightbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: calc(100vh - 160px);
    padding: 0 2rem;
    position: relative;
}

.lightbox-nav {
    width: 56px;
    height: 56px;
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2010;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.lightbox-nav:hover {
    background-color: var(--color-accent);
    color: var(--color-text-main);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.lightbox-nav:active {
    transform: translateY(0);
}

/* Center Image Container */
.lightbox-content {
    position: relative;
    max-width: 80%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-image.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Spinner while image is loading */
.lightbox-loader {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    animation: lightbox-spin 1s linear infinite;
    display: none;
}

@keyframes lightbox-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lightbox footer details */
.lightbox-footer {
    width: 100%;
    text-align: center;
    padding: 1.5rem 2rem;
    z-index: 2010;
    background: linear-gradient(to top, rgba(15, 30, 16, 1) 0%, rgba(15, 30, 16, 0) 100%);
}

.lightbox-caption-category {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: block;
}

.lightbox-caption-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.lightbox-counter {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* Responsive adjustments for lightbox */
@media (max-width: 991px) {
    .lightbox-wrapper {
        padding: 0 1rem;
    }
    .lightbox-content {
        max-width: 90%;
    }
    .lightbox-nav {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 768px) {
    .lightbox-wrapper {
        padding: 0;
        height: calc(100vh - 180px);
    }
    .lightbox-content {
        max-width: 95%;
    }
    .lightbox-nav {
        position: absolute;
        bottom: -60px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
    }
    .lightbox-nav-prev {
        left: calc(50% - 60px);
    }
    .lightbox-nav-next {
        right: calc(50% - 60px);
    }
    .lightbox-image {
        max-height: 60vh;
    }
    .lightbox-footer {
        padding: 1rem;
        margin-top: 1rem;
    }
    .lightbox-caption-title {
        font-size: 1.15rem;
    }
}
