/* ================================================
   321SPEED – ODTAH GALLERY CSS
   Append to styles/odtah.css
   ================================================ */

/* ── Gallery section ── */
.odtah-rides {
    padding: 80px 0 90px;
    background: #0a0a0a;
}

.odtah-rides-head {
    text-align: center;
    margin-bottom: 52px;
}

.odtah-rides-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.odtah-rides-title span { color: var(--primary-color); }

.odtah-rides-sub {
    color: var(--text-gray);
    font-size: 0.9rem;
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Grid ── */
.odtah-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Grid item ── */
.odtah-gallery-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: #161616;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    aspect-ratio: 16 / 9;

    /* Scroll reveal start state */
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease,
        border-color 0.25s;
}

.odtah-gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Wide accent items */
.odtah-gallery-item--wide {
    grid-column: span 2;
}

.odtah-gallery-item:hover {
    border-color: rgba(255,45,45,0.4);
}

/* ── Photo inside item ── */
.odtah-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(.4,0,.2,1), opacity 0.3s;
    opacity: 0;
}

.odtah-gallery-img.loaded {
    opacity: 1;
}

.odtah-gallery-item:hover .odtah-gallery-img {
    transform: scale(1.06);
}

/* ── Hover overlay ── */
.odtah-gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.7) 0%,
        rgba(0,0,0,0) 50%
    );
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 12px 14px;
    opacity: 0;
    transition: opacity 0.25s;
}

.odtah-gallery-item:hover .odtah-gallery-overlay {
    opacity: 1;
}

.odtah-gallery-overlay-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    backdrop-filter: blur(4px);
}

.odtah-gallery-overlay-num {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.5);
}

/* ── Red top border on hover ── */
.odtah-gallery-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 2;
}

.odtah-gallery-item:hover::before {
    transform: scaleX(1);
}

/* ── Lightbox ── */
.odtah-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.97);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

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

.odtah-lb-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: calc(100vw - 160px);
}

.odtah-lb-img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.8);
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity 0.12s ease;
}

.odtah-lb-img.odtah-lb-fade {
    opacity: 0;
}

.odtah-lb-close {
    position: absolute;
    top: 22px;
    right: 26px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

.odtah-lb-close:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.odtah-lb-arrow {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    padding: 16px 12px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.odtah-lb-arrow:hover {
    background: rgba(255,45,45,0.15);
    border-color: var(--primary-color);
    color: #fff;
}

.odtah-lb-counter {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.28);
    letter-spacing: 2px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .odtah-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .odtah-gallery-item--wide {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .odtah-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0 14px;
    }
    /* Na malých tabletech wide funguje normálně (2 ze 2 = full width) */
    .odtah-gallery-item--wide {
        grid-column: span 2;
    }
    .odtah-lb-content {
        max-width: calc(100vw - 100px);
    }
    .odtah-lb-arrow {
        padding: 12px 8px;
    }
}

@media (max-width: 560px) {
    .odtah-gallery-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .odtah-gallery-item--wide {
        grid-column: span 1;
    }
}

@media (max-width: 480px) {
    .odtah-gallery-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0 14px;
    }
    /* Zrušit wide variantu na mobilu */
    .odtah-gallery-item--wide {
        grid-column: span 1;
    }
    .odtah-lightbox {
        gap: 8px;
        padding: 12px;
    }
    .odtah-lb-content {
        max-width: calc(100vw - 80px);
    }
    .odtah-lb-close {
        top: 12px;
        right: 12px;
    }
}