/* Legacy-oriented layout adjustments for Melechov staging. */
:root {
    --melechov-accent: #b63c36;
    --melechov-accent-dark: #8f2e29;
    --melechov-ink: #2d3b40;
    --melechov-panel: #eef2f3;
    --melechov-panel-border: #c8d4d8;
    --melechov-soft-line: #dbe4e7;
    --melechov-soft-shadow: 0 8px 24px rgba(20, 44, 58, 0.06);
}

body.site {
    background: #fff;
    color: var(--melechov-ink);
}

.container-header,
.site-grid,
.container-footer {
    width: 100%;
    max-width: 1380px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    box-sizing: border-box;
    align-self: stretch;
}

.container-header {
    background: #fff;
    border-bottom: 0;
    box-shadow: none;
    margin-top: 0.75rem;
    display: block;
    width: 100%;
}

.container-header > .grid-child {
    display: block;
    width: 100%;
    max-width: none;
    flex: 0 0 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
}

.container-header .navbar-brand {
    display: block;
    flex: 1 0 100%;
    margin-inline-end: 0;
    padding: 1rem 0 0.65rem;
    width: 100%;
    max-width: none;
}

.container-header .navbar-brand .brand-logo {
    display: block;
    text-decoration: none;
    width: 100%;
}

.navbar-brand .legacy-brand-banner {
    min-height: 174px;
    background: #fff url("/media/templates/site/cassiopeia/images/header-left-250.png") center center / 250px 174px no-repeat;
}

.legacy-header-row {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 250px;
    gap: 1.5rem;
    align-items: stretch;
    width: 100%;
    min-width: 100%;
}

.legacy-header-block {
    min-height: 174px;
    box-sizing: border-box;
    border-radius: 4px;
}


.legacy-header-block--left {
    grid-column: 1;
    border: 0;
    box-shadow: var(--melechov-soft-shadow);
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    justify-self: center;
    overflow: hidden;
}

.legacy-header-block--right {
    grid-column: 2 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    box-shadow: var(--melechov-soft-shadow);
    background: #183048 url("/media/templates/site/cassiopeia/images/header-v120-right.png") center center / cover no-repeat;
    overflow: hidden;
}

.legacy-header-block--right span {
    display: none;
}

.legacy-header-meta {
    display: block;
    color: var(--melechov-ink);
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    margin-top: 0.55rem;
}

.legacy-header-meta .mod-custom,
.legacy-header-meta .custom,
.legacy-header-meta p {
    display: block;
    color: var(--melechov-ink);
    width: 250px;
    max-width: 250px;
    margin: 0;
}

.legacy-header-meta p {
    font-size: 0.8rem;
    line-height: 1.35;
    white-space: normal;
}

.legacy-header-meta .mod-breadcrumbs__wrapper,
.legacy-header-meta .mod-breadcrumbs {
    display: none;
}

.navbar-brand img.logo {
    max-height: 72px;
}

.navbar-brand img.legacy-header-logo {
    display: block;
    width: 100%;
    max-width: none;
    height: 174px;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    pointer-events: none;
}

body.has-legacy-sidebar-left .site-grid {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

body.has-legacy-sidebar-left.has-sidebar-right .site-grid {
    grid-template-columns: 250px minmax(0, 1fr) 210px;
}

.container-sidebar-left {
    align-self: start;
    width: 250px !important;
    min-width: 250px;
    max-width: 250px;
    overflow: visible;
}

body.has-legacy-sidebar-right .container-sidebar-right {
    align-self: start;
    width: 210px !important;
    min-width: 210px;
    max-width: 210px;
    overflow: visible;
}

.legacy-left-stack {
    width: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
    box-sizing: border-box;
    overflow: visible;
}

.legacy-right-stack {
    width: 100%;
    background: #fff;
    border: 0;
    padding: 0.75rem;
    box-shadow: none;
    box-sizing: border-box;
    overflow: visible;
}

.legacy-left-stack > * + * {
    margin-top: 0.8rem;
}

.legacy-left-stack .mod-menu,
.legacy-left-stack .mod-login,
.legacy-left-stack .mod-banners,
.legacy-left-stack .module,
.legacy-left-stack .card {
    background: var(--melechov-panel);
    border: 0;
    border-radius: 3px;
    box-shadow: none;
    margin: 0;
    overflow: hidden;
}

.legacy-right-stack .card {
    background: #fff;
    border: 0;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px var(--melechov-soft-line);
    margin: 0;
    overflow: hidden;
}

.legacy-right-stack .mod-banners,
.legacy-right-stack .module,
.legacy-right-stack .module-body,
.legacy-right-stack .card-body {
    background: #fff;
}

.legacy-left-stack .card + .card {
    margin-top: 0.8rem;
}

.legacy-right-stack .card + .card {
    margin-top: 1rem;
}

.legacy-left-stack .mod-menu .card-body,
.legacy-left-stack .mod-login .card-body,
.legacy-left-stack .mod-banners .card-body,
.legacy-right-stack .mod-banners .card-body,
.legacy-left-stack .module-body,
.legacy-right-stack .module-body,
.legacy-left-stack .card-body {
    padding: 0;
    background: var(--melechov-panel);
}

.legacy-right-stack .card-body {
    padding: 0.75rem;
}

.legacy-left-stack h3,
.legacy-left-stack .card-header,
.legacy-left-stack .module-title,
.legacy-right-stack h3,
.legacy-right-stack .card-header,
.legacy-right-stack .module-title {
    background: linear-gradient(180deg, var(--melechov-accent) 0%, var(--melechov-accent-dark) 100%);
    color: #fff;
    margin: 0;
    padding: 0.68rem 0.9rem;
    font-size: 0.95rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
    border: 0;
}

.legacy-right-stack .card-header,
.legacy-right-stack .module-title {
    background: linear-gradient(180deg, #6a7d83 0%, #52646a 100%);
    font-size: 0.88rem;
}

.legacy-left-stack .card-header a,
.legacy-left-stack .module-title a {
    color: inherit;
    text-decoration: none;
}

.legacy-left-stack ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.legacy-left-stack .mod-menu ul,
.legacy-left-stack .mod-menu li {
    display: block;
}

.legacy-left-stack ul.mod-menu,
.legacy-left-stack .mod-menu.nav {
    display: block;
    width: 100%;
}

.legacy-left-stack ul.mod-menu > li,
.legacy-left-stack .mod-menu.nav > li {
    display: block;
    width: 100%;
}

.legacy-left-stack li {
    border-top: 0;
}

.legacy-left-stack li:first-child {
    border-top: 0;
}

.legacy-left-stack li a,
.legacy-left-stack .nav-link {
    display: block;
    color: var(--melechov-ink);
    text-decoration: none;
    padding: 0.62rem 0.9rem;
    font-weight: 600;
}

.legacy-left-stack li a:hover,
.legacy-left-stack li a:focus,
.legacy-left-stack .nav-link:hover,
.legacy-left-stack .nav-link:focus {
    background: #dce7ea;
    color: var(--melechov-accent-dark);
}

.legacy-left-stack .mod-login form {
    padding: 0.9rem;
}

.legacy-right-stack .banneritem + .banneritem {
    margin-top: 0.9rem;
}

.legacy-right-stack .banneritem {
    text-align: center;
    padding: 0.25rem 0;
}

.legacy-right-stack .banneritem img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.legacy-left-stack .mod-login .form-control,
.legacy-left-stack .mod-login .form-control:focus {
    border-radius: 0;
}

.legacy-left-stack .btn,
.container-component .btn {
    border-radius: 0;
}

.container-component,
.container-sidebar-right,
.container-top-a,
.container-top-b,
.container-bottom-a,
.container-bottom-b {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.container-component {
    padding: 0.75rem 1.5rem 1.25rem;
    min-width: 0;
}

body.view-featured .container-component main {
    max-width: 900px;
    margin: 0 auto;
}

body.view-featured .blog-featured,
body.view-featured .blog-items.items-leading,
body.view-featured .blog-item,
body.view-featured .item-content {
    max-width: 100%;
}

body.view-featured .item-content img {
    display: block;
    width: auto;
    max-width: min(100%, 760px);
    height: auto;
    margin: 0.85rem auto 1.15rem;
}

body.view-featured .item-content table,
body.view-featured .item-content iframe,
body.view-featured .item-content video {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.blog-featured .blog-item,
.blog-items .blog-item {
    border-bottom: 1px solid #e2e8ea;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.blog-featured .blog-item:last-child,
.blog-items .blog-item:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}

@media (min-width: 992px) {
    body.has-legacy-sidebar-left.has-legacy-sidebar-right .site-grid,
    body.has-legacy-sidebar-left.has-sidebar-right .site-grid {
        grid-template-columns: 250px minmax(0, 1fr) 210px;
        grid-template-areas: none;
    }

    body.has-legacy-sidebar-left.has-legacy-sidebar-right .container-legacy-top,
    body.has-legacy-sidebar-left.has-legacy-sidebar-right .container-banner,
    body.has-legacy-sidebar-left.has-legacy-sidebar-right .container-top-a,
    body.has-legacy-sidebar-left.has-legacy-sidebar-right .container-top-b,
    body.has-legacy-sidebar-left.has-legacy-sidebar-right .container-bottom-a,
    body.has-legacy-sidebar-left.has-legacy-sidebar-right .container-bottom-b,
    body.has-legacy-sidebar-left.has-legacy-sidebar-right .container-breadcrumbs,
    body.has-legacy-sidebar-left.has-sidebar-right .container-legacy-top,
    body.has-legacy-sidebar-left.has-sidebar-right .container-banner,
    body.has-legacy-sidebar-left.has-sidebar-right .container-top-a,
    body.has-legacy-sidebar-left.has-sidebar-right .container-top-b,
    body.has-legacy-sidebar-left.has-sidebar-right .container-bottom-a,
    body.has-legacy-sidebar-left.has-sidebar-right .container-bottom-b,
    body.has-legacy-sidebar-left.has-sidebar-right .container-breadcrumbs {
        grid-column: 1 / -1;
        width: auto;
    }

    body.has-legacy-sidebar-left.has-legacy-sidebar-right .container-sidebar-left,
    body.has-legacy-sidebar-left.has-sidebar-right .container-sidebar-left {
        grid-column: 1;
    }

    body.has-legacy-sidebar-left.has-legacy-sidebar-right .container-component,
    body.has-legacy-sidebar-left.has-sidebar-right .container-component {
        grid-column: 2;
    }

    body.has-legacy-sidebar-left.has-legacy-sidebar-right .container-sidebar-right,
    body.has-legacy-sidebar-left.has-sidebar-right .container-sidebar-right {
        grid-column: 3;
    }

    body.has-legacy-sidebar-left:not(.has-sidebar-right) .site-grid {
        grid-template-columns: 250px minmax(0, 1fr);
        grid-template-areas: none;
    }

    body.has-legacy-sidebar-left:not(.has-sidebar-right) .container-legacy-top,
    body.has-legacy-sidebar-left:not(.has-sidebar-right) .container-banner,
    body.has-legacy-sidebar-left:not(.has-sidebar-right) .container-top-a,
    body.has-legacy-sidebar-left:not(.has-sidebar-right) .container-top-b,
    body.has-legacy-sidebar-left:not(.has-sidebar-right) .container-bottom-a,
    body.has-legacy-sidebar-left:not(.has-sidebar-right) .container-bottom-b,
    body.has-legacy-sidebar-left:not(.has-sidebar-right) .container-breadcrumbs {
        grid-column: 1 / -1;
        width: auto;
    }

    body.has-legacy-sidebar-left:not(.has-sidebar-right) .container-sidebar-left {
        grid-column: 1;
    }

    body.has-legacy-sidebar-left:not(.has-sidebar-right) .container-component {
        grid-column: 2;
    }
}

@media (max-width: 991.98px) {
    .container-header,
    .site-grid,
    .container-footer {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }


    .legacy-header-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .legacy-header-block--left,
    .legacy-header-block--right {
        grid-column: 1;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .legacy-header-block--right {
        min-height: 0;
        aspect-ratio: 2352 / 448;
        background-size: contain;
        background-position: center center;
        background-repeat: no-repeat;
    }

    .site-grid,
    body.has-legacy-sidebar-left .site-grid,
    body.has-legacy-sidebar-left.has-legacy-sidebar-right .site-grid,
    body.has-legacy-sidebar-left.has-sidebar-right .site-grid {
        grid-template-columns: 1fr !important;
        grid-template-areas: none !important;
    }

    .container-legacy-top {
        margin-bottom: 0;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .container-legacy-top .mod-custom,
    .container-legacy-top .mod-breadcrumbs {
        grid-column: 1;
        grid-row: auto;
    }

    body.has-legacy-sidebar-left .container-legacy-top,
    body.has-legacy-sidebar-left .container-sidebar-left,
    body.has-legacy-sidebar-left .container-component,
    body.has-legacy-sidebar-right .container-sidebar-right {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        width: 100% !important;
        min-width: 0;
        max-width: none;
    }

    body.has-legacy-sidebar-left .container-sidebar-left,
    body.has-legacy-sidebar-left .container-component,
    body.has-legacy-sidebar-right .container-sidebar-right {
        order: initial;
        display: block !important;
    }

    .legacy-left-stack .navbar-toggler {
        display: none;
    }

    .legacy-left-stack .navbar-collapse,
    .legacy-left-stack .collapse:not(.show) {
        display: block !important;
    }

    .legacy-left-stack .navbar {
        display: block;
        padding: 0;
        align-items: stretch;
    }
}

/* Mobile off-canvas navigation */
@media (min-width: 992px) {
    .mobile-top-banner,
    .mobile-menu-bar,
    .mobile-menu-overlay,
    .mobile-menu-panel-head {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    body.mobile-menu-open {
        overflow: visible;
    }

    .mobile-menu-state {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        margin: -1px;
        padding: 0;
        border: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .mobile-menu-bar {
        display: flex;
        align-items: flex-start;
        gap: 0.9rem;
        padding: 0.35rem 0 0.75rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid var(--melechov-soft-line);
    }

    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.22rem;
        min-width: 2.9rem;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--melechov-ink);
        line-height: 1;
    }

    .mobile-menu-toggle__icon {
        display: flex;
        flex-direction: column;
        gap: 0.26rem;
        margin-top: 0.08rem;
    }

    .mobile-menu-toggle__icon span {
        display: block;
        width: 1.75rem;
        height: 0.16rem;
        border-radius: 999px;
        background: var(--melechov-accent-dark);
    }

    .mobile-menu-toggle__label {
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .mobile-menu-brand {
        display: block;
        padding-top: 0.08rem;
        color: var(--melechov-accent-dark);
        text-decoration: none;
        font-size: 1.38rem;
        font-weight: 700;
        line-height: 1.08;
    }

    .mobile-top-banner {
        display: block;
        margin: 0 0 0.65rem;
    }

    .mobile-top-banner .legacy-header-block--right {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 0;
        aspect-ratio: 2352 / 448;
        background-size: contain;
        background-position: center center;
        background-repeat: no-repeat;
    }

    .container-header .navbar-brand,
    .container-header .container-nav {
        display: none;
    }

    .mobile-menu-overlay {
        display: none !important;
    }

    .mobile-menu-panel-head {
        display: none !important;
    }

    .mobile-menu-panel-title {
        color: var(--melechov-accent-dark);
        font-size: 1.02rem;
        font-weight: 700;
    }

    .mobile-menu-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        border: 0;
        border-radius: 999px;
        background: #dce7ea;
        color: var(--melechov-ink);
        font-size: 1.35rem;
        line-height: 1;
        padding: 0;
    }

    .site-grid > .container-sidebar-left[data-mobile-menu-panel] {
        position: static;
        inset: auto;
        z-index: auto;
        display: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto;
        max-height: none;
        margin: 0 0 1rem;
        padding: 0;
        background: transparent;
        overflow: visible;
        visibility: visible;
        opacity: 1;
        pointer-events: none;
        box-shadow: none;
        transition: none;
    }

    .mobile-menu-state:checked ~ .site-grid > .container-sidebar-left[data-mobile-menu-panel] {
        display: block !important;
        pointer-events: auto;
    }

    .mobile-menu-panel-head {
        display: none !important;
    }

    .mobile-menu-panel-scroll {
        display: block !important;
        overflow: visible;
        padding-right: 0;
        padding-top: 0;
    }

    .site-grid > .container-sidebar-left[data-mobile-menu-panel] .legacy-left-stack,
    .site-grid > .container-sidebar-left[data-mobile-menu-panel] .legacy-left-stack > *,
    .site-grid > .container-sidebar-left[data-mobile-menu-panel] .legacy-left-stack .card,
    .site-grid > .container-sidebar-left[data-mobile-menu-panel] .legacy-left-stack .card-body {
        display: block !important;
    }

    .container-sidebar-left .legacy-left-stack {
        padding: 0;
    }

    body.has-legacy-sidebar-left .container-component,
    body.has-sidebar-left .container-component {
        order: 1;
    }

    body.has-legacy-sidebar-right .container-sidebar-right,
    body.has-sidebar-right .container-sidebar-right {
        order: 2;
    }
}


/* Legacy submenu toggle fix */
.legacy-left-stack .mod-menu > li,
.legacy-left-stack .mod-menu > li > a {
    display: block;
}

.legacy-left-stack .mod-menu > li.parent {
    display: block;
}

.legacy-left-stack .mod-menu > li.parent > a {
    display: block;
}

.legacy-left-stack .mod-menu > li.parent > .mod-menu__toggle-sub,
.legacy-left-stack .mod-menu__toggle-sub {
    display: none !important;
}

.legacy-left-stack .mod-menu > li.parent > .mod-menu__sub {
    width: 100%;
}

.legacy-left-stack .mod-menu .mod-menu__sub[aria-hidden="true"] {
    display: none !important;
}

.legacy-left-stack .mod-menu .mod-menu__sub[aria-hidden="false"] {
    display: block !important;
}

/* Hide BreezingForms spam protection block; hidden inputs can still submit. */
fieldset#ochranaproti {
    display: none;
}
