/* --- IMPORT CZCIONEK --- */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=Oswald:wght@400;700&display=swap');

/* --- ZMIENNE I RESET --- */
:root {
    --primary-color: #91de61;
    --dark-bg: #1a1a1a;
    --glass-bg: rgba(20, 30, 20, 0.85);
    --text-color: #f0f0f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    /* Zmieniamy gradient i tło na bardziej stabilne */
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('images/tlo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Na telefonach 'fixed' często psuje widok, lepiej dać 'scroll' lub usunąć fixed */
    background-attachment: scroll; 
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Przywracamy fixed tylko dla komputerów, gdzie działa dobrze */
@media screen and (min-width: 1025px) {
    body {
        background-attachment: fixed;
    }
}

/* --- NAWIGACJA --- */
nav {
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 80px;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 2px solid var(--primary-color);
}

.logo { height: 60px; width: auto; }
.navLinks { display: flex; gap: 10px; }

.navMenu {
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    padding: 10px 15px;
    border-radius: 4px;
    transition: 0.3s;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
}

.navMenu:hover, .navMenu.active {
    background-color: var(--primary-color);
    color: #000;
}

.burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.burger span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: white;
    transition: 0.3s;
}

/* --- SLAJDER --- */
.slider {
    position: relative;
    width: 100%;
    max-width: 1400px;
    height: 60vh;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.slide { width: 100%; height: 100%; object-fit: cover; display: none; animation: fade 1.5s; }
.displaySlide { display: block; }

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 18px;
    transition: 0.3s;
    z-index: 10;
}
.prev { left: 0; }
.next { right: 0; }

@keyframes fade { from {opacity: .4} to {opacity: 1} }

/* --- TREŚĆ GŁÓWNA --- */
main {
    flex: 1;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 40px 20px;
}

.content-box {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    padding: 30px;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
    margin-bottom: 20px;
    color: #e0e0e0;
}

h1, h2, h3 { font-family: 'Oswald', sans-serif; color: var(--primary-color); margin-bottom: 15px; text-transform: uppercase; }
p { margin-bottom: 15px; text-align: justify; }

/* --- UKŁAD HISTORII I KONTAKTU --- */
.history-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

.history-text {
    max-height: 85vh;
    overflow-y: auto;
    padding-right: 15px;
}

.scroll-gallery {
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

.scroll-gallery img {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    display: block;
}

/* --- TABELA CEN --- */
.pricing-table {
    width: 100%;
    max-width: 850px;
    margin: 20px 0;
    border-collapse: collapse;
    background-color: rgba(255, 255, 255, 0.02);
}

.pricing-table td {
    padding: 15px 30px;
    border-bottom: 2px solid rgba(145, 222, 97, 0.2);
    font-size: 1.1rem;
}

.pricing-table td:last-child {
    text-align: right;
    color: var(--primary-color);
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    min-width: 120px;
}

.pricing-table tr:hover { background-color: rgba(145, 222, 97, 0.05); }

/* --- ELEMENTY DODATKOWE --- */
ul { list-style-position: inside; padding-left: 20px; margin-bottom: 15px; }
ul li { margin-bottom: 5px; text-align: justify; }
iframe { width: 100%; border: 0; border-radius: 4px; }

footer {
    background-color: #111;
    color: #777;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    font-size: 0.9rem;
}

/* --- SCROLLBAR STYLE --- */
.history-text::-webkit-scrollbar, .scroll-gallery::-webkit-scrollbar { width: 6px; }
.history-text::-webkit-scrollbar-thumb, .scroll-gallery::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* --- RESPONSYWNOŚĆ (TABLETY I MNIEJSZE) --- */
@media screen and (max-width: 1024px) {
    .history-layout {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: left;
        gap: 40px;
    }

    .history-text, .scroll-gallery {
        max-height: 500px;
        width: 100%;
        padding-right: 5px;
    }

    /* Centrowanie FB na tabletach */
    .history-layout > div:last-child {
        width: 100%;
        text-align: center;
    }

    .history-layout iframe {
        display: inline-block;
        max-width: 340px; /* Szerokość zgodna z parametrem widgetu */
    }

    .pricing-table { margin: 20px auto; }
}

/* --- RESPONSYWNOŚĆ (TELEFONY) --- */
@media screen and (max-width: 768px) {
    /* Menu Burger */
    .burger { display: flex; }
    .navLinks {
        position: absolute;
        top: 80px; left: 0; width: 100%;
        background-color: rgba(20, 20, 20, 0.98);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        transform: translateY(-150%);
        transition: transform 0.4s ease;
        z-index: 999;
    }
    .navLinks.active { transform: translateY(0); }
    
    .burger.toggle span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .burger.toggle span:nth-child(2) { opacity: 0; }
    .burger.toggle span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    /* Slajder na telefonie */
    /* .slider { height: 35vh; }
    .prev, .next {
        padding: 10px 15px;
        font-size: 20px;
        background-color: rgba(0,0,0,0.6);
    }
    .prev { left: 5px; }
    .next { right: 5px; }  */

    /* SLAJDER - POPRAWIONY */
    /* --- SLAJDER NA TELEFONIE - FIX PROPORCJI I STRZAŁEK --- */

    .slider {
        height: 25vh !important; /* Było 35vh, zmniejszamy, żeby pasowało do zdjęcia */
        position: relative !important;
        overflow: hidden !important;
        background-color: #000 !important;
    }

    .slides {
        height: 100% !important;
    }

    .slide {
        width: 100% !important;
        height: 100% !important;
        /* 'cover' sprawi, że zdjęcie wypełni to mniejsze pudełko idealnie */
        object-fit: cover !important; 
        object-position: center !important;
        display: none; /* JS to zmieni na block */
    }
    
    /* Poprawka dla JS, żeby nie psuł wyświetlania */
    .slide.displaySlide {
        display: block !important;
    }

    /* 2. Strzałki przesuwamy nieco wyżej (40% zamiast 50%) */
    .prev, .next {
        position: absolute !important;
        top: 40% !important; /* Przesunięte w górę, żeby na pewno były na zdjęciu */
        transform: translateY(-50%) !important;
        
        z-index: 100 !important;
        background-color: rgba(0, 0, 0, 0.6) !important;
        padding: 12px 15px !important;
        border: none !important;
        color: white !important;
        cursor: pointer !important;
    }

    .prev { left: 0 !important; }
    .next { right: 0 !important; }
}
    /* Historia i Kontakt na telefonie */
    .history-text, .scroll-gallery {
        overflow-y: auto;
        max-height: 450px;
    }
    
    /* .history-layout p { text-align: center; } */



/* --- PRECYZYJNA POPRAWKA TYLKO DLA STRONY KONTAKT (indexk.html) --- */

@media screen and (min-width: 1025px) {
    /* Używamy selektora :has(iframe), aby zmiany dotyczyły TYLKO strony z Facebookiem */
    .content-box.history-layout:has(iframe) {
        display: flex !important;
        /* Trzy równe odstępy: [lewa-tekst], [tekst-FB], [FB-prawa] */
        justify-content: space-evenly !important; 
        align-items: center !important;
        /* Idealna symetria góra/dół */
        padding: 80px 0 !important; 
        grid-template-columns: none !important; /* Wyłączamy siatkę, by flex działał poprawnie */
    }

    .content-box.history-layout:has(iframe) > div {
        flex: 0 1 auto !important;
        margin: 0 !important;
        padding: 0 !important; /* Kasujemy stare paddingi, które psuły środek */
    }

    /* Ograniczamy szerokość tekstu tylko w kontakcie, żeby nie "rozpychał" przerw */
    .content-box.history-layout:has(iframe) div:first-child {
        max-width: 400px;
    }
}

/* --- PRZYWRÓCENIE ORYGINALNEGO WYGLĄDU HISTORII (indexhm.html) --- */
/* --- POPRAWKA HISTORII NA KOMPUTERY (indexhm.html) --- */
@media screen and (min-width: 1025px) {
    /* Upewniamy się, że tam gdzie nie ma iframe (historia), układ jest duży */
    .content-box.history-layout:not(:has(iframe)) {
        display: grid !important;
        grid-template-columns: 1.1fr 1fr !important;
        gap: 40px !important;
        padding: 40px !important;
        
        /* Box zajmie minimum 80% wysokości okna */
        min-height: 80vh !important; 
        
        /* KLUCZOWA ZMIANA: To rozciąga kolumny z tekstem i zdjęciami do samego dołu czarnego boxa */
        align-items: stretch !important; 
    }

    /* Teraz zmuszamy środek, żeby wykorzystał całe to miejsce */
    .content-box.history-layout:not(:has(iframe)) .history-text,
    .content-box.history-layout:not(:has(iframe)) .scroll-gallery {
        height: 100% !important; /* Wypełnij wysokość rodzica */
        max-height: 78vh !important; /* Scrollujemy tylko jeśli treść wyjdzie poza te 80% ekranu */
    }
}


/* --- WYRÓWNANIE TEKSTU W HISTORII (DLA WSZYSTKICH EKRANÓW) --- */

/* Wszystkie akapity wewnątrz historii muzeum do lewej */
.history-text p {
    text-align: left !important;
}

/* Wyjątek: ostatni akapit (podziękowania) zawsze na środku */
.history-text p:last-child {
    text-align: center !important;
    font-weight: bold; /* Opcjonalnie: pogrubienie, żeby podziękowania się wyróżniały */
    margin-top: 25px;   /* Większy odstęp przed podziękowaniami */
}

/* --- OSTATECZNE WYRÓWNANIE TEKSTU --- */

/* 1. Wymuszamy lewą stronę dla wszystkich akapitów w historii na każdym urządzeniu */
.history-text p {
    text-align: left !important;
}
