/**
 * PyziTheme - blog.css (pyzitheme/assets/css/blog.css)
 * 
 * Blog, aktualności
 *
 * @package     PyziTheme
 * @subpackage  Assets/CSS
 * @author      Patryk Kowalski <p.kowalski@kamikstudio.pl>
 * @copyright   2025 KamikStudio & PyziPyzi
 * @license     Proprietary
 * @version     1.0.0
 * @since       1.0.0
 * 
 * Client: PyziPyzi - Domowe wyroby cukiernicze
 * Website: https://pyzipyzi.pl
 * 
 * This file is part of PyziTheme.
 * Unauthorized copying or distribution is prohibited.
 */

/* === BLOG CONTAINER === */
.blog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 20px;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 60px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.blog-main {
    min-width: 0; /* Fix dla overflow */
}

.blog-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* === NAGŁÓWEK BLOGA === */
.blog-header {
    margin-bottom: 50px;
}

.blog-header h1 {
    font-size: 42px;
    font-weight: 700;
    color: #5e341c;
    margin-bottom: 15px;
}

.blog-header p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* === LISTA POSTÓW === */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

.post-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.post-thumbnail {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
    background: #f5f0e8;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #ef6341;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-content-card {
    padding: 25px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #999;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta svg {
    width: 14px;
    height: 14px;
    fill: #ef6341;
}

.post-title {
    font-size: 22px;
    font-weight: 700;
    color: #2a2a2a;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ef6341;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: gap 0.3s;
}

.post-read-more:hover {
    gap: 12px;
}

.post-read-more svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* === SIDEBAR WIDGETS === */
.sidebar-widget {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.sidebar-widget h3 {
    font-size: 20px;
    font-weight: 700;
    color: #5e341c;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f0e8;
    position: relative;
}

.sidebar-widget h3::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #ef6341;
}

/* === KALENDARZ ARCHIWUM === */
.archive-calendar {
    list-style: none;
    padding: 0;
}

.archive-year {
    margin-bottom: 25px;
}

.archive-year-title {
    font-size: 18px;
    font-weight: 700;
    color: #5e341c;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.archive-year-title svg {
    width: 18px;
    height: 18px;
    fill: #ef6341;
}

.archive-months {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 8px;
}

.archive-month-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f5f0e8;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
}

.archive-month-item:hover {
    background: #ef6341;
    color: white;
    transform: translateX(5px);
}

.archive-month-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
}

.archive-month-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.archive-post-count {
    background: white;
    color: #5e341c;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.archive-month-item:hover .archive-post-count {
    background: rgba(255,255,255,0.9);
    color: #ef6341;
}

/* === KATEGORIE WIDGET === */
.categories-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 10px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f5f0e8;
    border-radius: 8px;
    transition: all 0.3s;
}

.category-item:hover {
    background: #ef6341;
    transform: translateX(5px);
}

.category-item a {
    text-decoration: none;
    color: #5e341c;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.category-item:hover a {
    color: white;
}

.category-count {
    background: white;
    color: #5e341c;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.category-item:hover .category-count {
    background: rgba(255,255,255,0.9);
    color: #ef6341;
}

/* === WYSZUKIWARKA W SIDEBARZE - POPRAWIONA === */
.sidebar-search {
    position: relative;
    width: 100%;
}

.sidebar-search input {
    width: 100%;
    padding: 14px 50px 14px 18px;
    border: 2px solid #f5f0e8;
    border-radius: 30px;
    font-size: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.sidebar-search input:focus {
    outline: none;
    border-color: #ef6341;
}

/* Przycisk search - WAŻNE: idealnie okrągły! */
.sidebar-search button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #ef6341;
    border: none;
    width: 40px;           /* Zwiększone z 36px */
    height: 40px;          /* Musi być = width! */
    min-width: 40px;       /* Zapobiega zmniejszaniu */
    min-height: 40px;      /* Zapobiega zmniejszaniu */
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;            /* Usuń wszelkie paddingi! */
    transition: background 0.3s, transform 0.2s;
    flex-shrink: 0;        /* Nie pozwalaj się kurczyć */
}

.sidebar-search button:hover {
    background: #d55431;
    transform: translateY(-50%) scale(1.05);
}

.sidebar-search button:active {
    transform: translateY(-50%) scale(0.95);
}

/* SVG ikona - MUSI być widoczna! */
.sidebar-search button svg {
    width: 18px;
    height: 18px;
    fill: white;
    display: block;
    pointer-events: none;
}

/* Fallback gdyby SVG nie załadowało się */
.sidebar-search button:empty::before {
    content: "🔍";
    font-size: 18px;
    line-height: 1;
}

/* === PAGINACJA - POPRAWIONA === */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #f5f0e8;
}

/* Lista UL - bez żadnych stylów wizualnych! */
.blog-pagination ul.page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    background: none !important;
    border: none !important;
}

.blog-pagination ul.page-numbers li {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

/* Style TYLKO dla linków i spanów wewnątrz */
.blog-pagination .page-numbers a,
.blog-pagination .page-numbers span,
.blog-pagination a.page-numbers,
.blog-pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    min-width: 45px;
    background: white;
    border: 2px solid #f5f0e8;
    border-radius: 8px;
    color: #5e341c;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
}

/* Hover i aktywna strona */
.blog-pagination .page-numbers a:hover,
.blog-pagination a.page-numbers:hover,
.blog-pagination .page-numbers span.current,
.blog-pagination span.page-numbers.current {
    background: #ef6341;
    border-color: #ef6341;
    color: white;
    transform: translateY(-2px);
}

/* Strzałki (prev/next) - SVG wewnątrz linków */
.blog-pagination .page-numbers svg,
.blog-pagination a.page-numbers svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Dots (...) */
.blog-pagination .page-numbers.dots,
.blog-pagination span.page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.blog-pagination .page-numbers.dots:hover {
    background: transparent;
    transform: none;
}

/* Responsywność */
@media (max-width: 768px) {
    .blog-pagination {
        margin-top: 40px;
        padding-top: 30px;
    }
    
    .blog-pagination ul.page-numbers {
        gap: 8px;
    }
    
    .blog-pagination .page-numbers a,
    .blog-pagination .page-numbers span,
    .blog-pagination a.page-numbers,
    .blog-pagination span.page-numbers {
        padding: 10px 14px;
        min-width: 40px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .blog-pagination .page-numbers a,
    .blog-pagination .page-numbers span,
    .blog-pagination a.page-numbers,
    .blog-pagination span.page-numbers {
        padding: 8px 12px;
        min-width: 36px;
        font-size: 13px;
    }
    
    /* Na małych ekranach ukryj niektóre numery, zostaw tylko nawigację i current */
    .blog-pagination .page-numbers a:not(.prev):not(.next),
    .blog-pagination a.page-numbers:not(.prev):not(.next) {
        display: none;
    }
    
    .blog-pagination .page-numbers span.current,
    .blog-pagination span.page-numbers.current {
        display: inline-flex;
    }
    
    .blog-pagination .page-numbers.dots {
        display: none;
    }
}

/* === RESPONSYWNOŚĆ === */
@media (max-width: 1024px) {
    .blog-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .blog-sidebar {
        position: static;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .blog-container {
        padding: 40px 20px;
    }

    .blog-header h1 {
        font-size: 32px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-thumbnail {
        height: 200px;
    }

    .sidebar-widget {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .blog-header h1 {
        font-size: 28px;
    }

    .post-title {
        font-size: 20px;
    }
}