/* LAYOUT: Struktura, tło, nawigacja, logo */

body {
    background: url('../img/bg.jpg') center center/cover no-repeat;
    font-family: Verdana;
    margin: 0px;
    padding-top: 56px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #222;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar li {
    margin: 0 20px;
}

/* Overlay (nakładka przyciemniająca) */
.navbar::before {
    content: "";
    position: fixed; 
    top: 0; 
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.0); 
    z-index: 999; 
    pointer-events: none; 
    transition: background-color 0.4s ease-in-out;
}

/* Aktywacja przyciemnienia po otwarciu menu */
.navbar.open::before {
    background: rgba(0, 0, 0, 0.75); 
    pointer-events: auto; 
}

.logo-pinned {
    position: fixed;
    top: 40px;
    right: 32px;
    width: 250px;
    height: auto;
    z-index: 1100;
    border-radius: 12px;
    padding: 8px;
}

section h1 {
    font-size: 2.2em;
    font-weight: 700;
    color: #B5CCFF;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-align: center;
}

section p {
    font-size: 1.15em;
    margin-bottom: 24px;
    text-align: center;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* HAMBURGER ICON STYLES */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    padding: 15px;
    z-index: 1001;
    
    position: absolute;
    left: 20px; 
    top: 0;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background: #B5CCFF; 
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Animacja przekształcenia w 'X' */
.hamburger-btn.open span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}


/* ========================================= */
/* MEDIA QUERY: OPTYMALIZACJA MOBILNA (max-width: 768px) */
/* ========================================= */
@media (max-width: 768px) {
    section {
    padding-left: 20px;
    padding-right: 20px;
}
    .hamburger-btn {
        display: flex; 
    }
    
    body {
        padding-top: 56px; 
    }

    /* Ukrycie i pozycjonowanie mobilnego menu (ul) */
    .navbar ul {
        display: none; 
        flex-direction: column;
        
        /* Pozycja i margines 20px z obu stron */
        width: auto; 
        left: 20px; 
        right: 20px; 
        margin: 0; 
        
        position: absolute;
        top: 66px; 
        
        /* KLUCZOWA ZMIANA 1: Solidne tło i zaokrąglenie WRACA NA UL */
        background: transparent; 
        border-radius: 10px; /* Zaokrąglenie całego panelu */
        
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.4s ease-out, max-height 0.4s ease-out;
        
        /* KLUCZOWA ZMIANA 2: Padding wewnętrzny do stworzenia marginesu wokół przycisków */
        padding: 5px; /* Margines 5px wokół wszystkich przycisków */
        
        z-index: 1000; 
    }
    
    /* Pokazywanie menu, gdy klasa 'open' jest aktywna */
    .navbar.open ul {
        display: flex;
        opacity: 1;
        max-height: 500px; 
    }
    
    .navbar li {
        margin: 5px 0; /* KLUCZOWA ZMIANA 3: Dodatkowy margines, który POKAŻE tło UL */
        width: 100%;
        text-align: center;
        border-bottom: none; 
        
        /* MUSIMY SIĘ UPEWNIĆ, ŻE LI NIE MA TŁA (domyślnie jest przezroczyste) */
        background-color: rgba(60, 60, 60, 0.9);
        border-radius: 8px;
    }
    
    .navbar li:first-child {
        margin-top: 0; 
    }
    
    .navbar li:last-child {
        margin-bottom: 0; 
    }
    
    .navbar a {
        font-size: 1em; 
        padding: 14px 0;
    }
    
    /* Ukrycie dodatkowego, przypiętego logo */
    .logo-pinned {
        display: none;
    }

    /* Dopasowanie nagłówków i akapitów */
    section h1 {
        font-size: 1.8em;
    }

    section p {
        font-size: 1em;
        margin-bottom: 18px;
    }
}