/* =================================================================
   Obec Ctiměřice v4.0 — Nový design
   DM Sans + DM Serif Display, světlý header, moderní paleta
   ================================================================= */

:root {
    --forest: #1a3a2a;
    --forest-light: #234d38;
    --emerald: #2d8659;
    --emerald-light: #34a065;
    --sage: #7dad8f;
    --mint: #e8f5ee;
    --cream: #f8faf9;
    --water: #3a7cbd;
    --water-light: #e3f0fa;
    --text: #1a2b23;
    --text-mid: #4a5e52;
    --text-light: #6b7f73;
    --border: #d8e2dc;
    --white: #ffffff;
    --red: #d94f4f;
    --red-light: #fef0f0;
    --amber: #c98a1b;
    --amber-light: #fef7e8;

    /* Aliasy pro zpětnou kompatibilitu */
    --green-900: var(--forest);
    --green-700: var(--forest-light);
    --green-600: var(--emerald);
    --green-500: var(--emerald-light);
    --green-100: var(--mint);
    --green-50: var(--cream);
    --blue-700: #1a5276;
    --blue-600: #2471a3;
    --blue-500: var(--water);
    --blue-100: var(--water-light);
    --blue-50: #eaf4fb;
    --gray-900: var(--text);
    --gray-700: var(--text-mid);
    --gray-500: var(--text-light);
    --gray-300: #c5d0c9;
    --gray-200: var(--border);
    --gray-100: #f0f4f2;
    --gray-50: var(--cream);
    --red-500: var(--red);
    --red-100: var(--red-light);
    --yellow-500: var(--amber);
    --yellow-100: var(--amber-light);

    --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-heading: 'DM Serif Display', Georgia, serif;

    --shadow-xs: 0 1px 2px rgba(26,58,42,0.05);
    --shadow-sm: 0 2px 8px rgba(26,58,42,0.06);
    --shadow: 0 4px 12px rgba(26,58,42,0.07);
    --shadow-md: 0 8px 24px rgba(26,58,42,0.08);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --max-width: 1120px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; overflow-y: scroll; scrollbar-gutter: stable; }
body { font-family: var(--font-body); color: var(--text); background: var(--cream); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--emerald); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--forest); }
img { max-width: 100%; height: auto; }

/* ---- Top Bar ---- */
.top-bar {
    background: var(--forest); color: rgba(255,255,255,0.75);
    font-size: 0.78rem; padding: 0.4rem 0; letter-spacing: 0.01em;
}
.top-bar-inner {
    max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
}
.top-bar a { color: rgba(255,255,255,0.85); }
.top-bar a:hover { color: #fff; }
.top-bar-links { display: flex; gap: 1.25rem; align-items: center; }
.top-bar-links span { display: inline-flex; align-items: center; gap: 0.3rem; }

/* ---- Header ---- */
/* .site-header defined in scroll transparency section below */
.header-inner {
    max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
    display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.site-brand {
    display: flex; align-items: center; gap: 0.75rem;
    text-decoration: none; flex-shrink: 0; color: var(--text);
}
.site-brand img { height: 60px; width: auto; }
.site-brand-text h1 {
    font-family: var(--font-heading); font-size: 1.5rem; color: var(--forest);
    line-height: 1.15; font-weight: 400;
}
.site-brand-text small {
    font-size: 0.72rem; color: var(--text-light); text-transform: uppercase;
    letter-spacing: 0.12em; font-weight: 600;
}
.header-right { display: flex; align-items: center; gap: 0.25rem; }

/* ---- Navigace ---- */
.site-nav { display: flex; align-items: center; }
.nav-links { list-style: none; display: flex; gap: 0.1rem; align-items: center; }
.nav-links li { display: flex; align-items: center; }
.nav-dropdown { display: contents; }
.nav-links a {
    color: var(--text-mid); padding: 0.5rem 0.7rem; border-radius: 8px;
    font-size: 0.9rem; font-weight: 500; transition: all 0.2s ease; white-space: nowrap;
    position: relative; letter-spacing: 0.01em; text-decoration: none;
}
.nav-links a:hover { color: var(--forest); background: rgba(45,134,89,0.08); }
.nav-links a.active {
    color: var(--emerald); font-weight: 700; background: rgba(45,134,89,0.1);
}
.nav-links a.active::after {
    content: ''; position: absolute; bottom: 0; left: 0.7rem; right: 0.7rem;
    height: 2.5px; background: var(--emerald); border-radius: 3px 3px 0 0;
}

/* ---- Search toggle ---- */
.search-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: none; border-radius: 50%;
    background: var(--mint); color: var(--emerald);
    cursor: pointer; transition: all 0.2s; flex-shrink: 0; margin-left: 0.25rem;
}
.search-toggle:hover { background: var(--emerald); color: var(--white); transform: scale(1.08); }
.search-toggle svg { display: block; }

/* ---- Search overlay ---- */
.search-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26,58,42,0.95); backdrop-filter: blur(12px);
    z-index: 9999; display: flex; align-items: flex-start; justify-content: center;
    padding-top: 18vh; opacity: 0; visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.search-overlay.open { opacity: 1; visibility: visible; }
.search-overlay-inner {
    width: 100%; max-width: 560px; padding: 0 1.5rem; text-align: center;
    transform: translateY(-30px); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.search-overlay.open .search-overlay-inner { transform: translateY(0); }
.search-overlay h2 {
    font-family: var(--font-heading); color: var(--white);
    font-size: 1.5rem; margin-bottom: 1.5rem; font-weight: 400;
}
.search-overlay-close {
    position: absolute; top: 1.5rem; right: 2rem;
    background: none; border: none; color: rgba(255,255,255,0.5);
    font-size: 2rem; cursor: pointer; line-height: 1;
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: all 0.2s;
}
.search-overlay-close:hover { color: #fff; background: rgba(255,255,255,0.1); }
.search-overlay-form {
    display: flex; margin-bottom: 1.5rem; border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: 0 4px 32px rgba(0,0,0,0.2);
}
.search-overlay-form input {
    flex: 1; padding: 1rem 1.25rem; font-size: 1.1rem; border: none;
    background: var(--white); color: var(--text); font-family: var(--font-body); outline: none;
}
.search-overlay-form input::placeholder { color: var(--text-light); }
.search-overlay-form button {
    padding: 1rem 1.5rem; border: none; background: var(--emerald); color: var(--white);
    font-size: 0.95rem; font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: background 0.2s;
}
.search-overlay-form button:hover { background: var(--emerald-light); }
.search-overlay-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.search-overlay-tags a {
    padding: 0.4rem 0.85rem; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7);
    border-radius: 20px; font-size: 0.82rem; font-weight: 500; transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}
.search-overlay-tags a:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ---- Obsah ---- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
main { flex: 1; padding: 2rem 0; }

.page-title {
    font-family: var(--font-heading); font-size: 1.75rem; color: var(--forest);
    font-weight: 400; margin-bottom: 1.5rem; padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--emerald);
}

/* ---- Hero ---- */
.hero {
    background: linear-gradient(160deg, var(--forest) 0%, var(--forest-light) 40%, var(--emerald) 100%);
    color: var(--white); padding: 4rem 0 3.5rem; margin: -2rem 0 2rem 0;
    text-align: center; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%); border-radius: 50%;
}
.hero h2 {
    font-family: var(--font-heading); font-size: 2.5rem; font-weight: 400;
    line-height: 1.2; margin-bottom: 1rem; position: relative;
}
.hero p {
    max-width: 600px; margin: 0 auto; font-size: 1.05rem;
    line-height: 1.7; color: rgba(255,255,255,0.82); position: relative;
}
.hero-badge {
    display: inline-block; padding: 0.35rem 1rem; background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15); border-radius: 20px;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; margin-bottom: 1.25rem; color: rgba(255,255,255,0.85);
}

/* ---- Slider ---- */
.slider { position: relative; width: 100%; max-height: 480px; overflow: hidden; background: var(--forest); margin: 0 0 2rem 0; border-radius: var(--radius-lg, 16px); }
.slider-track { position: relative; width: 100%; height: 480px; }
.slider-slide {
    position: absolute; inset: 0; opacity: 0; z-index: 0;
    transition: opacity 1.2s ease-in-out;
    pointer-events: none;
}
.slider-slide.active { opacity: 1; z-index: 1; pointer-events: auto; }
.slider-img { width: 100%; height: 480px; object-fit: cover; display: block; }
.slider-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 2.5rem 2rem 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    color: #fff; text-align: center;
}
.slider-title { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 0.4rem; text-shadow: 0 2px 12px rgba(0,0,0,0.8), 0 1px 3px rgba(0,0,0,0.6); color: #fff; }
.slider-subtitle { font-size: 1.1rem; opacity: 0.95; margin-bottom: 0.75rem; text-shadow: 0 1px 8px rgba(0,0,0,0.7), 0 1px 2px rgba(0,0,0,0.5); color: #fff; }
.slider-btn { display: inline-block; padding: 0.6rem 1.5rem; background: var(--emerald); color: var(--white); border-radius: var(--radius-sm); font-weight: 700; font-size: 0.95rem; transition: background 0.2s; text-shadow: none; }
.slider-btn:hover { background: var(--forest-light); color: var(--white); }
.slider-prev, .slider-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; background: rgba(0,0,0,0.35); color: var(--white); border: none; font-size: 1.4rem; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.slider-prev { left: 1rem; }
.slider-next { right: 1rem; }
.slider-prev:hover, .slider-next:hover { background: rgba(0,0,0,0.6); }
.slider-dots { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 0.5rem; }
.slider-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.7); background: transparent; cursor: pointer; transition: all 0.2s; padding: 0; }
.slider-dot.active, .slider-dot:hover { background: var(--white); border-color: var(--white); }
@media (max-width: 768px) { .slider { max-height: 320px; } .slider-track { height: 320px; } .slider-img { height: 320px; } .slider-title { font-size: 1.4rem; } }

/* ---- Info bar ---- */
.info-bar {
    background: linear-gradient(135deg, #f0f9f4 0%, #eef6f9 100%);
    border-bottom: 1px solid var(--border); color: var(--text-mid);
    font-size: 0.85rem; padding: 0.85rem 0;
}
.info-bar-items { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.info-bar-item { white-space: nowrap; display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 500; }
.info-bar a { color: var(--emerald); font-weight: 600; }

/* ---- Quick links ---- */
.home-quick-nav { padding: 2rem 0 0.5rem; }
.quick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.85rem; }
.quick-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.65rem;
    padding: 1.35rem 0.75rem; background: var(--white); border-radius: 14px;
    border: 1px solid var(--border); text-decoration: none; color: var(--text);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1); position: relative; overflow: hidden;
}
.quick-card::before {
    content: ''; position: absolute; inset: 0; opacity: 0;
    background: linear-gradient(135deg, rgba(45,134,89,0.06) 0%, rgba(109,179,232,0.06) 100%);
    transition: opacity 0.3s;
}
.quick-card:hover { border-color: var(--emerald); box-shadow: 0 8px 28px rgba(45,134,89,0.12); transform: translateY(-4px); color: var(--forest); }
.quick-card:hover::before { opacity: 1; }
.quick-card-icon {
    width: 52px; height: 52px; border-radius: 14px; display: flex;
    align-items: center; justify-content: center; font-size: 1.4rem;
    background: linear-gradient(135deg, var(--mint) 0%, #e3f0e8 100%);
    transition: all 0.3s; position: relative; z-index: 1;
}
.quick-card:hover .quick-card-icon { transform: scale(1.1); background: linear-gradient(135deg, var(--emerald) 0%, #3da36e 100%); box-shadow: 0 4px 12px rgba(45,134,89,0.25); }
.quick-card:hover .quick-card-icon { filter: none; }
.quick-card-label { font-weight: 600; font-size: 0.85rem; text-align: center; position: relative; z-index: 1; }

/* ---- Welcome ---- */
.home-welcome { padding: 1.25rem 0 0.5rem; }
.home-welcome p { max-width: 800px; margin: 0 auto; text-align: center; font-size: 1.02rem; color: var(--text-mid); line-height: 1.75; }

/* ---- Home grid ---- */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 1rem; }
.home-section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem; padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--mint);
}
.home-section-header h2 { font-family: var(--font-heading); font-size: 1.3rem; color: var(--forest); margin: 0; font-weight: 400; }
.home-section-header .more-link, .more-link { font-weight: 600; font-size: 0.82rem; color: var(--emerald); white-space: nowrap; letter-spacing: 0.02em; }
.more-link:hover { color: var(--forest); }

/* ---- News cards (homepage) ---- */
.news-card {
    display: flex; gap: 1rem; padding: 1rem; background: var(--white); border-radius: 12px;
    border: 1px solid var(--border); margin-bottom: 0.65rem; text-decoration: none;
    color: inherit; transition: all 0.25s; border-left: 3px solid transparent;
}
.news-card:hover { box-shadow: 0 4px 16px rgba(26,58,42,0.08); border-left-color: var(--emerald); transform: translateX(2px); }
.news-card-date {
    flex-shrink: 0; width: 56px; text-align: center; padding: 0.45rem 0;
    background: linear-gradient(135deg, var(--mint) 0%, #e3f0e8 100%);
    border-radius: 10px;
}
.news-card-day { display: block; font-size: 1.5rem; font-weight: 700; color: var(--emerald); line-height: 1.15; }
.news-card-month { display: block; font-size: 0.72rem; color: var(--text-light); font-weight: 600; }
.news-card-body h3 { font-size: 0.98rem; color: var(--forest); margin-bottom: 0.25rem; line-height: 1.35; }
.news-card:hover .news-card-body h3 { color: var(--emerald); }
.news-card-body p { font-size: 0.86rem; color: var(--text-light); line-height: 1.5; margin: 0; }

/* ---- Board list (homepage) ---- */
.board-list { display: flex; flex-direction: column; gap: 0.5rem; }
.board-item {
    display: flex; gap: 0.85rem; padding: 0.9rem 1rem; background: var(--white);
    border-radius: 12px; border: 1px solid var(--border); text-decoration: none;
    color: inherit; transition: all 0.25s; align-items: flex-start;
    border-left: 3px solid transparent;
}
.board-item:hover { border-left-color: var(--water); box-shadow: 0 4px 16px rgba(26,88,158,0.08); transform: translateX(2px); }
.board-item-icon { font-size: 1.3rem; flex-shrink: 0; }
.board-item-body h3 { font-size: 0.95rem; color: var(--forest); line-height: 1.35; margin-bottom: 0.2rem; }
.board-item:hover .board-item-body h3 { color: var(--water); }
.board-item-meta { font-size: 0.78rem; color: var(--text-light); }

/* ---- Cards ---- */
.card {
    background: var(--white); border-radius: var(--radius); padding: 1.25rem;
    margin-bottom: 0.75rem; border: 1px solid var(--border); transition: all 0.2s;
}
.card:hover { border-color: rgba(45,134,89,0.3); box-shadow: var(--shadow-sm); }
.card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; line-height: 1.4; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--emerald); }
.card .meta { font-size: 0.82rem; color: var(--text-light); margin-bottom: 0.35rem; }
.card .excerpt { color: var(--text-mid); font-size: 0.9rem; line-height: 1.55; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
th, td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { background: var(--mint); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--forest); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--cream); }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 0.2rem 0.55rem; font-size: 0.7rem; font-weight: 700; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-green { background: var(--mint); color: var(--emerald); }
.badge-blue { background: var(--water-light); color: var(--water); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-yellow { background: var(--amber-light); color: var(--amber); }

/* ---- Buttons ---- */
.btn { display: inline-block; padding: 0.55rem 1.25rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.92rem; border: none; cursor: pointer; transition: all 0.2s; text-decoration: none; line-height: 1.4; }
.btn-primary { background: var(--emerald); color: var(--white); }
.btn-primary:hover { background: var(--forest-light); color: var(--white); }
.btn-secondary { background: var(--gray-200); color: var(--text-mid); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #c53030; color: var(--white); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.92rem; color: var(--text-mid); }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"],
.form-group input[type="date"], .form-group input[type="number"], .form-group input[type="datetime-local"],
.form-group textarea, .form-group select {
    width: 100%; padding: 0.6rem 0.85rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.95rem;
    transition: border-color 0.2s; background: var(--white);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(45,134,89,0.12); }
.form-group textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 0.82rem; color: var(--text-light); margin-top: 0.25rem; }

/* ---- Flash ---- */
.flash { padding: 0.85rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-weight: 500; border-left: 4px solid; }
.flash-success { background: var(--mint); border-color: var(--emerald); color: var(--forest); }
.flash-error { background: var(--red-light); border-color: var(--red); color: var(--red); }
.flash-info { background: var(--blue-50); border-color: var(--water); color: var(--blue-700); }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 0.25rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pagination a { padding: 0.4rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-mid); font-size: 0.88rem; font-weight: 600; }
.pagination a:hover { background: var(--mint); border-color: var(--emerald); }
.pagination a.active { background: var(--emerald); color: var(--white); border-color: var(--emerald); }

/* ---- Footer ---- */
.site-footer { background: var(--forest); color: rgba(255,255,255,0.6); margin-top: auto; }
.footer-main {
    max-width: var(--max-width); margin: 0 auto; padding: 2.5rem 1.5rem 2rem;
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem;
}
.footer-brand p { margin-top: 0.5rem; font-size: 0.85rem; line-height: 1.6; max-width: 280px; }
.footer-col h4 { color: rgba(255,255,255,0.9); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; }
.footer-col a { display: block; color: rgba(255,255,255,0.6); font-size: 0.88rem; padding: 0.2rem 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding: 1.25rem 0; font-size: 0.82rem; }
.footer-bottom-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: #fff; }
/* Legacy footer (fallback) */
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 2rem 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-inner a { color: rgba(255,255,255,0.9); }
.footer-inner a:hover { color: var(--white); }

/* ---- Content body ---- */
.content-body { background: var(--white); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-xs); line-height: 1.8; border: 1px solid var(--border); }
.content-body h2, .content-body h3 { margin: 1.5rem 0 0.75rem; color: var(--forest); }
.content-body p { margin-bottom: 1rem; }
.content-body ul, .content-body ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.back-link { display: inline-block; margin-bottom: 1rem; font-weight: 600; font-size: 0.9rem; color: var(--text-light); }
.back-link:hover { color: var(--emerald); }

/* ---- Files ---- */
.file-list { list-style: none; }
.file-list li {
    padding: 0.55rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-bottom: 0.4rem; display: flex; align-items: center; justify-content: space-between;
    background: var(--cream); font-size: 0.9rem; transition: background 0.15s;
}
.file-list li:hover { background: var(--mint); }
.file-list a { font-weight: 600; color: var(--emerald); }
.file-size { font-size: 0.78rem; color: var(--text-light); }

/* File type icons */
.file-type-icon,
.ficon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 48px; border-radius: 4px; font-size: 0.55rem;
    font-weight: 800; letter-spacing: 0.03em; color: var(--white); flex-shrink: 0;
    position: relative; overflow: hidden;
}
.ficon::before {
    content: ''; position: absolute; top: 0; right: 0;
    width: 12px; height: 12px; background: rgba(255,255,255,0.3);
    clip-path: polygon(0 0, 100% 100%, 100% 0);
}
.ficon-pdf { background: linear-gradient(135deg, #e53e3e, #c53030); }
.ficon-doc { background: linear-gradient(135deg, #3a7cbd, #2b5ea7); }
.ficon-xls { background: linear-gradient(135deg, #2d8659, #1e6b45); }
.ficon-img { background: linear-gradient(135deg, #d69e2e, #b7791f); }
.ficon-zip { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.ficon-txt { background: linear-gradient(135deg, #6b7f73, #4a5e52); }
.ficon-default { background: linear-gradient(135deg, #718096, #4a5568); }
/* Legacy aliases */
.file-type-pdf { background: linear-gradient(135deg, #e53e3e, #c53030); }
.file-type-doc { background: linear-gradient(135deg, #3a7cbd, #2b5ea7); }
.file-type-xls { background: linear-gradient(135deg, #2d8659, #1e6b45); }
.file-type-img { background: linear-gradient(135deg, #d69e2e, #b7791f); }
.file-type-default { background: linear-gradient(135deg, #718096, #4a5568); }

/* File list with icons */
.file-list li {
    padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.65rem;
    background: var(--cream); font-size: 0.9rem; transition: all 0.15s;
}
.file-list li:hover { background: var(--mint); border-color: rgba(45,134,89,0.3); }
.file-list .file-info { flex: 1; min-width: 0; }
.file-list .file-info a { font-weight: 600; color: var(--emerald); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .file-info a:hover { color: var(--forest); }
.file-list .file-info .file-size { display: block; font-size: 0.75rem; color: var(--text-light); margin-top: 0.1rem; }
/* Legacy: simple file-list without .file-info wrapper */
.file-list a { font-weight: 600; color: var(--emerald); }
.file-size { font-size: 0.78rem; color: var(--text-light); }

/* ---- Contacts ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.contact-card { background: var(--white); border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--border); border-top: 3px solid var(--emerald); }
.contact-card h3 { color: var(--forest); margin-bottom: 0.75rem; font-size: 1rem; }
.contact-card dt { font-weight: 600; color: var(--text-light); font-size: 0.78rem; margin-top: 0.6rem; text-transform: uppercase; letter-spacing: 0.04em; }
.contact-card dd { color: var(--text); font-size: 0.92rem; margin: 0.1rem 0 0 0; }

/* ---- Mandatory info ---- */
.mandatory-section { background: var(--white); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 0.6rem; border: 1px solid var(--border); border-left: 3px solid var(--water); }
.mandatory-section h3 { font-size: 0.95rem; color: var(--forest); margin-bottom: 0.35rem; }
.mandatory-section .section-num { font-weight: 700; color: var(--water); margin-right: 0.4rem; }

/* ---- Actions ---- */
.actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.actions-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.meta { color: var(--text-light); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ---- Login ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--forest) 0%, var(--emerald) 100%); }
.login-box { background: var(--white); border-radius: var(--radius-lg); padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: var(--shadow-md); }
.login-box h1 { text-align: center; color: var(--forest); font-family: var(--font-heading); margin-bottom: 1.5rem; font-weight: 400; }
.login-box .logo-center { text-align: center; margin-bottom: 1rem; }
.login-box .logo-center img { height: 160px; }

/* ---- WCAG ---- */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 9999; background: var(--forest); color: var(--white); padding: 0.75rem 1.5rem; font-weight: 600; font-size: 0.9rem; border-radius: 0 0 var(--radius) 0; }
.skip-link:focus { left: 0; outline: 3px solid var(--amber); outline-offset: 2px; }
*:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; border-radius: 2px; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }

/* ---- Cookie banner ---- */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; background: var(--forest); color: rgba(255,255,255,0.9); padding: 1rem 0; font-size: 0.88rem; box-shadow: 0 -2px 8px rgba(0,0,0,0.15); }
.cookie-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: space-between; }
.cookie-inner p { margin: 0; flex: 1; min-width: 200px; }
.cookie-inner a { color: var(--mint); text-decoration: underline; }

/* ---- Quick link (legacy) ---- */
.quick-link { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.7rem 1.35rem; background: var(--white); color: var(--forest); border: 2px solid var(--emerald); border-radius: var(--radius); font-weight: 700; font-size: 0.95rem; text-decoration: none; transition: all 0.2s; }
.quick-link:hover { background: var(--emerald); color: var(--white); border-color: var(--emerald); }

/* ---- Search page ---- */
.search-form-big { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.search-form-big input { flex: 1; padding: 0.75rem 1rem; font-size: 1rem; border: 2px solid var(--border); border-radius: var(--radius); font-family: var(--font-body); }
.search-form-big input:focus { border-color: var(--emerald); outline: none; }

/* ---- Gallery ---- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.gallery-card { display: block; background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: all 0.2s; text-decoration: none; color: inherit; }
.gallery-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.gallery-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.gallery-card-placeholder { width: 100%; height: 200px; background: var(--gray-100); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.gallery-card-info { padding: 1rem; }
.gallery-card-info h3 { font-size: 1.05rem; margin: 0 0 0.25rem; }

/* ---- Photo grid + lightbox ---- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.photo-item { display: block; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4/3; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.photo-item:hover img { transform: scale(1.05); }
.photo-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; }
.photo-admin-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4/3; }
.photo-admin-item img { width: 100%; height: 100%; object-fit: cover; }

.lightbox-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.92); display: none; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); }
.lightbox-close { position: absolute; top: 1rem; right: 1.5rem; color: white; font-size: 2rem; cursor: pointer; background: none; border: none; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 2.5rem; cursor: pointer; background: rgba(0,0,0,0.3); border: none; padding: 0.5rem 1rem; border-radius: var(--radius-sm); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-caption { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.8); font-size: 0.9rem; text-align: center; }

/* ---- Poll ---- */
.poll-widget { background: var(--white); border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--border); border-top: 3px solid var(--emerald); }
.poll-widget h3 { font-size: 1.05rem; margin-bottom: 1rem; color: var(--forest); }
.poll-option { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.poll-option label { cursor: pointer; font-size: 0.95rem; }
.poll-bar { height: 24px; background: var(--gray-100); border-radius: 12px; overflow: hidden; margin-bottom: 0.35rem; position: relative; }
.poll-bar-fill { height: 100%; background: var(--emerald); border-radius: 12px; transition: width 0.5s; min-width: 2px; }
.poll-bar-text { position: absolute; right: 8px; top: 3px; font-size: 0.78rem; font-weight: 600; color: var(--text-mid); }
.poll-bar-label { font-size: 0.88rem; margin-bottom: 0.15rem; }

/* ---- Subscribe ---- */
.subscribe-form { display: flex; gap: 0.5rem; max-width: 400px; }
.subscribe-form input { flex: 1; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-body); }

/* ---- Map ---- */
.map-embed { border-radius: var(--radius); overflow: hidden; margin-top: 1.5rem; }
.map-embed iframe { width: 100%; height: 350px; border: 0; }

/* ---- WYSIWYG ---- */
.wysiwyg-container { border: 1px solid var(--border); border-radius: var(--radius-sm); min-height: 200px; }

/* ============ ADMIN ============ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--forest); color: var(--white); flex-shrink: 0; display: flex; flex-direction: column; }
.admin-sidebar-header { padding: 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 0.75rem; }
.admin-sidebar-header span { font-weight: 700; font-size: 0.95rem; }
.admin-nav { list-style: none; padding: 0.75rem 0; flex: 1; overflow-y: auto; }
.admin-nav li a { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1.25rem; color: rgba(255,255,255,0.7); font-size: 0.88rem; font-weight: 500; transition: all 0.15s; border-left: 3px solid transparent; }
.admin-nav li a:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.admin-nav li a.active { background: rgba(255,255,255,0.12); color: var(--white); border-left-color: var(--emerald-light); }
.admin-nav-divider { border-top: 1px solid rgba(255,255,255,0.1); margin: 0.5rem 0; }
.admin-sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.82rem; }
.admin-sidebar-footer a { color: rgba(255,255,255,0.7); }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 0.85rem 1.5rem; }
.admin-topbar h2 { font-size: 1.2rem; color: var(--text); font-family: var(--font-heading); font-weight: 400; }
.admin-content { flex: 1; padding: 1.5rem; background: var(--gray-100); }


.dashboard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--border); border-left: 4px solid var(--emerald); }
.stat-card .stat-number { font-size: 2rem; font-weight: 700; color: var(--emerald); line-height: 1; margin-bottom: 0.25rem; }
.stat-card .stat-label { font-size: 0.82rem; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.admin-table { width: 100%; background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.admin-table th { font-size: 0.78rem; }
.admin-table td { font-size: 0.88rem; vertical-align: middle; }
.audit-action { font-weight: 600; }

/* ============ MOBILE NAV ============ */
.nav-toggle {
    display: none; background: none; border: none; color: var(--text);
    cursor: pointer; padding: 0.5rem; width: 44px; height: 44px;
    position: relative; align-items: center; justify-content: center;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
    display: block; width: 22px; height: 2px; background: currentColor;
    border-radius: 2px; transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    position: absolute; left: 11px;
}
.nav-toggle-bar { top: 50%; transform: translateY(-50%); }
.nav-toggle-bar::before { content: ''; top: -7px; left: 0; position: absolute; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.nav-toggle-bar::after { content: ''; top: 7px; left: 0; position: absolute; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
/* X transform */
.nav-toggle.active .nav-toggle-bar { background: transparent; }
.nav-toggle.active .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle.active .nav-toggle-bar::after { top: 0; transform: rotate(-45deg); }

.mobile-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 98; opacity: 0; transition: opacity 0.3s;
}
.mobile-overlay.open { display: block; opacity: 1; }

.mobile-a11y {
    display: none; padding: 0.75rem 1rem; border-top: 1px solid var(--border);
    background: var(--cream);
}
.mobile-a11y .a11y-bar {
    margin: 0; padding: 0; border: 0;
    display: flex; justify-content: center; gap: 6px;
}
.mobile-a11y .a11y-btn {
    width: 40px; height: 40px; font-size: 0.85rem;
    background: var(--white); border-color: var(--border); color: var(--text-mid);
    border-radius: var(--radius-sm);
}
.mobile-a11y .a11y-btn:hover { background: var(--mint); color: var(--emerald); }
.mobile-a11y .a11y-btn-default.a11y-active { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.mobile-a11y .a11y-btn-theme { font-size: 1rem; }
.mobile-a11y .a11y-sep { width: 1px; height: 28px; background: var(--border); margin: 0 4px; }

/* ============ TABLET (768–1024) ============ */
@media (max-width: 1024px) {
    .nav-links a { padding: 0.4rem 0.45rem; font-size: 0.82rem; }
    .quick-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-main { grid-template-columns: 1fr 1fr; }
}

/* ============ MOBILE (< 900px) ============ */
@media (max-width: 900px) {
    /* Nav toggle */
    .nav-toggle { display: flex; }

    /* Mobile menu — slide-in from right */
    .nav-dropdown {
        position: fixed; top: 0; right: 0; bottom: 0;
        width: 85%; max-width: 360px;
        background: var(--white);
        flex-direction: column; z-index: 99;
        padding-top: 72px;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        box-shadow: -8px 0 40px rgba(26,58,42,0);
        display: flex;
        visibility: hidden;
    }
    .nav-dropdown.open { transform: translateX(0); visibility: visible; box-shadow: -8px 0 40px rgba(26,58,42,0.15); }
    .nav-links { display: flex; flex-direction: column; padding: 0.75rem 0; flex: 1; }
    .nav-links li { display: block; }
    .nav-links a {
        padding: 0.85rem 1.5rem; font-size: 1rem; font-weight: 500;
        border-bottom: none; border-radius: 0;
        min-height: 50px; display: flex; align-items: center; gap: 0.5rem;
        color: var(--text); transition: all 0.15s;
        border-left: 3px solid transparent;
        position: relative;
    }
    .nav-links a:hover { background: rgba(45,134,89,0.05); border-left-color: rgba(45,134,89,0.25); }
    .nav-links a.active {
        background: rgba(45,134,89,0.07); color: var(--emerald); font-weight: 700;
        border-left-color: var(--emerald);
    }
    .nav-links a.active::after { display: none; }

    /* Mobile menu header */
    .nav-dropdown::before {
        content: 'Menu'; display: block; position: absolute; top: 0; left: 0; right: 0;
        height: 72px; line-height: 72px; padding: 0 1.5rem;
        font-size: 1.1rem; font-weight: 700; color: var(--forest);
        border-bottom: 1px solid var(--border);
        background: var(--white);
    }

    /* Show mobile a11y */
    .mobile-a11y { display: block; }

    /* Hide desktop a11y */
    .top-bar .a11y-bar { display: none; }
    .top-bar-links:last-child { justify-content: flex-end; }

    /* Layout */
    .home-grid, .contact-grid, .dashboard-stats { grid-template-columns: 1fr; }
    .footer-main { grid-template-columns: 1fr 1fr; gap: 1.5rem; }

    /* Info bar */
    .info-bar-items { gap: 1rem; font-size: 0.8rem; }


    /* Gallery */
    .gallery-grid { grid-template-columns: 1fr 1fr; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

    /* Tables */
    .table-wrap, table { font-size: 0.85rem; }
    th, td { padding: 0.55rem 0.7rem; }

    /* Hero */
    .hero { padding: 3rem 0 2.5rem; }
    .hero h2 { font-size: 2rem; }
    .hero p { font-size: 0.95rem; }
    .hero-badge { font-size: 0.7rem; }

    /* Cards */
    .card { padding: 1rem; }

    /* Page title */
    .page-title { font-size: 1.5rem; }

    /* Contact strip */
    .contact-strip-inner { gap: 1rem; font-size: 0.82rem; }
}

/* ============ SMALL PHONE (< 600px) ============ */
@media (max-width: 600px) {
    .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .quick-card { padding: 1rem 0.5rem; }
    .quick-card-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .quick-card-label { font-size: 0.78rem; }

    .hero { padding: 2.5rem 0 2rem; }
    .hero h2 { font-size: 1.65rem; }
    .hero p { font-size: 0.9rem; }

    .home-grid { gap: 2rem; }
    .home-section-header h2 { font-size: 1.15rem; }

    .news-card { padding: 0.75rem; gap: 0.75rem; }
    .news-card-date { width: 48px; }
    .news-card-day { font-size: 1.3rem; }

    .footer-main { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.5rem 1.5rem 1rem; }
    .footer-col { padding-bottom: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.06); }

    .gallery-grid { grid-template-columns: 1fr; }

    .contact-grid { gap: 1rem; }
    .contact-card { padding: 1.15rem; }

    .slider { max-height: 280px; }
    .slider-track { height: 280px; }
    .slider-img { height: 280px; }
    .slider-title { font-size: 1.25rem; }
    .slider-subtitle { font-size: 0.9rem; }
    .slider-overlay { padding: 1.5rem 1rem 1.25rem; }
    .slider-prev, .slider-next { width: 36px; height: 36px; font-size: 1.1rem; }

    /* Top bar compact */
    .top-bar { font-size: 0.72rem; }
    .top-bar-inner { flex-direction: column; gap: 0; text-align: center; }
    .top-bar-links { gap: 0.75rem; justify-content: center; }

    /* File list */
    .file-list li { padding: 0.5rem 0.6rem; gap: 0.5rem; }
    .ficon, .file-type-icon { width: 34px; height: 42px; font-size: 0.5rem; }

    /* Table scroll hint */
    .table-wrap { position: relative; }
    .table-wrap::after {
        content: '← swipe →'; display: block; text-align: center;
        font-size: 0.72rem; color: var(--text-light); padding: 0.4rem 0; font-style: italic;
    }
}

/* ============ DARK MODE — mobile overrides ============ */
html.dark .nav-dropdown { background: #141f19; border-top-color: #2a3d32; }
html.dark .nav-links a { border-bottom-color: #2a3d32; }
html.dark .nav-links a:hover { background: #1a2e24; }
html.dark .nav-links a.active { background: #1a2e24; }
html.dark .mobile-a11y { background: #0f1a14; border-top-color: #2a3d32; }
html.dark .mobile-a11y .a11y-btn { background: #141f19; border-color: #2a3d32; color: #b0c4b8; }
html.dark .mobile-a11y .a11y-btn:hover { background: #1a2e24; color: #5dc98f; }
html.dark .mobile-a11y .a11y-sep { background: #2a3d32; }
html.dark .mobile-overlay.open { background: rgba(0,0,0,0.6); }

/* ============ PŘÍSTUPNOST — toolbar ============ */
.a11y-bar {
    display: inline-flex; align-items: center; gap: 2px;
    margin-left: 0.75rem; padding-left: 0.75rem;
    border-left: 1px solid rgba(255,255,255,0.2);
}
.a11y-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8);
    font-size: 0.68rem; font-weight: 700; cursor: pointer; transition: all 0.2s;
    font-family: var(--font-body); line-height: 1; padding: 0;
}
.a11y-btn:hover { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.35); }
.a11y-btn-default { font-size: 0.78rem; font-weight: 800; }
.a11y-btn-default.a11y-active { background: rgba(255,255,255,0.2); color: #fff; border-color: rgba(255,255,255,0.4); }
.a11y-btn-theme { font-size: 0.82rem; }
.a11y-sep { width: 1px; height: 18px; background: rgba(255,255,255,0.15); margin: 0 3px; }

/* ============ HEADER — scroll transparency ============ */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
.site-header.scrolled {
    background: rgba(255,255,255, var(--header-opacity, 0.9));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 16px rgba(26,58,42,0.08);
    border-bottom-color: transparent;
}
html.dark .site-header.scrolled {
    background: rgba(20,31,25, var(--header-opacity, 0.9));
    box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

/* ============ FONT SCALING ============ */
html.font-sm { font-size: 14px; }
html.font-lg { font-size: 18px; }
html.font-xl { font-size: 20px; }

/* ============ DARK MODE ============ */
html.dark {
    --forest: #b5d4c4;
    --forest-light: #8fbda6;
    --emerald: #5dc98f;
    --emerald-light: #6fd9a0;
    --sage: #7dad8f;
    --mint: #1a2e24;
    --cream: #0f1a14;
    --water: #6db3e8;
    --water-light: #1a2d3a;
    --text: #e2ece6;
    --text-mid: #b0c4b8;
    --text-light: #8a9f91;
    --border: #2a3d32;
    --white: #141f19;
    --red: #f87171;
    --red-light: #2a1a1a;
    --amber: #fbbf24;
    --amber-light: #2a2510;

    --green-900: var(--forest);
    --green-700: var(--forest-light);
    --green-600: var(--emerald);
    --green-500: var(--emerald-light);
    --green-100: var(--mint);
    --green-50: var(--cream);
    --blue-700: #7cc4f5;
    --blue-600: #6db3e8;
    --blue-500: var(--water);
    --blue-100: var(--water-light);
    --blue-50: #121f28;
    --gray-900: var(--text);
    --gray-700: var(--text-mid);
    --gray-500: var(--text-light);
    --gray-300: #3a4d42;
    --gray-200: var(--border);
    --gray-100: #1a2820;
    --gray-50: var(--cream);
    --red-500: var(--red);
    --red-100: var(--red-light);
    --yellow-500: var(--amber);
    --yellow-100: var(--amber-light);
}

html.dark body { background: #0f1a14; color: #e2ece6; }

html.dark .site-header { background: #141f19; border-bottom-color: #2a3d32; }
html.dark .site-brand-text h1 { color: #b5d4c4; }
html.dark .nav-links a { color: #b0c4b8; }
html.dark .nav-links a:hover { color: #e2ece6; background: #1a2e24; }
html.dark .nav-links a.active { color: #5dc98f; background: #1a2e24; }
html.dark .search-toggle { background: #1a2e24; color: #5dc98f; }
html.dark .search-toggle:hover { background: #5dc98f; color: #0f1a14; }

html.dark .top-bar { background: #0a1210; }
html.dark .info-bar { background: #141f19; border-bottom-color: #2a3d32; color: #8a9f91; }

html.dark .hero { background: linear-gradient(160deg, #0a1210 0%, #141f19 40%, #1a3a2a 100%); }

html.dark .card { background: #141f19; border-color: #2a3d32; }
html.dark .card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
html.dark .card h3 a { color: #e2ece6; }
html.dark .card h3 a:hover { color: #5dc98f; }

html.dark table { background: #141f19; border-color: #2a3d32; }
html.dark th { background: #1a2e24; color: #b5d4c4; }
html.dark td { border-bottom-color: #2a3d32; }
html.dark tr:hover td { background: #1a2820; }

html.dark .contact-card { background: #141f19; border-color: #2a3d32; border-top-color: #5dc98f; }
html.dark .mandatory-section { background: #141f19; border-color: #2a3d32; border-left-color: #6db3e8; }

html.dark .quick-card { background: #141f19; border-color: #2a3d32; color: #b0c4b8; }
html.dark .quick-card:hover { border-color: #5dc98f; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
html.dark .quick-card-icon { background: #1a2e24; }

html.dark .news-card { background: #141f19; border-color: #2a3d32; }
html.dark .news-card:hover { border-color: #1a2e24; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
html.dark .news-card-date { background: #1a2e24; }
html.dark .news-card-body h3 { color: #b5d4c4; }

html.dark .board-item { background: #141f19; border-color: #2a3d32; }
html.dark .board-item:hover { background: #1a2820; border-color: #1a2d3a; }

html.dark .content-body { background: #141f19; border-color: #2a3d32; }

html.dark .file-list li { background: #1a2820; border-color: #2a3d32; }
html.dark .file-list li:hover { background: #1a2e24; }

html.dark .flash-success { background: #1a2e24; border-color: #5dc98f; color: #5dc98f; }
html.dark .flash-error { background: #2a1a1a; border-color: #f87171; color: #f87171; }

html.dark .poll-widget { background: #141f19; border-color: #2a3d32; border-top-color: #5dc98f; }
html.dark .poll-bar { background: #1a2820; }

html.dark .site-footer { background: #0a1210; }

html.dark .login-page { background: linear-gradient(160deg, #0a1210 0%, #1a3a2a 100%); }
html.dark .login-box { background: #141f19; }
html.dark .login-box h1 { color: #b5d4c4; }

html.dark .form-group input, html.dark .form-group textarea, html.dark .form-group select {
    background: #1a2820; border-color: #2a3d32; color: #e2ece6;
}
html.dark .form-group input:focus, html.dark .form-group textarea:focus, html.dark .form-group select:focus {
    border-color: #5dc98f; box-shadow: 0 0 0 3px rgba(93,201,143,0.15);
}

html.dark .cookie-banner { background: #0a1210; }

html.dark .page-title { color: #b5d4c4; border-bottom-color: #1a2e24; }
html.dark .home-section-header { border-bottom-color: #1a2e24; }
html.dark .home-section-header h2 { color: #b5d4c4; }

html.dark .search-overlay { background: rgba(10,18,16,0.97); }

/* Admin dark mode */
html.dark .admin-topbar { background: #141f19; border-bottom-color: #2a3d32; }
html.dark .admin-topbar h2 { color: #b5d4c4; }
html.dark .admin-content { background: #0f1a14; }
html.dark .stat-card { background: #141f19; border-color: #2a3d32; }
html.dark .admin-table { background: #141f19; border-color: #2a3d32; }
html.dark .dashboard-stats .stat-card { border-left-color: #5dc98f; }

@media (max-width: 900px) {
    .a11y-bar { margin-left: 0.5rem; padding-left: 0.5rem; }
}
@media (max-width: 600px) {
    .a11y-bar { display: none; }
}

/* ============ WYSIWYG EDITOR ============ */
.wysiwyg-wrap {
    border: 1px solid var(--border, #d8e2dc);
    border-radius: var(--radius-sm, 6px);
    overflow: hidden;
    background: var(--white, #fff);
}
.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 8px;
    background: var(--cream, #f8faf9);
    border-bottom: 1px solid var(--border, #d8e2dc);
    align-items: center;
}
.wysiwyg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    color: var(--text-mid, #4a5e52);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}
.wysiwyg-btn:hover {
    background: var(--white, #fff);
    border-color: var(--border, #d8e2dc);
    color: var(--text, #1a2b23);
}
.wysiwyg-btn-active,
.wysiwyg-btn:active {
    background: var(--emerald, #2d8659);
    color: #fff;
    border-color: var(--emerald, #2d8659);
}
.wysiwyg-sep {
    width: 1px;
    height: 20px;
    background: var(--border, #d8e2dc);
    margin: 0 4px;
}
.wysiwyg-editor {
    min-height: 280px;
    max-height: 600px;
    overflow-y: auto;
    padding: 16px 20px;
    font-family: var(--font-body, sans-serif);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text, #1a2b23);
    outline: none;
}
.wysiwyg-editor:focus {
    box-shadow: inset 0 0 0 2px rgba(45,134,89,0.15);
}
.wysiwyg-editor h2 { font-size: 1.4rem; font-weight: 700; margin: 1.25rem 0 0.5rem; color: var(--forest, #1a3a2a); }
.wysiwyg-editor h3 { font-size: 1.15rem; font-weight: 700; margin: 1rem 0 0.4rem; color: var(--forest, #1a3a2a); }
.wysiwyg-editor p { margin: 0 0 0.75rem; }
.wysiwyg-editor ul, .wysiwyg-editor ol { margin: 0 0 0.75rem; padding-left: 1.5rem; }
.wysiwyg-editor li { margin-bottom: 0.25rem; }
.wysiwyg-editor a { color: var(--emerald, #2d8659); text-decoration: underline; }
.wysiwyg-editor hr { border: none; border-top: 2px solid var(--border, #d8e2dc); margin: 1.25rem 0; }
.wysiwyg-editor blockquote { border-left: 3px solid var(--emerald, #2d8659); padding-left: 1rem; margin: 0.75rem 0; color: var(--text-mid, #4a5e52); }
.wysiwyg-editor img { max-width: 100%; height: auto; border-radius: 4px; }
.wysiwyg-editor table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
.wysiwyg-editor th, .wysiwyg-editor td { border: 1px solid var(--border, #d8e2dc); padding: 0.4rem 0.6rem; text-align: left; }
.wysiwyg-source {
    width: 100%;
    min-height: 280px;
    max-height: 600px;
    padding: 16px 20px;
    border: none;
    font-family: var(--font-mono, 'Courier New', monospace);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text, #1a2b23);
    background: var(--cream, #f8faf9);
    resize: vertical;
    outline: none;
}
.wysiwyg-editor:empty::before {
    content: 'Začněte psát...';
    color: var(--text-light, #6b7f73);
    font-style: italic;
    pointer-events: none;
}

/* Dark mode */
html.dark .wysiwyg-wrap { border-color: #2a3d32; background: #141f19; }
html.dark .wysiwyg-toolbar { background: #0f1a14; border-bottom-color: #2a3d32; }
html.dark .wysiwyg-btn { color: #b0c4b8; }
html.dark .wysiwyg-btn:hover { background: #1a2e24; border-color: #2a3d32; color: #e2ece6; }
html.dark .wysiwyg-editor { color: #e2ece6; }
html.dark .wysiwyg-editor:focus { box-shadow: inset 0 0 0 2px rgba(93,201,143,0.15); }
html.dark .wysiwyg-editor h2, html.dark .wysiwyg-editor h3 { color: #b5d4c4; }
html.dark .wysiwyg-editor a { color: #5dc98f; }
html.dark .wysiwyg-editor hr { border-top-color: #2a3d32; }
html.dark .wysiwyg-source { background: #0f1a14; color: #b0c4b8; }
html.dark .wysiwyg-sep { background: #2a3d32; }

/* Responsive */
@media (max-width: 600px) {
    .wysiwyg-btn { min-width: 28px; height: 28px; font-size: 12px; }
    .wysiwyg-editor { min-height: 200px; padding: 12px 14px; font-size: 14px; }
}

/* ============ DRAG & DROP UPLOAD ============ */
.dropzone-wrap { margin-top: 0.25rem; }
.dropzone {
    border: 2px dashed var(--border, #d8e2dc);
    border-radius: var(--radius, 10px);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    background: var(--cream, #f8faf9);
}
.dropzone:hover {
    border-color: var(--emerald, #2d8659);
    background: var(--mint, #e8f5ee);
}
.dropzone-active,
.dropzone-active:hover {
    border-color: var(--emerald, #2d8659);
    background: var(--mint, #e8f5ee);
    border-style: solid;
    transform: scale(1.01);
}
.dropzone-icon {
    color: var(--text-light, #6b7f73);
    margin-bottom: 0.5rem;
    transition: color 0.25s, transform 0.25s;
}
.dropzone:hover .dropzone-icon,
.dropzone-active .dropzone-icon {
    color: var(--emerald, #2d8659);
    transform: translateY(-2px);
}
.dropzone-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text, #1a2b23);
    margin-bottom: 0.25rem;
}
.dropzone-hint {
    font-size: 0.82rem;
    color: var(--text-light, #6b7f73);
}

/* Preview */
.dropzone-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 0.6rem;
}
.dropzone-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--white, #fff);
    border: 1px solid var(--border, #d8e2dc);
    border-radius: var(--radius-sm, 6px);
    transition: background 0.15s;
}
.dropzone-item:hover {
    background: var(--cream, #f8faf9);
}
.dropzone-item-thumb {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dropzone-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border, #d8e2dc);
    background: #f0f0f0;
}
.dropzone-item-thumb .ficon {
    width: 36px;
    height: 44px;
    font-size: 0.55rem;
}
.dropzone-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.dropzone-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text, #1a2b23);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropzone-item-size {
    font-size: 0.75rem;
    color: var(--text-light, #6b7f73);
    margin-top: 1px;
}
.dropzone-item-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--text-light, #6b7f73);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}
.dropzone-item-remove:hover {
    background: var(--red-light, #fef0f0);
    color: var(--red, #d94f4f);
}

/* Dark mode */
html.dark .dropzone { background: #1a2820; border-color: #2a3d32; }
html.dark .dropzone:hover,
html.dark .dropzone-active { background: #1a2e24; border-color: #5dc98f; }
html.dark .dropzone-label { color: #e2ece6; }
html.dark .dropzone-item { background: #141f19; border-color: #2a3d32; }
html.dark .dropzone-item:hover { background: #1a2820; }
html.dark .dropzone-item-name { color: #e2ece6; }
html.dark .dropzone-item-remove:hover { background: #2a1a1a; }

/* Responsive */
@media (max-width: 600px) {
    .dropzone { padding: 1.25rem 1rem; }
    .dropzone-icon svg { width: 32px; height: 32px; }
    .dropzone-label { font-size: 0.88rem; }
}

/* ============ LIVE PREVIEW PANEL ============ */
.preview-panel {
    margin: 1rem 0 1.5rem;
    border: 1px solid var(--border, #d8e2dc);
    border-radius: var(--radius, 10px);
    overflow: hidden;
    background: var(--white, #fff);
}
.preview-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: var(--cream, #f8faf9);
    border-bottom: 1px solid var(--border, #d8e2dc);
}
.preview-panel-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-mid, #4a5e52);
}
.preview-panel-close {
    border: none;
    background: none;
    font-size: 1.2rem;
    color: var(--text-light, #6b7f73);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s;
}
.preview-panel-close:hover {
    background: var(--red-light, #fef0f0);
    color: var(--red, #d94f4f);
}
.preview-panel-body {
    padding: 0;
}
.preview-frame {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}
.preview-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--amber-light, #fef7e8);
    color: var(--amber, #c98a1b);
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}
.btn-preview {
    background: var(--cream, #f8faf9);
    color: var(--text-mid, #4a5e52);
    border: 1px solid var(--border, #d8e2dc);
}
.btn-preview:hover {
    background: var(--mint, #e8f5ee);
    color: var(--emerald, #2d8659);
    border-color: var(--emerald, #2d8659);
}
.btn-preview.btn-active {
    background: var(--emerald, #2d8659);
    color: #fff;
    border-color: var(--emerald, #2d8659);
}

/* Dark mode */
html.dark .preview-panel { background: #141f19; border-color: #2a3d32; }
html.dark .preview-panel-header { background: #0f1a14; border-bottom-color: #2a3d32; }
html.dark .preview-panel-title { color: #b0c4b8; }

/* Preview banner */
.preview-banner {
    background: var(--amber-light, #fef7e8);
    border: 1px solid var(--amber, #c98a1b);
    color: var(--amber, #c98a1b);
    border-radius: var(--radius-sm, 6px);
    padding: 0.65rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    font-weight: 500;
}
.preview-banner span {
    font-weight: 700;
    letter-spacing: 0.04em;
}
.preview-banner a {
    color: var(--amber, #c98a1b);
    font-weight: 700;
    text-decoration: underline;
}
html.dark .preview-banner { background: #2a2510; border-color: #c98a1b; }

/* ============ BREADCRUMB ============ */
.breadcrumb {
    margin-bottom: 1.25rem;
}
.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding: 0;
    margin: 0;
    font-size: 0.82rem;
}
.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    color: var(--text-light, #6b7f73);
}
.breadcrumb-item + .breadcrumb-item::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid var(--text-light, #6b7f73);
    border-top: 1.5px solid var(--text-light, #6b7f73);
    transform: rotate(45deg);
    margin: 0 0.6rem;
    opacity: 0.5;
}
.breadcrumb-item a {
    color: var(--text-light, #6b7f73);
    text-decoration: none;
    transition: color 0.15s;
}
.breadcrumb-item a:hover {
    color: var(--emerald, #2d8659);
}
.breadcrumb-item.active {
    color: var(--text, #1a2b23);
    font-weight: 500;
}
html.dark .breadcrumb-item.active { color: #e2ece6; }
html.dark .breadcrumb-item a { color: #8a9f91; }
html.dark .breadcrumb-item a:hover { color: #5dc98f; }

/* ============ VERSION DIFF ============ */
.diff-line {
    padding: 3px 8px;
    margin: 2px 0;
    font-family: var(--font-mono, 'Courier New', monospace);
    font-size: 0.82rem;
    line-height: 1.5;
    border-radius: 3px;
    white-space: pre-wrap;
    word-break: break-word;
}
.diff-removed {
    background: #fef0f0;
    color: #9b2c2c;
    border-left: 3px solid #e53e3e;
}
.diff-added {
    background: #f0fff4;
    color: #276749;
    border-left: 3px solid #38a169;
}
.version-preview {
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.88rem;
    line-height: 1.65;
}
html.dark .diff-removed { background: #2a1a1a; color: #f5a5a5; border-left-color: #e53e3e; }
html.dark .diff-added { background: #1a2a1a; color: #9ae6b4; border-left-color: #38a169; }

/* ============ PRINT ============ */
.print-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.9rem; background: var(--white, #fff);
    color: var(--text-mid, #4a5e52); border: 1px solid var(--border, #d8e2dc);
    border-radius: var(--radius-sm, 6px); font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.print-btn:hover { background: var(--mint, #e8f5ee); color: var(--emerald, #2d8659); border-color: var(--emerald, #2d8659); }
.print-btn svg { width: 15px; height: 15px; }

.print-header {
    display: none;
}

@media print {
    /* Skrýt vše kromě obsahu */
    .top-bar, .site-header, .site-footer, .breadcrumb,
    .cookie-banner, .skip-link, .mobile-overlay,
    .print-btn, .quick-grid, .subscribe-form,
    .slider, .home-section-header .more-link,
    .contact-strip, .info-bar, .preview-banner,
    .btn, form, .flash { display: none !important; }

    /* Reset */
    body { background: #fff !important; color: #000 !important; font-size: 11pt; line-height: 1.5; }
    main { padding: 0 !important; }
    .container { max-width: 100%; padding: 0; }
    a { color: #000 !important; text-decoration: none !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd; break-inside: avoid; }
    .page-title { font-size: 16pt; border-bottom: 2px solid #333; padding-bottom: 0.3rem; }
    table { font-size: 9pt; }
    th { background: #f0f0f0 !important; }

    /* Print header — logo + adresa */
    .print-header {
        display: flex !important;
        align-items: center;
        gap: 1rem;
        padding-bottom: 0.75rem;
        margin-bottom: 1rem;
        border-bottom: 2px solid #333;
    }
    .print-header img { width: 50px; height: 50px; }
    .print-header-text { flex: 1; }
    .print-header-text h2 { font-size: 14pt; margin: 0; }
    .print-header-text p { font-size: 9pt; color: #555; margin: 2px 0 0; }

    /* Print footer */
    .print-footer {
        display: block !important;
        margin-top: 2rem;
        padding-top: 0.5rem;
        border-top: 1px solid #ccc;
        font-size: 8pt;
        color: #888;
        text-align: center;
    }

    /* Badges čitelné v tisku */
    .badge { border: 1px solid #999 !important; background: #f5f5f5 !important; color: #333 !important; }
    .badge-green { background: #e8f5e9 !important; }
    .badge-yellow { background: #fff8e1 !important; }
    .badge-red { background: #fce4ec !important; }

    /* Odkaz URL za textem */
    .content-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #666; }

    /* Stránkování skrýt */
    .pagination { display: none !important; }
}

/* ============ MOBILE ALL PAGES (< 600px) ============ */
@media (max-width: 600px) {
    /* Universal: inline grids → 1 column */
    [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    /* Universal: flex with gap → wrap */
    [style*="display:flex"][style*="gap"],
    [style*="display: flex"][style*="gap"] { flex-wrap: wrap !important; }
    /* Universal: tables → scroll */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
    thead { white-space: nowrap; }
    th, td { padding: 0.5rem 0.65rem; font-size: 0.82rem; }
    /* Filter bars */
    [style*="align-items:end"],
    [style*="align-items: end"] { align-items: stretch !important; }
    .form-group select, .form-group input { font-size: 16px; }
    /* Buttons */
    .btn { font-size: 0.85rem; padding: 0.45rem 1rem; }
    .btn-sm { font-size: 0.78rem; padding: 0.3rem 0.65rem; }
    .print-btn { font-size: 0.78rem; padding: 0.3rem 0.65rem; }
    /* Page header with print btn */
    [style*="justify-content:space-between"] { gap: 0.5rem !important; }
}

/* ============ PHONE (< 480px) ============ */
@media (max-width: 480px) {
    .container { padding: 0 0.65rem; }
    .header-inner { padding: 0 0.5rem; height: 60px; }
    main { padding: 1rem 0; }

    /* Hero */
    .hero { padding: 1.5rem 0 1.25rem; margin: 0 0 1rem; }
    .hero h2 { font-size: 1.35rem; }
    .hero p { font-size: 0.85rem; padding: 0 0.5rem; }

    /* Headings */
    .page-title { font-size: 1.25rem; margin-bottom: 0.85rem; padding-bottom: 0.5rem; }
    h2 { font-size: 1.1rem; }

    /* Cards */
    .card { padding: 0.75rem; margin-bottom: 0.6rem; border-radius: 10px; }

    /* News */
    .news-card { padding: 0.6rem; gap: 0.5rem; }
    .news-card-date { width: 42px; padding: 0.25rem 0; }
    .news-card-day { font-size: 1.15rem; }
    .news-card-month { font-size: 0.65rem; }
    .news-card-body h3 { font-size: 0.92rem; }
    .news-card-body p { font-size: 0.82rem; }

    /* Quick links */
    .quick-grid { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
    .quick-card { padding: 0.65rem 0.3rem; border-radius: 10px; }
    .quick-card-icon { width: 34px; height: 34px; font-size: 0.95rem; }
    .quick-card-label { font-size: 0.72rem; }

    /* Home sections */
    .home-section-header { margin-bottom: 0.5rem; }
    .home-section-header h2 { font-size: 1.05rem; }

    /* Board items */
    .board-item { padding: 0.6rem; }

    /* Contacts */
    .contact-card { padding: 0.75rem; }
    .contact-card h3 { font-size: 0.95rem; }
    .contact-card dt { font-size: 0.75rem; margin-top: 0.5rem; }
    .contact-card dd { font-size: 0.88rem; }

    /* Mandatory info */
    .mandatory-section { padding: 0.75rem 0.85rem; margin-bottom: 0.5rem; }
    .mandatory-section h3 { font-size: 0.95rem; }

    /* Life situations */
    .content-body { font-size: 0.9rem; }
    .content-body ol, .content-body ul { padding-left: 1.25rem; }

    /* Budgets */
    .file-list li { padding: 0.45rem 0.6rem; font-size: 0.85rem; }

    /* Events */
    .event-date { font-size: 0.82rem; }

    /* Header */
    .site-brand h1 { font-size: 1.1rem; }
    .site-brand small { font-size: 0.6rem; letter-spacing: 0.08em; }
    .site-brand img { height: 44px; }
    .site-brand { gap: 0.5rem; }

    /* Top bar */
    .top-bar { padding: 0.25rem 0.5rem; font-size: 0.72rem; }

    /* Slider */
    .slider-overlay { padding: 1rem 0.75rem; }

    /* Footer */
    .footer-main { padding: 1rem 0.65rem 0.75rem; }
    .footer-col h4 { font-size: 0.82rem; }

    /* Badge */
    .badge { font-size: 0.68rem; padding: 0.15rem 0.45rem; }

    /* Search */
    .search-overlay-box { width: 95%; }

    /* Breadcrumb */
    .breadcrumb { font-size: 0.78rem; }
}

/* ============ TINY PHONE (< 380px) ============ */
@media (max-width: 380px) {
    .container { padding: 0 0.4rem; }
    .header-inner { padding: 0 0.35rem; }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .site-brand h1 { font-size: 1rem; }
    .site-brand img { height: 38px; }
    .news-card-date { width: 38px; }
    .card { padding: 0.6rem; }
    .page-title { font-size: 1.15rem; }
    .hero h2 { font-size: 1.2rem; }
}

/* ============ NAV SUB-MENU (dropdown) ============ */
.nav-has-sub { position: relative; }
.nav-sub-trigger { display: flex !important; align-items: center; gap: 0.25rem; cursor: pointer; }
.nav-arrow { font-size: 0.55rem; opacity: 0.4; transition: transform 0.25s ease; margin-left: 0.15rem; }
.nav-has-sub:hover .nav-arrow,
.nav-has-sub.open .nav-arrow { transform: rotate(180deg); opacity: 1; }

.nav-sub-trigger.active { color: var(--emerald); font-weight: 700; background: rgba(45,134,89,0.1); }
.nav-sub-trigger.active::after {
    content: ''; position: absolute; bottom: 0; left: 0.7rem; right: 0.7rem;
    height: 2.5px; background: var(--emerald); border-radius: 3px 3px 0 0;
}

/* Desktop dropdown — animated */
.nav-sub {
    display: none; position: absolute;
    top: 100%; left: 50%; transform: translateX(-50%);
    min-width: 200px;
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(26,58,42,0.12), 0 2px 8px rgba(26,58,42,0.06);
    padding: 0.35rem 0;
    z-index: 50; list-style: none;
    overflow: hidden;
}
/* Invisible bridge between trigger and dropdown */
.nav-has-sub::after {
    content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 12px; display: none;
}
.nav-has-sub:hover::after { display: block; }
.nav-has-sub:hover .nav-sub { display: block; }
.nav-sub li { list-style: none; display: block !important; width: 100%; }
.nav-sub li a {
    display: block !important;
    padding: 0.6rem 1.15rem 0.6rem 1rem !important;
    color: var(--text-mid) !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    white-space: nowrap;
    border-radius: 0 !important;
    position: relative;
    transition: all 0.15s !important;
    border-left: 3px solid transparent !important;
    margin: 0 !important;
}
.nav-sub li a::after { display: none !important; }
.nav-sub li a:hover { background: rgba(45,134,89,0.06) !important; color: var(--forest) !important; border-left-color: rgba(45,134,89,0.3) !important; }
.nav-sub li a.active { color: var(--emerald) !important; font-weight: 600 !important; background: rgba(45,134,89,0.1) !important; border-left-color: var(--emerald) !important; }

/* Mobile sub-menu — premium */
@media (max-width: 900px) {
    .nav-has-sub { position: static; }
    .nav-has-sub::after { display: none !important; }
    .nav-sub-trigger { font-size: 1rem; justify-content: space-between; }
    .nav-sub-trigger.active::after { display: none; }
    .nav-sub-trigger.active { border-left-color: var(--emerald); }
    .nav-arrow { font-size: 0.7rem; opacity: 0.6; transition: transform 0.3s; margin-left: auto; }
    .nav-sub {
        position: static; display: none;
        box-shadow: none; border: none;
        background: rgba(45,134,89,0.03);
        padding: 0; min-width: 0;
        border-radius: 0; transform: none; opacity: 1;
        border-left: none;
    }
    .nav-has-sub.open .nav-sub { display: block; }
    .nav-has-sub:hover .nav-sub { display: none; }
    .nav-has-sub.open:hover .nav-sub { display: block; }
    .nav-sub li a {
        padding: 0.7rem 1.5rem 0.7rem 2.75rem !important;
        font-size: 0.92rem !important;
        border-radius: 0 !important;
        border-left: 3px solid transparent !important;
        border-bottom: none !important;
        min-height: 46px;
        color: var(--text-mid) !important;
    }
    .nav-sub li a:hover { background: rgba(45,134,89,0.04) !important; border-left-color: rgba(45,134,89,0.2) !important; }
    .nav-sub li a.active { color: var(--emerald) !important; font-weight: 600 !important; border-left-color: var(--emerald) !important; background: rgba(45,134,89,0.06) !important; }
}

/* ============ DARK MODE FIXES ============ */
html.dark .slider-overlay { color: #fff; }
html.dark .slider-title { color: #fff; }
html.dark .slider-subtitle { color: #fff; }
html.dark .slider-btn { background: #5dc98f; color: #0f1a14; }
html.dark .slider-prev, html.dark .slider-next { background: rgba(0,0,0,0.5); color: #fff; }

/* Dark dropdown */
html.dark .nav-sub { background: #1a2820; border-color: #2a3d32; box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
html.dark .nav-sub li a { color: #b0c4b8 !important; }
html.dark .nav-sub li a:hover { background: #1f3329 !important; color: #e2ece6 !important; }
html.dark .nav-sub li a.active { background: #1a3a2a !important; color: #5dc98f !important; border-left-color: #5dc98f !important; }

/* Dark mobile menu */
html.dark .nav-dropdown { background: #141f19; }
html.dark .nav-dropdown::before { background: #141f19; border-bottom-color: #2a3d32; color: #b5d4c4; }
html.dark .nav-sub { background: #0f1a14 !important; }

/* Dark contact strip */
html.dark .contact-strip { background: #141f19; border-color: #2a3d32; color: #8a9f91; }
html.dark .contact-strip a { color: #5dc98f; }

/* Dark breadcrumb */
html.dark .breadcrumb { color: #8a9f91; }
html.dark .breadcrumb a { color: #b0c4b8; }

/* Dark page title */
html.dark .page-title { color: #b5d4c4; border-bottom-color: #2a3d32; }

/* Dark forms */
html.dark input, html.dark textarea, html.dark select { background: #1a2820; border-color: #2a3d32; color: #e2ece6; }
html.dark .form-group label { color: #b0c4b8; }

/* Dark subscribe */
html.dark .subscribe-box { background: #141f19; border-color: #2a3d32; }

/* Dark print btn */
html.dark .print-btn { background: #1a2820; color: #b0c4b8; border-color: #2a3d32; }
html.dark .print-btn:hover { background: #1a2e24; color: #5dc98f; }

/* Dark home section header */
html.dark .home-section-header h2 { color: #b5d4c4; }
html.dark .more-link { color: #5dc98f; }

/* Dark gallery */
html.dark .lightbox-overlay { background: rgba(0,0,0,0.92); }

/* Dark event cards */
html.dark .event-card { background: #141f19; border-color: #2a3d32; }

/* Dark life situations */
html.dark .content-body a { color: #5dc98f; }

/* ============ HOMEPAGE REDESIGN ============ */
/* Welcome text with decorative lines */
.home-welcome-inner { text-align: center; max-width: 800px; margin: 0 auto; padding: 0.5rem 0; }
.home-welcome-inner p { font-size: 1.02rem; color: var(--text-mid); line-height: 1.75; }
.home-welcome-line { height: 1px; background: linear-gradient(to right, transparent, var(--border), transparent); margin: 0.75rem 0; }

/* Events grid on homepage */
.home-events-section { margin-top: 2rem; }
.home-events-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.75rem; }
.home-event-card {
    display: flex; gap: 1rem; align-items: center;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.25rem; transition: all 0.2s;
}
.home-event-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.home-event-date {
    flex-shrink: 0; width: 52px; text-align: center;
    background: linear-gradient(135deg, var(--emerald), var(--forest)); color: #fff;
    border-radius: var(--radius-sm); padding: 0.5rem 0.25rem;
}
.home-event-day { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.home-event-month { display: block; font-size: 0.72rem; font-weight: 600; opacity: 0.85; }
.home-event-body h3 { font-size: 0.95rem; color: var(--forest); margin-bottom: 0.15rem; line-height: 1.3; }
.home-event-location { font-size: 0.82rem; color: var(--text-light); }

/* Subscribe redesign */
.home-subscribe {
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f4fb 100%);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.75rem; text-align: center;
}
.home-subscribe-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.home-subscribe h3 { font-family: var(--font-heading); font-size: 1.15rem; color: var(--forest); margin-bottom: 0.5rem; font-weight: 400; }
.home-subscribe p { font-size: 0.88rem; color: var(--text-mid); margin-bottom: 0.75rem; line-height: 1.5; }
.home-subscribe .subscribe-form { display: flex; gap: 0.5rem; max-width: 320px; margin: 0 auto; }
.home-subscribe .subscribe-form input { flex: 1; }
.home-subscribe-gdpr { font-size: 0.72rem; color: var(--text-light); margin-top: 0.5rem; }

/* Dark mode */
html.dark .home-subscribe { background: linear-gradient(135deg, #141f19 0%, #121f28 100%); border-color: #2a3d32; }
html.dark .home-event-card { background: #141f19; border-color: #2a3d32; }
html.dark .home-event-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
html.dark .home-event-body h3 { color: #b5d4c4; }
html.dark .home-welcome-line { background: linear-gradient(to right, transparent, #2a3d32, transparent); }

/* Dark mode — homepage redesign */
html.dark .info-bar { background: linear-gradient(135deg, #141f19 0%, #121f28 100%); }
html.dark .quick-card::before { background: linear-gradient(135deg, rgba(93,201,143,0.05) 0%, rgba(109,179,232,0.05) 100%); }
html.dark .quick-card-icon { background: linear-gradient(135deg, #1a2e24 0%, #1a2820 100%); }
html.dark .quick-card:hover .quick-card-icon { background: linear-gradient(135deg, #2d8659 0%, #24704a 100%); }
html.dark .news-card { border-left-color: transparent; }
html.dark .news-card:hover { border-left-color: #5dc98f; }
html.dark .news-card-date { background: linear-gradient(135deg, #1a2e24 0%, #1a2820 100%); }
html.dark .board-item { border-left-color: transparent; }
html.dark .board-item:hover { border-left-color: #6db3e8; }

/* ============ SCROLL PROGRESS + BACK TO TOP ============ */
.scroll-progress {
    position: fixed; top: 0; left: 0; height: 4px; z-index: 9999;
    background: linear-gradient(90deg, var(--emerald), #3da36e, var(--water));
    width: 0; transition: width 0.1s linear;
    pointer-events: none;
}

.scroll-top {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--white); border: 2px solid var(--border);
    box-shadow: 0 4px 20px rgba(26,58,42,0.12);
    cursor: pointer; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 0;
    opacity: 0; transform: translateY(20px) scale(0.8);
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
}
.scroll-top.visible {
    opacity: 1; transform: translateY(0) scale(1);
    pointer-events: auto;
}
.scroll-top:hover {
    border-color: var(--emerald);
    box-shadow: 0 6px 28px rgba(45,134,89,0.2);
    transform: translateY(-3px) scale(1.05);
}
.scroll-top:active { transform: translateY(0) scale(0.95); }

.scroll-top-icon {
    font-size: 1.4rem; line-height: 1;
    transition: transform 0.3s;
}
.scroll-top:hover .scroll-top-icon { transform: translateY(-2px); }

.scroll-top-pct {
    font-size: 0.55rem; font-weight: 700; color: var(--text-light);
    line-height: 1; margin-top: -1px; letter-spacing: 0.02em;
}

/* Dark mode */
html.dark .scroll-top { background: #1a2820; border-color: #2a3d32; }
html.dark .scroll-top:hover { border-color: #5dc98f; box-shadow: 0 6px 28px rgba(93,201,143,0.15); }
html.dark .scroll-top-pct { color: #8a9f91; }
html.dark .scroll-progress { background: linear-gradient(90deg, #5dc98f, #3da36e, #6db3e8); }

@media (max-width: 480px) {
    .scroll-top { width: 44px; height: 44px; bottom: 1rem; right: 1rem; }
    .scroll-top-icon { font-size: 1.2rem; }
    .scroll-top-pct { font-size: 0.5rem; }
}
