/* Блог / гайды */
.blog-hero {
    background: linear-gradient(135deg, #0d6efd 0%, #084298 55%, #1a1a2e 100%);
    color: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
}
.blog-hero h1 { font-weight: 700; margin-bottom: 0.5rem; }
.blog-hero p { opacity: 0.92; margin-bottom: 0; max-width: 640px; }

.blog-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e8e8e8);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    height: 100%;
}
.blog-card:hover {
    box-shadow: 0 12px 32px rgba(13, 110, 253, 0.12);
    border-color: rgba(13, 110, 253, 0.35);
}
.blog-card-link {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
    color: inherit;
    min-height: 148px;
    background: inherit;
}
.blog-card-link--cover .blog-card-body {
    flex: 1 1 62%;
    min-width: 0;
}
.blog-card-body {
    padding: 1.25rem 1rem 1.25rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* Общий стиль миниатюры справа (категории, блог, шапка статьи) */
.card-side-media {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    background: transparent;
}
.card-side-media img {
    max-width: 88%;
    max-height: 88%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
}
/* Миниатюры карточек (категории, блог): ×1.4 — длительность пропорциональна масштабу */
.home-category-media.card-side-media img,
.blog-card-media.card-side-media img {
    transition: transform 1.58s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.blog-card-media {
    flex: 0 0 38%;
    max-width: 38%;
    min-height: 148px;
    padding: 0.65rem 0.85rem;
}
/* Зум миниатюры карточек: ×1.4 за ~1.05s */
.blog-card:hover .blog-card-media img,
.blog-card-link:hover .blog-card-media img,
.blog-card-media:hover img {
    transform: scale(1.4) !important;
}
.blog-card-icon {
    flex: 0 0 56px;
    max-width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0d6efd;
    font-size: 1.35rem;
    background: transparent;
}
.blog-card-meta { font-size: 0.8rem; color: var(--text-muted, #6c757d); margin-bottom: 0.5rem; }
.blog-card-title { color: var(--text, #212529); margin-bottom: 0.75rem; }
.blog-card-excerpt {
    color: var(--text-muted, #6c757d);
    font-size: 0.9rem;
    flex: 1;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-read {
    color: #0d6efd;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: auto;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    text-decoration: underline transparent;
    text-underline-offset: 3px;
}
.blog-card-link:hover .blog-card-read,
.blog-card-read:hover {
    color: #084298;
    text-decoration-color: #084298;
}
.blog-card-link:hover .blog-card-read i,
.blog-card-read:hover i {
    transform: translateX(4px);
}
.blog-card-read i {
    display: inline-block;
    transition: transform 0.2s ease;
}

.article-hero {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #f7f8fa 0%, #eef2ff 100%);
    border: 1px solid var(--border, #e8e8e8);
    display: flex;
    align-items: stretch;
    max-height: 320px;
    min-height: 0;
}
.article-hero--with-cover {
    min-height: 220px;
}
.article-hero--with-cover .article-hero-text {
    flex: 1 1 58%;
    min-width: 0;
}
.article-hero-text {
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
}
.article-hero-media {
    flex: 0 0 42%;
    max-width: 42%;
    min-height: 0;
    max-height: 320px;
    padding: 0.75rem 1rem;
}
/* Hover-zoom: обложка в шапке статьи */
.article-img-zoom {
    overflow: hidden;
    line-height: 0;
}
.article-hero-media.article-img-zoom {
    border-radius: 0;
}
.article-hero-media.article-img-zoom img {
    max-width: 88%;
    max-height: 260px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transform-origin: center center;
    transition: transform 3.6s cubic-bezier(0.22, 1, 0.36, 1) !important;
    will-change: transform;
}
.article-hero-media.article-img-zoom:hover img {
    transform: scale(1.3) !important;
}
/* Inline-картинки в тексте: ×1.3, медленнее */
.article-content .article-img-zoom {
    display: block;
    border-radius: 12px;
    margin: 1.25rem 0;
    max-width: 100%;
}
.article-content .article-img-zoom img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    border-radius: 0;
    display: block;
    transform-origin: center center;
    transition: transform 3.6s cubic-bezier(0.22, 1, 0.36, 1) !important;
    will-change: transform;
}
.article-content .article-img-zoom:hover img {
    transform: scale(1.3) !important;
}
[data-theme="dark"] .article-hero {
    background: linear-gradient(135deg, #1a1d24 0%, #16213e 100%);
}
.article-hero-icon {
    width: 64px; height: 64px; border-radius: 16px;
    background: linear-gradient(135deg, #0d6efd, #084298);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem; margin-bottom: 1rem;
}
.article-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.article-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text);
    overflow-x: hidden;
}
.article-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    padding-top: 0.5rem;
}
.article-content h3 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.75rem; }
.article-content p { margin-bottom: 1rem; }
.article-content ul, .article-content ol { margin-bottom: 1rem; padding-left: 1.25rem; }
.article-content li { margin-bottom: 0.35rem; }
.article-content a { color: #0d6efd; text-decoration: underline; }
.article-content a:hover { color: #0a58ca; }
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.25rem 0;
    display: block;
}
.article-content .article-img-zoom img {
    border-radius: 0;
    margin: 0;
}

.blog-lead {
    font-size: 1.15rem;
    line-height: 1.7;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid #0d6efd;
    background: rgba(13, 110, 253, 0.06);
    border-radius: 0 12px 12px 0;
    margin-bottom: 2rem;
}
.blog-callout {
    background: var(--bg-input, #f7f8fa);
    border: 1px solid var(--border, #e8e8e8);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}
.blog-callout-info { border-left: 4px solid #0d6efd; }
.blog-table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.blog-table th, .blog-table td {
    border: 1px solid var(--border, #dee2e6);
    padding: 0.65rem 0.85rem;
    vertical-align: top;
}
.blog-table th { background: var(--bg-input, #f7f8fa); font-weight: 600; }

.article-cta {
    margin-top: 2.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(13, 110, 253, 0.02));
    border: 1px solid rgba(13, 110, 253, 0.2);
    text-align: center;
}

.home-category-card,
.blog-card-link {
    transition: none;
}
.home-category-card:active,
.blog-card-link:active {
    transform: none;
}

.home-category-card-inner {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e8e8e8);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    align-items: stretch;
    min-height: 168px;
}
.home-category-card-inner.has-image .home-category-content {
    flex: 1 1 58%;
    min-width: 0;
}
.home-category-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.75rem 1.5rem;
    z-index: 1;
}
.home-category-media {
    flex: 0 0 42%;
    max-width: 42%;
    min-height: 168px;
    padding: 0.75rem 1rem;
}
/* Зум карточек категорий: ×1.4 за ~1.05s */
.home-category-card:hover .home-category-media img,
.home-category-card:hover .card-side-media img,
.home-category-card-inner:hover .home-category-media img,
.home-category-media:hover img {
    transform: scale(1.4) !important;
}
.home-category-card:hover .home-category-card-inner {
    box-shadow: 0 12px 28px rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.35);
}
.home-category-link {
    color: #0d6efd;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: auto;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    text-decoration: underline transparent;
    text-underline-offset: 3px;
}
.home-category-card:hover .home-category-link,
.home-category-link:hover {
    color: #084298;
    text-decoration-color: #084298;
}
.home-category-link i {
    display: inline-block;
    transition: transform 0.2s ease;
}
.home-category-card:hover .home-category-link i,
.home-category-link:hover i {
    transform: translateX(4px);
}

[data-theme="dark"] .blog-card { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .blog-card-title { color: var(--text); }
[data-theme="dark"] .home-category-card-inner { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .home-category-card .text-dark { color: var(--text) !important; }

@media (max-width: 575.98px) {
    .home-category-card-inner.has-image { flex-direction: column; min-height: 0; }
    .home-category-card-inner.has-image .home-category-content { flex: none; }
    .home-category-media {
        flex: none;
        max-width: none;
        width: 100%;
        min-height: 130px;
    }
    .blog-card-link--cover { flex-direction: column; min-height: 0; }
    .blog-card-link--cover .blog-card-body { flex: none; }
    .blog-card-media {
        flex: none;
        max-width: none;
        width: 100%;
        min-height: 120px;
    }
    .article-hero--with-cover { flex-direction: column; max-height: none; min-height: 0; }
    .article-hero-media {
        flex: none;
        max-width: none;
        width: 100%;
        min-height: 180px;
        max-height: 240px;
    }
    .article-hero-text { padding: 1.25rem 1.25rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .home-category-media.card-side-media img,
    .blog-card-media.card-side-media img,
    .article-hero-media.article-img-zoom img,
    .article-content .article-img-zoom img {
        transition: none !important;
    }
}
