/* =========================================
   ZMIENNE GLOBALNE (MOTYW URBEX)
========================================= */
:root {
    --bg-image: url('tlo.png');
    --bg-base-color: #111a1e;
    --accent-color: #d97706;
    --accent-hover: #f59e0b;
    --card-bg: rgba(17, 26, 30, 0.85);
    --border-color: rgba(255, 255, 255, 0.12);
    --text-main: #ffffff;
    --text-muted: #999999;
}

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-base-color);
    color: var(--text-main);
    font-family: 'Roboto Condensed', sans-serif;
    overflow-x: hidden; /* Zapobiega poziomemu przewijaniu na mobilkach */
}

/* KONTROLA BRAKU PRZEPEŁNIENIA DLA OBRAZÓW */
img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   GŁÓWNY KONTENER I TŁO
========================================= */
.collage-container {
    width: 100%;
    min-height: 100vh;
    padding: 40px 20px 80px 20px;
    background-image: 
        radial-gradient(
            circle at center, 
            rgba(17, 26, 30, 0.25) 20%, 
            rgba(17, 26, 30, 0.85) 75%, 
            var(--bg-base-color) 100%
        ),
        var(--bg-image);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.9);
}

.center-title {
    text-align: center;
    margin-bottom: 25px;
}

.center-title h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 2.5rem;
    letter-spacing: 2px;
    color: var(--text-main);
    margin: 0;
    text-transform: uppercase;
}

/* =========================================
   PASEK PAGINACJI LAT (WYBÓR SEZONU)
========================================= */
.year-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.year-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 1px;
    touch-action: manipulation;
}

.year-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-main);
}

.year-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}

/* =========================================
   SEKCJE LAT (UKRYWANIE / POKAZYWANIE)
========================================= */
.year-section {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
}

.year-section.active {
    display: block;
}

.year-header {
    max-width: 1400px;
    margin: 0 auto 20px auto;
}

.year-title-group {
    display: flex;
    align-items: baseline;
    gap: 15px;
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 1px;
    color: var(--accent-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    text-transform: uppercase;
}

.year-count-badge {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: 'Roboto Condensed', sans-serif;
}

/* =========================================
   UKŁAD SIATKI (GŁÓWNY LAYOUT DWUKOLUMNOWY)
========================================= */
.year-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================
   LEWA KOLUMNA (STICKY & POLAROID CARD)
========================================= */
.hero-card-container {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 40px);
}

.hero-photo-card {
    background: #ffffff;
    padding: 12px 12px 18px 12px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    color: #111;
    flex-shrink: 0;
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.hero-caption {
    padding: 12px 4px 4px 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-caption strong {
    color: #111;
    font-size: 1.1em;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-caption span {
    color: #666;
    font-size: 0.85rem;
}

.entries-selector-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.selector-title {
    font-family: 'Oswald', sans-serif;
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.entry-list-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 5px;
    max-height: calc(100vh - 350px);
}

.entry-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 15px;
    border-radius: 4px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    touch-action: manipulation;
}

.entry-btn:hover {
    border-color: var(--accent-color);
    background: rgba(217, 119, 6, 0.15);
}

.entry-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.entry-btn-title {
    font-weight: bold;
    font-size: 1em;
}

.entry-btn-date {
    font-size: 0.8em;
    color: var(--text-muted);
}

.entry-btn.active .entry-btn-date {
    color: #f3f4f6;
}

/* =========================================
   PRAWA KOLUMNA (METRYKA I GALERIA)
========================================= */
.entry-details-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Zapewnia brak rozpychania flexboxa/gridu przez dzieci */
}

.entry-header-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 25px;
}

.entry-main-title {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-main);
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
}

.entry-short-desc {
    margin-bottom: 20px;
    color: var(--text-muted);
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
    color: #ccc;
}

.tag-badge.tag-type {
    background: rgba(217, 119, 6, 0.2);
    border-color: var(--accent-color);
    color: var(--accent-color);
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.5px;
}

.entry-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.75em;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-family: 'Oswald', sans-serif;
}

.meta-value {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--accent-color);
}

/* =========================================
   GALERIA I AKORDEONY WIZYT
========================================= */
.gallery-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    min-width: 0;
}

.gallery-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); /* Mniejszy min-width dla smartfonów */
    gap: 8px;
    width: 100%;
}

/* Wymuszanie ukrywania miniaturek powyżej 6 na urządzeniach mobilnych */
.gallery-grid.limited > .gallery-thumb:nth-child(n+7) {
    display: none !important;
}

.gallery-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, border-color 0.2s;
    touch-action: manipulation;
    position: relative;
}

.gallery-thumb:hover {
    transform: scale(1.03);
    border-color: var(--accent-color);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none; /* Kliknięcie idzie bezpośrednio do div.gallery-thumb */
}

.load-more-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1rem;
    transition: background 0.3s, border-color 0.3s;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    touch-action: manipulation;
}

.load-more-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #fff;
}

/* Akordeony wizyt */
.visit-accordion {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.visit-accordion summary {
    padding: 12px 15px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.2s;
    touch-action: manipulation;
}

.visit-accordion summary:hover {
    background: rgba(217, 119, 6, 0.15);
}

.visit-content {
    padding: 15px;
    min-width: 0;
}

/* =========================================
   LIGHTBOX (PODGLĄD ZDJĘĆ)
========================================= */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    user-select: none;
    pointer-events: none; /* Zapobiega przypadkowym blokadom ekranu gdy ukryty */
}

.lightbox.active {
    display: flex;
    pointer-events: auto;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 15px; right: 20px;
    color: #fff; font-size: 40px; cursor: pointer;
    z-index: 10000;
    background: none;
    border: none;
    padding: 10px;
    touch-action: manipulation;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 24px;
    padding: 12px 18px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 10000;
    touch-action: manipulation;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.4);
}

.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

/* =========================================
   RESPONSYWNOŚĆ (MEDIA QUERIES)
========================================= */
@media (min-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 900px) {
    .collage-container {
        padding: 10px 5px 30px 5px;
    }

    /* Wymuszenie 2 kolumn obok siebie na telefonie */
    .year-grid {
        display: grid;
        grid-template-columns: 125px 1fr; /* 125px na lewe menu, reszta szerokości na treść */
        gap: 8px;
    }

    /* Ukrycie wyróżnionego obrazka */
    .hero-photo-card {
        display: none;
    }

    /* Sticky dla lewego menu na telefonie */
    .hero-card-container {
        position: sticky;
        top: 10px;
        max-height: calc(100vh - 20px);
    }

    .entries-selector-box {
        padding: 8px;
    }

    .selector-title {
        font-size: 0.85rem;
        margin-bottom: 8px;
        padding-bottom: 5px;
    }

    /* Dopasowanie przycisków w wąskiej kolumnie */
    .entry-list-buttons {
        max-height: calc(100vh - 80px);
        gap: 5px;
        padding-right: 2px;
    }

    .entry-btn {
        padding: 6px;
        word-wrap: break-word;
        hyphens: auto;
    }

    .entry-btn-title {
        font-size: 0.75rem;
        line-height: 1.1;
    }

    .entry-btn-date {
        font-size: 0.65rem;
    }

    /* Zmniejszenie dopełnień po prawej stronie dla oszczędności miejsca */
    .entry-header-box,
    .gallery-section {
        padding: 10px;
    }

    .entry-main-title {
        font-size: 1.2rem;
    }

    .entry-meta-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 8px;
    }

    /* Więcej mniejszych miniaturek w rzędzie na małym ekranie */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .lightbox-nav {
        padding: 8px 12px;
        font-size: 18px;
    }
}

/* Fix for phones in landscape and very short desktop windows:
   Since the screen is too short for a 500px menu + photo to fit on-screen simultaneously,
   we disable the sticky behavior. This allows the menu to be large (500px) and the photo 
   to remain visible, while completely eliminating the need for a second container scrollbar. 
   You just scroll the page naturally to see the bottom of the left column. */
@media (max-height: 500px) and (min-width: 901px) {
    .hero-card-container {
        position: relative; /* Disables sticky */
        top: 0;
        max-height: none; /* Allows it to be taller than the screen */
    }
    .entry-list-buttons {
        max-height: 500px !important;
    }
}

/* =========================================
   STOPKA I STATYSTYKI URBEX
========================================= */
.urbex-footer {
    width: 100%;
    max-width: 1400px; /* Zrównanie szerokości z główną siatką strony */
    margin: 40px auto 0 auto;
    padding: 20px;
    background: var(--card-bg); /* Tło spójne z resztą paneli */
    border: 1px solid var(--border-color); /* Standardowa ramka motywu */
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.footer-stats-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-family: 'Roboto Condensed', sans-serif;
    color: var(--text-main);
}

/* Wzmocnienie wyglądu poszczególnych kafli statystyk wewnątrz stopki */
.footer-stats-container .stat-item,
.footer-stats-container > div {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Etykiety i wartości statystyk z wykorzystaniem akcentu motywu */
.footer-stats-container .stat-label {
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.footer-stats-container .stat-value,
.footer-stats-container strong {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    color: var(--accent-color); /* Pomarańczowy akcent */
}


/* Pasek z zachętą – widoczny TYLKO w pionie na telefonach */
.landscape-prompt {
    display: none; /* Domyślnie ukryty na komputerach i w poziomie */
}

/* =========================================
   PŁYWAJĄCY KOMUNIKAT O OBROCIE EKRANU
========================================= */
.landscape-prompt {
    display: none; /* Domyślnie ukryty na komputerach i w poziomie */
}

@media (max-width: 900px) and (orientation: portrait) {
    .landscape-prompt {
        display: flex;
        align-items: center;
        justify-content: space-between;
        
        /* Pozycjonowanie pływające (przymocowane do dołu ekranu) */
        position: fixed;
        bottom: 15px;
        left: 15px;
        right: 15px;
        z-index: 8888; /* Widoczny nad całą treścią strony (poniżej lightboxa) */

        background: rgba(217, 119, 6, 0.95); /* Akcent URBEX z lekką przezroczystością */
        color: #ffffff;
        padding: 12px 16px;
        border-radius: 8px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.2);
        
        font-family: 'Oswald', sans-serif;
        font-size: 0.95rem;
        letter-spacing: 0.5px;
        backdrop-filter: blur(4px); /* Efekt rozmycia tła pod spodem */
    }

    .landscape-prompt span {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .landscape-prompt button {
        background: rgba(0, 0, 0, 0.2);
        border: none;
        color: #ffffff;
        font-size: 1.1rem;
        font-weight: bold;
        cursor: pointer;
        padding: 4px 10px;
        border-radius: 4px;
        margin-left: 10px;
        line-height: 1;
        transition: background 0.2s;
    }

    .landscape-prompt button:active {
        background: rgba(0, 0, 0, 0.4);
    }
}