/* =========================================================
   КДЦ «Барвиха» — фирменная шапка с Медиатором
   Версия 1.0.3
   ========================================================= */

.site-header.kdc-mediator-header-ready {
    position: relative;
    z-index: 100;
    background: #fff;
}

.site-header .site-header-top-inner {
    min-height: 78px !important;
    height: 78px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 18px !important;
    flex-wrap: nowrap !important;
    padding: 0 12px !important;
}

/* Фирменный Медиатор */
.site-header .site-brand {
    flex: 0 0 auto !important;
    height: 78px !important;
    display: flex !important;
    align-items: center !important;
}

.site-header .site-logo {
    width: 92px !important;
    height: 70px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: visible !important;
}

.site-header .site-logo img {
    display: block !important;
    width: 84px !important;
    height: 70px !important;
    max-width: 84px !important;
    max-height: 70px !important;
    object-fit: contain !important;
    object-position: left center !important;
}

/* Меню в той же строке */
.site-header .header-navigation {
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.site-header .main-nav {
    width: 100% !important;
    min-height: 78px !important;
    height: 78px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.site-header .main-nav ul,
.site-header .main-nav .main-menu {
    width: auto !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.site-header .main-nav li {
    flex: 0 0 auto !important;
}

.site-header .main-nav a {
    display: block !important;
    padding: 10px 10px !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    color: #333 !important;
}

.site-header .main-nav a:hover {
    color: #c5162e !important;
    background: #fafafa !important;
}

/* Сервисные кнопки */
.kdc-header-tools {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.kdc-header-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    color: #333;
    text-decoration: none;
    border-radius: 7px;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.kdc-header-tool:hover {
    color: #c5162e;
    background: #fafafa;
}

.kdc-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e2e4e7;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
}

.kdc-tool-label {
    margin-left: 7px;
    font-size: 11px;
}

.kdc-access-trigger {
    padding: 0 10px;
    border: 1px solid #d92f2f;
    color: #d92f2f;
}

.kdc-access-trigger .kdc-tool-icon {
    color: #d92f2f;
    border-color: #d92f2f;
    font-size: 13px;
}

.kdc-access-trigger.is-active {
    background: #d92f2f;
    color: #fff;
}

.kdc-access-trigger.is-active .kdc-tool-icon {
    color: #fff;
    border-color: rgba(255,255,255,.7);
}

/* «Дома культуры Подмосковья» справа */
.site-header .mosreg-brand {
    flex: 0 0 auto !important;
    height: 78px !important;
    margin-left: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.site-header .mosreg-brand-title {
    font-size: 11px !important;
    line-height: 1.15 !important;
    color: #333 !important;
    text-align: left !important;
    white-space: nowrap !important;
}

.site-header .site-title-wrap {
    display: none !important;
}

.kdc-search-box {
    position: absolute;
    top: 72px;
    right: 20px;
    z-index: 1200;
    width: min(360px, calc(100vw - 32px));
    padding: 10px;
    background: #fff;
    border: 1px solid #e1e4e7;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.10);
}

.kdc-search-box[hidden] { display: none; }

.kdc-search-form {
    display: flex;
    gap: 8px;
}

.kdc-search-form input {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    border: 1px solid #dcdfe3;
    border-radius: 7px;
    padding: 0 12px;
    font-size: 14px;
}

.kdc-search-form button {
    border: 0;
    border-radius: 7px;
    padding: 0 15px;
    background: #d92f2f;
    color: #fff;
    cursor: pointer;
}

/* Базовая читаемая версия */
body.kdc-readable-version {
    font-size: 16px !important;
}

body.kdc-readable-version .site-header .main-nav a,
body.kdc-readable-version .kdc-tool-label {
    font-size: 14px !important;
}

body.kdc-readable-version a:focus,
body.kdc-readable-version button:focus,
body.kdc-readable-version input:focus {
    outline: 3px solid #111 !important;
    outline-offset: 2px;
}

@media (max-width: 1100px) {
    .site-header .site-header-top-inner {
        gap: 10px !important;
        padding: 0 8px !important;
    }

    .site-header .site-logo {
        width: 76px !important;
    }

    .site-header .site-logo img {
        width: 68px !important;
        max-width: 68px !important;
    }

    .site-header .main-nav a {
        padding: 9px 7px !important;
        font-size: 12px !important;
    }

    .kdc-tool-label {
        display: none;
    }
}

@media (max-width: 760px) {
    .site-header .site-header-top-inner {
        min-height: 68px !important;
        height: 68px !important;
        overflow: hidden !important;
    }

    .site-header .site-brand,
    .site-header .main-nav,
    .site-header .mosreg-brand {
        min-height: 68px !important;
        height: 68px !important;
    }

    .site-header .site-logo,
    .site-header .site-logo img {
        width: 64px !important;
        height: 58px !important;
        max-width: 64px !important;
        max-height: 58px !important;
    }

    .site-header .main-nav {
        justify-content: flex-start !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    .site-header .main-nav ul,
    .site-header .main-nav .main-menu {
        min-width: max-content !important;
        justify-content: flex-start !important;
    }

    .site-header .main-nav a {
        padding: 9px 7px !important;
        font-size: 11px !important;
    }

    .site-header .mosreg-brand-title {
        font-size: 9px !important;
    }

    .kdc-header-tools {
        gap: 4px;
    }

    .kdc-tool-icon {
        width: 28px;
        height: 28px;
        font-size: 17px;
    }

    .kdc-access-trigger {
        padding: 0 5px;
    }
}


/* =========================================================
   РЕЖИМ ПОВЫШЕННОЙ ЧИТАЕМОСТИ
   ========================================================= */
body.kdc-readable-version {
    font-size: 18px !important;
    line-height: 1.6 !important;
    color: #111 !important;
    background: #fff !important;
}

body.kdc-readable-version .site-header,
body.kdc-readable-version .site-header .site-header-top-inner,
body.kdc-readable-version .site-header .header-navigation {
    background: #fff !important;
}

body.kdc-readable-version .site-header .main-nav a,
body.kdc-readable-version .kdc-tool-label,
body.kdc-readable-version .mosreg-brand-title {
    font-size: 16px !important;
    line-height: 1.4 !important;
}

body.kdc-readable-version h1,
body.kdc-readable-version h2,
body.kdc-readable-version h3,
body.kdc-readable-version h4,
body.kdc-readable-version p,
body.kdc-readable-version li,
body.kdc-readable-version .card,
body.kdc-readable-version .card-body,
body.kdc-readable-version .section-link {
    line-height: 1.6 !important;
}

body.kdc-readable-version a {
    text-decoration: underline !important;
}

body.kdc-readable-version .kdc-access-trigger {
    background: #111 !important;
    border-color: #111 !important;
    color: #fff !important;
}

body.kdc-readable-version .kdc-access-trigger .kdc-tool-icon {
    color: #fff !important;
    border-color: #fff !important;
}

body.kdc-readable-version :focus-visible {
    outline: 3px solid #000 !important;
    outline-offset: 3px !important;
}

@media (prefers-reduced-motion: reduce) {
    body.kdc-readable-version * {
        scroll-behavior: auto !important;
        animation: none !important;
        transition: none !important;
    }
}


/* Официальный логотип «Дома культуры Подмосковья» */
.site-header .mosreg-brand {
    width: 132px !important;
    justify-content: flex-end !important;
    overflow: visible !important;
}

.site-header .mosreg-brand-logo {
    display: block !important;
    width: 118px !important;
    height: auto !important;
    max-width: 118px !important;
    max-height: 42px !important;
    object-fit: contain !important;
}

@media (max-width: 1100px) {
    .site-header .mosreg-brand {
        width: 112px !important;
    }
    .site-header .mosreg-brand-logo {
        width: 100px !important;
        max-width: 100px !important;
    }
}

@media (max-width: 760px) {
    .site-header .mosreg-brand {
        width: 88px !important;
    }
    .site-header .mosreg-brand-logo {
        width: 78px !important;
        max-width: 78px !important;
        max-height: 34px !important;
    }
}


.kdc-eye-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
