/* =========================================
   1. ZMIENNE I PALETA KOLORÓW (Elegancka Leśna Paleta)
   ========================================= */
:root {
    /* --- CIEMNA PALETA PREMIUM --- */
    --bg-body: #111612;
    --bg-card: #1A241E;
    --col-border: #2C3E30;
    --col-accent: #C5A065; /* Złoto */
    --col-accent-light: #D4B276; /* Jaśniejsze złoto */

    /* --- TEKST --- */
    --col-text: #E6E6E6;
    --col-text-muted: #B0B0B0;
    --col-heading: #FFFFFF;
    --col-dark-green: #0F1410;

    /* --- CZCIONKI --- */
    --font-display: "Cormorant Garamond", serif; /* Elegancki display */
    --font-heading: "Crimson Text", serif; /* Nagłówki */
    --font-body: "Lato", serif; /* Tekst body */
}

/* =========================================
   2. STYLE GLOBALNE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--col-text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* === TŁO BODY - STATYCZNE ZDJĘCIE TRAWY === */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/grass.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll; /* ← ZMIENIONE z fixed! */
    z-index: -2;

    /* Optimizacje scrollowania */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* === OVERLAY - PRZYCIEMNIENIE TŁA === */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 22, 18, 0.75);
    z-index: -1;
}

/* Nagłówki globalne */
h1, h2, h3, h4, h5, h6 {
    color: var(--col-heading);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.2rem;
}

h3 {
    font-size: 1.8rem;
}

a {
    color: var(--col-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--col-accent);
}

/* ================= MASTHEAD (HEADER) z płynnym przejściem ================= */

/* Kontener nagłówka - przezroczysty, używa tła z body */
header.masthead {
    position: relative;
    background: transparent;
    padding-top: 220px;
    padding-bottom: 180px;
    margin-bottom: 0; /* Usuwamy margines, przejście jest płynne */
    overflow: hidden;
}

/* Dodatkowa warstwa przyciemnienia + BLUR tylko w obszarze headera */
header.masthead::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
}

/* PŁYNNE PRZEJŚCIE - Gradient fade-out na dole headera */
header.masthead::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(17, 22, 18, 0.3) 50%,
        rgba(17, 22, 18, 0.6) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* Kontener treści */
header.masthead .container {
    position: relative;
    z-index: 3;
    text-align: center;
}

/* Tytuł główny */
header.masthead .site-heading h1 {
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 600;
    color: #fff;
    margin-top: 0;
    margin-bottom: 20px;
    text-shadow: 3px 3px 12px rgba(0,0,0,0.8);
    letter-spacing: 2px;
}

/* Podtytuł */
header.masthead .site-heading .subheading {
    font-family: var(--font-body);
    font-size: 1.6rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1.4;
    display: block;
    margin-top: 10px;
    color: var(--col-accent-light);
    text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
    letter-spacing: 1px;
}

/* Logo (gdy zamienimy tekst na logo) */
.header-logo {
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.7));
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

/* =========================================
   3. MAIN CONTENT - z padding-top dla płynnego przejścia
   ========================================= */
main.container {
    position: relative;
    z-index: 1;
    padding-top: 6rem;
    padding-bottom: 6rem;
    max-width: 1200px;
    margin: 0 auto;
}


/* =========================================
   5. PAGINACJA
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-family: var(--font-body);
    font-weight: 600;
    margin-top: 4rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.pagination a {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 2px solid var(--col-border);
    color: var(--col-text);
    border-radius: 30px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.pagination a:hover {
    background: linear-gradient(135deg, var(--col-accent) 0%, var(--col-accent-light) 100%);
    color: #000;
    border-color: var(--col-accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(197, 160, 101, 0.3);
}

.pagination span,
.pagination .pagination-current {
    color: var(--col-accent);
    font-size: 0.95rem;
    padding: 12px 20px;
    background: rgba(197, 160, 101, 0.1);
    border: 2px solid var(--col-accent);
    border-radius: 30px;
    font-weight: 700;
}

/* =========================================
   6. FOOTER - z blur i przyciemnieniem jak masthead
   ========================================= */
footer.site-footer {
    position: relative;
    margin-top: 100px;
    padding: 80px 0 40px;
    overflow: hidden;
}

/* Dodatkowa warstwa przyciemnienia + BLUR w footerze */
footer.site-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1;
}

/* Gradient fade-in na górze footera */
footer.site-footer::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0) 0%,
        rgba(17, 22, 18, 0.3) 50%,
        rgba(17, 22, 18, 0.6) 100%
    );
    z-index: 0;
    pointer-events: none;
}

/* Kontener footera */
footer.site-footer .container {
    position: relative;
    z-index: 2;
}

/* Nagłówki w footerze */
footer.site-footer .footer-heading {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--col-accent);
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Tekst w footerze */
footer.site-footer p {
    color: var(--col-text);
    line-height: 1.8;
    margin-bottom: 0.8rem;
}

/* Linki w footerze */
footer.site-footer .footer-links {
    list-style: none;
    padding: 0;
}

footer.site-footer .footer-links li {
    margin-bottom: 0.8rem;
}

footer.site-footer .footer-links a {
    color: var(--col-text-muted);
    transition: all 0.3s ease;
    display: inline-block;
}

footer.site-footer .footer-links a:hover {
    color: var(--col-accent);
    transform: translateX(5px);
}

/* Linia separująca */
footer.site-footer .footer-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--col-accent),
        transparent
    );
    margin: 2.5rem 0;
    opacity: 0.5;
}

/* Copyright */
footer.site-footer .copyright {
    color: var(--col-text-muted);
    font-size: 0.9rem;
    margin-top: 1.5rem;
    font-style: italic;
}

/* =========================================
   7. RESPONSYWNOŚĆ MOBILNA
   ========================================= */

/* Tablety i większe telefony */
@media (max-width: 992px) {
    header.masthead {
        padding-top: 180px;
        padding-bottom: 140px;
    }

    header.masthead::before {
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    header.masthead .site-heading h1 {
        font-size: 3.5rem;
    }

    header.masthead .site-heading .subheading {
        font-size: 1.4rem;
    }

    body::after {
        background: rgba(17, 22, 18, 0.8);
    }

    /* Layout postów - 2 kolumny na tablecie */
    .blog-posts-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px 20px;
    }

    /* Resetujemy przesunięcia na tablecie */
    .post-card:nth-child(3n + 2),
    .post-card:nth-child(3n + 3) {
        transform: translateY(0);
    }

    footer.site-footer::before {
        background: rgba(0, 0, 0, 0.5);
    }
}

/* Małe telefony */
@media (max-width: 768px) {
    header.masthead {
        padding-top: 150px;
        padding-bottom: 110px;
    }

    header.masthead::before {
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    header.masthead .site-heading h1 {
        font-size: 2.8rem;
    }

    header.masthead .site-heading .subheading {
        font-size: 1.2rem;
    }

    body::after {
        background: rgba(17, 22, 18, 0.85);
    }

    /* Layout postów - 1 kolumna na telefonie */
    .blog-posts-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* Wszystkie karty równo */
    .post-card:nth-child(3n + 1),
    .post-card:nth-child(3n + 2),
    .post-card:nth-child(3n + 3) {
        grid-column: span 1;
        transform: translateY(0);
    }

    .post-card-img {
        height: 220px;
    }

    .post-card-body {
        padding: 1.5rem;
    }

    main.container {
        padding-top: 50px !important;
    }

    footer.site-footer {
        padding: 60px 0 30px;
    }
}

/* Bardzo małe telefony */
@media (max-width: 480px) {
    header.masthead {
        padding-top: 130px;
        padding-bottom: 90px;
    }

    header.masthead::before {
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    header.masthead .site-heading h1 {
        font-size: 2.2rem;
    }

    header.masthead .site-heading .subheading {
        font-size: 1rem;
    }

    .header-logo {
        max-width: 250px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    body {
        font-size: 16px;
    }

    body::before {
        background-attachment: scroll;
    }

    .post-card-body {
        padding: 1.2rem;
    }

    .post-title {
        font-size: 1.4rem;
    }
}

/* =========================================
   8. ANIMACJE
   ========================================= */

/* Animacja fade-in dla kart przy załadowaniu */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

/* Opóźnienie animacji dla każdej karty */
.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }
.post-card:nth-child(6) { animation-delay: 0.6s; }