/* ========== GLOBAL RESETS ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --cce-green: #098137;
    --cce-green-dark: #066828;
    --cce-green-light: #e8f5e9;
    --cce-morning-sky: #3DA3DC;
    --cce-morning-sky-20: rgba(62, 163, 220, .15);
    --cce-night-sky: #1a365d;
    --cce-night-sky-10: rgba(26, 54, 93, .08);

    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --radius: 8px;
    --radius-lg: 12px;
    --nav-width: 220px;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    max-width: 100vw;
    overflow-x: hidden;
}

/* ========== LAYOUT ========== */
.wrap {
    max-width: 1100px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

/* ========== HEADER ========== */
header {
    background: linear-gradient(135deg, var(--cce-green) 0%, var(--cce-green-dark) 100%);
    padding: 20px 28px;
}

header a {
    display: inline-block;
    text-decoration: none;
    color: white;
    transition: opacity .2s;
}

header a:hover {
    opacity: .9;
}

header img#ramecek {
    height: auto;
    max-width: 100%;
    width: auto;
}

/* ========== MAIN CONTENT WRAPPER ========== */
.main-content-wrapper {
    display: flex;
    flex: 1;
}

/* ========== HAMBURGER – SKRYTO NA DESKTOPU ========== */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
}

/* ========== NAVIGATION – MODERN SIDEBAR ========== */
nav {
    width: var(--nav-width);
    min-width: var(--nav-width);
    background: var(--bg-page);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
}

nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

nav > ul > li {
    margin-bottom: 4px;
}

nav > ul > li > a {
    display: block;
    padding: 12px 20px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all .2s ease;
}

nav > ul > li > a:hover {
    background: var(--cce-green-light);
    color: var(--cce-green);
    border-left-color: var(--cce-green);
}

nav li ul {
    padding: 4px 0 8px 0;
    margin-left: 0;
}

nav li li a {
    display: block;
    padding: 10px 20px 10px 28px;
    font-size: .9em;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all .2s ease;
}

nav li li a:hover {
    background: var(--cce-green-light);
    color: var(--cce-green);
    border-left-color: var(--cce-green);
}

/* ========== SECTION – CONTENT ========== */
section {
    flex: 1;
    padding: 28px 32px 40px;
    background: var(--bg-card);
    position: relative;
}

section a {
    color: var(--cce-green);
    text-decoration: none;
    transition: color .2s;
}

section a:hover {
    color: var(--cce-green-dark);
    text-decoration: underline;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3 {
    margin: 0 0 12px 0;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 1.75rem;
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cce-green-light);
}

h2 {
    font-size: 1.35rem;
    margin-top: 24px;
}

h3 {
    font-size: 1.15rem;
    margin-top: 20px;
}

p {
    margin: 0 0 1em 0;
}

/* ========== BOX / CARD ========== */
.box {
    float: right;
    width: 340px;
    margin: 0 0 20px 24px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}


/* Web: box pod nadpisem, float vpravo, text obtéká. Mobil: order ho doplave níže. */
.box h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

/* Kalendář v boxu – stejné barvy jako na stránce Kalendář akcí, bez rámečku */
.box .kalendar {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.box .kalendar tr:nth-child(odd) {
    background: white;
}

.box .kalendar tr:nth-child(even) {
    background: var(--bg-page);
}

.box .kalendar tr:hover {
    background: var(--cce-green-light);
}

/* ========== TABLES ========== */
.kalendar {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.kalendar td, .kalendar th {
    padding: 10px 14px;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

.kalendar tr:last-child td {
    border-bottom: none;
}

.kalendar tr:nth-child(even) {
    background: var(--bg-page);
}

.kalendar tr:hover {
    background: var(--cce-green-light);
}

/* ========== IMAGES ========== */
img {
    max-width: 100%;
    height: auto;
}

img.right {
    float: right;
    margin: 0 0 16px 20px;
}

img.left {
    float: left;
    margin: 0 20px 16px 0;
}

img.shadow {
    box-shadow: var(--shadow-md);
}

.cb {
    clear: both;
}

/* ========== LISTS ========== */
section ul {
    margin: 0 0 1em 0;
    padding-left: 1.5em;
}

section li {
    margin-bottom: 6px;
}

/* ========== FOOTER ========== */
footer {
    margin-top: auto;
    padding: 16px 28px;
    background: var(--cce-green);
    color: white;
    text-align: center;
}

footer a {
    color: white;
    text-decoration: underline;
}

footer a:hover {
    opacity: .9;
}

footer p {
    margin: 0;
    font-size: .875rem;
}

/* ========== WORD WRAP ========== */
section a, footer a, p, li, td, th {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========== CENTER ========== */
center {
    display: block;
    text-align: center;
}

/* ============================================
   RESPONSIVE – MOBILNÍ VERZE
   Breakpoints: 1024px, 768px, 480px
   ============================================ */

@media screen and (max-width: 1024px) {
    .wrap {
        max-width: 100%;
    }

    nav {
        width: 200px;
        min-width: 200px;
    }

    section {
        padding: 20px 24px 40px;
    }
}

/* ===== MOBIL – 768px a méně (HAMBURGER MENU) ===== */
@media screen and (max-width: 768px) {
    .wrap {
        max-width: 100%;
        box-shadow: none;
        padding: 0;
    }

    body {
        font-size: 16px;
    }

    /* Header – místo pro hamburger vpravo */
    header {
        padding: 12px 60px 12px 16px;
        margin-bottom: 0;
    }

    header img#ramecek {
        max-height: 48px;
        max-width: 100%;
        width: auto;
    }

    /* Hamburger – 3 čárky */
    .nav-toggle {
        display: none;
    }

    .nav-toggle-label {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 10px;
        cursor: pointer;
        background: rgba(255,255,255,.2);
        border-radius: var(--radius);
        transition: background .2s;
    }

    .nav-toggle-label:hover {
        background: rgba(255,255,255,.3);
    }

    .nav-toggle-label span {
        display: block;
        width: 22px;
        height: 2px;
        background: white;
        border-radius: 1px;
        transition: transform .3s, opacity .3s;
    }

    /* Křížek při otevření */
    .nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle:checked + .nav-toggle-label span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Umístění hamburgeru v headeru – label musí být v main-content-wrapper, takže ho přemístíme vizuálně */
    .main-content-wrapper {
        flex-direction: column;
        position: relative;
    }

    .nav-toggle-label {
        position: absolute;
        top: -56px;
        right: 16px;
        z-index: 100;
    }

    /* Menu – skryté, zobrazí se po kliknutí */
    nav {
        width: 100%;
        min-width: 100%;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        padding: 0;
        border-right: none;
        border-bottom: none;
        background: var(--bg-card);
        box-shadow: var(--shadow-md);
        transition: max-height .35s ease, opacity .2s;
    }

    .nav-toggle:checked ~ nav {
        max-height: 80vh;
        overflow-y: auto;
        opacity: 1;
    }

    nav > ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 12px 0 16px;
    }

    nav > ul > li {
        margin: 0;
        border-bottom: 1px solid var(--border-color);
    }

    nav > ul > li:last-child {
        border-bottom: none;
    }

    nav > ul > li > a {
        padding: 14px 20px;
        min-height: 48px;
        display: flex;
        align-items: center;
        border-left: none;
        border-radius: 0;
        background: white;
        font-size: 1rem;
    }

    nav > ul > li > a:hover {
        background: var(--cce-green-light);
    }

    nav li ul {
        position: static;
        margin: 0;
        padding: 0 0 8px 20px;
        background: var(--cce-green-light);
        border-radius: 0 0 var(--radius) var(--radius);
    }

    nav li li a {
        padding: 12px 0 12px 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-left: none;
        border-radius: 0;
        font-size: 0.95rem;
    }

    nav li li a:hover {
        background: transparent;
        color: var(--cce-green-dark);
    }

    /* Obsah – flex umožní order: box doplave níže (pod kontakt) */
    section {
        padding: 20px 16px 60px;
        margin: 0;
        display: flex;
        flex-direction: column;
    }
    .box { order: 1; }
    section > img { order: 2; }
    section > center { order: 3; }

    .box {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 20px 0;
        padding: 20px;
    }

    /* Tabulky – scroll */
    .kalendar,
    section table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 16px 0;
    }

    .kalendar table,
    section table {
        min-width: 300px;
    }

    .kalendar td, .kalendar th {
        padding: 12px 10px;
        font-size: 0.9rem;
    }

    /* Obrázky – max-width, vystředění na mobilu */
    img.right, img.left,
    img[style*="float"],
    section img {
        float: none;
        display: block;
        margin: 16px auto;
        max-width: 100%;
        width: auto;
    }

    /* Nadpisy */
    h1 {
        font-size: 1.5rem;
        margin-top: 0;
    }

    h2 {
        font-size: 1.25rem;
        margin-top: 20px;
    }

    h3 {
        font-size: 1.1rem;
    }

    footer {
        padding: 16px;
    }
}

/* ===== MALÉ TELEFONY – 480px a méně ===== */
@media screen and (max-width: 480px) {
    .wrap {
        margin: 0;
    }

    header {
        padding: 10px 12px;
    }

    header img#ramecek {
        max-height: 40px;
    }

    nav > ul {
        padding: 10px 12px 12px;
    }

    nav > ul > li > a {
        padding: 12px 12px;
        min-height: 44px;
        font-size: 0.95rem;
    }

    nav li li a {
        padding: 10px 0 10px 8px;
        min-height: 44px;
    }

    section {
        padding: 16px 12px 50px;
    }

    .box {
        padding: 16px;
    }

    .kalendar td, .kalendar th {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    h1 {
        font-size: 1.35rem;
    }

    h2 {
        font-size: 1.15rem;
    }

    footer {
        padding: 12px;
    }

    footer p {
        font-size: 0.8rem;
    }
}
