@font-face {
    font-family: 'Tektur';
    src: url('fonts/Tektur-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   1. RESET I PODSTAWY
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

body {
    font-family: 'Tenor Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: #ffffff;
    color: #000;
    -webkit-user-select: none;
    user-select: none;
}

header {
    padding: 35px 0 10px 0; /* POPRAWKA: Minimalne marginesy */
    text-align: center;
}

.logo {
    font-size: 1.8rem;
    letter-spacing: 8px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.logo a {
    text-decoration: none;
    color: #000;
}

/* ==========================================================================
   2. NAWIGACJA (GÓRA I DÓŁ)
   ========================================================================== */
.header-links, .footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
    margin: 12px 0 8px 0; /* Zacieśniona nawigacja */
    padding: 0;
}

.header-links a, .footer-links a {
    text-decoration: none;
    color: #555;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: color 0.3s ease;
}

.header-links a:hover, .footer-links a:hover {
    color: #000;
}

.ig-icon svg {
    display: block;
    color: #555;
}

/* ==========================================================================
   3. WYSZUKIWARKA
   ========================================================================== */
.search-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 5px auto 5px auto; 
    padding: 0 20px;
    position: relative;
}

.arnold-search {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #ccc;
    color: #000;
    font-family: 'Tenor Sans', sans-serif; 
    font-size: 0.75rem; 
    text-align: center;
    padding: 8px 0;
    letter-spacing: 2px;
    outline: none;
    text-transform: uppercase; 
}

.arnold-search:focus {
    border-bottom-color: #000;
}

.arnold-search::placeholder {
    color: #aaa;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 20px;
    right: 20px;
    background-color: #fff;
    list-style: none;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.suggestions-list li {
    padding: 12px 15px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    transition: background-color 0.2s, color 0.2s;
}

/* DODANE: CZARNE PODŚWIETLENIE PODPOWIEDZI WYSZUKIWARKI */
.suggestions-list li:hover {
    background-color: #000;
    color: #fff;
}

/* ==========================================================================
   4. GALERIA (Z POPRAWKĄ UKRYWANIA DLA WYSZUKIWARKI)
   ========================================================================== */
.gallery-section {
    width: 92%; 
    max-width: 1700px;
    margin: 5px auto 40px auto; 
}

.gallery-grid {
    column-count: 5;
    column-gap: 15px;
}

.photo-card {
    display: inline-block; 
    width: 100%;
    margin-bottom: 15px;
    break-inside: avoid;
    overflow: hidden;
}

/* KLUCZOWA LINIA DLA HIGHLIGHTÓW/WYSZUKIWARKI */
.photo-card.hidden { 
    display: none !important; 
}

.photo-card img {
    width: 100%;
    height: auto; 
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease; 
}

.photo-card:hover img { transform: scale(1.03); }

/* ==========================================================================
   5. STOPKA & LICZNIK
   ========================================================================== */
footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0 30px 0;
}

.pentax-counter {
    margin-bottom: 30px; 
}

.counter-frame {
    width: 30px; height: 20px;
    background-color: #000;
    border: 1.5px solid #888; 
    border-radius: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#frame-count {
    font-family: 'Courier New', monospace;
    color: #fff;
    font-size: 0.8rem;
}

.footer-name {
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ==========================================================================
   6. STRZAŁKA BACK TO TOP (DESKTOP)
   ========================================================================== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    background: transparent;
    border: none;
    display: none;
    z-index: 1000;
    opacity: 0.3;
    transition: all 0.3s;
}

#back-to-top:hover { opacity: 1; }

#back-to-top:after {
    content: '';
    width: 12px; height: 12px;
    border-top: 1.5px solid #000;
    border-right: 1.5px solid #000;
    display: block;
    transform: rotate(-45deg);
    margin: 20px auto 0 auto;
}

/* ==========================================================================
   7. LIGHTBOX (DESKTOP)
   ========================================================================== */
.lightbox {
    display: none; 
    position: fixed;
    z-index: 999999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: #ffffff; 
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.lightbox.active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.nav-arrow, .close {
    position: fixed;
    cursor: pointer;
    opacity: 0.3;
    background: transparent;
    border: none;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:hover, .close:hover { opacity: 1; }

.nav-arrow:after {
    content: '';
    width: 14px; height: 14px;
    border-top: 1.5px solid #000;
    border-right: 1.5px solid #000;
    display: block;
}

.prev { left: 20px; top: 50%; transform: translateY(-50%); width: 70px; height: 70px; }
.prev:after { transform: rotate(-135deg); margin-left: 6px; }

.next { right: 20px; top: 50%; transform: translateY(-50%); width: 70px; height: 70px; }
.next:after { transform: rotate(45deg); margin-right: 6px; }

.close { top: 30px; right: 30px; width: 55px; height: 55px; }
.close:before, .close:after { content: ''; position: absolute; width: 22px; height: 1.5px; background-color: #000; }
.close:before { transform: rotate(45deg); }
.close:after { transform: rotate(-45deg); }

/* ==========================================================================
   8. RESPONSIVE (TABLET I MOBILE) - POPRAWKI STRZAŁKI
   ========================================================================== */
@media (max-width: 1100px) {
    .gallery-grid { column-count: 3; }

    /* PRZESUNIĘCIE I ZMNIEJSZENIE STRZAŁKI DLA TABLETU I MOBILE */
    #back-to-top {
        bottom: 20px !important;
        right: 2px !important; /* Maksymalnie do krawędzi */
        width: 30px !important; /* Jeszcze mniejsza */
        height: 30px !important;
        opacity: 0.15 !important; /* Minimalnie bardziej czarna */
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #back-to-top:after {
        width: 8px !important;
        height: 8px !important;
        border-top-width: 1px !important; /* Cieńsza linia dla minimalizmu */
        border-right-width: 1px !important;
        margin: 0 !important; /* Wyśrodkowanie mniejszej strzałki */
    }
}

@media (max-width: 768px) {
    .header-links, .footer-links { gap: 20px; }
    .gallery-grid { column-count: 2; column-gap: 10px; }

    .lightbox { flex-direction: column; }
    .lightbox-content {
        max-width: 95vw;
        max-height: 72vh; 
        margin-top: -35px; /* Podniesienie zdjęcia wyżej */
    }
    .close { top: 15px; right: 15px; width: 40px; height: 40px; }
    .nav-arrow { position: absolute; bottom: 25px; top: auto; transform: none; width: 60px; height: 60px; opacity: 0.6; }
    .prev { left: 25%; }
    .next { right: 25%; }
}

/* ==========================================================================
   9. LANDSCAPE (POZIOM) - CAŁKOWITY RE-UKŁAD DLA DUŻYCH ZDJĘĆ BEZ KOLIZJI
   ========================================================================== */
@media (max-width: 950px) and (orientation: landscape) {
    
    /* 1. Mniejszy header, żeby nie zabierał miejsca w poziomie */
    header { padding: 10px 0 5px 0 !important; }
    .logo { font-size: 1.2rem !important; margin-bottom: 5px !important; letter-spacing: 4px !important; }
    .header-links { margin: 5px 0 !important; gap: 25px !important; }

    /* 2. Galeria: Gęściej w poziomie */
    .gallery-grid { column-count: 4 !important; column-gap: 8px !important; }
    .photo-card { margin-bottom: 8px !important; }

    /* 3. LIGHTBOX POZIOMY: CAŁKOWITY REMONT UKŁADU */
    .lightbox { 
        justify-content: flex-start !important; /* Zaczynamy od góry */
        align-items: center !important; 
        padding-top: 10vh !important; /* Dajemy luźne miejsce na X */
        flex-direction: column !important; /* Pionowy Flexbox pod obraz */
    }
    
    .lightbox-content {
        max-width: 98vw !important;
        
        /* Drastycznie ograniczona wysokość, by strzałki miały miejsce na dole */
        max-height: 55vh !important; 
        
        object-fit: contain !important;
        margin-top: 0 !important; 
        margin-bottom: 10px !important; /* Przerwa bezpieczeństwa */
    }

    /* Iks (X) mniejszy i subtelniejszy w rogu */
    .close { top: 10px !important; right: 10px !important; width: 35px !important; height: 35px !important; }

    /* Strzałki wylecą pod obraz obok siebie (position:static), żeby nie było kolizji */
    .nav-arrow { 
        position: static !important; /* Wyłączamy fixed z boku */
        top: auto !important;
        transform: none !important;
        width: 50px !important; /* Subtelniejsze dotykowe */
        height: 50px !important;
        opacity: 0.8 !important; /* Większa widoczność, bo są pod klatką */
        margin: 5px !important; /* Odstęp między strzałkami */
    }
    
    /* Układamy je pod zdjęciem za pomocą flex boxa .lightbox */
    .prev { order: 2; margin-top: -10px !important; }
    .next { order: 3; margin-top: -10px !important; }
    .lightbox-content { order: 1; }
}
