/* Шаблоны главной страницы блога (Modules/Articles).
   Цвета — только через CSS-переменные темы (dynamic-colors). */

/* ---- Общие элементы ---- */

.blog-tpl-eyebrow {
    display: block;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.blog-tpl-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--links-color);
}

.blog-tpl-more .bi {
    transition: transform 0.25s ease;
}

a:hover .blog-tpl-more .bi {
    transform: translateX(4px);
}

/* ---- magazine: hero + сетка ---- */

.blog-tpl-hero {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    min-height: 300px;
}

@media (min-width: 768px) {
    .blog-tpl-hero {
        min-height: 420px;
    }
}

.blog-tpl-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog-tpl-hero:hover .blog-tpl-hero-img {
    transform: scale(1.03);
}

.blog-tpl-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.35) 45%,
        rgba(0, 0, 0, 0.05) 100%
    );
}

.blog-tpl-hero-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@media (min-width: 768px) {
    .blog-tpl-hero-body {
        padding: 36px;
        max-width: 75%;
    }
}

.blog-tpl-hero-title {
    font-size: clamp(22px, 4vw, 38px);
    line-height: 1.15;
    font-weight: 600;
}

.blog-tpl-hero-excerpt {
    font-size: 15px;
    opacity: 0.85;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- list: горизонтальные карточки ---- */

.blog-tpl-list-item {
    padding: 22px 0;
    border-bottom: 1px solid var(--additional-color);
}

.blog-tpl-list-item:first-of-type {
    border-top: 1px solid var(--additional-color);
}

.blog-tpl-list-media {
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.blog-tpl-list-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-tpl-list-item:hover .blog-tpl-list-img {
    transform: scale(1.05);
}

.blog-tpl-list-title {
    font-size: clamp(19px, 2.5vw, 26px);
    line-height: 1.2;
    color: var(--secondary-color);
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.blog-tpl-list-item:hover .blog-tpl-list-title {
    color: var(--links-color);
}

.blog-tpl-list-excerpt {
    color: var(--bs-body-color, #333);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- masonry: плитка на CSS columns ---- */

.blog-tpl-masonry {
    columns: 1;
    column-gap: 16px;
}

@media (min-width: 576px) {
    .blog-tpl-masonry {
        columns: 2;
    }
}

@media (min-width: 992px) {
    .blog-tpl-masonry {
        columns: 3;
    }
}

.blog-tpl-masonry-card {
    display: block;
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--additional-color);
    text-decoration: none;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.blog-tpl-masonry-card:hover {
    box-shadow: 0 12px 28px rgba(var(--bs-secondary-rgb), 0.18);
    transform: translateY(-3px);
}

.blog-tpl-masonry-img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 4 / 3;
}

/* Разная высота фото — живой ритм плитки без JS */
.blog-tpl-masonry-card:nth-child(3n + 2) .blog-tpl-masonry-img {
    aspect-ratio: 1 / 1;
}

.blog-tpl-masonry-card:nth-child(4n + 3) .blog-tpl-masonry-img {
    aspect-ratio: 3 / 4;
}

.blog-tpl-masonry-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px 16px;
}

.blog-tpl-masonry-title {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    color: var(--secondary-color);
}

.blog-tpl-masonry-card:hover .blog-tpl-masonry-title {
    color: var(--links-color);
}

.blog-tpl-masonry-excerpt {
    font-size: 13.5px;
    color: var(--bs-body-color, #333);
    opacity: 0.75;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- minimal: типографский список ---- */

.blog-tpl-minimal {
    max-width: 880px;
}

.blog-tpl-minimal-item {
    padding: 26px 0;
    border-bottom: 1px solid var(--additional-color);
}

.blog-tpl-minimal-item:first-of-type {
    border-top: 1px solid var(--additional-color);
}

.blog-tpl-minimal-date {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
}

@media (min-width: 768px) {
    .blog-tpl-minimal-date {
        flex-direction: column;
        gap: 0;
    }
}

.blog-tpl-minimal-day {
    font-size: clamp(28px, 3vw, 44px);
    line-height: 1;
    color: var(--primary-color);
    opacity: 0.35;
    transition: opacity 0.25s ease;
}

.blog-tpl-minimal-item:hover .blog-tpl-minimal-day {
    opacity: 1;
}

.blog-tpl-minimal-title {
    font-size: clamp(20px, 2.6vw, 28px);
    line-height: 1.2;
    color: var(--secondary-color);
    margin-bottom: 6px;
    transition: color 0.2s ease, transform 0.25s ease;
}

.blog-tpl-minimal-item:hover .blog-tpl-minimal-title {
    color: var(--links-color);
    transform: translateX(6px);
}

.blog-tpl-minimal-excerpt {
    color: var(--bs-body-color, #333);
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- cover: full-bleed карточки ---- */

.blog-tpl-cover-card {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
}

.blog-tpl-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-tpl-cover-card:hover .blog-tpl-cover-img {
    transform: scale(1.06);
}

.blog-tpl-cover-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.30) 45%,
        rgba(0, 0, 0, 0.05) 100%
    );
    transition: background 0.3s ease;
}

.blog-tpl-cover-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-tpl-cover-title {
    font-size: 19px;
    line-height: 1.25;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-tpl-cover-excerpt {
    font-size: 13.5px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: opacity 0.35s ease, max-height 0.35s ease;
}

.blog-tpl-cover-card:hover .blog-tpl-cover-excerpt {
    opacity: 0.85;
    max-height: 60px;
}

/* ---- editorial: просторная редакционная вёрстка ---- */

.blog-tpl-editorial-media {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin-bottom: 12px;
}

.blog-tpl-editorial-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-tpl-editorial-feature,
.blog-tpl-editorial-row a {
    text-decoration: none;
    display: block;
}

.blog-tpl-editorial-feature:hover .blog-tpl-editorial-img,
.blog-tpl-editorial-row:hover .blog-tpl-editorial-img {
    transform: scale(1.04);
}

.blog-tpl-editorial-feature-title {
    display: block;
    font-size: clamp(20px, 2.8vw, 30px);
    line-height: 1.2;
    color: var(--secondary-color);
    margin-bottom: 6px;
    transition: color 0.2s ease;
}

.blog-tpl-editorial-feature:hover .blog-tpl-editorial-feature-title {
    color: var(--links-color);
}

.blog-tpl-editorial-row {
    padding: 26px 0;
    border-top: 1px solid var(--additional-color);
}

.blog-tpl-editorial-row .blog-tpl-editorial-media {
    margin-bottom: 0;
    aspect-ratio: 4 / 3;
}

@media (min-width: 768px) {
    .blog-tpl-editorial-row--flip .blog-tpl-editorial-row-media {
        order: 2;
    }
}

.blog-tpl-editorial-title {
    font-size: clamp(19px, 2.4vw, 26px);
    line-height: 1.2;
    color: var(--secondary-color);
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.blog-tpl-editorial-row:hover .blog-tpl-editorial-title {
    color: var(--links-color);
}

.blog-tpl-editorial-excerpt {
    display: block;
    color: var(--bs-body-color, #333);
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- show/reader: узкая читательская колонка ---- */

.blog-tpl-reader {
    max-width: 760px;
    margin: 0 auto;
}

.blog-tpl-reader-title {
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.15;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.blog-tpl-reader-lead {
    font-size: 18px;
    line-height: 1.55;
    color: var(--bs-body-color, #333);
    opacity: 0.85;
}

.blog-tpl-reader-media {
    border-radius: 12px;
    overflow: hidden;
}

.blog-tpl-reader-content {
    font-size: 17px;
    line-height: 1.7;
}

.blog-tpl-reader-other {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- show/hero: обложка на всю ширину ---- */

.blog-tpl-show-hero {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
}

@media (min-width: 768px) {
    .blog-tpl-show-hero {
        min-height: 440px;
    }
}

.blog-tpl-show-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-tpl-show-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.30) 50%,
        rgba(0, 0, 0, 0.10) 100%
    );
}

.blog-tpl-show-hero-body {
    position: relative;
    color: #fff;
    padding-bottom: 28px;
}

.blog-tpl-show-hero-title {
    font-size: clamp(24px, 4vw, 44px);
    line-height: 1.15;
    margin: 0;
}

/* ---- widget/strip: горизонтальная лента со scroll-snap ---- */

.blog-tpl-strip {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.blog-tpl-strip-item {
    flex: 0 0 260px;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .blog-tpl-strip-item {
        flex-basis: 300px;
    }
}

/* ---- widget/spotlight: 1 крупная + 3 сбоку ---- */

.blog-tpl-spotlight-main {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    min-height: 280px;
    height: 100%;
}

.blog-tpl-spotlight-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-tpl-spotlight-main:hover .blog-tpl-spotlight-img {
    transform: scale(1.04);
}

.blog-tpl-spotlight-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.70) 0%,
        rgba(0, 0, 0, 0.25) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
}

.blog-tpl-spotlight-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px;
    color: #fff;
}

.blog-tpl-spotlight-title {
    display: block;
    font-size: clamp(20px, 2.6vw, 28px);
    line-height: 1.2;
    font-weight: 600;
}

.blog-tpl-spotlight-side {
    display: flex;
    gap: 14px;
    align-items: center;
    text-decoration: none;
    border-radius: 10px;
}

.blog-tpl-spotlight-side-img {
    width: 110px;
    height: 82px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.blog-tpl-spotlight-side:hover .blog-tpl-spotlight-side-img {
    transform: scale(1.05);
}

.blog-tpl-spotlight-side-title {
    display: block;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    color: var(--secondary-color);
}

.blog-tpl-spotlight-side:hover .blog-tpl-spotlight-side-title {
    color: var(--links-color);
}
