/* ==========================================
    1. RESET I USTAWIENIA BAZOWE
    ========================================== */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    background-color: #ffffff; 
    color: #333; 
    line-height: 1.5;
    overflow-x: hidden; /* Zapobiega poziomemu przewijaniu na mobile */
}

hr { 
    border: 0; 
    height: 1px; 
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0)); 
    margin: 20px 0;
}

/* USTAWIENIE SZEROKOŚCI NA 1200PX */
.container { 
    width: 100%;
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* ==========================================
    2. NAGŁÓWEK
    ========================================== */
.main-header {
    width: 100%;
    background: #ffffff;
    padding: 20px 0;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Pozwala zawijać elementy na mobile */
    gap: 20px;
}

.logo a {
    text-decoration: none;
    text-transform: uppercase;
    font-size: 20px;
    display: block;
}

.logo-bold { color: #003366; font-weight: 900; }
.logo-light { color: #0056b3; font-weight: 300; margin-left: 3px; }

.checkbox-group { display: flex; gap: 8px; flex-wrap: wrap; }
.check-item input { display: none; }
.check-item span {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f2f5;
    color: #003366;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.check-item input:checked + span { background: #003366; color: #fff; }

/* ==========================================
    3. TREŚĆ I SIATKA (4 KOLUMNY)
    ========================================== */
.month-divider {
    width: 100%;
    margin: 30px 0 10px 0;
}

.month-divider span {
    font-size: 20px;
    font-weight: 900;
    color: #003366;
    text-transform: uppercase;
}

.grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); /* 4 KOLUMNY NA DESKTOP */
    gap: 20px; 
    margin-bottom: 50px; 
}

/* ==========================================
    4. KARTA WYDARZENIA (DAY-CARD)
    ========================================== */
.day-card { 
    background: #ffffff; 
    border: 1px solid #e1e8f0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    padding: 15px 0;
    align-items: center;
    height: 100%;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.day-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.event-img-outer {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    padding: 0 15px; /* Marginesy dla zdjęcia wewnątrz karty */
}

.event-img-fixed {
    width: 100%; /* Obrazek dopasowuje się do szerokości karty */
    max-width: 280px; 
    height: 158px; 
    object-fit: cover;
    border-radius: 8px;
    display: block;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.event-content { 
    width: 100%;
    padding: 0 15px;
    text-align: left; 
}

.event-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.time { font-size: 11px; font-weight: 800; color: #0056b3; }
.cat-label { background: #f0f4f8; font-size: 10px; padding: 2px 6px; border-radius: 4px; color: #555; text-transform: uppercase; }

h3 { 
    font-size: 14px; /* Nieco mniejszy font, by zmieścić się w 4 kolumnach */
    font-weight: 900; 
    color: #003366; 
    text-transform: uppercase; 
    margin: 5px 0;
    line-height: 1.3;
}
h3 a { text-decoration: none; color: inherit; }

.desc { 
    font-size: 12px; 
    color: #555; 
    line-height: 1.4; 
    margin-top: 5px;
}

/* ==========================================
    5. SEKCJA STOPKI (FOOTER)
    ========================================== */
.main-footer {
    width: 100%;
    background: #ffffff;
    padding: 20px 0;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
}

/* ==========================================
    6. RESPONSYWNOŚĆ (MOBILE-FIRST)
    ========================================== */

/* Tablety i laptopy (3 kolumny) */
@media (max-width: 1100px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
}

/* Małe tablety (2 kolumny) */
@media (max-width: 850px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
}

/* URZĄDZENIA MOBILNE (Jeden pod drugim) */
@media (max-width: 600px) {
    .container { padding: 0 15px; }
    
    .grid { 
        grid-template-columns: 1fr; /* Jeden wpis pod drugim */
        gap: 15px;
    }

    .header-flex {
        flex-direction: column;
        text-align: center;
    }

    .event-img-fixed {
        max-width: 100%; /* Na mobile zdjęcie może być szersze */
        height: 200px;
    }

    h3 { font-size: 16px; } /* Na mobile tytuły mogą być nieco większe dla czytelności */
}

/* GŁÓWNY KONTENER - WYRÓWNANIE DO 1200PX */
.container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

.main-page-wrapper {
    background-color: #f4f7f9;
    padding: 40px 0 80px 0;
}

/* NAGŁÓWEK SEKCJI */
.content-header {
    margin-bottom: 30px;
    border-left: 5px solid #003366;
    padding-left: 20px;
}

.page-title {
    font-size: 28px;
    color: #003366;
    text-transform: uppercase;
    font-weight: 900;
    margin: 0;
}

/* SIATKA 4 KOLUMNY */
.events-grid-4-col {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* KLUCZ: 4 równe kolumny */
    gap: 20px; /* Odstęp między kartami */
}

/* KARTA WYDARZENIA */
.event-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.event-card:hover {
    transform: translateY(-5px);
}

.card-thumb {
    position: relative;
    height: 160px;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #003366;
    color: #fff;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-date {
    font-size: 12px;
    color: #0056b3;
    font-weight: bold;
    margin-bottom: 8px;
}

.card-title {
    font-size: 16px;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
    font-weight: 700;
    min-height: 44px; /* Trzyma wysokość tytułu przy 2 liniach */
}

.card-location {
    font-size: 13px;
    color: #777;
    margin-bottom: 15px;
}

.card-link {
    margin-top: auto;
    display: block;
    text-align: center;
    background: #f0f4f8;
    color: #003366;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    transition: 0.2s;
}

.card-link:hover {
    background: #003366;
    color: #fff;
}

/* RESPONSIVE - RWD */
@media (max-width: 1100px) {
    .events-grid-4-col { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 850px) {
    .events-grid-4-col { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 550px) {
    .events-grid-4-col { grid-template-columns: 1fr; }
}