/* ==========================================================================
   MHDinfo.cz - Hlavní stylopis
   ========================================================================== */

:root {
    --red-primary: #dc2626;     /* Červená akcentní barva */
    --red-hover: #b91c1c;       
    --bg-body: #f1f5f9;         /* Světle šedé pozadí stránky */
    --bg-card: #ffffff;         /* Bílé pozadí karet a obsahu */
    --text-main: #1e293b;       /* Tmavá barva textu */
    --text-muted: #64748b;      
    --border-color: #e2e8f0;    
    --max-width: 1100px;        
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* --- HLAVIČKA A NAVIGACE --- */
.site-header {
    background: #0f172a url('/img/head2.png') center/cover no-repeat;
    border-bottom: 4px solid var(--red-primary);
    color: white;
    position: relative;
}

.header-overlay {
    background: rgba(15, 23, 42, 0.45);
    padding: 2.5rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-text {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.8), 0 0 10px rgba(220, 38, 38, 0.5);
    letter-spacing: -0.5px;
}

.logo-text span {
    color: #ef4444;
}

.top-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.65);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.top-nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.top-nav a:hover, .top-nav a.active {
    background-color: var(--red-primary);
    color: white;
}

/* --- LAYOUT GRID --- */
.layout-container {
    max-width: var(--max-width);
    margin: 1.5rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
}

/* --- SIDEBAR --- */
.sidebar {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 1.25rem;
    height: fit-content;
}

.sidebar-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--red-primary);
    font-weight: 700;
    border-bottom: 2px solid var(--red-primary);
    padding-bottom: 0.3rem;
    margin-bottom: 0.75rem;
}

.sidebar-menu {
    list-style: none;
    margin-bottom: 1.5rem;
}

.sidebar-menu:last-child {
    margin-bottom: 0;
}

.sidebar-menu li a {
    display: block;
    padding: 0.35rem 0.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.sidebar-menu li a:hover {
    background-color: #fef2f2;
    color: var(--red-primary);
    padding-left: 0.75rem;
}

/* --- HLAVNÍ OBSAH --- */
.main-content {
    min-width: 0;
}

.card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.card-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.card-title {
    color: var(--text-main);
    font-size: 1.4rem;
    border-left: 4px solid var(--red-primary);
    padding-left: 0.75rem;
}

.card h2 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem 0;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3rem;
}

.card p {
    margin-bottom: 1rem;
}

/* --- AKTUALIZACE NA ÚVODNÍ STRÁNCE --- */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.card-header h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.card-title-sub {
    margin: 0;
    border: none;
    font-size: 1.2rem;
}

.card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card p a {
    color: var(--red-primary);
    font-weight: bold;
}

/* --- ŠTÍTKY LINEK A TRATÍ --- */
.badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 700;
    border-radius: 4px;
    font-size: 0.85rem;
}

.badge-pid {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--red-primary, #dc2626);
    color: #ffffff;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.85em;
    display: inline-block;
    letter-spacing: -0.02em;
    box-shadow: inset 0 0 0 1px #334155;
}

.badge-vlak {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-vlak::before {
    content: "\1F686\a0";
    font-size: 0.85em;
}

.badge-silnice {
    background-color: #334155;
    color: #ffffff;
    font-size: 0.8em;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    letter-spacing: 0.5px;
}

/* Vlastní odrážky seznamu */
.custom-list {
    list-style: none;
    margin: 1rem 0;
}

.custom-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.custom-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 10px;
    height: 10px;
    background: url('/img/seznam.png') center/contain no-repeat;
}

/* --- FOTOGRAFIE V TEXTU --- */
figure.featured-photo {
    margin: 1.5rem 0;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

figure.featured-photo img {
    width: 100%;
    height: auto;
    display: block;
}

figure.featured-photo figcaption {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* --- FOTOGALERIE --- */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
    margin: 1rem 0;
}

.photo-gallery img,
.photo-gallery a img {
    width: 100% !important;
    height: 110px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: block;
    transition: transform 0.2s, border-color 0.2s;
}

.photo-gallery a:hover img {
    transform: scale(1.04);
    border-color: var(--red-primary);
}

@media (max-width: 900px) {
    .photo-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 550px) {
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .photo-gallery img,
    .photo-gallery a img {
        height: 100px !important;
    }
}

/* --- TABULKY --- */
.table-wrapper {
    overflow-x: auto;
    margin: 1.25rem 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.data-table thead th {
    background-color: #f8fafc;
    color: var(--red-primary);
    font-weight: 700;
}

.data-table th {
    background-color: #f8fafc;
    width: 90px;
}

/* --- KONTEJNER PRO UŽITEČNÉ ODKAZY --- */
.links-block {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--red-primary);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.9rem;
    background-color: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}

.link-btn:hover {
    border-color: var(--red-primary);
    color: var(--red-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}

.link-map::before   { content: "\1F5FA\a0"; }
.link-pdf::before   { content: "\1F4C4\a0"; }
.link-web::before   { content: "\1F310\a0"; }
.link-bus::before   { content: "\1F68C\a0"; }
.link-train::before { content: "\1F686\a0"; }

/* --- DĚLÍCÍ ČÁRA A PATIČKA --- */
.divider {
    height: 2px;
    background: url('/img/foot.png') center/cover no-repeat;
    margin: 2rem 0;
    border: none;
}

.page-footer-note {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    font-style: italic;
}

.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 3px solid var(--red-primary);
    text-align: center;
    font-size: 0.9rem;
}

.site-footer a {
    color: #ffffff;
    text-decoration: underline;
}

.site-footer a:hover {
    color: var(--red-primary);
}

/* DOLADĚNÍ GLIGHTBOXU */
.gslide-title {
    color: var(--red-primary) !important;
    font-weight: 700;
}

/* --- RESPONSIVITA (MOBILY) --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .top-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .layout-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }
}

/* --- SOCIÁLNÍ SÍTĚ --- */
.social-links {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
}

.top-nav .social-btn,
.site-footer .social-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}

.top-nav .social-btn {
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

.top-nav .social-btn:hover {
    background: var(--red-primary) !important;
    border-color: var(--red-primary) !important;
    transform: translateY(-2px);
}

.site-footer .social-btn {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #ffffff !important;
}

.site-footer .social-btn:hover {
    background: var(--red-primary) !important;
    border-color: var(--red-primary) !important;
    transform: translateY(-2px);
}

.social-btn svg {
    width: 22px !important;
    height: 22px !important;
    fill: currentColor !important;
    display: block !important;
}

/* --- ÚPRAVA MAPY LEAFLET --- */
.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    padding: 4px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
}

.leaflet-popup-tip {
    background: #ffffff !important;
}

.custom-map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
}