/* Главная страница — плиточный каталог инструментов */

/* Широкий контейнер на 2K и ultra-wide (Bootstrap .container ≈ 1320px — узко) */
.container.container-home,
.container-home {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
}

@media (min-width: 576px) {
    .container-home {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container-home {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container-home {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container-home {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container-home {
        max-width: 1520px;
    }
}

@media (min-width: 1800px) {
    .container-home {
        max-width: min(1920px, calc(100vw - 4rem));
    }
}

@media (min-width: 2200px) {
    .container-home {
        max-width: min(2200px, calc(100vw - 5rem));
    }
}

.home-page {
    background: var(--bg-secondary, #f8fafc);
}

/* Не дублировать min-height с .content-wrapper (60vh) — иначе футер уезжает под прокрутку */
.content-wrapper:has(.home-page) {
    min-height: 0;
    padding-top: 0;
    padding-bottom: 1.5rem;
}

.home-hero {
    padding: 3rem 0 2rem;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, var(--bg-secondary, #f8fafc) 100%);
}

.home-hero__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 0.75rem;
}

.home-hero__subtitle {
    font-size: 1.05rem;
    color: var(--text-muted, #64748b);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

.home-tools {
    padding: 0 0 4rem;
}

.home-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.home-filter-pill {
    border: none;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.home-filter-pill:hover {
    background: #cbd5e1;
}

.home-filter-pill.active {
    background: #1e293b;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 41, 59, 0.25);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 1.25rem;
}

@media (min-width: 1400px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.5rem;
    }
}

@media (min-width: 1800px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

.tool-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    min-height: 180px;
}

.tool-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
    color: inherit;
}

.tool-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--tool-color) 12%, white);
    color: var(--tool-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.tool-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.tool-card__title .tool-department {
    font-weight: 500;
    color: #94a3b8;
    font-size: 0.9em;
}

.tool-card__description {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    flex-grow: 1;
}

.tool-card.is-hidden {
    display: none;
}

.home-tools__empty {
    text-align: center;
    padding: 2rem 0;
}
