/*
Theme Name: Nowoczesny Czarno-Bialy V4
Description: Minimalistyczny portal, seamless grid, tytuły na obrazkach, wielkie hero.
Version: 4.0
*/

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&display=swap');

* {
    box-sizing: border-box;
}

body {
    background-color: #fff;
    color: #111;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    color: #111;
    text-decoration: none;
    transition: 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- TOP BAR --- */
.top-bar {
    display: flex;
    justify-content: flex-end;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.top-socials a {
    margin-left: 20px;
    font-size: 18px;
}

.top-socials a:hover {
    color: #ff0000;
}

/* --- HEADER & SEARCH --- */
.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    position: relative;
}

.site-logo img {
    max-width: 250px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.site-logo-text {
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
    align-items: center;
}

nav ul li a {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 15px;
}

nav ul li a:hover {
    color: #ff0000;
}

.search-form {
    display: flex;
    border: 2px solid #111;
}

.search-field {
    border: none;
    padding: 10px 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    outline: none;
    width: 160px;
}

.search-submit {
    background: #111;
    color: #fff;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.search-submit:hover {
    background: #ff0000;
}

/* --- REKLAMY --- */
.ad-container {
    text-align: center;
    margin: 20px 0;
    min-height: 90px;
}

/* --- SEAMLESS GRID (Tytuły na zdjęciach) --- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: none;
}

.grid-item {
    position: relative;
    overflow: hidden;
    display: block;
}

.thumb-wrapper {
    width: 100%;
    height: 350px;
    position: relative;
    overflow: hidden;
    display: block;
}

/* Ciemny gradient na dole zdjęcia (poprawia czytelność białego tekstu) */
.thumb-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 1;
    pointer-events: none;
}

.thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.grid-item:hover .thumb-wrapper img {
    transform: scale(1.05);
}

/* Kontener na tekst zawieszony na obrazku */
.post-content-box {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    z-index: 2;
    pointer-events: none;
}

.post-content-box a {
    pointer-events: auto;
    color: #fff;
}

/* Meta w kafelku */
.post-meta-grid {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.post-category {
    font-size: 11px;
    font-weight: 900;
    color: #ff0000;
    text-transform: uppercase;
}

.post-category a {
    color: #ff0000;
}

.post-date {
    font-size: 10px;
    font-weight: 700;
    color: #ccc;
}

.grid-item h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

/* --- HERO POSTS (Top 3 są ogromne) --- */
@media (min-width: 900px) {
    .grid-item:nth-child(-n+3) .thumb-wrapper {
        height: 600px;
    }

    .grid-item:nth-child(-n+3) h2 {
        font-size: 36px;
        text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8);
    }

    .grid-item:nth-child(-n+3) .post-content-box {
        padding: 40px 50px;
    }
}

/* --- SINGLE POST --- */
.single-post-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0;
}

.single-title {
    font-size: 50px;
    font-weight: 900;
    text-align: center;
    line-height: 1.1;
    margin-bottom: 15px;
}

/* Wyśrodkowany obrazek */
.single-thumb {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.single-thumb img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.single-meta {
    text-align: center;
    margin-bottom: 40px;
    font-size: 14px;
}

.single-meta .post-date {
    color: #888;
    margin-left: 10px;
    font-size: 13px;
}

/* Formatowanie wpisu */
.entry-content {
    font-size: 19px;
    line-height: 1.8;
}

/* Tylko linki wewnątrz tekstu są czerwone i podkreślone */
.entry-content a {
    color: #ff0000;
    text-decoration: underline;
    font-weight: 700;
}

.entry-content a:hover {
    color: #111;
}

.entry-content iframe,
.entry-content .wp-block-embed-youtube {
    display: block;
    margin: 40px auto;
    width: 100% !important;
    max-width: 850px;
    aspect-ratio: 16/9;
    height: auto;
    border: none;
}

/* --- UDOSTĘPNIANIE (SOCIAL SHARE) --- */
.social-share {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 40px 0;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.social-share span {
    font-weight: 900;
    text-transform: uppercase;
}

.social-share a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background: #111;
    color: #fff;
    border-radius: 5px;
    font-size: 20px;
}

.social-share a:hover {
    background: #ff0000;
    transform: translateY(-3px);
}

/* --- PAGINACJA --- */
.pagination {
    text-align: center;
    padding: 50px 0;
    font-weight: 900;
    font-size: 24px;
}

/* --- MOBILE & RESPONSIVE --- */
@media (max-width: 800px) {
    .post-grid {
        grid-template-columns: 1fr;
    }

    .header-main {
        flex-direction: column;
        gap: 20px;
    }

    .thumb-wrapper {
        height: 300px !important;
    }

    /* Hamburger stylizacja */
    #menu-toggle {
        display: block !important;
        width: 100%;
        background: #111;
        color: #fff;
        padding: 15px;
        border: none;
        font-size: 20px;
        font-family: 'Montserrat', sans-serif;
        font-weight: 900;
        cursor: pointer;
        border-radius: 4px;
    }

    /* Poprawka Menu (Z-index zapobiega wchodzeniu pod zdjęcia) */
    #site-navigation {
        display: none;
        width: 100%;
        margin-top: 15px;
        background: #fff;
        position: relative;
        z-index: 999;
    }

    #site-navigation.toggled {
        display: block;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
    }

    nav ul li {
        border-bottom: 1px solid #eee;
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }
}

/* --- PASEK POSTĘPU CZYTANIA --- */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background-color: #ff0000;
    z-index: 9999;
    transition: width 0.1s ease;
}

/* --- MINIMALISTYCZNY AUTOR W SINGLE.PHP --- */
.simple-author-box {
    margin: 40px 0;
    padding: 15px 0;
    border-top: 2px solid #eee;
    border-bottom: 2px solid #eee;
    text-transform: uppercase;
    font-weight: 900;
    font-size: 14px;
    text-align: right;
}

.simple-author-box span {
    color: #ff0000;
    font-size: 16px;
}

/* Przesunięcie paska postępu w dół, gdy zalogowany jest admin WP */
.admin-bar #reading-progress {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar #reading-progress {
        top: 46px;
        /* Na telefonach pasek admina jest grubszy */
    }
}