/* General Body Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
    overflow-x: hidden;
}

body.mobile-menu-active {
    overflow: hidden;
}


/* Container */
.header-container, .main-container{
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;  
}

/* Header */
header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    position: relative;
    z-index: 1001; /* Ustawia header nad innymi elementami */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #000;
    font-weight: bold;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.header-right {
    display: flex;
    align-items: center;
}

.search-bar {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.search-bar input {
    border: none;
    padding: 8px;
    outline: none;
}

.search-bar button {
    background-color: #fff;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.accessibility button {
    margin-left: 10px;
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
}

/* Przycisk menu mobilnego - domyślnie ukryty */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}

.mobile-menu-header {
    display: none; /* Ukryty na desktopie */
}

/* Nawigacja Główna */
.main-nav {
    background-color: #f8f9fa;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-around; 
    max-width: 1200px;
    margin: 0 auto;
}

.main-nav ul li {
    position: relative;
    border-right: 1px solid #e0e0e0; 
    flex: 1; /* Równomierne rozłożenie elementów */
}

.main-nav ul li:last-child {
    border-right: none;
}

.main-nav ul li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px; 
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: background-color 0.3s;
    width: 100%;
    box-sizing: border-box; /* Uwzględnia padding w szerokości */
}

.main-nav ul li a .fa-chevron-down {
    font-size: 0.8em;
}

.main-nav ul li:hover > a {
    background-color: #e9ecef;
}

/* Podmenu */
.main-nav .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 250px;
    z-index: 1000;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
}

.main-nav ul li:hover > .submenu {
    display: block;
}

.submenu li {
    border: none;
}

.submenu li a {
    justify-content: flex-start;
    padding: 12px 15px;
    white-space: nowrap;
}

.submenu li a:hover {
    background-color: #f1f1f1;
}

/* Main Content */
.main-container {
    padding-top: 20px;
    padding-bottom: 20px;
}

.breadcrumbs {
    margin-bottom: 20px;
    color: #555;
    font-size: 0.9em;
}

.breadcrumbs a {
    text-decoration: none;
    color: #007bff;
}

.intro-section {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.intro-text p {
    font-size: 1.1em;
    line-height: 1.6;
    margin: 0;
}

.intro-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.side-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid #eee;
    padding-left: 20px;
}

.side-links li {
    margin-bottom: 10px;
}

.side-links a {
    text-decoration: none;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.side-links a:hover {
    background-color: #f9f9f9;
}

/* Latest News */
.latest-news {
    margin-top: 40px;
}

.latest-news h2 {
    border-bottom: 3px solid #007bff;
    padding-bottom: 10px;
    display: inline-block;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.news-item {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 15px;
}

.news-image-placeholder {
    width: 100%;
    height: 150px;
    background-color: #333;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 800 400"><rect fill="%23333" width="800" height="400"/><text fill="%23777" font-family="Arial" font-size="30" dy="10.5" font-weight="bold" x="50%" y="50%" text-anchor="middle">TITLE LOREM IPSUM</text></svg>');
    background-size: cover;
    margin-bottom: 15px;
}

.news-item h3 {
    margin: 0 0 10px 0;
}

.news-item p {
    font-size: 0.9em;
    color: #666;
}

.read-more {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.publish-date {
    display: block;
    margin-top: 10px;
    font-size: 0.8em;
    color: #888;
}

.section-title {
    font-size: 1.8em;
    color: #333;
    border-bottom: none; 
    padding-bottom: 5px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #f0ad4e; 
    box-shadow: -8px 0 0 0 #f0ad4e, 0 -8px 0 0 #f0ad4e;
    margin-right: 15px;
    position: relative;
    top: -4px;
}

.intro-text p::before{
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background-color: #007bff; 
    box-shadow: -8px 0 0 0 #007bff, 0 -8px 0 0 #007bff;
    margin-right: 10px;
    position: relative;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.gallery-grid a {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-grid a:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Sprawia, że obrazek wypełnia kafelek bez zniekształceń */
    display: block;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 20px;
    padding-bottom: 10px;
    background-color: #e9ecef;
    margin-top: 40px;
    font-size: 0.9em;
    color: #666;
    position: relative;
    bottom: 0;
    width: 100%;
}

.foot{
    width:35%;
}

.social-media-link {
    display: flex;
    align-items: center;
    margin-right: 15px;
    scale: 1.1;
}

.social-media-link a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 50%; /* Okrągły kształt */
    text-decoration: none;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.social-media-link a:hover {
    color: #fff;
    background-color: #1877F2; /* Oficjalny kolor Facebooka */
    border-color: #1877F2;
    transform: scale(1.1);
}

.pdf-viewer-frame {
    width: 100%;
    height: 85vh; /* 85% wysokości okna przeglądarki */
    border: 1px solid #ccc;
    border-radius: 5px;
}


/* === Widget Dostępności === */
#toggle-accessibility-widget {
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2em;
}

#widget-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 9998; opacity: 0;
    visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
#widget-overlay.active { opacity: 1; visibility: visible; }

.accessibility-widget {
    position: fixed; top: 0; right: -320px; width: 300px;
    height: 100%; background-color: #fff; border-left: 1px solid #ddd;
    box-shadow: -2px 0 15px rgba(0,0,0,0.1); z-index: 9999;
    transition: right 0.3s ease-in-out; display: flex; flex-direction: column;
}
.accessibility-widget.active { right: 0; }
.widget-header { display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; border-bottom: 1px solid #eee; }
.widget-header h2 { margin: 0; font-size: 1.5em; }
#close-widget-btn { background: none; border: none; font-size: 2.5em;
    font-weight: 300; cursor: pointer; padding: 0; line-height: 1; }
.widget-options { list-style: none; padding: 10px 0; margin: 0; overflow-y: auto; }
.widget-options li button { display: flex; align-items: center; width: 100%;
    padding: 15px 20px; background: none; border: none; text-align: left;
    font-size: 1em; cursor: pointer; border-bottom: 1px solid #f5f5f5; }
.widget-options li button:hover { background-color: #f8f9fa; }
.widget-options li button i { font-size: 1.2em; margin-right: 15px; width: 25px; text-align: center; color: #3d5a80; }

/* Klasy modyfikujące stronę (WCAG) */
body.accessibility-grayscale { filter: grayscale(100%); }
body.accessibility-high-contrast { background-color: #000 !important; color: #fff !important; }
body.accessibility-high-contrast header, body.accessibility-high-contrast .main-nav,
body.accessibility-high-contrast footer, body.accessibility-high-contrast .news-item { background-color: #000 !important; color: #fff !important; border-color: #fff !important; }
body.accessibility-high-contrast a { color: #FFFF00 !important; }
body.accessibility-negative { filter: invert(100%); }
body.accessibility-negative img, body.accessibility-negative video, body.accessibility-negative .news-image-placeholder { filter: invert(100%); }
body.accessibility-underline-links a { text-decoration: underline !important; }



/* === STYLE MOBILNE === */
@media (max-width: 768px) {
    .header-right .search-bar{ display: none; }
    .header-container { padding: 10px 15px; }
    .mobile-menu-btn { display: block; }
    
    .main-nav {
        position: fixed;
        top: 60px; 
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        background-color: #fff;
        z-index: 1000;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        border: none;
        will-change: transform;
    }
    
    .main-nav.mobile-active {
        transform: translateX(0);
    }
    
    .main-nav ul li:hover > a,
    .main-nav .submenu li a:hover {
        background-color: transparent;
    }

    .main-nav ul { flex-direction: column; width: 100%; padding-top: 10px; }
    .main-nav ul li { border-right: none; border-bottom: 1px solid #e0e0e0; }
    .main-nav ul li:last-child { border-bottom: none; }
    .main-nav ul li a { justify-content: space-between; padding: 20px; font-weight: bold; }
    .main-nav ul li a .fa-chevron-down { 
        transition: transform 0.3s ease;
        padding: 15px;
        margin: -15px;
    }
    .main-nav ul li.submenu-open > a .fa-chevron-down { transform: rotate(180deg); }

    
    .main-nav .submenu {
        position: static;
        display: block;
        border: none;
        box-shadow: none;
        min-width: auto;
        padding-left: 0;
        background-color: #f8f9fa;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s ease-out;
        transform: translateZ(0);
    }
    
    .main-nav li.submenu-open > .submenu {
        max-height: 500px;
        opacity: 1;
        visibility: visible;
    }

    .main-nav .submenu li { border-top: 1px solid #e9ecef; }
    .main-nav .submenu a { font-weight: normal; padding: 15px 20px 15px 40px; }
    .main-nav .submenu a .fa-chevron-down { display: none; }
    
    .intro-section { grid-template-columns: 1fr; }
    .intro-image { order: -1; }
    .side-links { display: none; }
    .foot{
        width: 75%;
    }
}

/* Plik: style.css (dodaj ten fragment na końcu) */

.post-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}
.post-author {
    font-weight: bold;
}

/* =================================================================== */
/* === 1. Lepsze skalowanie zdjęć i filmów w postach i projektach === */
/* =================================================================== */

/* Te style zadziałają na stronach post.php i project_single.php */
.post-content img,
.post-content video {
    max-width: 80%; /* Zdjęcie zajmie maksymalnie 80% szerokości kontenera */
    height: auto;
    display: block; /* Kluczowe do wyśrodkowania za pomocą marginesów */
    margin-left: auto;
    margin-right: auto;
    margin-top: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); /* Ładniejszy, głębszy cień */
    border: 1px solid #eee;
}

/* Dodajemy również style dla generowanych nagłówków i paragrafów z Markdown */
.post-content h2 {
    font-size: 1.8em;
    margin-top: 40px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.post-content p {
    line-height: 1.7;
    font-size: 1.1em;
}

/* ====================================================== */
/* === 2. Styl dla listy projektów (kafelki)          === */
/* ====================================================== */

/* Użyjemy tych samych stylów co dla aktualności, aby zachować spójność. */
/* Twój plik project.html już powinien mieć klasę .news-grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Jeśli w project.html użyłeś klasy .project-item, ta reguła też zadziała */
.project-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.project-item .news-image-placeholder { /* Reużywamy stylu dla obrazka */
    height: 200px;
    background-size: cover;
    background-position: center;
}

.project-item h3 {
    font-size: 1.3em;
    color: #333;
    padding: 20px 20px 10px 20px;
}

.project-item p {
    padding: 0 20px;
    line-height: 1.6;
    flex-grow: 1; /* Sprawia, że opis rozciąga się, wypychając przycisk na dół */
}

.project-item .read-more {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 10px 15px;
    margin: 20px;
    border-radius: 5px;
    text-decoration: none;
    align-self: flex-start; /* Przycisk trzyma się lewej strony */
}

.project-item .read-more:hover {
    background-color: #0056b3;
}

/*Panel admina*/

.delete-list-item {
    display: flex;
    justify-content: space-between; /* To jest kluczowe - rozsuwa elementy na boki */
    align-items: center;
    padding: 15px; /* Większy odstęp wewnątrz */
    border-bottom: 1px solid #eee;
}

.delete-list-item span {
    color: #333;
    font-size: 1.1em;
    /* Dodajemy margines po prawej stronie, aby tekst nigdy nie dotykał przycisku */
    margin-right: 20px; 
}

.delete-btn {
    background-color: #dc3545;
    width: 35px; /* Nieco większy przycisk */
    height: 35px;
    padding: 0;
    font-size: 1em;
    line-height: 1;
    /* Ta właściwość sprawia, że przycisk się nie "kurczy" */
    flex-shrink: 0; 
}