/**
 * v4.1 - Plik: 8-news.css
 * Zmiany: Standaryzacja CKM, Wdrożenie "Hybrydy Mistrzowskiej" (Premium UX dla Mobile).
 */

/* ==========================================================================
   1. CKM - GLOBAL LAYOUT (A+B = 1200px) - Wspólne dla Archive, 1109 i Single
   ========================================================================== */
.ckm-page-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}

.ckm-breadcrumbs {
    width: 100%;
    margin-bottom: -15px; 
    font-size: 13px;
    font-weight: 600;
    color: #666;
}

.ckm-breadcrumbs a {
    color: #111111;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ckm-breadcrumbs a:hover {
    color: #00a859;
}

.ckm-breadcrumbs .sep {
    margin: 0 8px;
    color: #cccccc;
}

.ckm-main-content,
.ckm-page-main-content {
    flex: 1;
    min-width: 0; 
}

.ckm-sidebar-area {
    width: 320px; 
    flex-shrink: 0;
}

/* ==========================================================================
   2. CKM - SYSTEM AKTUALNOŚCI (GRID 3-KOLUMNOWY PRO)
   ========================================================================== */
.ckm-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Magia: 3 kafelki w rzędzie */
    gap: 30px; 
    margin-bottom: 40px;
}

.ckm-news-item {
    background: #ffffff;
    border-radius: 16px; /* Zaokrąglenie w stylu akademii */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); 
    display: flex;
    flex-direction: column; /* Układ pionowy: zdjęcie na górze, tekst na dole */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.02);
}

.ckm-news-item:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 15px 35px rgba(0, 168, 89, 0.1); 
    border-color: rgba(0,168,89,0.2);
}

.ckm-news-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    width: 100%;
    height: 100%;
    color: inherit;
}

.ckm-news-thumb {
    width: 100%; 
    height: 220px; /* Stała wysokość miniaturki */
    flex-shrink: 0;
    background: #f4f7f5;
    position: relative;
    overflow: hidden;
}

.ckm-news-thumb img {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.ckm-news-item:hover .ckm-news-thumb img {
    transform: scale(1.08); /* Efekt zoom dla spójności ze stroną główną */
}

.ckm-news-placeholder {
    width: 100%;
    height: 100%;
    background: #e9f7ef;
}

.ckm-news-content {
    padding: 25px; 
    display: flex;
    flex-direction: column;
    flex: 1; /* Pozwala dopchnąć przycisk na sam dół */
}

.ckm-news-date {
    font-size: 11px; 
    font-weight: 700; 
    color: #00a859; 
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.ckm-news-title {
    font-size: 18px; /* Odrobinę mniejszy tytuł, żeby lepiej siedział w 3 kolumnach */
    font-weight: 900; 
    color: #111111; 
    margin: 0 0 12px 0; 
    line-height: 1.3;
    transition: color 0.3s ease;
}

.ckm-news-item:hover .ckm-news-title {
    color: #00a859; 
}

.ckm-news-excerpt {
    font-size: 14px; 
    color: #555555; 
    margin-bottom: 20px; 
    line-height: 1.5;
    /* Ucinanie do max 3 linijek tekstu (zapobiega rozciąganiu kafla) */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ckm-news-more {
    font-size: 12px; 
    font-weight: 800; 
    color: #111111; 
    text-transform: uppercase;
    margin-top: auto; /* Dopycha przycisk zawsze na dół kafla */
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.ckm-news-item:hover .ckm-news-more {
    color: #00a859;
}

/* ==========================================================================
   3. CKM - SINGLE POST (Pojedynczy Artykuł / Biała Karta)
   ========================================================================== */
.ckm-single-card {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 40px;
}

.ckm-single-hero-img {
    width: 100%;
    max-height: 500px; 
    overflow: hidden;
    background: #f4f7f5;
}

.ckm-single-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ckm-single-body {
    padding: 40px;
}

.ckm-single-title {
    font-size: 36px;
    font-weight: 900;
    color: #111111;
    margin: 0 0 20px 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.ckm-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    font-weight: 700;
    color: #00a859;
    text-transform: uppercase;
    margin-bottom: 30px;
    align-items: center;
}

.ckm-meta-item {
    position: relative;
    letter-spacing: 0.5px;
}

.ckm-meta-item:not(:last-child)::after {
    content: '•';
    color: #cccccc;
    margin-left: 15px;
}

.ckm-content-divider {
    border: 0;
    height: 1px;
    background: #eeeeee;
    margin: 0 0 35px 0;
}

.ckm-entry-content {
    font-size: 16px;
    line-height: 1.8;
    color: #444444;
}

.ckm-entry-content p {
    margin-bottom: 25px;
}

.ckm-entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

/* ==========================================================================
   CKM PAGINATION & ACTIVE FILTERS (Global Fix)
   ========================================================================== */

/* 1. Globalna Paginacja (Archive & Search) */
.ckm-pagination {
    margin-top: 50px;
    margin-bottom: 30px;
    text-align: center;
}

.ckm-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 15px;
    margin: 0 4px;
    background: #ffffff;
    color: #111111;
    font-weight: 800;
    font-size: 14px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

/* Stan Hover */
.ckm-pagination .page-numbers:hover {
    background: #e9f7ef;
    color: #00a859;
    transform: translateY(-2px);
}

/* Aktywna Strona */
.ckm-pagination .page-numbers.current {
    background: #00a859;
    color: #ffffff;
    box-shadow: 0 6px 15px rgba(0,168,89,0.3);
    pointer-events: none; /* Wyłącza klikanie w aktualną stronę */
}

/* Ukrycie kropek z WP na mobile, zostawienie tylko przycisków Prev/Next */
@media (max-width: 480px) {
    .ckm-pagination .page-numbers {
        margin: 0 2px;
        padding: 0 10px;
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
    .ckm-pagination .dots {
        display: none;
    }
}

/* 2. Aktywny przycisk w panelu filtrów (wyszukiwarka) */
.ckm-squad-nav-link.active {
    background: #00a859 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0,168,89,0.3);
}
/* --- Zabezpieczenie dla Tabletów (Przejście na 2 kolumny) --- */
@media (max-width: 1100px) {
    .ckm-news-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   4. CKM - RWD MOBILE (HYBRYDA MISTRZOWSKA)
   ========================================================================== */
@media (max-width: 950px) {
    .ckm-sidebar-area { width: 100%; }
    
    /* Gęstsza siatka dla telefonów - Wymuszenie 1 kolumny! */
    .ckm-news-grid { 
        grid-template-columns: 1fr; 
        gap: 15px; 
    }

  
    /* --- GŁÓWNY NEWS (Wydarzenie Dnia - 1. pozycja) --- */
    .ckm-news-item:first-child .ckm-news-link { flex-direction: column; }
    .ckm-news-item:first-child .ckm-news-thumb { width: 100%; height: 220px; }
    .ckm-news-item:first-child .ckm-news-content { padding: 20px; }
    .ckm-news-item:first-child .ckm-news-title { font-size: 22px; }

    /* --- POZOSTAŁE NEWSY (Kompaktowa Lista PRO) --- */
    .ckm-news-item:not(:first-child) { 
        border-radius: 10px; 
    }
    .ckm-news-item:not(:first-child) .ckm-news-link { 
        flex-direction: row; /* Wymuszamy poziom */
        align-items: stretch; /* Obrazek na pełną wysokość kafla */
    }
    .ckm-news-item:not(:first-child) .ckm-news-thumb { 
        width: 120px; /* Zgrabny kwadrat obrazka */
        height: auto; 
        min-height: 110px; 
    }
    .ckm-news-item:not(:first-child) .ckm-news-content { 
        padding: 15px; 
        justify-content: center;
    }
    .ckm-news-item:not(:first-child) .ckm-news-date { 
        font-size: 10px; 
        margin-bottom: 5px; 
    }
    .ckm-news-item:not(:first-child) .ckm-news-title { 
        font-size: 15px; 
        margin: 0; 
        line-height: 1.3;
    }
    /* Ukrywamy zbędne teksty w małych kaflach, liczy się dynamika */
    .ckm-news-item:not(:first-child) .ckm-news-excerpt,
    .ckm-news-item:not(:first-child) .ckm-news-more { 
        display: none; 
    }

    /* Single Post Mobile */
    .ckm-single-body { padding: 25px; }
    .ckm-single-title { font-size: 26px; }
}