/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

.moj-slider-container {
    padding-top: 20px;
}

.moj-slider-container .n2-ss-text{
    text-transform: none;
}

.n2-ss-slider {
    border-radius: 20px !important;
    overflow: hidden !important;
    max-height: 400px
}

#n2-ss-2-arrow-previous, #n2-ss-2-arrow-next {
    color: white;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 992px) {
    .moj-slider-container {
        height: 400px;
        width: 90%;
        margin: 0 auto;
    }
    .moj-slider-container .n2-ss-text {  
        font-size: 200%;
    }
}

/* Style dla sekcji postów */

.custom-homepage-section {
    padding: 40px 0; /* Odstęp góra/dół */
}

.custom-homepage-section .container {
    max-width: 1290px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.section-title {
    text-align: center;
    font-size: 2.5rem; /* Przykładowy rozmiar */
    margin-bottom: 30px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsywna siatka */
    gap: 25px; /* Odstęp między elementami */
}

.post-item {
    /* Możesz dodać style dla ramek, cieni itp. */
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden; /* Ukrywa wystające elementy, np. obrazek */
}

.post-item-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.post-item-content {
    padding: 20px;
}

.post-item-title {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.post-item-title a {
    text-decoration: none;
    color: #333;
}

.post-item-title a:hover {
    color: #0073aa; /* Przykładowy kolor po najechaniu */
}


/* SEKCJA NAJNOWSZE */


.section-najnowsze {
    padding: 40px 0;
}

/* Układ siatki: 3 kolumny na dużych ekranach - bez zmian */
.section-najnowsze .posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    background-color: #ffd494;
    padding: 24px;
    border-radius: 12px;
}

/* Styl pojedynczego kafelka - bez zmian */
.section-najnowsze .post-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    aspect-ratio: 3 / 4; /* Proporcje 3:4 (szerokość do wysokości) - to tworzy pionowy prostokąt */
    overflow: hidden; 
}

/* Kontener na obrazek (górna połowa) - bez zmian */
.section-najnowsze .post-item-thumbnail {
    height: 60%;
    display: block;
}

.section-najnowsze .post-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Kontener na treść (dolna połowa) - bez zmian */
.section-najnowsze .post-item-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.section-najnowsze .post-item-title {
    font-size: 1.1rem;
    margin: 0 0 15px 0;
}

.section-najnowsze .post-item-content {
    align-items: center;
    text-align: center;
}

.section-najnowsze .post-item-excerpt {
    font-size: 0.9rem;
    color: #555;
    margin-top: auto;
    margin-bottom: auto;
}


/*
================================================
Responsywność dla sekcji "Najnowsze"
================================================
*/

/* Na tabletach 2 kolumny - bez zmian */
@media (max-width: 992px) {
    .section-najnowsze .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Na telefonach 1 kolumna - bez zmian */
@media (max-width: 576px) {
    .section-najnowsze .posts-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    /* Zmniejszamy padding na małych ekranach dla lepszego wyglądu */
    .section-najnowsze .container {
        padding: 16px;
    }
}


/* SEKCJA 1 */


.section-sekcja1 .posts-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: 2fr 1fr; /* Górny wiersz 2x wyższy niż dolny */
    grid-template-areas:
        "top1 top1 top1 top2 top2 top2"
        "bottom1 bottom1 bottom2 bottom2 bottom3 bottom3";
    height: 50vh;
}

/* --- 2. Przypisanie kafelków do obszarów siatki --- */
.section-sekcja1 .post-item:nth-child(1) { grid-area: top1; }
.section-sekcja1 .post-item:nth-child(2) { grid-area: top2; }
.section-sekcja1 .post-item:nth-child(3) { grid-area: bottom1; }
.section-sekcja1 .post-item:nth-child(4) { grid-area: bottom2; }
.section-sekcja1 .post-item:nth-child(5) { grid-area: bottom3; }

/* --- 3. Wygląd pojedynczego kafelka (styl z poprzedniej wiadomości) --- */
.section-sekcja1 .post-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    display: block;
    background-color: #333;
    /* UWAGA: Usunęliśmy 'aspect-ratio', ponieważ wymiary są teraz narzucone przez siatkę (grid) */
}

.section-sekcja1 .post-item-thumbnail,
.section-sekcja1 .post-item-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.section-sekcja1 .post-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
    transition: background-color 0.3s ease;
}

.section-sekcja1 .post-item-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.section-sekcja1 .post-item-excerpt {
    display: none;
}

.section-sekcja1 .post-item-title {
    margin: 0;
}

.section-sekcja1 .post-item-title a {
    color: #fff;
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.section-sekcja1 .post-item-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
}

/* --- 4. Efekty Hover --- */
.section-sekcja1 .post-item:hover .post-item-thumbnail img {
    transform: scale(1.05);
}

.section-sekcja1 .post-item:hover::after {
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 100%);
}

.section-sekcja1 .post-item:hover .post-item-title a {
    text-decoration: underline;
}

/* --- 5. Responsywność dla siatki --- */
@media (max-width: 992px) {
    .section-sekcja1 .posts-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        grid-template-areas: none;
    }
    .section-sekcja1 .post-item:nth-child(n) {
        grid-area: auto;
        aspect-ratio: 16 / 9; /* Przywracamy aspect-ratio na mniejszych ekranach */
    }
}

@media (max-width: 576px) {
    .section-sekcja1 .posts-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        height: auto;
        margin: 0 auto;
        width: 90%;
    }

    /* Styl dla 2 WIĘKSZYCH postów */
    .section-sekcja1 .post-item:nth-child(1),
    .section-sekcja1 .post-item:nth-child(2) {
        aspect-ratio: 8 / 9;
    }

    /* Styl dla 3 MNIEJSZYCH postów */
    .section-sekcja1 .post-item:nth-child(n+3) {
        aspect-ratio: 16 / 9;
    }

    .section-sekcja1 .post-item-content {
        position: absolute;
        justify-content: center;
        align-items: flex-end;
        text-align: center;
    }
    .section-sekcja1 .post-item-content .post-item-title {
        position: relative;
        bottom: 15%;
    }
    .section-sekcja1 .post-item-content .post-item-title a {
        font-size: 22px;
    }
}


/*  SEKCJA 2 */


.section-sekcja2 .posts-grid {
    background-color: #ffd494; /* Twój przykładowy kolor */
    padding: 25px;
    border-radius: 12px;
}

/* --- 2. Definicja siatki 2x2 --- */
.section-sekcja2 .posts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dwie równe kolumny */
    gap: 25px;
}

/* --- 3. Wygląd pojedynczego kafelka --- */
.section-sekcja2 .post-item {
    position: relative;
    aspect-ratio: 16 / 9; /* Pozioma orientacja */
    border-radius: 8px;
    overflow: hidden;
    background-color: #333;
}

.section-sekcja2 .post-item-thumbnail,
.section-sekcja2 .post-item-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* --- 4. Warstwa przyciemniająca na dole --- */
.section-sekcja2 .post-item::after {
    content: '';
    position: absolute;
    bottom: 0; /* Kluczowa zmiana: gradient zaczyna się od dołu */
    left: 0;
    width: 100%;
    height: 70%; /* Wysokość gradientu */
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    z-index: 1;
    transition: background 0.3s ease;
}

/* --- 5. Kontener na treść (tytuł) --- */
.section-sekcja2 .post-item-content {
    position: absolute;
    bottom: 0; /* Kluczowa zmiana: treść wyrównana do dołu */
    left: 0;
    width: 100%;
    height: auto;
    z-index: 2;
    padding: 20px;
    text-align: left; /* Tytuł wyrównany do lewej */
}

.section-sekcja2 .post-item-excerpt {
    display: none;
}

/* --- 6. Styl tytułu --- */
.section-sekcja2 .post-item-title {
    margin: 0;
    text-align: center;
    padding-bottom: 20px;
}

.section-sekcja2 .post-item-title a {
    color: #fff;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.section-sekcja2 .post-item-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
}

/* --- 7. Efekty Hover --- */
.section-sekcja2 .post-item:hover .post-item-thumbnail img {
    transform: scale(1.05);
}

/* --- 8. Responsywność --- */
@media (max-width: 576px) {
    .section-sekcja2 .container {
        width: 90%;
        margin: 0 auto;
    }
    .section-sekcja2 .posts-grid {
        grid-template-columns: 1fr; /* Jedna kolumna na telefonach */
        gap: 10px;
    }
    .section-sekcja2 .post-item {
        aspect-ratio: 8 / 9;
    }
    .section-sekcja2 .post-item-content {
        position: absolute;
        justify-content: center;
        align-items: flex-end;
        text-align: center;
    }
    .section-sekcja2 .post-item-content .post-item-title {
        position: relative;
        bottom: 15%;
    }
    .section-sekcja2 .post-item-content .post-item-title a {
        font-size: 22px;
    }
}


/*  SEKCJA 3  */


.section-sekcja3 .posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Cztery równe kolumny */
    gap: 25px;
}

/* --- 2. Styl pojedynczego kafelka (styl z sekcji "Najnowsze") --- */
.section-sekcja3 .post-item {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 50vh;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

/* --- 3. Obrazek (górna część) --- */
.section-sekcja3 .post-item-thumbnail {
    height: 60%; /* Obrazek zajmuje 60% wysokości kafelka */
    display: block;
}

.section-sekcja3 .post-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- 4. Treść (dolna część) --- */
.section-sekcja3 .post-item-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrowanie treści w pionie */
    align-items: center; /* Centrowanie treści w poziomie */
    text-align: center;
    flex-grow: 1; /* Pozwala kontenerowi wypełnić resztę miejsca */
}

.section-sekcja3 .post-item-title {
    font-size: 1.2rem;
    margin: 0 0 10px 0;
}

.section-sekcja3 .post-item-title a {
    text-decoration: none;
    color: #333;
}

.section-sekcja3 .post-item-title a:hover {
    color: #0073aa;
}

.section-sekcja3 .post-item-excerpt {
    font-size: 0.9rem;
    color: #555;
}

/* --- 5. Responsywność --- */

/* Na tabletach - 2 kolumny */
@media (max-width: 992px) {
    .section-sekcja3 .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Na telefonach - 1 kolumna */
@media (max-width: 576px) {
    .section-sekcja3 .posts-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        width: 90%;
        margin: 0 auto;
    }
    .post-item-content .post-item-excerpt {
        font-size: 16px;
    }
    h2.section-title {
        font-size: 28px;
        font-weight: 700;
    }
    .post-item-content .post-item-title {
        font-size: 22px;
    }
    .custom-homepage-section {
        padding-bottom: 0;
    }
    .section-najnowsze .post-item-excerpt,
    .section-sekcja3 .post-item-excerpt {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3; /* <-- Ustawia maksymalnie 2 linie tekstu */
        overflow: hidden;
        text-overflow: ellipsis;
    }
}