@import url('https://fonts.googleapis.com/css2?family=Onest:wght@300;400;500;600;700;800&family=Inter:wght@400;600;700&display=swap');

:root {
    /* Color Palette - Mockup V2 */
    --primary-blue: #005EB8;
    --primary-dark: #0038A8;
    --accent-orange: #FFA100;
    --accent-sand: #F8F4E5;
    --bg-white: #FFFFFF;
    --bg-light: #F4F7F9;
    --text-main: #1D1D1F;
    --text-muted: #535759;
    --border-color: #E2E4E6;
    
    /* Layout Constants */
    --container-width: 1240px;
    --gap: 15px;
    --header-top-h: 120px;
    --nav-bar-h: 56px;
    --primary-blue: #005EB8;
    
    /* Typography */
    --font-main: 'Onest', sans-serif;
    --font-ui: 'Inter', sans-serif;
    
    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: 0.2s var(--ease);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 750;
    line-height: 1.25;
}

ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    transition: max-width 0.3s ease;
}

/* --- Speedbar (Breadcrumbs) --- */
.speedbar-nav {
    background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-light) 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 10px 0;
    margin-bottom: 25px;
    position: sticky;
    top: 232px; /* Збільшений відступ (шапка 226 + 6 пікс запас) */
    z-index: 1050; /* Нижче за шапку, щоб точно не налазив зверху */
    box-shadow: none;
}

.speedbar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.speedbar-inner a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: 0.2s;
}

.speedbar-inner i {
    color: var(--primary-blue);
    font-size: 1rem;
    margin-right: 5px;
}

.speedbar-inner span {
    margin: 0 5px;
    opacity: 0.5;
    font-weight: 400;
}

/* --- Layout Grid --- */
.main-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
    margin-top: 40px; /* Відступ від Hero-секції */
}

@media (min-width: 992px) {
    .main-wrapper {
        grid-template-columns: 1fr 310px;
        column-gap: 40px; /* Оптимальна дистанція */
        row-gap: 15px;
        align-items: start;
    }
    .main-wrapper > aside {
        align-self: stretch; /* sidebar stretches to content column height so sticky works */
    }
}

.is-news-page .main-wrapper {
    column-gap: 40px;
}

/* Sidebar Alignment Fix - only for news pages where there is a h1 above */
.is-news-page .sidebar-sticky-wrapper {
    margin-top: 10px;
}
.sidebar-sticky-wrapper {
    margin-top: 0;
}

.main-wrapper.is-full-width {
    grid-template-columns: 1fr;
}

.main-wrapper.is-full-width .content-side {
    max-width: 900px;
    margin: 0 auto;
}

.content-side {
    min-width: 0; /* prevents grid blowout */
}

/* --- Header System --- */
header {
    position: sticky;
    top: 0;
    z-index: 1100; /* Самий вищий рівень */
    background: var(--bg-light);
}

.header-top {
    min-height: var(--header-top-h);
    padding: 10px 0;
    background: url("../images/banner-ukr-isr.png") no-repeat center center;
    background-size: cover;
    position: relative;
    z-index: 20;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-top::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    z-index: 0;
}

.header-top-inner {
    display: flex;
    justify-content: flex-start; /* Логотип зліва */
    align-items: center;
    position: relative;
    z-index: 10;
    min-height: var(--header-top-h);
    padding-top: 10px;
    padding-bottom: 10px;
}

.header-top-inner .menu-toggle {
    display: none;
}

@media (max-width: 991px) {
    .header-top-inner .menu-toggle {
        display: flex;
    }
}

/* --- Logo System --- */
.logo-block {
    display: flex;
    align-items: center;
}

/* --- Info Bar (між header і меню) --- */
.header-info-bar {
    background: var(--bg-light, #f5f5f7);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 5px 0;
}

.header-info-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
}

/* --- Info Widget --- */
.header-info-widget {
    display: flex;
    align-items: center;
    gap: 20px;
    background: transparent;
    padding: 0;
    border: none;
    font-family: var(--font-ui);
}

.widget-time-block {
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0,0,0,0.1);
    padding-right: 15px;
}

#current-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1.1;
}

#current-date {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.widget-meta-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.holiday-wrap {
    overflow: hidden;
    width: 100%;
    max-width: 320px;
}
.holiday-wrap:has(#current-holiday:empty) { display: none; }

#current-holiday {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-ui, 'Inter', sans-serif);
    color: #005eb8;
    white-space: nowrap;
}
#current-holiday:empty { display: none; }

#current-holiday.h-scrolling {
    animation: h-scroll var(--h-dur, 10s) linear infinite;
}
@keyframes h-scroll {
    0%,  18% { transform: translateX(0); }
    82%, 100% { transform: translateX(var(--h-dist, -100px)); }
}

/* --- Weather Cities Widget --- */
.weather-cities {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.w-city {
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.w-city i {
    color: var(--accent-orange);
    font-size: 0.85rem;
}

.w-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.w-temp {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.w-sep {
    color: rgba(0,0,0,0.2);
    font-size: 0.7rem;
    padding: 0 3px;
    user-select: none;
}

/* User's city highlighted slightly */
.w-city--user .w-name {
    color: var(--primary-blue, #1a73e8);
}

/* Mobile: hide city names to save space */
@media (max-width: 900px) {
    .w-name { display: none; }
}
@media (max-width: 600px) {
    .w-city--user { display: none; }
}
.logo-icon {
    width: 320px;
    height: 85px;
    background: url("../images/logo-final.png") no-repeat center center;
    background-size: contain;
    margin-left: 0; /* Прибираємо будь-яке зміщення */
}

/* --- Mobile Nav --- */
.menu-toggle {
    display: flex;
    font-size: 1.8rem;
    color: var(--primary-blue);
    background: none;
    border: none;
    cursor: pointer;
}

.header-nav-bar {
    height: var(--nav-bar-h);
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    border-top: 1px solid rgba(0,0,0,0.03);
    position: relative; 
    z-index: 10; /* Нижче ніж header-top */
}

.header-nav-bar .container {
    height: 100%;
    display: flex;
    justify-content: flex-start; /* Меню починається зліва під логотипом */
    align-items: center;
}

@media (max-width: 991px) {
    .header-nav-bar { display: none; } /* Мобліьне меню окремо */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--header-top-h);
        width: 80%;
        height: calc(100vh - var(--header-top-h));
        background: white;
        padding: 40px;
        transition: 0.3s var(--ease);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
        z-index: 100;
        display: none;
        overflow-y: auto;
    }
    .nav-menu.active {
        left: 0;
        display: block;
    }
    .nav-list {
        list-style: none;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .dropdown-menu {
        list-style: none;
        padding: 10px 0 0 20px;
        display: none; /* На мобільних поки просто приховано або відкривається кліком */
    }
    .has-dropdown.active .dropdown-menu {
        display: block;
    }
    .header-right { gap: 10px; }
}

@media (min-width: 992px) {
    .menu-toggle { display: none; }
    .nav-menu {
        display: flex;
        align-items: center;
        height: 100%;
    }
    .nav-list {
        display: flex;
        list-style: none;
        padding: 0;
        margin: 0;
        gap: 2.5rem;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.85rem;
        letter-spacing: 0.5px;
    }
    .menu-item {
        position: relative;
    }
    .menu-item a {
        display: flex;
        align-items: center;
        transition: 0.2s;
    }
    .menu-item a:hover { color: var(--primary-blue); }

    .menu-caret {
        display: inline-flex;
        margin-left: 2px; /* Максимально близько до тексту */
        width: 11px; 
        height: 11px;
        transition: 0.3s var(--ease);
    }
    .menu-caret svg {
        fill: currentColor;
        width: 100%;
        height: 100%;
    }
    .menu-item:hover .menu-caret {
        transform: rotate(180deg);
    }

    /* Dropdown logic */
    /* Dropdown Enhancements */
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 260px;
        background: white;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.12);
        border: 1px solid rgba(0,0,0,0.05);
        padding: 10px 0;
        list-style: none;
        z-index: 1000;
        
        /* Плавна анімація */
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: 0.3s var(--ease);
        margin-top: 10px;
    }

    .has-dropdown:hover > .dropdown-menu,
    .menu-item:hover > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .dropdown-menu li a {
        padding: 12px 25px;
        color: var(--text-dark);
        font-size: 14px;
        font-weight: 500;
        text-transform: none;
        display: block;
        transition: 0.2s;
    }

    .dropdown-menu li a:hover {
        background: rgba(0, 94, 184, 0.05);
        color: var(--primary-blue);
        padding-left: 30px; /* Ефект зміщення зліва */
    }

    .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -10px;
        left: 0;
        width: 100%;
        height: 10px;
        background: transparent;
    }
    .dropdown-menu li {
        padding: 0;
        position: relative; /* Для позиціонування вкладених меню */
    }
    .dropdown-menu a {
        padding: 8px 25px;
        text-transform: none;
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--text-main);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .dropdown-menu a:hover {
        background: rgba(0,94,184,0.05);
        color: var(--primary-blue);
    }

    /* 3-й рівень меню */
    .dropdown-menu .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: 0;
        margin-left: 10px;
        background: rgba(255, 255, 255, 0.96) !important;
    }

    /* Invisible bridge for nested dropdown to avoid hover loss */
    .dropdown-menu .dropdown-menu::before {
        top: 0;
        left: -10px;
        width: 10px;
        height: 100%;
    }

    .dropdown-menu .menu-caret {
        transform: rotate(-90deg);
    }
    
    .dropdown-menu .has-dropdown:hover > a .menu-caret {
        transform: rotate(-90deg);
    }

    .menu-item:hover > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.header-widgets {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Search Bar --- */
.header-search-bar {
    position: absolute;
    top: var(--header-h);
    left: 0;
    width: 100%;
    background: var(--bg-white);
    padding: 15px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s var(--ease);
    z-index: 999;
}
.header-search-bar.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.h-search-form {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}
.h-search-form i { font-size: 1.5rem; color: var(--primary-blue); }
.h-search-form input {
    flex-grow: 1;
    border: none;
    background: none;
    font-size: 1.2rem;
    font-weight: 600;
    outline: none;
    font-family: var(--font-main);
}

.search-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.user-auth {
    position: relative;
    z-index: 1010;
}

.menu-toggle {
    display: none; /* Приховано на десктопі */
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
}

.search-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.2s;
}
.search-toggle:hover { color: var(--primary-blue); }

/* --- Hero Grid (1+4) --- */
.hero-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
    margin-top: 30px; /* Відступ від шапки */
}

@media (min-width: 1200px) {
    .hero-section {
        grid-template-columns: 2fr 1fr;
    }
}

.hero-large {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 450px;
}

.hero-small-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* --- News Grid System --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
}

/* --- Profile UI System --- */
.profile-card {
    background: #fdfbf7 url('../images/profile-bg-watercolor.png') no-repeat center bottom / cover;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}

.profile-header {
    height: 180px;
    background: linear-gradient(135deg, var(--primary-blue), #00A3FF);
    position: relative;
}

.profile-avatar-wrapper {
    position: absolute;
    bottom: -50px;
    left: 40px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 30px;
    border: 6px solid white;
    background: white;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-brief {
    padding-bottom: 55px; /* Піднімаємо текст вище на синій фон */
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.profile-brief h1 {
    font-size: 1.8rem;
    font-weight: 850;
    margin: 0;
}

.profile-status {
    font-size: 0.9rem;
    opacity: 0.9;
}

.profile-content {
    padding: 70px 40px 40px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.info-block {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.03);
}

.info-label {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.info-value {
    font-weight: 600;
    color: var(--text-main);
}

.edit-profile-form {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02);
}

.edit-profile-form .form-group {
    margin-bottom: 20px;
}

.edit-profile-form label {
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
    font-size: 0.9rem;
}

.edit-profile-form input[type="text"],
.edit-profile-form input[type="email"],
.edit-profile-form input[type="password"],
.edit-profile-form textarea {
    width: 100%;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1.5px solid #eee;
    background: #fcfcfc;
    transition: 0.3s;
}

.edit-profile-form input:focus {
    border-color: var(--primary-blue);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 94, 184, 0.1);
}

/* --- Search Page Stylings --- */
.search-form-box {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
}

.search-form-group { margin-bottom: 20px; }
.search-form-group label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 10px; color: var(--text-muted); }
.search-form-group input[type="text"], .search-form-group select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    transition: 0.3s;
}
.search-form-group input:focus { border-color: var(--primary-blue); box-shadow: 0 0 0 4px rgba(0,94,184,0.1); }

.search-form-actions { display: flex; gap: 15px; margin-top: 25px; }

.btn-primary-action {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}
.btn-primary-action:hover { background: var(--primary-dark); transform: translateY(-2px); }

.btn-secondary-action {
    background: var(--bg-light);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-secondary-action:hover { background: var(--border-color); }

.search-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.search-form-row { display: flex; gap: 15px; }

/* ——— Content body: smart 2-col grid ——— */
.content-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

/* Invisible full-card overlay link used in hero templates */
.hero-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-large-item {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 440px;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* hidden preload img for LCP hint — background-image stays as visual */
.hero-bg-img {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s var(--ease);
}

.hero-large-item:hover .hero-bg { transform: scale(1.05); }

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,94,184,0.95) 0%, rgba(0,0,0,0) 70%);
}

.hero-content {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    z-index: 2;
}

.hero-content h2 { font-size: 2.25rem; font-weight: 800; line-height: 1.2; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero-meta { margin-top: 15px; font-size: 0.95rem; opacity: 0.9; font-weight: 600; }

.hero-grid .hero-large-img img {
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: block;
    width: 100%;
}

/* All div AND form children = FULL WIDTH (DLE wraps search in a <form>) */
.content-body > div,
.content-body > form {
    grid-column: 1 / -1;
}

/* Article news cards = 1 column each (2 per row) */
.content-body > article {
    grid-column: auto;
}

/* Full news page: single column layout for the article */
.is-news-page .content-body,
.is-static-page .content-body {
    grid-template-columns: 1fr;
}

/* Mobile: single column */
@media (max-width: 767px) {
    .content-body {
        grid-template-columns: 1fr;
    }
    .content-body > div {
        grid-column: 1;
    }
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    background: var(--primary-blue);
    color: white;
    padding: 0 12px;
    height: 30px;
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* hero-badge base */
.hero-badge {
    display: inline-block;
    background: var(--primary-blue);
    color: #fff;
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

/* CAT_COLORS_START */
.cat-pill.cat-1, .hero-badge.cat-1 { background: #2563eb; }
[data-cat-id="1"] .category-block-header::after { background: #2563eb; }
.cat-pill.cat-2, .hero-badge.cat-2 { background: #ca8a04; }
[data-cat-id="2"] .category-block-header::after { background: #ca8a04; }
.cat-pill.cat-3, .hero-badge.cat-3 { background: #16a34a; }
[data-cat-id="3"] .category-block-header::after { background: #16a34a; }
.cat-pill.cat-4, .hero-badge.cat-4 { background: #ea580c; }
[data-cat-id="4"] .category-block-header::after { background: #ea580c; }
.cat-pill.cat-5, .hero-badge.cat-5 { background: #475569; }
[data-cat-id="5"] .category-block-header::after { background: #475569; }
.cat-pill.cat-6, .hero-badge.cat-6 { background: #dc2626; }
[data-cat-id="6"] .category-block-header::after { background: #dc2626; }
.cat-pill.cat-7, .hero-badge.cat-7 { background: #7c3aed; }
[data-cat-id="7"] .category-block-header::after { background: #7c3aed; }
.cat-pill.cat-8, .hero-badge.cat-8 { background: #0891b2; }
[data-cat-id="8"] .category-block-header::after { background: #0891b2; }
.cat-pill.cat-9, .hero-badge.cat-9 { background: #0284c7; }
[data-cat-id="9"] .category-block-header::after { background: #0284c7; }
.cat-pill.cat-10, .hero-badge.cat-10 { background: #4f46e5; }
[data-cat-id="10"] .category-block-header::after { background: #4f46e5; }
.cat-pill.cat-11, .hero-badge.cat-11 { background: #d97706; }
[data-cat-id="11"] .category-block-header::after { background: #d97706; }
.cat-pill.cat-12, .hero-badge.cat-12 { background: #e11d48; }
[data-cat-id="12"] .category-block-header::after { background: #e11d48; }
.cat-pill.cat-14, .hero-badge.cat-14 { background: #059669; }
[data-cat-id="14"] .category-block-header::after { background: #059669; }
.cat-pill.cat-15, .hero-badge.cat-15 { background: #6b7280; }
[data-cat-id="15"] .category-block-header::after { background: #6b7280; }
.cat-pill.cat-16, .hero-badge.cat-16 { background: #b91c1c; }
[data-cat-id="16"] .category-block-header::after { background: #b91c1c; }
.cat-pill.cat-17, .hero-badge.cat-17 { background: #65a30d; }
[data-cat-id="17"] .category-block-header::after { background: #65a30d; }
.cat-pill.cat-18, .hero-badge.cat-18 { background: #92400e; }
[data-cat-id="18"] .category-block-header::after { background: #92400e; }
.cat-pill.cat-19, .hero-badge.cat-19 { background: #a21caf; }
[data-cat-id="19"] .category-block-header::after { background: #a21caf; }
.cat-pill.cat-20, .hero-badge.cat-20 { background: #0369a1; }
[data-cat-id="20"] .category-block-header::after { background: #0369a1; }
.cat-pill.cat-21, .hero-badge.cat-21 { background: #0f766e; }
[data-cat-id="21"] .category-block-header::after { background: #0f766e; }
.cat-pill.cat-22, .hero-badge.cat-22 { background: #1d4ed8; }
[data-cat-id="22"] .category-block-header::after { background: #1d4ed8; }
.cat-pill.cat-23, .hero-badge.cat-23 { background: #c2410c; }
[data-cat-id="23"] .category-block-header::after { background: #c2410c; }
.cat-pill.cat-24, .hero-badge.cat-24 { background: #b45309; }
[data-cat-id="24"] .category-block-header::after { background: #b45309; }
/* CAT_COLORS_END */

.cat-pill a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

/* Category Thematic Colors (by slug) */
.cat-svit { background: #10B981; } /* World - Emerald */
.cat-kultura { background: #8B5CF6; } /* Culture - Violet */
.cat-ekonomika { background: #475569; } /* Economy - Slate */
.cat-sport { background: #F59E0B; } /* Sport - Amber */
.cat-politika { background: #3B82F6; } /* Politics - Blue */
.cat-suspilstvo { background: #6366F1; } /* Society - Indigo */
.cat-susp-lstvo { background: #6366F1; } /* Handle alternate slug if needed */

/* --- News Cards (Standard) --- */
.news-card {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    margin-bottom: 15px;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-image-link {
    display: block;
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #eee;
}

.card-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 5;
}

.card-body { padding: 20px; }
.card-title { margin-bottom: 12px; font-size: 1.15rem; font-weight: 800; line-height: 1.4; }
.card-title a { color: var(--text-main); text-decoration: none; }
.card-excerpt { font-size: 0.9rem; line-height: 1.6; margin-bottom: 20px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; font-weight: 600; opacity: 0.7; }

/* --- Hero Small Items --- */
.hero-small-item {
    display: flex;
    gap: 12px;
    position: relative;
    background: var(--bg-white);
    padding: 8px;
    border-radius: 12px;
    transition: all 0.2s var(--ease);
    text-decoration: none;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.hero-small-item:hover {
    background: var(--accent-sand);
    transform: translateX(4px);
}

.small-thumb {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.small-thumb img { width: 100%; height: 100%; object-fit: cover; }
.small-info { position: relative; z-index: 2; }
.small-info h4 { font-size: 0.9rem; font-weight: 700; line-height: 1.3; color: var(--text-main); margin-top: 5px; }

.widget {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.widget-title {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--primary-blue);
    padding-left: 12px;
}

/* Utility */
.text-muted { color: var(--text-muted); }
.d-flex { display: flex; }
.align-center { align-items: center; }

/* Currency Widget Styles */
.currency-content {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 15px;
    margin-top: 10px;
}

/* FOOTER MODERN STYLES */
.footer-v2 {
    background: url("../images/header-bg.png") no-repeat center;
    background-size: cover; /* Також повертаємо тут */
    border-top: 1px solid var(--border-color);
    padding: 60px 0 40px;
    margin-top: 60px;
    position: relative;
}

.footer-v2::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.footer-v2 .container {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-v2 .logo-block span {
    color: var(--text-dark);
    font-weight: 700;
}

.footer-nav a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.footer-nav a:hover {
    color: var(--primary-blue);
}

.social-links {
    color: var(--primary-blue);
}

.footer-bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
    text-align: right;
    font-size: 0.85rem;
    opacity: 0.6;
    font-weight: 600;
}

.currency-li.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.sidebar-sticky-wrapper {
    position: sticky;
    top: calc(var(--nav-bar-h) + 20px);
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.currency-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.currency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.currency-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.curr-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.curr-val {
    font-size: 1.1rem;
    font-weight: 850;
    color: var(--primary-blue);
    font-family: var(--font-ui);
}

.currency-error {
    font-size: 0.85rem;
    color: #cc0000;
    text-align: center;
}


/* --- Category Clusters (Main Page) --- */
.category-block {
    margin-bottom: 50px;
}

.category-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.category-block-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--cat-accent, var(--primary-blue));
}

.category-block-title {
    font-size: 1.4rem;
    font-weight: 850;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-block-title a {
    text-decoration: none;
    color: inherit;
}

.category-block-more {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 5px;
}

.category-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Cat Item - Grid Layout */
.cat-grid-item {
    display: flex;
    gap: 15px;
    background: var(--bg-white);
    padding: 12px;
    border-radius: 12px;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    border: 1px solid rgba(0,0,0,0.03);
}

.cat-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border-color: rgba(0,94,184,0.1);
}

.cat-grid-thumb {
    width: 120px;
    height: 85px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.cat-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cat-grid-item:hover .cat-grid-thumb img {
    transform: scale(1.1);
}

.cat-grid-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.cat-grid-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.cat-grid-item:hover h4 {
    color: var(--primary-blue);
}

.cat-grid-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 991px) {
    .category-grid-2x2 {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .category-grid-2x2 {
        grid-template-columns: 1fr;
    }
    .cat-grid-thumb {
        width: 100px;
        height: 75px;
    }
}

/* === Cat + City row === */
.cat-location-row {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.city-arrow {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 14px 0 22px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #fff;
    background-color: #64748b;
    clip-path: polygon(10px 0%, 100% 0%, 100% 100%, 10px 100%, 0% 50%);
    margin-left: -2px;
    white-space: nowrap;
}

/* === Anti-Gravity Breadcrumbs === */
.ag-breadcrumbs {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 18px;
    font-size: 0;
}

.article-meta-top .ag-breadcrumbs { margin-bottom: 0; }

.ag-breadcrumbs a {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 18px 0 22px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #fff !important;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.6px;
    white-space: nowrap;
    margin-left: -8px;
    z-index: 1;
    background-color: #1a365d;
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 50%, 100% 100%, 10px 100%, 0% 50%);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.15),
                inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -1px 0 rgba(0,0,0,0.15);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.06) 45%, rgba(0,0,0,0.08) 100%);
    background-blend-mode: overlay;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.ag-breadcrumbs a:first-child {
    clip-path: polygon(0% 0%, 100% 0%, calc(100% - 10px) 50%, 100% 100%, 0% 100%);
    padding-left: 14px;
    margin-left: 0;
}

.ag-breadcrumbs a:hover {
    transform: translateY(-4px) scale(1.06);
    z-index: 20;
    filter: brightness(1.18) drop-shadow(0 10px 18px rgba(0,0,0,0.35));
}

/* Reverse z-index so left arrows render on top of right arrows (shows chevron tips) */
.ag-breadcrumbs a:nth-child(1) { z-index: 6; }
.ag-breadcrumbs a:nth-child(2) { z-index: 5; }
.ag-breadcrumbs a:nth-child(3) { z-index: 4; }
.ag-breadcrumbs a:nth-child(4) { z-index: 3; }
.ag-breadcrumbs a:nth-child(5) { z-index: 2; }

/* Hide " / " separator text/elements output by {link-category} */
.ag-breadcrumbs > *:not(a) { display: none; }

/* Category colors by URL slug */
.ag-breadcrumbs a[href="/"]                          { background-color: #1a365d; }
.ag-breadcrumbs a[href*="israel"]                    { background-color: #2563eb; }
.ag-breadcrumbs a[href*="novyny-ukrayiny"]           { background-color: #ca8a04; }
.ag-breadcrumbs a[href*="ekonomika-ta-nerukhomist"]  { background-color: #16a34a; }
.ag-breadcrumbs a[href*="blyzkiy-skhid"]             { background-color: #ea580c; }
.ag-breadcrumbs a[href*="army-and-security"]         { background-color: #475569; }
.ag-breadcrumbs a[href*="zdorovya"]                  { background-color: #dc2626; }
.ag-breadcrumbs a[href*="kultura-ta-sport"]          { background-color: #7c3aed; }
.ag-breadcrumbs a[href*="oglyad-zmi"]                { background-color: #0891b2; }
.ag-breadcrumbs a[href*="tekhnolohiyi"]              { background-color: #0284c7; }
.ag-breadcrumbs a[href*="suspilstvo"]                { background-color: #4f46e5; }
.ag-breadcrumbs a[href*="tradytsiyi"]                { background-color: #d97706; }
.ag-breadcrumbs a[href*="diaspora"]                  { background-color: #e11d48; }
.ag-breadcrumbs a[href*="mandrivki"]                 { background-color: #059669; }
.ag-breadcrumbs a[href*="politics"]                  { background-color: #6b7280; }
.ag-breadcrumbs a[href*="vybory"]                    { background-color: #b91c1c; }
.ag-breadcrumbs a[href*="weekend-routes"]            { background-color: #65a30d; }
.ag-breadcrumbs a[href*="history-places"]            { background-color: #92400e; }
.ag-breadcrumbs a[href*="afisha"]                    { background-color: #a21caf; }
.ag-breadcrumbs a[href*="regions"]                   { background-color: #0369a1; }
.ag-breadcrumbs a[href*="north"]                     { background-color: #0f766e; }
.ag-breadcrumbs a[href*="center"]                    { background-color: #1d4ed8; }
.ag-breadcrumbs a[href*="south"]                     { background-color: #c2410c; }

/* ============================================================
   MOBILE PILL-SCROLL MENU
   ============================================================ */
.pill-nav {
    display: none; /* показується тільки на мобайлі */
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--bg-primary, #fff);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding: 8px 12px;
    gap: 8px;
    white-space: nowrap;
}
.pill-nav::-webkit-scrollbar { display: none; }

.pill-nav a {
    display: inline-block;
    scroll-snap-align: start;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border, #e5e7eb);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pill-nav a:hover {
    background: var(--primary-blue, #2563eb);
    color: #fff;
    border-color: var(--primary-blue, #2563eb);
}
.pill-nav a.active {
    background: var(--primary-blue, #2563eb);
    color: #fff;
    border-color: var(--primary-blue, #2563eb);
}

/* Кольори для конкретних розділів */
.pill-nav a[data-cat="1"].active  { background: #2563eb; border-color: #2563eb; }
.pill-nav a[data-cat="5"].active  { background: #dc2626; border-color: #dc2626; }
.pill-nav a[data-cat="15"].active { background: #6b7280; border-color: #6b7280; }
.pill-nav a[data-cat="3"].active  { background: #16a34a; border-color: #16a34a; }
.pill-nav a[data-cat="26"].active { background: #ea580c; border-color: #ea580c; }
.pill-nav a[data-cat="2"].active  { background: #ca8a04; border-color: #ca8a04; }
.pill-nav a[data-cat="4"].active  { background: #ea580c; border-color: #ea580c; }
.pill-nav a[data-cat="9"].active  { background: #0284c7; border-color: #0284c7; }
.pill-nav a[data-cat="7"].active  { background: #7c3aed; border-color: #7c3aed; }
.pill-nav a[data-cat="14"].active { background: #059669; border-color: #059669; }

@media (max-width: 991px) {
    .pill-nav {
        display: flex;
    }
}
.ag-breadcrumbs a[href*="jerusalem"]                 { background-color: #b45309; }

/* ── Auto-links in article body ─────────────────────────────────────── */
.article-body a:not([class]) {
    color: #1a6fc4;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    text-decoration-color: #1a6fc480;
    transition: color .15s, text-decoration-color .15s;
}
.article-body a:not([class]):hover {
    color: #0d4f9e;
    text-decoration-color: #0d4f9e;
    text-decoration-style: solid;
}
