/**
 * Общие стили раздела Блог
 * Файл: /local/templates/opk/css/blog.css
 * Подключается в header.php
 */

/* ============================================
   СТРАНИЦА СПИСКА БЛОГА
   ============================================ */

.blog-page {
    padding: 64px 0 30px 0;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

.page-title.blog {
    text-align: center;
}

/* ============================================
   РАЗДЕЛЫ БЛОГА
   ============================================ */

.blog-sections {
    margin-bottom: 32px;
    margin-top: 32px;
    width: 100%;
}

.blog-sections-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: stretch;
    width: 100%;
}

.blog-section-item {
    padding: 10px;
    background: #FFFFFF;
    border-radius: 90px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    opacity: 0.40;
    transition: opacity 0.2s ease;
    flex: 1 1 auto;
    min-width: 150px;
    justify-content: center;
}

.blog-section-item:hover,
.blog-section-item.active {
    opacity: 1;
}

.blog-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #D9D9D9;
}

.blog-section-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-section-icon-placeholder {
    width: 40px;
    height: 40px;
    background: #D9D9D9;
    border-radius: 9999px;
}

.blog-section-name {
    color: #02254E;
    font-size: 15px;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 400;
    white-space: nowrap;
    padding-right: 10px;
}

/* ============================================
   СПИСОК СТАТЕЙ
   ============================================ */

.blog-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

/* ============================================
   КАРТОЧКА СТАТЬИ (общая для списка и главной)
   ============================================ */

.blog-card {
    width: 295px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card:hover .blog-card-title {
    color: #E32125;
}

/* Image */
.blog-card-image {
    height: 180px;
    background: #E8E8E8;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-image-placeholder {
    width: 73px;
    height: 73px;
    background: #FFFFFF;
}

/* Content */
.blog-card-content {
    padding: 24px;
    background: #FFFFFF;
    border-radius: 0 0 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

/* Title */
.blog-card-title {
    color: #02254E;
    font-size: 16px;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 600;
    line-height: 1.4;
    word-wrap: break-word;
    transition: color 0.2s ease;

    /* Ограничение в 3 строки */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-card-date,
.blog-card-time {
    color: rgba(2, 37, 78, 0.40);
    font-size: 15px;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 400;
}

/* ============================================
   ДЕТАЛЬНАЯ СТРАНИЦА СТАТЬИ - HERO BLOCK
   ============================================ */

.blog-detail-hero {
    width: 100%;
    height: 469px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    background: #D9D9D9;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.blog-detail-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(31, 31, 31, 0.80) 36%, rgba(31, 31, 31, 0) 100%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.blog-detail-hero-content {
    position: absolute;
    top: 120px;
    left: 105px;
    width: 562px;
    z-index: 2;
}

.blog-detail-hero-title {
    color: #FFFFFF;
    font-size: 44px;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 16px 0;
    word-wrap: break-word;
}

.blog-detail-hero-preview {
    color: rgba(255, 255, 255, 0.70);
    font-size: 15px;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Meta badges */
.blog-detail-hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}

.blog-detail-meta-item {
    height: 40px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.80);
    border-radius: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.blog-detail-meta-item .meta-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.blog-detail-meta-item span {
    color: #02254E;
    font-size: 17px;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 500;
}

/* ============================================
   ДЕТАЛЬНАЯ СТРАНИЦА - КОНТЕНТ
   ============================================ */

.blog-detail-wrapper {
    display: flex;
    gap: 125px;
    align-items: flex-start;
    margin-top: 40px;
    width: 100%;
}

.blog-detail-content {
    flex: 1;
    max-width: 820px;
    color: rgba(2, 37, 78, 0.40);
    font-size: 17px;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.7;
}

.blog-detail-content p {
    margin-bottom: 20px;
}

.blog-detail-content h2 {
    color: #02254E;
    font-size: 28px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 40px 0 20px 0;
    text-align: center;
}

.blog-detail-content h3 {
    color: #02254E;
    font-size: 20px;
    font-weight: 600;
    margin: 25px 0 10px 0;
}

.blog-detail-content ul,
.blog-detail-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.blog-detail-content ul {
    list-style-type: disc;
}

.blog-detail-content ol {
    list-style-type: decimal;
}

.blog-detail-content li {
    margin-bottom: 8px;
}

.blog-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 24px;
    margin: 30px 0;
}

.blog-detail-content a {
    color: #02254E;
    text-decoration: underline;
}

.blog-detail-content a:hover {
    color: #E32125;
}

.blog-detail-content blockquote {
    border-left: 4px solid #E32125;
    padding-left: 20px;
    margin: 25px 0;
    color: rgba(2, 37, 78, 0.70);
    font-style: italic;
}

/* Sidebar */
.blog-detail-sidebar {
    width: 295px;
    flex-shrink: 0;
}

.blog-sidebar-title {
    color: #02254E;
    font-size: 18px;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 600;
    margin-bottom: 20px;
}

.blog-detail-sidebar .blog-card {
    width: 100%;
    margin-bottom: 20px;
}

.blog-detail-sidebar .blog-card:last-child {
    margin-bottom: 0;
}

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

@media (max-width: 1280px) {
    .blog-list .blog-card {
        width: calc(25% - 15px);
        min-width: 250px;
    }

    .blog-detail-hero-content {
        left: 60px;
    }
}

@media (max-width: 1024px) {
    .blog-list .blog-card {
        width: calc(50% - 10px);
        min-width: 280px;
    }

    .blog-detail-hero {
        height: 400px;
    }

    .blog-detail-hero-title {
        font-size: 36px;
    }

    .blog-detail-hero-content {
        left: 40px;
        width: 450px;
    }

    .blog-detail-wrapper {
        flex-direction: column;
        gap: 40px;
    }

    .blog-detail-content {
        max-width: 100%;
    }

    .blog-detail-sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }

    .blog-sidebar-title {
        width: 100%;
    }

    .blog-detail-sidebar .blog-card {
        width: calc(50% - 10px);
        display: inline-flex;
        vertical-align: top;
        margin-bottom: 0;
    }

    .blog-sections-list {
        gap: 4px;
    }

    .blog-section-item {
        padding: 8px;
    }

    .blog-section-icon,
    .blog-section-icon-placeholder {
        width: 36px;
        height: 36px;
    }

    .blog-section-name {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .blog-page {
        padding: 20px 0;
    }

    .blog-list {
        gap: 15px;
    }

    .blog-list .blog-card {
        width: 100%;
        min-width: 100%;
    }

    .blog-detail-hero {
        height: 350px;
        border-radius: 16px;
    }

    .blog-detail-hero-title {
        font-size: 28px;
    }

    .blog-detail-hero-content {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        padding: 30px 20px;
    }

    .blog-detail-hero-preview {
        font-size: 14px;
    }

    .blog-detail-meta-item {
        height: 36px;
        padding: 4px 8px;
    }

    .blog-detail-meta-item span {
        font-size: 14px;
    }

    .blog-detail-content {
        font-size: 15px;
    }

    .blog-detail-content h2 {
        font-size: 22px;
    }

    .blog-detail-sidebar .blog-card {
        width: 100%;
    }

    .blog-sections-list {
        gap: 4px;
    }

    .blog-section-item {
        padding: 6px;
    }

    .blog-section-icon,
    .blog-section-icon-placeholder {
        width: 32px;
        height: 32px;
    }

    .blog-section-name {
        font-size: 13px;
        padding-right: 8px;
    }
}

@media (max-width: 480px) {
    .blog-card-image {
        height: 150px;
    }

    .blog-card-content {
        padding: 16px;
    }

    .blog-card-title {
        font-size: 15px;
    }

    .blog-card-date,
    .blog-card-time {
        font-size: 13px;
    }

    .blog-detail-hero {
        height: 300px;
    }

    .blog-detail-hero-title {
        font-size: 24px;
    }

    .blog-detail-hero-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
}
