@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Roboto:wght@300;400;500;700&display=swap');

/* =========================================
   WTM GALLERY — Root & Variables
   ========================================= */
.wtm-gallery-root {
    --gal-primary:  #01639A;
    --gal-dark:     #004b75;
    --gal-accent:   #009FE3;
    --gal-bg:       #f8f9fa;
    --gal-white:    #ffffff;
    --gal-border:   #e0e0e0;
    --gal-text:     #333333;
    --gal-muted:    #666666;
    --gal-shadow:   0 2px 8px rgba(0,0,0,0.08);
    --gal-shadow-hover: 0 8px 24px rgba(1,99,154,0.18);
    --gal-radius:   8px;
    --gal-gap:      10px;
    font-family: 'Roboto', sans-serif;
    color: var(--gal-text);
    width: 100%;
    box-sizing: border-box;
}

/* =========================================
   Loading
   ========================================= */
.wtm-gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.wtm-gallery-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--gal-border);
    border-top-color: var(--gal-primary);
    border-radius: 50%;
    animation: gal-spin 0.8s linear infinite;
}

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

/* =========================================
   Empty State
   ========================================= */
.wtm-gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gal-muted);
}

.wtm-gallery-empty-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.4;
}

.wtm-gallery-empty p {
    font-size: 1.1em;
}

/* =========================================
   Album Tabs Navigation
   ========================================= */
.wtm-gallery-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--gal-border);
    padding-bottom: 0;
}

.wtm-gallery-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1em;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--gal-muted);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
    white-space: nowrap;
}

.wtm-gallery-tab:hover {
    color: var(--gal-primary);
}

.wtm-gallery-tab.active {
    color: var(--gal-primary);
    border-bottom-color: var(--gal-primary);
}

.wtm-gallery-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gal-border);
    color: var(--gal-muted);
    font-family: 'Roboto', sans-serif;
    font-size: 0.7em;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 7px;
    min-width: 22px;
    transition: background 0.2s, color 0.2s;
}

.wtm-gallery-tab.active .wtm-gallery-tab-count {
    background: var(--gal-primary);
    color: #fff;
}

/* =========================================
   Image Grid — Masonry/Columns Layout (Flat Wall)
   ========================================= */
.wtm-gallery-grid {
    display: grid !important;
    grid-gap: var(--gal-gap, 10px) !important;
    width: 100% !important;
    animation: gal-fade-in 0.4s ease-out;
}

@keyframes gal-fade-in {
    from { opacity: 0 !important; transform: translateY(10px) !important; }
    to   { opacity: 1 !important; transform: translateY(0) !important; }
}

/* =========================================
   Image Item
   ========================================= */
.wtm-gallery-item {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: transparent !important;
    cursor: pointer !important;
    display: block !important;
    width: 100% !important;
    aspect-ratio: 4/3 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: transform 0.3s ease !important;
    animation: gal-item-in 0.3s ease-out both !important;
}

@keyframes gal-item-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Stagger delay for cool entrance animation */
.wtm-gallery-item:nth-child(1)    { animation-delay: 0.01s !important; }
.wtm-gallery-item:nth-child(2)    { animation-delay: 0.03s !important; }
.wtm-gallery-item:nth-child(3)    { animation-delay: 0.05s !important; }
.wtm-gallery-item:nth-child(4)    { animation-delay: 0.07s !important; }
.wtm-gallery-item:nth-child(n+5)  { animation-delay: 0.09s !important; }

.wtm-gallery-item:hover {
    z-index: 5 !important;
}

/* Bild behält seine originalen Proportionen voll bei (Masonry) */
.wtm-gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    border-radius: 0 !important;
}

.wtm-gallery-item:hover img {
    transform: scale(1.08) !important; /* Zooms the image inside the container boundaries */
}

/* Overlay placeholder (wird nur noch vom Skeleton Loader genutzt) */
.wtm-gallery-item::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background: rgba(0,0,0,0) !important;
    opacity: 1 !important;
    transition: background 0.3s ease !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* Kein Overlay-Icon */
.wtm-gallery-item-overlay,
.wtm-gallery-item-overlay-icon {
    display: none !important;
}

/* Skeleton loader */
.wtm-gallery-item.skeleton {
    background: #e0e2e5 !important;
    animation: gal-skeleton 1.4s infinite ease-in-out !important;
    cursor: default !important;
}

.wtm-gallery-item.skeleton img {
    display: none !important;
}

.wtm-gallery-item.skeleton::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.6) 50%,
        transparent 100%) !important;
    animation: gal-shimmer 1.4s infinite !important;
}

@keyframes gal-skeleton {
    0%, 100% { background: #e0e2e5 !important; }
    50%       { background: #eaecef !important; }
}

@keyframes gal-shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* =========================================
   LIGHTBOX
   ========================================= */
.wtm-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.93);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gal-lb-fade 0.2s ease-out;
    overscroll-behavior: contain;
}

@keyframes gal-lb-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.wtm-gallery-lb-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 80px;
    box-sizing: border-box;
}

.wtm-gallery-lb-img-wrap {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gal-lb-img-in 0.2s ease-out;
}

@keyframes gal-lb-img-in {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

.wtm-gallery-lb-img {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: 4px;
    display: block;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    user-select: none;
    -webkit-user-drag: none;
}

/* Close button */
.wtm-gallery-lb-close {
    position: fixed !important;
    top: 16px !important;
    right: 20px !important;
    background: #01639A !important;
    border: none !important;
    color: #fff !important;
    font-size: 1.5em !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.1s !important;
    z-index: 10 !important;
    line-height: 1 !important;
}

.wtm-gallery-lb-close:hover {
    background: #004b75 !important;
    transform: scale(1.05) !important;
}

/* Download button */
.wtm-gallery-lb-download {
    position: fixed !important;
    top: 16px !important;
    right: 74px !important;
    background: #01639A !important;
    border: none !important;
    color: #fff !important;
    font-size: 1.2em !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 0 !important;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.1s !important;
    z-index: 10 !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.wtm-gallery-lb-download:hover {
    background: #004b75 !important;
    transform: scale(1.05) !important;
}

/* Navigation arrows */
.wtm-gallery-lb-prev,
.wtm-gallery-lb-next {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: #01639A !important;
    border: none !important;
    color: #fff !important;
    font-size: 2em !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.15s !important;
    z-index: 10 !important;
}

.wtm-gallery-lb-prev { left: 16px !important; }
.wtm-gallery-lb-next { right: 16px !important; }

.wtm-gallery-lb-prev:hover,
.wtm-gallery-lb-next:hover {
    background: #004b75 !important;
    transform: translateY(-50%) scale(1.05) !important;
}

/* Counter */
.wtm-gallery-lb-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3em;
    letter-spacing: 2px;
    background: rgba(0,0,0,0.6);
    padding: 4px 16px;
    border-radius: 0;
}

/* Caption / Alt text */
.wtm-gallery-lb-caption {
    position: fixed;
    bottom: 55px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.85);
    font-family: 'Roboto', sans-serif;
    font-size: 0.9em;
    background: rgba(0,0,0,0.5);
    padding: 5px 16px;
    border-radius: 0;
    max-width: 80vw;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


@media (min-width: 1024px) {
    .wtm-gallery-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

@media (max-width: 1023px) and (min-width: 768px) {
    .wtm-gallery-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 767px) and (min-width: 481px) {
    .wtm-gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .wtm-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .wtm-gallery-tabs {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 4px !important;
        scrollbar-width: none !important;
    }
    .wtm-gallery-tabs::-webkit-scrollbar { display: none !important; }
    .wtm-gallery-tab {
        flex-shrink: 0 !important;
        padding: 7px 12px !important;
        font-size: 0.95em !important;
    }
    .wtm-gallery-lb-inner {
        padding: 44px 6px 80px !important;
    }
    .wtm-gallery-lb-img {
        max-height: calc(100vh - 130px) !important;
    }
    .wtm-gallery-lb-caption {
        font-size: 0.8em !important;
        max-width: 90vw !important;
    }
    .wtm-gallery-lb-close {
        right: auto !important;
        left: 16px !important;
    }
}
