/* CMS Karviná – front + admin, Safari/iOS */

:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --touch-min: 44px;
    
    --karvina-primary: #4c589f;
    --karvina-secondary: #313d82;
    --karvina-accent: #e31f24;
    --karvina-accent-dark: #9b1f25;
    --karvina-green: #175d13;
    --karvina-charcoal: #2b2929;
    --karvina-dark: #2b2929;
    --karvina-text: #343434;
    --karvina-light-bg: #f5f7ff;
    --karvina-footer-bg: #f5f7ff;
    --karvina-border: #e0e0e0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.site-front,
body.site-admin {
    min-height: 100vh;
    min-height: 100dvh;
    display: -webkit-box;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    padding-top: var(--safe-top);
    padding-right: var(--safe-right);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
}

body.site-front {
    --site-header-offset: 7.25rem;
    scroll-padding-top: calc(var(--site-header-offset) + var(--safe-top) + 0.5rem);
}

.site-main {
    -webkit-box-flex: 1;
    flex: 1 0 auto;
}

.site-footer {
    margin-top: auto;
}

/* Touch targets (iOS HIG min 44px) */
.touch-target,
.navbar-toggler,
.btn,
.nav-link,
.dropdown-item,
.life-tree button,
.life-tree .tree-link {
    min-height: var(--touch-min);
    min-width: var(--touch-min);
}

@media (pointer: fine) {
    .btn-sm.touch-target {
        min-height: 2rem;
        min-width: auto;
    }
}

/* Min. výška je vyšší než řádek textu, proto text jinak sedí nahoře. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* iOS zoom on focus – inputs min 16px */
input,
select,
textarea,
.form-control,
.form-select {
    font-size: 16px;
}

input[type="date"],
input[type="search"] {
    font-size: 16px;
}

/* Admin layout */
body.site-admin {
    overflow-x: clip;
    max-width: 100%;
}

body.site-admin > .admin-shell {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.admin-shell {
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 100%;
    min-width: 0;
}

.min-vh-admin {
    min-height: 100vh;
    min-height: 100dvh;
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: 0.625rem 1rem;
    background-color: #212529;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.admin-topbar__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-topbar__menu-btn {
    flex-shrink: 0;
    min-height: 2.25rem;
    min-width: auto;
}

.admin-sidebar {
    width: 100%;
    -webkit-overflow-scrolling: touch;
    background-color: #212529 !important;
}

@media (min-width: 992px) {
    .admin-sidebar {
        width: 260px;
        max-height: 100dvh;
        overflow-y: auto;
    }

    .admin-sidebar.collapse:not(.show) {
        display: block;
    }
}

.admin-sidebar__inner {
    width: 100%;
}

.admin-sidebar__view-site {
    justify-content: center;
    font-weight: 500;
}

.admin-shell > .admin-content {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    width: auto;
    overflow-x: clip;
}

.admin-content {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.admin-content .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-content form.row,
.admin-content .admin-filter-form {
    flex-wrap: wrap;
}

.admin-content > .d-flex.justify-content-between.align-items-center {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-content .form-actions,
.admin-content form > .btn,
.admin-content form > a.btn {
    flex-shrink: 0;
}

.admin-content form .d-flex.flex-wrap.gap-2 {
    row-gap: 0.5rem;
}

@media (max-width: 991.98px) {
    .admin-content {
        padding-top: 0.75rem !important;
    }

    .admin-content .table-responsive {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
}

@media (max-width: 767.98px) {
    .admin-content > .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .admin-content > .d-flex.justify-content-between.align-items-center > .btn,
    .admin-content > .d-flex.justify-content-between.align-items-center > a.btn {
        align-self: flex-start;
    }

    .admin-content form.row > [class*="col-"] {
        flex: 0 0 100%;
        width: 100%;
        max-width: none !important;
        min-width: 0 !important;
    }

    .admin-content > .d-flex.justify-content-between.align-items-center.mt-2,
    .admin-content > .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .admin-content .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Statistiky – jednotná velikost oken s grafy */
.stats-chart-card {
    min-height: 22rem;
}

.stats-chart-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.stats-chart-wrap {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 14rem;
    max-height: 16rem;
}

.admin-sidebar a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.admin-sidebar a:hover {
    color: #fff !important;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 0.375rem;
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.admin-sidebar .nav-link:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .nav-link.active {
    background-color: var(--karvina-primary);
    color: #fff !important;
    font-weight: 500;
}

.admin-sidebar hr {
    border-color: rgba(255, 255, 255, 0.2) !important;
    opacity: 1;
}

.admin-sidebar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.admin-sidebar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* Skeleton / loading */
.skeleton-loader .placeholder {
    min-height: 1rem;
}

.min-h-detail {
    min-height: 12rem;
}

/* Life situations tree */
.life-tree .tree-link {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.life-tree .tree-link:hover,
.life-tree .tree-link:focus {
    background-color: rgba(13, 110, 253, 0.08);
}

.life-tree .tree-link.active {
    background-color: rgba(13, 110, 253, 0.12);
    font-weight: 600;
}

.life-tree ul {
    padding-left: 1rem;
}

/* Board list */
.board-intro {
    line-height: 1.6;
}

.board-item td {
    vertical-align: top;
}

/* Smooth scrolling iOS */
.site-header,
.site-main {
    -webkit-overflow-scrolling: touch;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .spinner-border {
        -webkit-animation-duration: 1.5s;
        animation-duration: 1.5s;
    }
}

/* Karviná branding – font a barvy podle karvina.cz */
.site-front {
    font-family: 'Roboto Condensed', sans-serif;
    color: var(--karvina-text);
}

.site-front h1,
.site-front h2,
.site-front h3,
.site-front h4,
.site-front h5,
.site-front h6 {
    font-family: 'Roboto Condensed', sans-serif;
}

.site-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-header__inner {
    padding-top: 0.625rem;
    padding-bottom: 0.375rem;
}

.site-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #f0f0f0;
}

.site-header__search {
    display: flex;
    align-items: stretch;
    flex: 0 1 22rem;
    max-width: 100%;
    margin-left: auto;
}

.site-header__search-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    font-size: 0.875rem;
}

.site-header__search-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-left: 0.875rem;
    padding-right: 0.875rem;
}

.site-header__nav {
    padding-top: 0.25rem;
}

.site-search-results__item {
    position: relative;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

.site-search-results__link {
    display: inline-block;
    font-weight: 600;
    color: var(--karvina-primary);
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.site-search-results__link:hover {
    color: var(--karvina-secondary);
}

.site-search-results__badge {
    display: inline-block;
    margin-left: 0.5rem;
    font-weight: 500;
    vertical-align: middle;
}

.site-search-results__snippet,
.site-search-results__meta {
    margin-top: 0.25rem;
}

.site-search-results__snippet {
    color: #555;
    font-size: 0.875rem;
}

.site-header.sticky-top {
    top: var(--safe-top);
    z-index: 1030;
}

.scroll-to-top {
    position: fixed;
    right: calc(1rem + var(--safe-right));
    bottom: calc(1rem + var(--safe-bottom));
    z-index: 1030;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--karvina-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, background-color 0.2s;
}

.scroll-to-top:hover,
.scroll-to-top:focus-visible {
    background-color: var(--karvina-secondary);
    color: #fff;
}

.scroll-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .scroll-to-top {
        transition: none;
    }
}

.top-bar {
    background-color: var(--karvina-light-bg);
    border-bottom: 1px solid var(--karvina-border);
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.navbar-brand {
    color: var(--karvina-primary) !important;
    font-size: 1.25rem;
}

.site-front .navbar-brand {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    line-height: 1;
}

.site-front .navbar-brand-logo {
    display: block;
    height: 2.5rem;
    width: auto;
    max-width: min(11rem, 52vw);
}

.site-front .site-header__brand .navbar-brand-logo {
    height: 3.75rem;
    max-width: min(16rem, 55vw);
}

@media (max-width: 991.98px) {
    .site-header__top {
        flex-wrap: wrap;
    }

    .site-header__search {
        flex: 1 1 100%;
        order: 3;
    }

    .site-front .site-header__brand .navbar-brand-logo {
        height: 3rem;
    }

    :root {
        --site-header-offset: 9.5rem;
    }
}

/* Frontend nav links – pouze pro veřejnou část */
.site-front .nav-link {
    color: #333 !important;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-front .nav-link:hover,
.site-front .nav-link.active {
    color: var(--karvina-primary) !important;
    border-bottom-color: var(--karvina-accent);
}

/* Hlavní menu – podmenu po najetí (desktop), klik vede na stránku */
.site-header__nav[data-menu-expand-on-click="1"] .main-nav__item {
    position: relative;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__toggle-icon {
    transition: transform 0.2s ease;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__caret {
    transition: transform 0.2s ease;
    vertical-align: -0.125em;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__item--expanded > .main-nav__row .main-nav__toggle-icon,
.site-header__nav[data-menu-expand-on-click="1"] .main-nav__item--expanded > .main-nav__row .main-nav__caret--desktop {
    transform: rotate(90deg);
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub {
    display: none;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__item--expanded > .main-nav__sub {
    display: block;
}

/* Submenu – vzhled jako boční menu stránky */
.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__item {
    border-bottom: 1px solid #f0f0f0;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__item:last-child {
    border-bottom: none;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__row {
    display: flex;
    align-items: stretch;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__link {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: #333;
    text-decoration: none;
    border-bottom: none;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__link:hover {
    background-color: var(--karvina-light-bg);
    color: var(--karvina-primary);
    border-bottom-color: transparent;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__toggle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    min-width: 2.25rem;
    padding: 0;
    border: none;
    border-left: 1px solid #f0f0f0;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__toggle:hover {
    background-color: var(--karvina-light-bg);
    color: var(--karvina-primary);
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__toggle:focus-visible {
    outline: 2px solid var(--karvina-primary);
    outline-offset: -2px;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__sub .main-nav__link {
    padding-left: 1.75rem;
    font-size: 0.82rem;
    color: #555;
}

.site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__sub .main-nav__sub .main-nav__link {
    padding-left: 2.5rem;
}

@media (min-width: 992px) {
    .site-header__nav[data-menu-expand-on-click="1"] .navbar-nav > .main-nav__item--has-sub > .main-nav__sub {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 14rem;
        max-height: min(70vh, calc(100dvh - var(--site-header-offset, 9.5rem) - 1rem));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
        padding: 0.25rem 0;
        margin-top: 0;
        background: #fff;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 0.375rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
        z-index: 1040;
    }

    .site-header__nav[data-menu-expand-on-click="1"] .navbar-nav > .main-nav__item--has-sub > .main-nav__sub::-webkit-scrollbar {
        width: 6px;
    }

    .site-header__nav[data-menu-expand-on-click="1"] .navbar-nav > .main-nav__item--has-sub > .main-nav__sub::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.25);
        border-radius: 3px;
    }

    .site-header__nav[data-menu-expand-on-click="1"] .navbar-nav > .main-nav__item--hover-open > .main-nav__sub::before {
        height: 1rem;
        top: -1rem;
    }

    .site-header__nav[data-menu-expand-on-click="1"] .navbar-nav > .main-nav__item--has-sub > .main-nav__sub::before {
        content: "";
        position: absolute;
        top: -0.5rem;
        left: 0;
        right: 0;
        height: 0.5rem;
    }

    /* Vnořená podmenu se rozbalí dolů (jako boční menu), ne do boku */
    .site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__sub {
        position: static;
        top: auto;
        left: auto;
        min-width: 0;
        padding: 0;
        margin: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }

    .site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub .main-nav__item--has-sub > .main-nav__sub::before {
        content: none;
    }
}

@media (max-width: 991.98px) {
    .site-header__nav[data-menu-expand-on-click="1"] .main-nav__row {
        display: flex;
        align-items: stretch;
    }

    .site-header__nav[data-menu-expand-on-click="1"] .main-nav__row > .main-nav__link {
        flex: 1 1 auto;
        border-bottom: none;
    }

    .site-header__nav[data-menu-expand-on-click="1"] .navbar-nav > .main-nav__item > .main-nav__row > .main-nav__link {
        font-weight: 500;
    }

    .site-header__nav[data-menu-expand-on-click="1"] .main-nav__toggle {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.25rem;
        min-width: 2.25rem;
        padding: 0;
        border: none;
        border-left: 1px solid #f0f0f0;
        background: transparent;
        color: #666;
    }

    .site-header__nav[data-menu-expand-on-click="1"] .navbar-nav > .main-nav__item {
        border-bottom: 1px solid #f0f0f0;
    }

    .site-header__nav[data-menu-expand-on-click="1"] .main-nav__sub {
        padding-left: 0;
    }
}

/* Dynamická fotogalerie v obsahu článku */
.cms-photo-gallery--inline .cms-photo-gallery__link {
    overflow: hidden;
    border-radius: 0.375rem;
    background: #f8f9fa;
}

.cms-photo-gallery--inline .cms-photo-gallery__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.cms-photo-gallery--inline .cms-photo-gallery__link:hover .cms-photo-gallery__thumb {
    transform: scale(1.03);
}

.cms-photo-gallery--slideshow {
    max-width: 720px;
    margin: 1rem 0;
}

.cms-photo-gallery--slideshow .carousel-item img {
    max-height: 480px;
    object-fit: contain;
    background: #111;
}

.cms-photo-gallery__caption {
    line-height: 1.3;
}

.cms-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.88);
}

.cms-lightbox.is-open {
    display: flex;
}

.cms-lightbox__img {
    max-width: min(960px, 100%);
    max-height: calc(100vh - 4rem);
    object-fit: contain;
}

.cms-lightbox__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem;
    color: #fff;
    text-align: center;
    font-size: 0.95rem;
}

.cms-lightbox__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--karvina-primary);
    border-color: var(--karvina-primary);
}

.btn-primary:hover {
    background-color: var(--karvina-secondary);
    border-color: var(--karvina-secondary);
}

/* Červené tlačítko „admin-href“ z karvina.cz */
.btn-accent {
    background-color: var(--karvina-accent);
    border-color: var(--karvina-accent);
    border-bottom: 2px solid var(--karvina-accent-dark);
    color: #fff;
    font-weight: 700;
}

.btn-accent:hover {
    background-color: var(--karvina-accent);
    border-color: var(--karvina-accent);
    opacity: 0.9;
    color: #fff;
}

.section-title {
    color: #222;
    font-weight: 700;
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 2rem;
}

.news-item {
    border-bottom: 1px solid var(--karvina-border);
    padding: 1rem 0;
}

.news-item:last-child {
    border-bottom: 0;
}

.news-date {
    color: #666;
    font-size: 0.875rem;
    font-weight: 500;
}

.news-title {
    color: var(--karvina-primary);
    text-decoration: none;
    font-weight: 600;
}

.news-title:hover {
    color: var(--karvina-primary);
    text-decoration: underline;
}

.home-events-list {
    overflow: hidden;
}

.home-events-list .news-item {
    padding: 0.65rem 0;
}

.home-events-list .news-date,
.home-events-list .h6,
.home-events-list .text-muted {
    line-height: 1.3;
}

.home-events-item[hidden],
.home-events-group[hidden] {
    display: none !important;
}

.home-events-group__title {
    margin: 0;
    padding: 1rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--karvina-charcoal);
}

.home-events-group:first-child .home-events-group__title {
    padding-top: 0.15rem;
}

.home-events-group__title::after {
    content: "";
    display: block;
    width: 2rem;
    height: 3px;
    margin-top: 0.35rem;
    border-radius: 1px;
    background: var(--karvina-accent);
}

.home-events-group__title--tomorrow::after {
    background: #2f9e44;
}

.home-events-group__title--longterm::after {
    background: var(--karvina-primary);
}

.home-events-group .news-item:last-child {
    border-bottom: 1px solid var(--karvina-border);
}

.home-events-list .home-events-group:last-child .news-item:last-child {
    border-bottom: 0;
}

.home-events-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.home-events-pagination .page-link {
    min-width: 2rem;
    text-align: center;
}

.home-events-open {
    display: block;
    width: 100%;
    min-height: 0;
    min-width: 0;
    font-size: inherit;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    white-space: normal;
    color: var(--karvina-primary);
    text-decoration: none;
}

.home-events-open:hover,
.home-events-open:focus {
    color: var(--karvina-primary);
    text-decoration: underline;
}

.home-event-modal__meta dt {
    color: #666;
    font-weight: 600;
}

.home-event-modal__description p,
.home-event-modal__note p {
    white-space: pre-wrap;
}

/* Titulka – kompaktní dlaždice v sekci „Právě se děje“ (stejná velikost jako Turistika) */
.home-hot-tiles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.home-hot-tiles__item {
    max-width: 100%;
}

/* Patička – světlé pozadí podle karvina.cz (třída „bigfoot“) */
.site-footer {
    background-color: var(--karvina-footer-bg);
    color: var(--karvina-text);
    padding: 2rem 0 1rem;
    border-top: 1px solid var(--karvina-border);
}

.site-footer h5 {
    color: #000;
    font-weight: 700;
}

.site-footer a:not(.btn) {
    color: var(--karvina-primary);
    text-decoration: none;
}

.site-footer a:not(.btn):hover {
    color: var(--karvina-secondary);
}

.site-footer .footer-auth-btn {
    justify-content: center;
    min-width: auto;
    vertical-align: middle;
    line-height: 1.5;
    text-decoration: none;
}

.site-footer .border-top {
    border-color: var(--karvina-border) !important;
}

.footer-contact {
    font-size: 0.875rem;
}

.footer-contact a {
    border-bottom: 1px solid var(--karvina-primary);
}

.footer-contact a:hover {
    border-bottom-color: transparent;
}

.footer-social-link {
    font-size: 1.25rem;
}

.hero-section {
    background: linear-gradient(135deg, var(--karvina-primary) 0%, var(--karvina-secondary) 100%);
    color: #fff;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.home-slider {
    margin-bottom: 0;
}

.home-slider__visual {
    min-height: 420px;
    background-color: var(--karvina-dark);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.home-slider__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 51, 102, 0.15) 0%, rgba(0, 51, 102, 0.85) 100%);
}

.home-slider__caption {
    position: relative;
    z-index: 1;
    padding: 3rem 0 2.5rem;
    color: #fff;
}

.home-slider__title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.home-slider__text {
    display: inline-block;
    max-width: 42rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background-color: rgba(76, 88, 159, 0.6);
    border-radius: 0.3rem;
    opacity: 1;
}

.cms-ai-image-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-style: italic;
    color: #666;
}

.cms-ai-image-label--overlay {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2;
    margin: 0;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-style: italic;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.65);
    border-radius: 0.25rem;
    pointer-events: none;
}

.cms-ai-image {
    display: inline-block;
    max-width: 100%;
    margin: 0 0 1rem;
}

.cms-ai-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.cms-ai-image .cms-ai-image-label {
    margin-top: 0.35rem;
    text-align: left;
}

/* ─── Dlaždice sekcí „Magistrát“/„Turistika“ (vzor karvina.cz) ─── */
.home-tile-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--karvina-border);
    border-radius: 0.375rem;
    overflow: hidden;
    background-color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.home-tile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.home-tile-card__header {
    padding: 0.85rem 1rem;
    line-height: 1.3;
}

.home-tile-card__header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.home-tile-card__header a {
    color: #fff;
    text-decoration: none;
}

.home-tile-card__header a:hover {
    color: #fff;
    text-decoration: underline;
}

.home-tile-card__header--green { background-color: var(--karvina-green); }
.home-tile-card__header--navy { background-color: var(--karvina-primary); }
.home-tile-card__header--dark { background-color: var(--karvina-charcoal); }

.home-tile-card__image {
    height: 160px;
    overflow: hidden;
    background-color: var(--karvina-light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.home-tile-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-tile-card__image-icon {
    font-size: 2.5rem;
    color: var(--karvina-border);
}

.home-tile-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
}

.home-tile-card__desc {
    color: #555;
    font-size: 0.9rem;
    flex: 1;
    margin-bottom: 1rem;
}

.home-tile-card__cta {
    align-self: flex-start;
}

.footer-html a {
    color: var(--karvina-primary);
}

.footer-html p:last-child {
    margin-bottom: 0;
}

/* ─── „TOP téma“ – plnobarevný pruh přes celou šířku (vzor karvina.cz) ─── */
.top-topic-bar {
    background-color: var(--karvina-primary);
    width: 100%;
    padding: 0.75rem 0;
}

.top-topic-bar__title {
    display: inline-block;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    padding-right: 1.5rem;
    vertical-align: middle;
}

.top-topic-bar__content {
    display: inline-block;
    vertical-align: middle;
}

.top-topic-bar__content p {
    display: inline-block;
    margin: 0;
    padding: 0.25rem 1rem;
}

.top-topic-bar__content a {
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
    border-bottom: 1px solid #fff;
    padding-bottom: 1px;
}

.top-topic-bar__content a:hover,
.top-topic-bar__content a:focus {
    color: #fff;
    border-bottom-color: transparent;
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.125rem;
    opacity: 0.95;
}

.services-grid {
    background-color: var(--karvina-light-bg);
    padding: 3rem 0;
}

.quick-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-link-btn {
    background-color: #fff;
    border: 1px solid var(--karvina-border);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    text-decoration: none;
    color: #333;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.quick-link-btn:hover {
    background-color: var(--karvina-primary);
    color: #fff;
    border-color: var(--karvina-primary);
}

.page-content {
    line-height: 1.7;
}

.page-content h2 {
    color: var(--karvina-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.page-content h3 {
    color: var(--karvina-dark);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.page-content :is(h1, h2, h3, h4, h5, h6).cms-page-list-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 0;
    row-gap: 0.35rem;
}

.page-content .cms-page-list-heading .editor-toolbar {
    margin: 0 0 0 1.15rem;
    font-weight: 400;
    line-height: 1.2;
}

.page-content .cms-page-list-heading .editor-toolbar__btn,
.page-content .cms-page-list-heading .editor-toolbar__btn:hover,
.page-content .cms-page-list-heading .editor-toolbar__btn:focus-visible {
    text-decoration: none;
    font-weight: 400;
    color: var(--karvina-primary, #4c589f);
}

.page-content p {
    margin-bottom: 1rem;
}

.page-content ul,
.page-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.page-content a:not(.btn) {
    color: var(--karvina-primary);
    text-decoration: underline;
}

.page-content a:not(.btn):hover {
    color: var(--karvina-dark);
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
    margin: 1rem 0;
}

.page-content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.page-content table th,
.page-content table td {
    padding: 0.75rem;
    border: 1px solid var(--karvina-border);
}

.page-content table th {
    background-color: var(--karvina-light-bg);
    font-weight: 600;
    text-align: left;
}

/* ─── Stránka s bočním menu ─────────────────────────────── */

.page-title {
    color: var(--karvina-primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--karvina-primary);
}

.page-perex {
    font-size: 1.05rem;
    color: #444;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

/* Boční navigace */
.page-sidebar {
    background: #fff;
    border: 1px solid var(--karvina-border);
    border-radius: 0.375rem;
    overflow: hidden;
}

.page-sidebar.sticky-top {
    top: calc(var(--site-header-offset, 3.75rem) + var(--safe-top) + 1rem);
}

.cms-page-list {
    margin: 1.25rem 0;
}

.cms-page-list--links {
    padding-left: 1.25rem;
}

.cms-page-list--links li + li {
    margin-top: 0.35rem;
}

.cms-page-list--horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    list-style: none;
    padding-left: 0;
}

.cms-page-list__horizontal-item {
    margin: 0;
}

.cms-page-list--titles-stack .cms-page-list__stack-item + .cms-page-list__stack-item {
    margin-top: 0.5rem;
}

.cms-page-list--titles-stack .cms-page-list__stack-title {
    display: block;
    font-weight: 600;
    text-decoration: none;
}

.cms-page-list--title-perex .cms-page-list__item,
.cms-page-list--title-info .cms-page-list__item,
.cms-page-list--perex-info .cms-page-list__item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--karvina-border);
}

.cms-page-list--title-perex .cms-page-list__item:last-child,
.cms-page-list--title-info .cms-page-list__item:last-child,
.cms-page-list--perex-info .cms-page-list__item:last-child {
    border-bottom: none;
}

.cms-page-list--map .cms-page-list__map-level {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.cms-page-list--map .cms-page-list__map-level .cms-page-list__map-level {
    margin-top: 0.35rem;
    margin-left: 1.25rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--karvina-border);
}

.cms-page-list__map-item + .cms-page-list__map-item {
    margin-top: 0.35rem;
}

.cms-page-list__map-item > a {
    text-decoration: none;
    color: inherit;
}

.cms-page-list__map-item > a:hover {
    color: var(--karvina-primary);
}

.cms-page-list__news-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--karvina-border);
}

.cms-page-list__news-item:last-child {
    border-bottom: none;
}

.cms-page-list__news-title a {
    color: inherit;
    text-decoration: none;
}

.cms-page-list__news-title a:hover {
    color: var(--karvina-primary);
}

.page-content .cms-page-list__news-date {
    display: block;
    margin: 0;
    line-height: 1.3;
}

.page-content .cms-page-list__news-date + :is(.cms-page-list__news-title, .cms-page-list__title) {
    margin-top: 0;
}

.cms-page-list-block {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    border: 2px dashed var(--karvina-primary);
    border-radius: 0.375rem;
    background: #eef5ff;
    color: #0a3d7a;
    font-size: 0.9rem;
}

.cms-paginated-list__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.cms-paginated-list__load-more-wrap {
    flex: 1 1 12rem;
    display: flex;
    justify-content: center;
}

.cms-paginated-list__pagination {
    margin-left: auto;
}

.cms-paginated-list__load-more[disabled] {
    opacity: 0.65;
    pointer-events: none;
}

.tox.tox-tinymce-aux .tox-dialog {
    max-height: calc(100vh - 2rem);
}

.tox.tox-tinymce-aux .tox-dialog__body {
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
}

.tox.tox-tinymce-aux .tox-dialog__footer {
    flex-shrink: 0;
}

.cms-document-list {
    margin: 1.25rem 0;
}

.cms-document-list--links,
.cms-document-list--files,
.cms-document-list--detailed {
    padding-left: 0;
}

.cms-document-list--links li + li {
    margin-top: 0.35rem;
}

.cms-document-list__item {
    padding: 0.35rem 0;
    border-bottom: none;
    font-size: 1rem;
}

.cms-document-list__title {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
}

.cms-document-list__icon {
    margin-right: 0.35rem;
    font-size: 1.1rem;
    vertical-align: -0.15em;
}

.cms-document-list__title a {
    color: inherit;
    text-decoration: none;
}

.cms-document-list__title a:hover {
    color: var(--karvina-primary);
}

.cms-document-list-block {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    border: 2px dashed #198754;
    border-radius: 0.375rem;
    background: #edf7f1;
    color: #145c32;
    font-size: 0.9rem;
}

.cms-document-explorer__heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 0.75rem;
    row-gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.cms-document-explorer__heading .editor-toolbar {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.2;
}

.page-content .cms-document-explorer__heading .editor-toolbar__btn,
.page-content .cms-document-explorer__heading .editor-toolbar__btn:hover,
.page-content .cms-document-explorer__heading .editor-toolbar__btn:focus-visible,
.document-folder-page .cms-document-explorer__heading .editor-toolbar__btn,
.document-folder-page .cms-document-explorer__heading .editor-toolbar__btn:hover,
.document-folder-page .cms-document-explorer__heading .editor-toolbar__btn:focus-visible {
    text-decoration: none;
    font-weight: 400;
    color: var(--karvina-primary, #4c589f);
}

.cms-doc-dropzone {
    padding: 1.25rem;
    border: 2px dashed #adb5bd;
    border-radius: 0.5rem;
    text-align: center;
    background: #f8f9fa;
    color: #495057;
}

.cms-doc-dropzone.is-dragover {
    border-color: var(--karvina-primary, #0d6efd);
    background: #e7f1ff;
}

.cms-doc-dropzone > .bi {
    font-size: 1.75rem;
    color: var(--karvina-primary, #0d6efd);
}

.cms-document-explorer__section + .cms-document-explorer__section {
    margin-top: 1.75rem;
}

.cms-folder-up {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-weight: 600;
    text-decoration: none;
}

.cms-folder-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.cms-folder-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--karvina-border, rgba(0, 0, 0, 0.12));
    border-radius: 0.5rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.cms-folder-card:hover {
    border-color: var(--karvina-primary, #0d6efd);
    color: inherit;
}

.page-content a.cms-folder-card,
.page-content a.cms-folder-card:hover {
    color: inherit;
    text-decoration: none;
}

.cms-folder-card__icon {
    flex: 0 0 auto;
    font-size: 1.5rem;
    color: #c5811a;
}

.cms-folder-card__count {
    color: #6c757d;
    font-weight: 400;
}

.cms-file-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border: 0;
    color: inherit;
    text-decoration: none;
}

.cms-file-row:hover,
.cms-file-row:focus-visible {
    color: inherit;
    text-decoration: none;
}

.page-content a.cms-file-row,
.page-content a.cms-file-row:hover,
.page-content a.cms-file-row:focus-visible {
    color: inherit;
    text-decoration: none;
}

.cms-file-row:hover .cms-file-row__title,
.cms-file-row:focus-visible .cms-file-row__title {
    color: var(--karvina-primary, #0d6efd);
}

.cms-file-row__icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 2.5rem;
    line-height: 1;
}

.cms-file-row__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.1rem;
}

.cms-file-row__title {
    color: var(--karvina-dark, #2b2929);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.cms-file-row__meta,
.cms-file-row__desc {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25;
}

.cms-contact-vcard {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    background: #fff;
}

/* Samostatná vizitka: šířka jedné dlaždice (col-lg-4), těsnější řádkování a okraje. */
.cms-contact-vcard--single {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    gap: 0.5rem;
    padding: 0.4rem 0.55rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

@media (min-width: 576px) {
    .cms-contact-vcard--single {
        width: calc((100% - 1rem) / 2);
        max-width: calc((100% - 1rem) / 2);
    }
}

@media (min-width: 992px) {
    .cms-contact-vcard--single {
        width: calc((100% - 2rem) / 3);
        max-width: calc((100% - 2rem) / 3);
    }
}

.page-content .cms-contact-vcard--single .cms-contact-vcard__name {
    margin: 0 0 0.1rem !important;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    color: inherit;
}

.page-content .cms-contact-vcard--single p {
    margin: 0 0 0.12rem !important;
    line-height: 1.3;
    font-size: 0.9rem;
}

.page-content .cms-contact-vcard--single .cms-contact-vcard__function {
    margin-bottom: 0.15rem !important;
}

.page-content .cms-contact-vcard--single .cms-contact-vcard__room {
    margin-bottom: 0 !important;
}

.page-content .cms-contact-vcard--single img {
    margin: 0;
}

.cms-contact-vcard--single a {
    overflow-wrap: anywhere;
}

.cms-contact-vcard__photo img {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: 0.375rem;
}

.contact-card__photo {
    width: 72px;
    height: 96px;
    object-fit: cover;
    flex-shrink: 0;
}

.cms-contact-list__description {
    font-size: 0.95rem;
}

.cms-contact-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.cms-contact-table th,
.cms-contact-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    vertical-align: top;
    text-align: left;
}

.cms-contact-table th {
    background: #f4f7fb;
    font-weight: 600;
    white-space: nowrap;
}

.cms-contact-table a {
    color: inherit;
}

.cms-contact-table__assignment {
    white-space: normal;
    min-width: 8rem;
}

.cms-contact-table__phone,
.cms-contact-table__phone-value {
    white-space: nowrap;
}

.cms-contact-table__emphasis {
    font-weight: 700;
}

.cms-contact-block {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    border: 2px dashed #6f42c1;
    border-radius: 0.375rem;
    background: #f3ecff;
    color: #4a2d7a;
    font-size: 0.9rem;
}

.page-sidebar__header {
    background-color: var(--karvina-primary);
    padding: 0.75rem 1rem;
}

.page-sidebar__section-link {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: block;
}

.page-sidebar__section-link:hover {
    color: #fff;
    text-decoration: underline;
}

.page-sidebar__menu {
    padding: 0.25rem 0;
}

.page-sidebar__item {
    border-bottom: 1px solid #f0f0f0;
}

.page-sidebar__item:last-child {
    border-bottom: none;
}

.page-sidebar__row {
    display: flex;
    align-items: stretch;
}

.page-sidebar__link {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.page-sidebar__link:hover {
    background-color: var(--karvina-light-bg);
    color: var(--karvina-primary);
}

.page-sidebar__toggle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    padding: 0;
    border: none;
    border-left: 1px solid #f0f0f0;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.page-sidebar__toggle:hover {
    background-color: var(--karvina-light-bg);
    color: var(--karvina-primary);
}

.page-sidebar__toggle:focus-visible {
    outline: 2px solid var(--karvina-primary);
    outline-offset: -2px;
}

.page-sidebar__toggle-icon {
    transition: transform 0.2s ease;
}

.page-sidebar__item--expanded > .page-sidebar__row .page-sidebar__toggle-icon {
    transform: rotate(90deg);
}

.page-sidebar__item--active > .page-sidebar__row > .page-sidebar__link {
    background-color: var(--karvina-light-bg);
    color: var(--karvina-primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--karvina-primary);
}

.page-sidebar__sub .page-sidebar__item--active > .page-sidebar__row > .page-sidebar__link {
    padding-left: 1.75rem;
}

.page-sidebar__sub .page-sidebar__sub .page-sidebar__item--active > .page-sidebar__row > .page-sidebar__link {
    padding-left: 2.5rem;
}

.page-sidebar__item--has-sub:not(.page-sidebar__item--expanded) > .page-sidebar__sub {
    display: none;
}

.page-sidebar__sub {
    padding-left: 0;
}

.page-sidebar__sub .page-sidebar__link {
    padding-left: 1.75rem;
    font-size: 0.82rem;
    color: #555;
}

.page-sidebar__sub .page-sidebar__sub .page-sidebar__link {
    padding-left: 2.5rem;
}

/* Dlaždice podkategorií (vzor karvina.cz/magistrat) */
.page-tiles {
    margin-bottom: 2rem;
}

.page-tile-card {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 1px solid var(--karvina-border);
    border-radius: 0.5rem;
    background: #fff;
    text-decoration: none;
    color: #333;
    transition: box-shadow 0.2s, transform 0.2s;
    height: 100%;
    overflow: hidden;
}

.page-tile-card:hover {
    box-shadow: 0 4px 12px rgba(76, 88, 159, 0.15);
    transform: translateY(-3px);
    color: var(--karvina-primary);
}

.page-tile-card__img-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.page-tile-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-tile-card__img-wrap--placeholder {
    background-color: var(--karvina-light-bg);
}

.page-tile-card__placeholder-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -65%);
    color: var(--karvina-secondary);
}

.page-tile-card__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.88);
    text-align: center;
}

.page-tile-card__title {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.35;
    margin: 0;
}

/* Drobečková navigace */
.breadcrumb {
    font-size: 0.85rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #999;
}

.breadcrumb-item a,
.breadcrumb-item a:hover,
.breadcrumb-item a:focus {
    color: var(--karvina-primary);
}

/* ─── Responzivní přizpůsobení ────────────────────────── */

@media (max-width: 767.98px) {
    .page-title {
        font-size: 1.4rem;
    }

}

@media (max-width: 767.98px) {
    .home-slider__visual {
        min-height: 280px;
    }

    .home-slider__caption {
        padding: 2rem 0 1.5rem;
    }

    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .services-grid {
        padding: 2rem 0;
    }

    .top-topic-bar__title {
        display: block;
        padding-right: 0;
        margin-bottom: 0.25rem;
        font-size: 1.2rem;
    }

    .top-topic-bar__content p {
        padding: 0.15rem 0.6rem 0.15rem 0;
    }
}

/* ============================================================
   Editor toolbar – zobrazuje se redaktorům nad titulkem článku
   ============================================================ */

.editor-toolbar-wrap {
    position: relative;
    margin-bottom: 0.5rem;
}

.editor-toolbar {
    display: -webkit-inline-box;
    display: inline-flex;
    -webkit-box-align: center;
    align-items: center;
    gap: 0.25rem;
    background: #fff;
    border: 1px solid var(--karvina-border, #e0e0e0);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
    font-size: 0.82rem;
    -webkit-user-select: none;
    user-select: none;
    flex-wrap: wrap;
}

.editor-toolbar__btn {
    display: -webkit-inline-box;
    display: inline-flex;
    -webkit-box-align: center;
    align-items: center;
    gap: 0.3em;
    padding: 0.28rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--karvina-primary, #4c589f);
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    -webkit-transition: background 0.15s, border-color 0.15s;
    transition: background 0.15s, border-color 0.15s;
    min-height: 32px;
}

.editor-toolbar__btn:hover,
.editor-toolbar__btn:focus-visible {
    background: #e8f0fb;
    border-color: var(--karvina-primary, #4c589f);
    outline: none;
}

.editor-toolbar__btn--danger {
    color: #c0392b;
}

.editor-toolbar__btn--danger:hover,
.editor-toolbar__btn--danger:focus-visible {
    background: #fdecea;
    border-color: #c0392b;
}

.editor-toolbar__btn svg {
    flex-shrink: 0;
}

#editorLoginBtn {
    opacity: 0.55;
    font-size: 0.8rem;
    text-decoration: none;
    border: none;
    background: none;
}

#editorLoginBtn:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Administrace – dokumenty a soubory */
.admin-doc-sidebar {
    max-height: calc(100vh - 8rem);
    overflow: auto;
}

.admin-doc-tree {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.admin-doc-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 1rem;
}

.admin-doc-tree__link {
    display: inline-block;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
}

.admin-doc-tree__link.active,
.admin-doc-tree__link:hover {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.admin-doc-tree__edit {
    font-size: 0.75rem;
    color: #6c757d;
    margin-left: 0.25rem;
}

/* Admin – strom struktury webu */
.admin-structure-tree {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.admin-structure-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.admin-structure-tree__row {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.15rem 0.25rem;
    border-radius: 0.25rem;
    cursor: default;
}

.admin-structure-tree__row.is-selected {
    background: rgba(13, 110, 253, 0.15);
}

.admin-structure-tree__row.is-dragging {
    opacity: 0.5;
}

.admin-structure-tree__row.is-drop-target {
    outline: 2px dashed #0d6efd;
    outline-offset: 1px;
}

.admin-structure-tree__toggle,
.admin-structure-tree__toggle-spacer {
    width: 1.25rem;
    flex-shrink: 0;
    text-align: center;
}

.admin-structure-tree__label {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    line-height: 1.35;
}

.admin-structure-tree__label:hover {
    color: #0d6efd;
}

.admin-structure-node--hidden {
    opacity: 0.75;
}

.admin-structure-node--trash .admin-structure-tree__label {
    color: #842029;
}

.admin-structure-node--system .admin-structure-tree__label {
    font-weight: 600;
}

.admin-structure-search-results,
.admin-structure-move-results {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    background: #fff;
    position: relative;
    z-index: 10;
}

.admin-structure-search-results {
    margin-top: 0.25rem;
}

.admin-structure-panel-table tr.is-dragging {
    opacity: 0.5;
}

.admin-structure-panel-table tr.is-drop-target {
    outline: 2px dashed #0d6efd;
}

.badge.bg-purple-subtle {
    background-color: #e2d9f3 !important;
    color: #432874 !important;
}

.employee-directory-table th,
.employee-directory-table td {
    font-size: 0.92rem;
}

.employee-directory-table td:last-child {
    min-width: 14rem;
}

.cms-public-form {
    max-width: 46rem;
    margin-right: auto;
    margin-left: auto;
}

.cms-public-form__intro,
.cms-public-form__note,
.cms-public-form__before {
    margin-bottom: 1rem;
}

.cms-public-form__heading {
    margin-top: 1.5rem;
}

.cms-form-list,
.cms-form-poll {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem 0.25rem;
    max-height: 18rem;
    overflow: auto;
}

.cms-form-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

