/* ============================================
   ГЛОБАЛЬНЫЕ СБРОСЫ
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ============================================
   КОНТЕЙНЕР (переопределение для главной)
   ============================================ */
.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
    }
}

/* ============================================
   СЕТКА ГЛАВНОЙ СТРАНИЦЫ
   ============================================ */
.home-layout {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr) 350px;
    gap: 30px;
    align-items: start;
    margin-top: 30px;
}

.main-content {
    width: 100%;
    min-width: 0; /* Критично для grid-элементов */
}

/* ============================================
   ГЕРОЙ-БЛОК
   ============================================ */
.hero-block {
    text-align: center;
    padding: 20px 0;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0c004b;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.hero-accent {
    color: #ff0033;
}

.hero-subtitle {
    font-family: monospace;
    font-weight: bold;
    font-size: 1.1rem;
    color: #475569;
    margin: 0;
}

.block-subtitle {
    margin: 0 0 20px;
    font-size: 1.5rem;
    color: #0f172a;
    text-align: center;
}

/* ============================================
   СПИСКИ ГОРОДОВ (сайдбары)
   ============================================ */
.city-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.city-list li {
    margin-bottom: 8px;
}

.city-list a {
    text-decoration: none;
    color: #334155;
    transition: color 0.2s;
}

.city-list a:hover {
    color: #1a73e8;
}

/* ============================================
   БАННЕРЫ И ПОИСК
   ============================================ */
.banner-container {
    margin-bottom: 20px;
    text-align: center;
}

.main-search-block {
    background: white;
    padding: 25px;
    border-radius: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.search-form-wide {
    max-width: 700px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    gap: 10px;
}

.search-input-wrapper input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-wrapper input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.search-input-wrapper button {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}

.search-input-wrapper button:hover {
    background: #1557b0;
}

/* ============================================
   БЛОКИ КОНТЕНТА
   ============================================ */
.page-blocks {
    width: 100%;
}

.block-wrapper {
    margin-bottom: 30px;
    background: white;
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.block-header h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
}

.block-footer {
    margin-top: 20px;
    text-align: right;
}

.block-footer a {
    display: inline-block;
    background: #f1f5f9;
    color: #1a73e8;
    padding: 8px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.block-footer a:hover {
    background: #e2e8f0;
}

/* ============================================
   СЕТКИ КАРТОЧЕК
   ============================================ */
.vacancies-list-horizontal,
.news-list-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* ============================================
   КАРТОЧКИ ВАКАНСИЙ И НОВОСТЕЙ
   ============================================ */
.vacancy-card-horizontal,
.news-card-horizontal {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 16px;
    padding: 15px;
    border: 1px solid #eef2ff;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    overflow: hidden; /* Предотвращает выход содержимого */
}

.vacancy-card-horizontal:hover,
.news-card-horizontal:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
    border-color: #dbeafe;
}

/* Изображения */
.vacancy-image,
.news-image {
    width: 100%;
    height: 180px;
    margin-bottom: 15px;
    overflow: hidden;
}

.vacancy-image img,
.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.no-image {
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    border-radius: 12px;
}

/* Заголовки */
.vacancy-info h3,
.news-info h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.vacancy-info h3 a,
.news-info h3 a {
    text-decoration: none;
    color: #0f172a;
}

.vacancy-info h3 a:hover,
.news-info h3 a:hover {
    color: #1a73e8;
}

/* ============================================
   ВНУТРЕННЯЯ СТРУКТУРА КАРТОЧКИ ВАКАНСИИ
   (город между компанией и зарплатой)
   ============================================ */
.vacancy-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vacancy-company {
    font-size: 0.9rem;
    color: #1a73e8;
    margin-bottom: 6px;
    font-weight: 500;
}

/* Город — отдельный блок, переносится естественно */
.vacancy-location {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Зарплата прижата к низу карточки */
.vacancy-salary-block {
    margin-top: auto;
}

.salary {
    font-weight: 700;
    color: #16a34a;
    font-size: 1rem;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Старый .vacancy-meta (если остался в коде) */
.vacancy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: auto;
}

.vacancy-meta > * {
    min-width: 0;
    word-break: break-word;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

/* Планшеты и узкие экраны */
@media (max-width: 1200px) {
    .home-layout {
        grid-template-columns: 240px 1fr;
    }
    
    .sidebar-right {
        display: none;
    }
    
    .container {
        padding: 0 20px;
    }
}

/* Мобильные устройства */
@media (max-width: 900px) {
    .home-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar-left,
    .sidebar-right {
        display: none;
    }
    
    .main-content {
        padding: 0 15px;
    }
}

/* Маленькие мобильные */
@media (max-width: 600px) {
    .container {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 0 10px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .main-search-block,
    .block-wrapper {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .vacancies-list-horizontal,
    .news-list-horizontal {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-input-wrapper {
        flex-direction: column;
    }
    
    .search-input-wrapper input,
    .search-input-wrapper button {
        width: 100%;
    }
    
    .vacancy-card-horizontal h3,
    .news-card-horizontal h3 {
        font-size: 1rem;
    }
    
    .vacancy-company,
    .vacancy-location {
        font-size: 0.85rem;
    }
    
    .salary {
        font-size: 0.95rem;
    }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
    .main-search-block,
    .block-wrapper {
        padding: 12px;
    }
}
/* === МЕТА-ИНФОРМАЦИЯ НОВОСТЕЙ (дата + город) === */
.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Прижимает к низу карточки */
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: #64748b;
    gap: 10px;
}

.news-date,
.news-city {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

/* Иконки */
.meta-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: #94a3b8;
}

.news-date {
    color: #64748b;
}

.news-city {
    color: #64748b;
}

.news-city a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.news-city a:hover {
    color: #1557b0;
    text-decoration: underline;
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding-top: 10px;
    }
    
    .news-date,
    .news-city {
        font-size: 0.8rem;
    }
    
    .meta-icon {
        width: 12px;
        height: 12px;
    }
}
/* === КАРТОЧКИ НОВОСТЕЙ === */
.news-card-horizontal {
    display: flex;
    flex-direction: column;
    height: 100%; /* Важно: карточка занимает всю высоту */
    background: #ffffff;
    border-radius: 16px;
    padding: 15px;
    border: 1px solid #eef2ff;
    transition: all 0.2s;
    overflow: hidden;
}

.news-card-horizontal:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
    border-color: #dbeafe;
}

/* Контейнер информации - flex column */
.news-info {
    display: flex;
    flex-direction: column;
    flex: 1; /* Занимает всё доступное пространство */
    min-width: 0; /* Предотвращает переполнение */
}

.news-info h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.news-info h3 a {
    text-decoration: none;
    color: #0f172a;
    transition: color 0.2s;
}

.news-info h3 a:hover {
    color: #1a73e8;
}

/* Краткое описание */
.news-excerpt {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1; /* Растягивается, чтобы прижать мета-блок к низу */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   МЕТА-ИНФОРМАЦИЯ НОВОСТЕЙ (Дата + Город)
   ============================================ */
.news-meta-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Прижимает к низу карточки */
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: #64748b;
    gap: 12px;
    flex-shrink: 0;
}

.news-date,
.news-city {
    display: flex;
    align-items: center;
    gap: 6px; /* Чуть больше воздуха между иконкой и текстом */
}

/* Иконки */
.meta-icon {
    width: 15px; /* Чуть крупнее для лучшей читаемости */
    height: 15px;
    flex-shrink: 0;
    stroke: #94a3b8;
    transition: stroke 0.2s ease; /* Плавная смена цвета иконки */
}

.news-date {
    color: #64748b;
}

/* --- СОВРЕМЕННАЯ ССЫЛКА НА ГОРОД --- */
.city-link {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 600; /* Чуть жирнее для акцента */
    transition: all 0.2s ease;
    padding: 2px 6px; /* Внутренние отступы для эффекта */
    border-radius: 6px; /* Скругленные углы */
    margin: -2px -6px; /* Компенсация padding, чтобы не ломать сетку */
}

/* Эффект при наведении: мягкая подложка вместо подчеркивания */
.city-link:hover {
    color: #1557b0;
    background-color: rgba(26, 115, 232, 0.08); /* Очень легкая синяя дымка */
}

/* При наведении на блок города иконка тоже становится синей */
.news-city:hover .meta-icon {
    stroke: #1a73e8;
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ МЕТА-БЛОКА
   ============================================ */
@media (max-width: 600px) {
    .news-meta-small {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-top: 12px;
        font-size: 0.8rem;
    }
    
    .news-date,
    .news-city {
        width: 100%;
        justify-content: flex-start;
    }
    
    .meta-icon {
        width: 13px;
        height: 13px;
    }
    
    /* На мобильных убираем компенсацию margin, чтобы тап-зона была удобной */
    .city-link {
        margin: 0;
        padding: 4px 8px;
    }
}