/* Mrakoplašova předpovědní stránka — stylesheet */

/* ── Base ── */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0 5px;
    background: #ffffff;
    color: #222;
}

/* ── Header / top links ── */
.page-header {
    width: 100%;
    border-collapse: collapse;
    border: none;
}
.page-header td {
    padding: 0;
    vertical-align: top;
}
.top-links {
    font-family: Arial, sans-serif;
    font-size: 11px;
    text-align: right;
}
.top-links a {
    color: #000;
}

/* ── Site title block ── */

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 900px;
    margin: 10px auto;
    gap: 20px;
}
.header-image img {
    max-width: 120px; /* Zde si můžeš upravit velikost obrázku */
    height: auto;
    display: block;
}
.title-block {
    text-align: left;
}
.title-block h2 {
    color: #202eac;
    font-family: Arial, sans-serif;
    margin: 4px 0;
}
.title-block .subtitle {
    color: #202eac;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
}
.title-block .description {
    font-family: Arial, sans-serif;
    font-size: 12px;
}

/* ── Section headings ── */
h3 {
    font-family: Arial, sans-serif;
    color: #202eac;
    font-size: 16px;
    margin: 24px 0 8px 0;
    text-align: center;
}

/* ── Teletext images — 2-column grid, 480 px per image ── */
.teletext-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: 12px auto;
    max-width: 972px; /* 2 × 480 px + 4 px gap + small buffer */
}
.teletext-block {
    flex: 0 0 480px;
    width: 480px;
}
.teletext-block img {
    width: 480px;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
.teletext-label {
    flex: 0 0 100%;
    font-family: Arial, sans-serif;
    font-size: 11px;
    color: #888;
    text-align: center;
    margin-top: 4px;
}

/* Mobile: one image per row */
@media (max-width: 600px) {
    .teletext-section {
        flex-direction: column;
        align-items: center;
        max-width: 100%;
    }
    .teletext-block {
        flex: 0 0 100%;
        width: 100%;
    }
    .teletext-block img {
        width: 100%;
    }
}

/* ── Weather table (4 cities) ── */
.weather-table {
    width: 1000px;
    margin: 0 auto;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 13px;
    text-align: center;
}
.weather-table th {
    background-color: #c8d8e8;
    padding: 8px;
    border: 1px solid #b0c0d8;
}
.weather-table td {
    padding: 8px 4px;
    border: 1px solid #ddd;
    vertical-align: middle;
}
.weather-table .row-even {
    background-color: #f8f8ff;
}
.weather-table .row-odd {
    background-color: #ffffff;
}

/* ── Hourly forecast table ── */
.forecast-table {
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 12px;
    margin: 4px auto;
}
.forecast-table th {
    background-color: #c8d8e8;
    padding: 4px 8px;
    border: 1px solid #b0c0d8;
}
.forecast-table td {
    padding: 4px 8px;
    border: 1px solid #ddd;
}
.forecast-table .row-even {
    background-color: #f8f8ff;
}
.forecast-table .row-odd {
    background-color: #ffffff;
}

/* ── Map blocks ── */
.map-block {
    text-align: center;
    margin: 16px auto;
}
.map-block .map-title {
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
}
.map-block img {
    display: block;
    margin: 0 auto;
}
.map-block iframe {
    display: block;
    margin: 0 auto;
    border: none;
}
.w800 { width: 800px; }
.w640 { width: 640px; }
.w600 { width: 600px; }
.w480 { width: 480px; }
.w320 { width: 320px; }

/* ── Source captions ── */
.source-caption {
    display: block;
    font-family: Arial, sans-serif;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    text-align: center;
}

/* ── Page content wrapper ── */
.page-content {
    text-align: center;
}

/* ── Footer ── */
.footer-note {
    font-family: Arial, sans-serif;
    font-size: 11px;
    text-align: center;
}

/* Globální pojistka proti přetékání prvků na mobilu */
img, iframe {
    max-width: 100%;
}

/* Změny pro tablety a mobily */
@media (max-width: 850px) {
    /* Přepsání fixních šířek na 100% displeje */
    .w800, .w640, .w600, .w480, .w320 {
        width: 100%;
        height: auto;
    }

    /* Tabulky s počasím se nevejdou, tak se musí scrollovat do boku */
    .weather-table, .forecast-table {
        width: 100%;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Hlavička - Mrakoplaš vedle textu, menší obrázek */
    .header-container {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }
    .header-image {
        flex: 0 0 80px; /* fixní šířka kontejneru pro obrázek */
    }
    .header-image img {
        width: 100%;
        max-width: 80px;
    }
    .title-block {
        text-align: left;
    }

    /* Horní lišta s odkazy na střed */
    .page-header td {
        display: block;
        width: 100%;
    }
    .top-links {
        text-align: center;
    }
}

/* Striktní zalamování teletextu na úzkých displejích mobilů */
@media (max-width: 600px) {
    .teletext-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .teletext-block {
        width: 100%;
        flex: none;
        margin-bottom: 10px;
    }
    .teletext-block img {
        width: 100%;
        height: auto;
    }
}