/* ==========================================================================
   iPOPOZÍTŘÍ.CZ – HLAVNÍ STYLOVÝ SOUBOR (Modernizováno)
   ========================================================================== */

/* 1. ZÁKLADNÍ NASTAVENÍ A RESET */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-family: Arial, Helvetica, sans-serif;
    background: #eeeeee;
    color: #171717;
}

body {
    margin: 0;
    min-width: 320px;
}

a {
    color: inherit;
    text-decoration: none;
}

.in-feed-ad {
    display: none;
}

/* ==================================================
   MODERNÍ ROZVRŽENÍ STRÁNKY (Flexbox s bannery)
   ================================================== */

.page-wrapper-with-ads {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 15px; /* Přesně 5 bodů odstup mezi webem a bannery */
    max-width: 1380px; /* 160px + 5px + 1050px + 5px + 160px */
    margin: 0 auto;
    padding: 20px 10px;
    box-sizing: border-box;
    position: relative;
}

.page {
    width: 100%;
    max-width: 1050px;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: max-width 0.2s ease;
}

/* Postranní reklamy – drží se nahoře při scrollování */
.side-ad {
    position: sticky;
    top: 20px;
    width: 160px;
    height: 600px;
    flex-shrink: 0;
    z-index: 99;
}

/* Automatické skrytí reklam, když se na obrazovku nevejdou (< 1380px) */
@media (max-width: 1380px) {
    .side-ad {
        display: none !important;
    }
}

/* 2. HLAVIČKA A NAVIGACE */
.topbar {
    height: 86px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.top-date {
    font-size: 13px;
    color: #666666;
    flex: 1;
    text-align: left;
}

.logo {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -1.5px;
    flex: 1;
    text-align: center;
}

.logo span {
    font-weight: 400;
}

.categories {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid #cccccc;
    scrollbar-width: thin;
}

.categories a {
    padding: 15px 15px;
    font-size: 16px;
    font-weight: 700;
}

.categories a:hover,
.categories a.active {
    background: #222222;
    color: #ffffff;
}

main {
    padding: 0 30px 40px;
    flex: 1;
}

.content-layout {
    display: flex;
    gap: 30px;
    padding: 20px;
}

.main-column {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* 3. KARTY ČLÁNKŮ (Základ pro PC) */
.news-card {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid #888;
}

/* Vynutíme skrytí pro panely */
#bazarSearchContainer,
#bazarFormCard {
    display: none !important;
}

#bazarSearchContainer.open, 
#bazarFormCard.open {
    display: flex !important;
}

/* Pořadí prvků na PC: Obrázek (1), Nadpis (2), Meta (3) */
.news-media { 
    order: 1; 
    flex-shrink: 0; 
    width: 250px;
}
.news-header { order: 2; flex: 1; min-width: 0; }
.news-body { order: 3; width: 100%; }

.news-content h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.15;
}

.news-content p {
    margin: 0 0 10px;
    color: #555555;
    font-size: 14px;
    line-height: 1.35;
}

/* ==========================================================================
   TABLETY A MALÉ NOTEBOOKY (do 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .news-media {
        width: 100% !important;
        max-width: 100% !important;
        flex-shrink: 1 !important;
        margin-bottom: 10px !important;
    }

    .news-card {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
    }

    .news-header, .news-body {
        width: 100% !important;
        flex: none !important;
    }

    .news-card .news-header h2 span {
        font-size: 18px !important;
    }
}

/* ==========================================================================
   PC VERZE (Obrazovky do 768px)
   ========================================================================== */
@media (min-width: 768px) {
  .jen-mobil {
    display: none;  
  }
}


/* ==========================================================================
   MOBILNÍ VERZE (Obrazovky do 768px)
   ========================================================================== */
@media (max-width: 768px) {
    main { padding: 10px 8px 40px 8px !important; }
    .content-layout { display: block !important; width: 100% !important; padding: 0 !important; }
    .main-column { display: block !important; width: 100% !important; margin: 0 0 20px 0 !important; }
    .sidebar { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }

    .news-card {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        padding: 10px 0 !important;
    }

    #bazarSearchContainer,
    #bazarFormCard {
        display: none !important;
    }
    
    #bazarSearchContainer.open, 
    #bazarFormCard.open {
        display: flex !important;
    }

    .news-header { display: contents !important; }

    .news-card .article-category { order: 1 !important; width: 100% !important; }
    .news-card h2 { order: 2 !important; width: 100% !important; }
    .news-media { order: 3 !important; width: 100% !important; height: auto !important; margin-bottom: 5px !important; }
    .news-header .news-perex { order: 4 !important; width: 100% !important; margin: 0 0 4px 0 !important; display: block !important; }
    .news-body { order: 5 !important; width: 100% !important; margin-top: 0 !important; padding-top: 0 !important; }

    .news-media img, .news-media div {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16/9 !important;
        object-fit: cover !important;
    }

    .news-card .news-header h2,
    .news-card .news-header h2 span {
        font-size: 22px !important;
        line-height: 1.2 !important;
        margin-bottom: 5px !important;
    }

    .news-perex { font-size: 18px !important; }
    .news-perex span { display: none !important; }
}