/*
 * header-recolor.css  —  Cifrum header palette refresh (2026-06)
 *
 * SCOPE: .cf-site-header and .cf-hubs only.
 * WHAT CHANGES: colors, backgrounds, borders, shadows.
 * WHAT DOES NOT CHANGE: structure, layout, sizes, paddings, animations,
 *   JavaScript, WPML, PHP functions, HTML markup, logo, menu items.
 *
 * New palette:
 *   Upper bar bg  #155BEA (solid, no gradient)
 *   Button bg     rgba(255,255,255,0.14) / hover 0.22
 *   Active lang   #fff bg / #101B3D text
 *   Cat-bar bg    #FFFFFF
 *   Cat text      #101B3D  |  cat icon / active  #315EF6
 *   Active "All"  bg #F1F0FF
 *   Counter bg    #EEF0F6  |  counter text  #25304D
 *   Divider       #E7EAF2
 *   Header shadow 0 8px 24px rgba(20,39,90,0.10)
 */

/* =========================================================================
   PALETTE TOKENS — scoped to header + hubs
   ========================================================================= */
.cf-site-header,
.cf-hubs {
    --ch-primary:        #155BEA;
    --ch-primary-hover:  #0F4FD3;
    --ch-btn-bg:         rgba(255, 255, 255, 0.14);
    --ch-btn-hover:      rgba(255, 255, 255, 0.22);
    --ch-btn-border:     rgba(255, 255, 255, 0.20);
    --ch-accent:         #315EF6;
    --ch-active-bg:      #F1F0FF;
    --ch-counter-bg:     #EEF0F6;
    --ch-counter-text:   #25304D;
    --ch-border:         #E7EAF2;
    --ch-text-dark:      #101B3D;
    --ch-shadow:         0 8px 24px rgba(20, 39, 90, 0.10);
}

/* =========================================================================
   UPPER BAR — solid bright-blue, no gradient
   ========================================================================= */
.cf-site-header {
    background: var(--ch-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: var(--ch-shadow);
}

/* Scrolled state: keep same subtle shadow */
body.cf-scrolled .cf-site-header {
    box-shadow: var(--ch-shadow);
}

/* Logo: neutralise dark-bg glow, use blue-toned shadow */
.cf-site-header__logo {
    filter: drop-shadow(0 2px 8px rgba(15, 50, 160, 0.30));
}

/* Site name: lighten heavy text-shadow for bright-blue bg */
.cf-site-header__brand-text {
    text-shadow: 0 1px 4px rgba(10, 40, 140, 0.30);
}

.cf-site-header__brand-tagline {
    text-shadow: none;
    color: rgba(255, 255, 255, 0.80) !important;
}

/* ---- Search button — translucent white pill ---- */
.cf-search-btn {
    background: var(--ch-btn-bg);
    border: 1px solid var(--ch-btn-border);
    box-shadow: none;
    color: #fff;
}

.cf-search-btn:hover {
    background: var(--ch-btn-hover);
    box-shadow: none;
    transform: translateY(-1px);
}

.cf-search-btn:active {
    background: var(--ch-btn-bg);
    box-shadow: none;
    transform: translateY(0);
}

.cf-search-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.70);
    outline-offset: 2px;
}

/* ---- Language switcher ---- */
.cf-util-langs {
    border-color: var(--ch-btn-border);
}

.cf-util-lang,
.cf-util-lang:link,
.cf-util-lang:visited {
    color: rgba(255, 255, 255, 0.75);
}

.cf-util-lang:hover {
    color: #fff;
    background: var(--ch-btn-hover);
}

.cf-util-lang:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.70);
    outline-offset: 1px;
}

/* Active language — white bg, dark text */
.cf-util-lang.is-active {
    background: #ffffff !important;
    color: #101B3D !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* ---- Social icons — translucent white ---- */
.cf-util-social,
.cf-util-social:link,
.cf-util-social:visited {
    background: var(--ch-btn-bg);
    border-color: var(--ch-btn-border);
    box-shadow: none;
    color: #ffffff;
}

/* Hover underline: keep brand colours but white default */
.cf-util-social::before {
    background: rgba(255, 255, 255, 0.55);
}

.cf-util-social--facebook::before  { background: #1877f2; }
.cf-util-social--twitter::before   { background: #ffffff; }
.cf-util-social--vk::before        { background: #0077ff; }
.cf-util-social--youtube::before   { background: #ff0033; }
.cf-util-social--telegram::before  { background: #27a7e7; }

.cf-util-social:hover,
.cf-util-social:focus-visible {
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 4px 14px rgba(21, 91, 234, 0.20);
    color: #155BEA;
}

.cf-util-social:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.70);
    outline-offset: 1px;
}

/* ---- Burger button — translucent white ---- */
.cf-burger {
    background: var(--ch-btn-bg);
    border-color: var(--ch-btn-border);
}

.cf-burger:hover {
    background: var(--ch-btn-hover);
    border-color: rgba(255, 255, 255, 0.40);
}

.cf-burger[aria-expanded="true"] {
    background: var(--ch-btn-hover);
    border-color: rgba(255, 255, 255, 0.40);
}

.cf-burger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.70);
    outline-offset: 2px;
}

/* Burger lines stay white */
.cf-burger__line { background: #ffffff; }
.cf-burger:hover .cf-burger__line { background: rgba(255, 255, 255, 0.90); }
.cf-burger[aria-expanded="true"] .cf-burger__line { background: #ffffff; }

/* ---- Burger panel (mobile dropdown) — slightly deeper blue ---- */
.cf-burger-panel {
    background: #0F4FD3;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* ---- Search overlay submit button ---- */
.cf-search-overlay__submit {
    background: var(--ch-primary);
}
.cf-search-overlay__submit:hover {
    background: var(--ch-primary-hover);
}
.cf-search-overlay__input:focus {
    border-color: var(--ch-primary) !important;
    box-shadow: 0 0 0 4px rgba(21, 91, 234, 0.28), 0 12px 36px rgba(0, 0, 0, 0.30);
}

/* =========================================================================
   CATEGORY BAR .cf-hubs — white background
   ========================================================================= */
.cf-hubs {
    background: #ffffff;
    border-bottom: 1px solid var(--ch-border);
}

/* ---- Category items — dark text, blue icon ---- */
.cf-hubs__item,
.cf-hubs__item:link,
.cf-hubs__item:visited {
    color: var(--ch-text-dark) !important;
}

.cf-hubs__item .cf-hubs__icon {
    color: var(--ch-accent);
    opacity: 0.85;
}

/* Hover */
.cf-hubs__item:hover {
    color: var(--ch-accent) !important;
    background: rgba(49, 94, 246, 0.06);
}

.cf-hubs__item:hover .cf-hubs__icon {
    color: var(--ch-accent);
    opacity: 1;
}

/* Active (current category) */
.cf-hubs__item.is-active,
.cf-hubs__item.is-active:link,
.cf-hubs__item.is-active:visited {
    color: var(--ch-accent) !important;
    background: transparent !important;
}

.cf-hubs__item.is-active .cf-hubs__icon {
    color: var(--ch-accent);
    opacity: 1;
}

/* Active underline — keep blue accent */
.cf-hubs__item.is-active::after {
    background: var(--ch-accent);
}

/* ---- "Все" pin button — solid primary-blue bg, white content (all states) ---- */
.cf-hubs__pin {
    background: var(--ch-primary) !important;
    color: #ffffff !important;
    border-radius: 10px;
}

.cf-hubs__pin .cf-hubs__icon {
    color: #ffffff !important;
    opacity: 1;
}

.cf-hubs__pin .cf-hubs__chevron {
    color: #ffffff;
    opacity: 0.85;
}

.cf-hubs__pin:hover {
    background: var(--ch-primary-hover) !important;
    color: #ffffff !important;
}

.cf-hubs__pin:focus-visible {
    outline: 2px solid rgba(21, 91, 234, 0.45);
    outline-offset: 2px;
}

/* Active state — same blue, no underline (bg is already the indicator) */
.cf-hubs__pin.is-active {
    background: var(--ch-primary) !important;
    color: #ffffff !important;
}

.cf-hubs__pin.is-active .cf-hubs__icon {
    color: #ffffff !important;
    opacity: 1;
}

.cf-hubs__pin.is-active::after {
    display: none !important;
}

/* Open dropdown — slightly deeper blue */
.cf-hubs__pin[aria-expanded="true"] {
    background: var(--ch-primary-hover) !important;
    color: #ffffff !important;
}

.cf-hubs__pin[aria-expanded="true"] .cf-hubs__icon {
    color: #ffffff !important;
    opacity: 1;
}

.cf-hubs__pin[aria-expanded="true"] .cf-hubs__chevron {
    opacity: 1;
}

/* ---- Counters ---- */
.cf-hubs__count {
    background: var(--ch-counter-bg);
    color: var(--ch-counter-text);
}

.cf-hubs__item:hover .cf-hubs__count {
    background: var(--ch-accent);
    color: #ffffff;
}

.cf-hubs__item.is-active .cf-hubs__count {
    background: var(--ch-accent);
    color: #ffffff;
}

/* ---- Dropdown menu (inside .cf-hubs__menu, already white) ---- */
.cf-hubs__menu-item:hover {
    background: rgba(49, 94, 246, 0.07);
    color: var(--ch-accent) !important;
}

.cf-hubs__menu-item:hover .cf-hubs__icon { opacity: 1; }

.cf-hubs__menu-item.is-active {
    background: rgba(49, 94, 246, 0.09);
    color: var(--ch-accent) !important;
}

.cf-hubs__menu-item.is-active .cf-hubs__icon { opacity: 1; }

.cf-hubs__menu-item:hover .cf-hubs__count,
.cf-hubs__menu-item.is-active .cf-hubs__count {
    background: var(--ch-accent);
    color: #ffffff;
}

/* ---- Marquee fade-mask: updated for white background ---- */
.cf-hubs__marquee {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #ffffff 24px, #ffffff calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #ffffff 24px, #ffffff calc(100% - 24px), transparent 100%);
}

/* On mobile the marquee switches to horizontal scroll — remove fade mask */
@media (max-width: 768px) {
    .cf-hubs__marquee {
        -webkit-mask-image: none;
                mask-image: none;
    }
}

/* ---- Mobile bottom nav: accent = new primary ---- */
.cf-mobile-bottom-nav__item.is-active,
.cf-mobile-bottom-nav__item:focus-visible {
    color: var(--ch-accent);
}

.cf-mobile-bottom-nav__item.is-active .cf-mobile-bottom-nav__icon,
.cf-mobile-bottom-nav__item:focus-visible .cf-mobile-bottom-nav__icon {
    background: rgba(49, 94, 246, 0.10);
    color: var(--ch-accent);
}
