/* ============================================================
   blog-grid.css — сетка карточек блога в стиле v2 (как /faq)
   Используется в /blog (blog.tpl, blog.php) и /article (article.php)
   ============================================================ */

/* ---------- Hero (хлебные крошки + заголовок) — те же стили, что в /contacts ---------- */
.contacts-hero {
    padding: 40px 0 30px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 32px;
}
/* Хлебные крошки — единый стиль .breadcrumbs (common-v2.css) */
.contacts-hero__title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 38px;
    font-weight: 700;
    color: #222;
    margin: 0 0 14px;
    line-height: 1.15;
    letter-spacing: -.5px;
}
.contacts-hero__subtitle {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 17px;
    color: #555;
    margin: 0;
    max-width: 760px;
    line-height: 1.55;
}

@media (max-width: 850px) {
    .contacts-hero { padding: 28px 0 22px; margin-bottom: 24px; }
    .contacts-hero__title { font-size: 28px; }
    .contacts-hero__subtitle { font-size: 15px; }
}

/* ---------- Сетка карточек (.blog_list) ---------- */
.blog_list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 24px !important;
    list-style: none;
    margin: 0 0 32px !important;
    padding: 0 !important;
}

/* ---------- Карточка статьи ---------- */
.art_list,
.blog_list article.art_list {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8eaf0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    /* сбрасываем фиксированную ширину старых стилей */
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    text-align: left;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.art_list:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    border-color: #d4d7e0;
}

/* Картинка-обложка */
.art_list > a:first-child {
    display: block;
    position: relative;
    width: 100% !important;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f3f4f8;
}

.art_img_list {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    transition: transform .4s ease;
}

.art_list:hover .art_img_list {
    transform: scale(1.04);
}

/* Заголовок статьи */
.art_list h2 {
    margin: 16px 18px 6px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -.005em;
}

.art_list h2 a,
.art_list h2 .blog-descr-links {
    color: #1a1a2e;
    text-decoration: none;
    background: none;
    transition: color .2s ease;
}

.art_list:hover h2 a {
    color: #ea5b71;
}

/* Дата */
.art_date_list {
    margin: 0 18px 10px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Анонс */
.art_anons_list {
    margin: 0 18px 16px;
    flex: 1 1 auto;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.art_anons_list a,
.art_anons_list .blog-descr-links {
    color: inherit;
    text-decoration: none;
    background: none;
}

/* Кнопка "Подробнее" */
.artbutton {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 18px 18px;
    align-self: flex-start;
    padding: 9px 16px;
    border-radius: 8px;
    background: #f3f4f8;
    color: #1a1a2e;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    transition: background .2s ease, color .2s ease;
}

.artbutton::after {
    content: "→";
    font-size: 15px;
    transition: transform .2s ease;
}

.artbutton:hover {
    background: #ea5b71;
    color: #fff;
}

.artbutton:hover::after {
    transform: translateX(3px);
}

/* ---------- Пагинация ---------- */
.change_page_0 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 8px 0 16px;
    padding: 16px 0;
    border-top: 1px solid #e8eaf0;
}

#change_page,
.change_page_0 a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    background: #fff;
    color: #1a1a2e;
    border: 1px solid #e8eaf0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

#change_page:hover,
.change_page_0 a:hover {
    background: #ea5b71;
    color: #fff;
    border-color: #ea5b71;
}

#button_empty {
    width: 1px;
}

/* ============================================================
   Страница статьи (article.php)
   ============================================================ */

.art_detail {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8eaf0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    padding: 32px 36px;
    /* Читабельная колонка ~66 символов вместо простыни на всю ширину */
    max-width: 760px;
    margin: 0 auto 24px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.art_detail_title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.art_detail > p:first-of-type {
    color: #6b7280;
    font-size: 13px;
    margin: 0 0 20px;
}

.art_detail_img {
    width: 100%;
    height: auto;
    /* Hero-фото не должно занимать два экрана до текста */
    max-height: 380px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 0 24px;
    display: block;
}

.art_detail_content {
    font-size: 16px;
    line-height: 1.7;
    color: #2a2a3a;
}

.art_detail_content p { margin: 0 0 14px; }

/* Маркеры списков: глобальный reset (ul { list-style: none }) в common-v2
   убивает буллеты — внутри статьи возвращаем. */
.art_detail_content ul,
.art_detail_content ol {
    padding-left: 22px;
    margin: 0 0 14px;
}
.art_detail_content ul { list-style: disc; }
.art_detail_content ol { list-style: decimal; }
.art_detail_content li { margin: 0 0 6px; }

.art_detail_content h2,
.art_detail_content h3 {
    color: #1a1a2e;
    font-weight: 600;
    margin: 24px 0 10px;
    line-height: 1.3;
}

.art_detail_content a {
    color: #ea5b71;
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
}

.art_detail_content a:hover { border-bottom-style: solid; }

.art_detail_content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}

/* Похожие материалы */
.art_detail + h2,
.similar-art-cont + h2 {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
    max-width: 760px;
    margin: 28px auto 14px;
}

.similar-art-cont {
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 760px;
    margin: 0 auto 8px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: border-color .2s ease, transform .2s ease;
}

.similar-art-cont:hover {
    border-color: #ea5b71;
    transform: translateX(2px);
}

.similar-art-cont .similar-article {
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 500;
}

.similar-art-cont:hover .similar-article {
    color: #ea5b71;
}

/* ---------- Адаптив ---------- */
@media (max-width: 850px) {
    .blog-title { font-size: 26px; margin: 0 0 18px; }
    .blog_list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; gap: 16px !important; }
    .art_list h2 { font-size: 16px; margin: 14px 14px 6px; }
    .art_date_list { margin: 0 14px 8px; }
    .art_anons_list { margin: 0 14px 12px; font-size: 13px; }
    .artbutton { margin: 0 14px 14px; }
    .art_detail { padding: 22px 18px; }
    .art_detail_content { font-size: 15px; }
}

@media (max-width: 480px) {
    .blog_list { grid-template-columns: 1fr !important; }
}
