/* Shared header: keep the title centred independently of the emblem and search. */
.site-header { padding: 0; }
.site-header .site-tools__links { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.site-header .site-tools__links .site-edit-link { margin-right: 0; }
.site-header .header-telegram { display: inline-flex; align-items: center; flex-shrink: 0; gap: 8px; padding: 5px 10px 5px 6px; border: 1px solid #c7e4f1; border-radius: 999px; background: #edf7fc; color: #11638c; font-size: 13px; font-weight: 700; line-height: 1.3; text-decoration: none; white-space: nowrap; }
.header-telegram svg { flex-shrink: 0; width: 22px; height: 22px; color: #229ed9; }
.header-telegram__arrow { font-size: 16px; line-height: 1; }
.site-header .header-telegram:hover { background: #e0f0f9; border-color: #7abbdc; color: #084a72; }
.site-header :is(.header-telegram,.header-brand,.header-emblem):focus-visible { outline: 3px solid var(--color-primary); outline-offset: 4px; }
.site-header .site-branding { display: grid; grid-template-columns: minmax(150px,1fr) auto minmax(150px,1fr); gap: 24px; align-items: center; min-height: 118px; padding: 24px 20px; text-align: center; }
.header-emblem { display: block; justify-self: start; line-height: 0; border-radius: 5px; }
.header-emblem img { display: block; width: 62px; height: 70px; object-fit: contain; }
.site-header .header-brand { display: grid; grid-template-columns: 52px minmax(0,auto) 52px; align-items: center; gap: 14px; min-width: 0; color: var(--color-primary-dark); text-decoration: none; border-radius: 6px; }
.header-brand::after { content: ''; width: 52px; }
.header-brand__mark { display: block; width: 52px; height: 52px; object-fit: contain; }
.header-brand__name { display: block; font-size: clamp(30px,2.85vw,40px); font-weight: 700; letter-spacing: -.9px; line-height: 1.2; overflow-wrap: anywhere; }
.site-header .header-brand:hover { color: var(--color-primary); text-decoration: none; }
.site-header .header-search { width: 260px; max-width: 100%; min-width: 0; justify-self: end; margin: 0; }
.header-search form { width: 100%; min-width: 0; }
.site-header .header-search input { flex: 1; width: 100%; min-width: 0; padding: 11px 14px; }
.site-header .header-search button { flex-shrink: 0; padding: 12px 17px; }
html.vodokanal-dark-mode .site-header .header-brand { color: #c4e9e4; }
html.vodokanal-dark-mode .site-header .header-brand:hover { color: #fff; }
html.vodokanal-dark-mode .site-header .header-telegram { background: #15323c; border-color: #355965; color: #c2e6f6; }
html.vodokanal-dark-mode .site-header .header-telegram:hover { background: #214650; }
html.vodokanal-dark-mode .site-header :is(.header-telegram,.header-brand,.header-emblem):focus-visible { outline-color: #9addd4; }
html.vodokanal-visual-mode .site-header .header-telegram { font-size: 18px; background: #fff; border-color: #000; }
html.vodokanal-visual-mode .header-telegram svg { color: #000; }
html.vodokanal-visual-mode .site-header :is(.header-telegram,.header-brand,.header-emblem):focus-visible { outline-color: #000; }
@media (max-width: 1100px) {
    .site-header .site-branding { grid-template-columns: 70px minmax(0,1fr) 70px; gap: 16px; padding: 20px; }
    .site-header .header-brand { justify-self: center; }
    .header-brand__name { font-size: 34px; }
    .site-header .header-search { grid-column: 1 / -1; justify-self: center; width: 520px; }
}
@media (max-width: 992px) {
    .site-header .site-tools__inner { flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 8px; padding-bottom: 8px; overflow: visible; white-space: normal; }
    .site-header .site-tools__links { display: contents; }
}
@media (max-width: 800px) {
    .site-header .site-branding { grid-template-columns: 48px minmax(0,1fr) 48px; gap: 14px; padding: 20px 15px; }
    .header-emblem img { width: 48px; height: 56px; }
    .site-header .header-brand { grid-column: 2 / -1; grid-template-columns: minmax(0,1fr) 48px; gap: 14px; width: 100%; }
    .header-brand::after { display: none; }
    .header-brand__mark { grid-column: 2; grid-row: 1; width: 48px; height: 48px; }
    .header-brand__name { grid-column: 1; grid-row: 1; font-size: clamp(27px,4.4vw,34px); }
}
@media (max-width: 560px) {
    .site-header { padding: 0; }
    .site-header .site-branding { grid-template-columns: 36px minmax(0,1fr) 36px; gap: 10px; padding: 18px 12px; }
    .header-emblem img { width: 36px; height: 44px; }
    .site-header .header-brand { grid-template-columns: minmax(0,1fr) 36px; gap: 10px; }
    .header-brand__mark { width: 36px; height: 36px; }
    .header-brand__name { font-size: clamp(20px,6vw,28px); letter-spacing: -.55px; }
    .site-header .header-search { margin-top: 5px; }
}
