/* ============================================================
   BLOG.CSS
   Страницы:
   - blog/blog.html
   - blog/blog_detail.html
   ============================================================ */


/* ============================================================
   BLOG LIST PAGE
   ============================================================ */

.blog-page {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 40px 20px 70px;
    box-sizing: border-box;
}

.blog-page h1 {
    margin: 0 0 30px;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    color: #222;
}


/* ============================================================
   BLOG GRID
   ============================================================ */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
}


/* ============================================================
   BLOG CARD
   ============================================================ */

.blog-card {
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
}

.blog-card a {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.blog-card img {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: cover;
    background: #f4f4f4;
}

.blog-card-content {
    padding: 18px 20px 22px;
}

.blog-card time {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #777;
}

.blog-card h2 {
    margin: 0 0 10px;
    font-size: 21px;
    line-height: 1.3;
    font-weight: 700;
    color: #222;
}

.blog-card p {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: #555;
}


/* ============================================================
   EMPTY BLOG LIST
   ============================================================ */

.blog-grid > p {
    grid-column: 1 / -1;
    margin: 20px 0;
    font-size: 17px;
    color: #555;
}


/* ============================================================
   BLOG DETAIL PAGE
   ============================================================ */

.blog-detail {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 35px 20px 70px;
    box-sizing: border-box;
}

.blog-detail h1 {
    margin: 18px 0 14px;
    font-size: 38px;
    line-height: 1.18;
    font-weight: 700;
    color: #222;
    word-break: break-word;
}

.blog-subtitle {
    margin: 0 0 14px;
    font-size: 19px;
    line-height: 1.55;
    color: #555;
}

.blog-detail > time {
    display: inline-block;
    margin-bottom: 25px;
    font-size: 14px;
    color: #777;
}


/* ============================================================
   BREADCRUMBS
   ============================================================ */

.breadcrumbs {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #777;
    word-break: break-word;
}

.breadcrumbs a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: #c62828;
}

.breadcrumbs span {
    color: #777;
}


/* ============================================================
   BLOG DETAIL IMAGES
   ============================================================ */

.blog-images {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
    margin: 25px 0 30px;
}

.blog-images img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    border-radius: 16px;
    background: #f4f4f4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Десктоп: если картинок несколько, первая широкая, остальные в две колонки */
@media (min-width: 769px) {
    .blog-images {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-images img:first-child {
        grid-column: 1 / -1;
    }

    .blog-images img:not(:first-child) {
        max-height: 360px;
    }
}


/* ============================================================
   BLOG VIDEO
   ============================================================ */

.blog-video {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 30px 0;
    padding-top: 56.25%;
    border-radius: 16px;
    background: #000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.blog-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}


/* ============================================================
   BLOG TEXT FROM CKEDITOR
   ============================================================ */

.blog-text {
    width: 100%;
    max-width: 100%;
    margin-top: 30px;
    font-size: 17px;
    line-height: 1.75;
    color: #333;
    overflow-wrap: break-word;
    word-break: normal;
    box-sizing: border-box;
}

.blog-text * {
    max-width: 100%;
    box-sizing: border-box;
}

.blog-text p {
    margin: 0 0 18px;
}

.blog-text h2 {
    margin: 34px 0 16px;
    font-size: 28px;
    line-height: 1.25;
    color: #222;
}

.blog-text h3 {
    margin: 28px 0 14px;
    font-size: 23px;
    line-height: 1.3;
    color: #222;
}

.blog-text h4 {
    margin: 24px 0 12px;
    font-size: 20px;
    line-height: 1.35;
    color: #222;
}

.blog-text ul,
.blog-text ol {
    margin: 0 0 22px 22px;
    padding: 0;
}

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

.blog-text a {
    color: #c62828;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-text img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px;
}

.blog-text iframe,
.blog-text video {
    max-width: 100% !important;
}

.blog-text blockquote {
    margin: 25px 0;
    padding: 18px 22px;
    border-left: 4px solid #c62828;
    background: #f7f7f7;
    color: #444;
    font-style: italic;
}

.blog-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 15px;
}

.blog-text table th,
.blog-text table td {
    padding: 12px;
    border: 1px solid #ddd;
}

.blog-text table th {
    background: #f5f5f5;
    font-weight: 700;
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-page {
        padding-top: 32px;
    }

    .blog-detail h1 {
        font-size: 34px;
    }
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 768px) {

    /* ---------- BLOG LIST ---------- */

    .blog-page {
        width: 100%;
        max-width: 100%;
        padding: 20px 12px 45px;
        box-sizing: border-box;
    }

    .blog-page h1 {
        margin: 0 0 18px;
        font-size: 24px;
        line-height: 1.25;
        text-align: left;
    }

    .blog-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
        width: 100%;
    }

    .blog-card {
        width: 100%;
        border-radius: 12px;
        overflow: hidden;
    }

    .blog-card:hover {
        transform: none;
    }

    .blog-card a {
        display: block;
        width: 100%;
    }

    .blog-card img {
        width: 100%;
        height: 185px;
        object-fit: cover;
        display: block;
    }

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

    .blog-card time {
        margin-bottom: 8px;
        font-size: 12px;
    }

    .blog-card h2 {
        margin: 0 0 8px;
        font-size: 18px;
        line-height: 1.3;
    }

    .blog-card p {
        font-size: 14px;
        line-height: 1.5;
    }


    /* ---------- BLOG DETAIL ---------- */

    .blog-detail {
        width: 100%;
        max-width: 100%;
        padding: 18px 12px 45px;
        box-sizing: border-box;
    }

    .breadcrumbs {
        margin-bottom: 10px;
        font-size: 12px;
        line-height: 1.4;
        word-break: break-word;
    }

    .blog-detail h1 {
        margin: 12px 0 10px;
        font-size: 24px;
        line-height: 1.25;
        word-break: break-word;
    }

    .blog-subtitle {
        margin: 0 0 12px;
        font-size: 15px;
        line-height: 1.55;
    }

    .blog-detail > time {
        margin-bottom: 18px;
        font-size: 12px;
    }


    /* ---------- IMAGES ---------- */

    .blog-images {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 12px;
        width: 100%;
        margin: 18px 0 22px;
    }

    .blog-images img {
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: cover;
        border-radius: 12px;
        display: block;
    }

    .blog-images img:first-child {
        grid-column: auto !important;
    }


    /* ---------- VIDEO ---------- */

    .blog-video {
        width: 100%;
        margin: 22px 0;
        padding-top: 56.25%;
        border-radius: 12px;
    }


    /* ---------- CKEDITOR TEXT ---------- */

    .blog-text {
        width: 100%;
        margin-top: 22px;
        font-size: 15px;
        line-height: 1.7;
        overflow-wrap: break-word;
        word-break: normal;
    }

    .blog-text p {
        margin: 0 0 15px;
    }

    .blog-text h2 {
        margin: 26px 0 12px;
        font-size: 22px;
        line-height: 1.3;
    }

    .blog-text h3 {
        margin: 22px 0 10px;
        font-size: 19px;
        line-height: 1.35;
    }

    .blog-text h4 {
        margin: 18px 0 8px;
        font-size: 17px;
        line-height: 1.35;
    }

    .blog-text ul,
    .blog-text ol {
        margin: 0 0 18px 18px;
        padding: 0;
    }

    .blog-text li {
        margin-bottom: 7px;
    }

    .blog-text img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 10px;
    }

    .blog-text iframe,
    .blog-text video {
        max-width: 100% !important;
    }

    .blog-text table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 13px;
    }

    .blog-text table th,
    .blog-text table td {
        padding: 8px;
    }

    .blog-text blockquote {
        margin: 20px 0;
        padding: 14px 16px;
        font-size: 14px;
    }
}


/* ============================================================
   EXTRA SMALL PHONES
   ============================================================ */

@media (max-width: 480px) {

    .blog-page {
        padding: 16px 10px 40px;
    }

    .blog-page h1 {
        font-size: 22px;
    }

    .blog-card img {
        height: 165px;
    }

    .blog-card-content {
        padding: 12px 12px 14px;
    }

    .blog-card h2 {
        font-size: 17px;
    }

    .blog-card p {
        font-size: 13px;
    }

    .blog-detail {
        padding: 16px 10px 40px;
    }

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

    .blog-subtitle {
        font-size: 14px;
    }

    .blog-text {
        font-size: 14px;
        line-height: 1.65;
    }

    .blog-text h2 {
        font-size: 20px;
    }

    .blog-text h3 {
        font-size: 18px;
    }
}


/* ============================================================
   FINAL WIDTH FIX
   ============================================================ */

.blog-page,
.blog-detail,
.blog-grid,
.blog-card,
.blog-text {
    max-width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   BLOG MIN HEIGHT ONLY DESKTOP
   ============================================================ */

@media (min-width: 769px) {
    .blog-middle-column {
        min-height: 700px;
    }

    .blog-page {
        min-height: 700px;
    }
}

@media (max-width: 768px) {
    .blog-middle-column {
        min-height: auto;
    }

    .blog-page {
        min-height: auto;
    }
}