/* Základní styly pro web školních jídelen */
@import url('https://fonts.googleapis.com/css2?family=Cherry+Bomb+One&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: "Montserrat", sans-serif;
    color: #333;

    background: #F2EFD9;
}

.cherry-bomb-one {
    font-family: "Cherry Bomb One", system-ui;
    font-weight: 400;
    font-style: normal;
}

header {
    background-color: #333;
    color: #fff;
    padding: 1em 0;
    text-align: center;
}

header h1 {
    margin: 0;
}

nav ul {
    list-style-type: none;
    padding: 0;
    text-align: center;
}

nav ul li {
    display: inline;
    margin-right: 20px;
}

nav a {
    color: black;
    text-decoration: none;
}

main {
    padding: 20px;
    margin: 20px;
    background-color: #fff;
}

footer {
    text-align: center;
    padding: 10px;
    background-color: #333;
    color: #fff;
    bottom: 0;
    width: 100%;
}

/* Styly pro veřejnou patičku */
.public-footer {
    background-color: #2c2c2c;
    color: #ccc;
    padding: 2em 0;
    text-align: center;
    border-top: 3px solid #0056b3;
    margin-top: auto; /* Zajistí, že patička bude na spodu, pokud je obsahu málo */
}

.public-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.public-footer nav ul {
    list-style-type: none;
    padding: 0;
    margin-top: 10px;
}

.public-footer nav ul li {
    display: inline-block;
    margin: 0 10px;
}

.public-footer nav ul li a {
    color: #a0d8ff;
    text-decoration: none;
}

.public-footer nav ul li a:hover {
    text-decoration: underline;
}

/* Základní layout pro tělo stránky a hlavní obsah */
.main-public-content {
    flex-grow: 1;
    padding-bottom: 30px; /* Odsazení, aby obsah nebyl překryt patičkou */
}

.container.page-content {
    max-width: 1100px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.page-content h1 {
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: #0056b3;
}

.page-content .subtitle {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 25px;
}

/* Styly pro karty jídelen - přesunuto z public/index.php pro centralizaci */
.canteen-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.canteen-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

.canteen-card h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #007bff;
    font-size: 1.6em;
}

/* Tlačítka */
.button-primary {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1em;
    transition: background-color 0.2s;
}
.button-primary:hover {
    background-color: #0056b3;
}

.button-secondary {
    background-color: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1em;
    transition: background-color 0.2s;
}
.button-secondary:hover {
    background-color: #545b62;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Styly pro homepage - public/homepage.php */
.homepage .homepage-header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.homepage .homepage-header h1 {
    color: #0056b3; /* Stejná jako ostatní H1 v page-content */
    border-bottom: none; /* Odebereme dvojitou čáru */
    margin-bottom: 10px;
}

.homepage .homepage-header .lead {
    font-size: 1.3em;
    color: #555;
    margin-bottom: 0;
}

.homepage-section {
    margin-bottom: 40px;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.homepage-section h2 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.menu-section .placeholder-content {
    text-align: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px dashed #ddd;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.info-card {
    background-color: #fdfdfd;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9e9e9;
    display: flex;
    flex-direction: column;
}

.info-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.info-card p {
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

.info-card .button-primary,
.info-card .button-secondary {
    display: inline-block;
    margin-top: auto; /* Posune tlačítko dolů, pokud je karta vyšší */
}

.info-card .button-group {
    margin-top: auto;
    display: flex;
    gap: 10px; /* Mezera mezi tlačítky */
}

.disabled-link {
    background-color: #adb5bd !important; /* Světlejší šedá pro neaktivní */
    cursor: not-allowed !important;
    opacity: 0.7;
}

.change-canteen-section {
    text-align: center;
    padding: 15px; /* Menší padding pro tuto sekci */
    background-color: transparent; /* Bez pozadí */
    box-shadow: none; /* Bez stínu */
}

/* Styly pro info zprávy (pokud je budeme používat z PHP na index.php) */
.info-message {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: .25rem;
}
.info-message.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.info-message.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Styly pro sekce s příspěvky (aktuality, recepty) na homepage a v listech */
.posts-section h2 {
    text-align: center;
    margin-bottom: 30px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Mírně větší min. šířka */
    gap: 25px; /* Zachovat mezeru */
}

.post-card {
    background-color: #ffffff;
    border-radius: 8px; /* Zaoblené rohy */
    box-shadow: 0 4px 8px rgba(0,0,0,0.08); /* Výraznější stín */
    overflow: hidden; /* Aby obrázek nepřesahoval zaoblené rohy */
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12); /* Zvýrazněný stín při hoveru */
}

.post-card-image-link {
    display: block;
    width: 100%;
    height: 200px; /* Pevná výška pro obrázek */
    overflow: hidden;
}

.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Obrázek vyplní prostor a ořízne se */
    transition: transform 0.3s ease;
}

.post-card:hover .post-card-image {
    transform: scale(1.05); /* Jemné zvětšení obrázku při hoveru na kartu */
}

.post-card-content {
    padding: 20px; /* Vnitřní odsazení obsahu karty */
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Aby obsah zabral zbývající místo */
}

.post-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.4em; /* Větší nadpis */
    line-height: 1.3;
}

.post-card h3 a {
    color: #0056b3; /* Modrá barva z tématu */
    text-decoration: none;
    transition: color 0.2s;
}

.post-card h3 a:hover {
    color: #003d80; /* Tmavší modrá při hoveru */
}

.post-card .post-meta {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 15px;
}

.post-card .post-excerpt {
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
    flex-grow: 1; /* Aby excerpt vyplnil prostor před tlačítkem */
    margin-bottom: 15px;
}

.post-card .button-secondary.button-small,
.post-card .button-secondary { /* Sjednotíme styl pro tlačítko v kartě */
    padding: 8px 15px;
    font-size: 0.9em;
    margin-top: auto; /* Tlačítko na spodek karty */
    align-self: flex-start; /* Zarovnání tlačítka doleva */
}

.all-posts-link {
    text-align: center;
    margin-top: 20px; /* Odsazení od mřížky */
}

/* Styly pro detail příspěvku - post_detail.php */
.post-detail-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 25px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding-top: 10px;
}

.post-detail-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.post-detail-header h1 {
    font-size: 2.2em; /* Větší nadpis pro detail */
    color: #0056b3; /* Konzistentní barva */
    margin-bottom: 10px;
    border-bottom: none; /* Odebrání, pokud .page-content h1 již má */
}

.post-detail-meta {
    font-size: 0.9em;
    color: #6c757d; /* Šedá barva pro metadata */
    margin-bottom: 20px;
}

.post-detail-meta span {
    margin-right: 15px;
}
.post-detail-meta span:last-child {
    margin-right: 0;
}

.post-detail-featured-image {
    width: 100%;
    max-height: 450px; /* Maximální výška úvodního obrázku */
    object-fit: cover; /* Aby obrázek dobře vypadal */
    border-radius: 8px; /* Zaoblené rohy */
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* Styly pro obsah detailu příspěvku - aby odpovídal TinyMCE */
.post-content {
    font-size: 1.12em;
    line-height: 1.1em;
    color: #23272f;
    margin-bottom: 2.5em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.post-content h1, .post-content h2, .post-content h3 {
    color: #000000;
    margin-top: 1.6em;
    margin-bottom: 0.7em;
    font-weight: 700;
    line-height: 1.25;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.post-content h1 { font-size: 2em; }
.post-content h2 { font-size: 1.5em; }
.post-content h3 { font-size: 1.2em; }
.post-content p {
    margin: 0 0 1.3em 0;
}
.post-content ul, .post-content ol {
    margin: 1.2em 0 1.2em 2.2em;
    padding-left: 0;
}
.post-content li {
    margin-bottom: 0.5em;
}
.post-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
    background: #fff;
    font-size: 1em;
}
.post-content th, .post-content td {
    border: 1px solid #d1d5db;
    padding: 10px 14px;
}
.post-content th {
    background: #f0f4fa;
    color: #0056b3;
    font-weight: 600;
}
.post-content blockquote {
    border-left: 4px solid #007bff;
    background: #f8f9fa;
    margin: 1.5em 0;
    padding: 1em 1.5em;
    color: #555;
    font-style: italic;
}
.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.post-content a {
    color: #007bff;
    text-decoration: underline;
    transition: color 0.2s;
}
.post-content a:hover {
    color: #003d80;
    text-decoration: none;
}
.post-content pre, .post-content code {
    background: #f4f4f4;
    color: #222;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
    font-size: 0.98em;
    border-radius: 4px;
}
.post-content pre {
    padding: 1em;
    overflow-x: auto;
    margin: 1.2em 0;
}
.post-content code {
    padding: 2px 6px;
}

.post-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
}

/* Ostatní styly v .post-content jako tabulky, pre, code atd. lze přidat podle potřeby */

/* Responzivní úpravy pro mřížku příspěvků */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .post-card h3 {
        font-size: 1.3em;
    }
    .post-detail-header h1 {
        font-size: 1.8em;
    }
    .post-content h1 { font-size: 1.6em; }
    .post-content h2 { font-size: 1.4em; }
    .post-content h3 { font-size: 1.2em; }
}

@media (max-width: 480px) {
    .posts-grid {
        grid-template-columns: 1fr; /* Jeden sloupec na malých obrazovkách */
    }
    .post-card-image-link {
        height: 180px; /* Mírně menší obrázek na mobilech */
    }
    .post-detail-header h1 {
        font-size: 1.6em;
    }
}

/* Styly pro patičku na stránce příspěvku */
.post-footer a.button-secondary,
.post-footer a.button-primary {
    padding: 8px 15px;
    font-size: 0.9em;
}

.canteen-selection-page .canteen-list {
    list-style-type: none;
    padding: 0;
    margin: 20px 0 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.canteen-selection-page .canteen-list li {
    margin: 0;
    padding: 0;
}

.canteen-selection-page .canteen-link {
    display: block;
    background-color: #ffffff;
    padding: 25px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.canteen-selection-page .canteen-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.canteen-selection-page .canteen-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}

.canteen-selection-page .canteen-link .canteen-name {
    font-size: 1.2rem;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.canteen-selection-page .canteen-link .canteen-city {
    font-size: 0.95rem;
    color: #777;
    display: block;
    margin-top: auto;
}