/* ============================================================
   article.css — стили элемента «Статья» (рендер Markdown)
   Извлечено из template.html (страница статей cgi/router.py).
   Подключается рантаймом js/page-runtime.js на сгенерированных
   страницах, когда в составе есть элемент «Статья».
   ============================================================ */
.article-content {
    background: linear-gradient(135deg, rgba(34,36,47,0.7), rgba(30,30,30,0.7));
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flow-root;
    color: #CCC6C0;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}
.article-content h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #FFFFFF;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(255, 140, 0, 0.2);
    padding-bottom: 15px;
}
.article-content h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #FF8C00;
    margin: 35px 0 20px 0;
}
.article-content h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 20px;
    color: #FFFFFF;
    margin: 25px 0 15px 0;
}
.article-content p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #CCC6C0;
    text-align: justify;
}
.article-content blockquote {
    margin: 1.5em 0;
    padding: .8em 1.2em;
    border-left: 4px solid #FF8C00;
    background: rgba(255, 140, 0, 0.06);
    border-radius: 0 10px 10px 0;
    color: #E6E0DA;
    font-style: italic;
}
.article-content blockquote p {
    margin-bottom: .6em;
}
.article-content blockquote p:last-child {
    margin-bottom: 0;
}
.article-content ul, .article-content ol {
    margin: 0 0 25px 25px;
}
.article-content li {
    margin-bottom: 8px;
    color: #CCC6C0;
}
.article-img-left {
    float: left;
    margin: 0 30px 20px 0;
    max-width: 45%;
    height: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 140, 0, 0.15);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.article-img-right {
    float: right;
    margin: 0 0 20px 30px;
    max-width: 45%;
    height: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 140, 0, 0.15);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 30px 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.article-content th {
    background-color: #1A1613;
    color: #FF8C00;
    font-weight: 600;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 2px solid rgba(255, 140, 0, 0.2);
}
.article-content td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background-color: rgba(255, 255, 255, 0.01);
    color: #E6E0DA;
}
.article-content tr:hover td {
    background-color: rgba(255, 140, 0, 0.02);
}

/* Картинки в статье — клик открывает лайтбокс (увеличение) */
.article-content img { cursor: zoom-in; }

/* Лайтбокс (галерея картинок статьи) */
#article-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
#article-lightbox.open { display: flex; }
#article-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    cursor: zoom-out;
}
#article-lightbox .al-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 44px;
    color: #F0E0D0;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    opacity: 0.85;
}
#article-lightbox .al-nav:hover { opacity: 1; color: #FF8C00; }
#article-lightbox .al-prev { left: 10px; }
#article-lightbox .al-next { right: 10px; }

@media (max-width: 768px) {
    .article-content {
        padding: 25px 20px;
    }
    .article-content h1 { font-size: 26px; }
    .article-img-left, .article-img-right {
        float: none;
        display: block;
        margin: 20px auto;
        max-width: 100%;
        width: 100%;
    }
}
/* ============================================================
   БРОНЕБОЙНАЯ ЗАЩИТА ИКОНОК (v3.0 — Финал)
   Цепляется напрямую к расширению .svg и префиксу ico_ в названии файла.
   Никакой JS-рантайм не сможет это сломать при обновлении страницы F5.
   ============================================================ */

/* Применяется и на ПК, и на мобильных по умолчанию */
.article-content img[src$=".svg"],
.article-content img[src*="ico_"] {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    max-width: none !important;
    
    /* Принудительное обтекание */
    display: inline-block !important;
    float: left !important;
    
    /* Отступы от текста */
    margin: 4px 12px 4px 0 !important; 
    
    object-fit: contain !important;
    cursor: default !important;
}

/* Жесткий сброс мобильного блочного поведения темы для этих файлов */
@media (max-width: 768px) {
    .article-content img[src$=".svg"],
    .article-content img[src*="ico_"] {
        display: inline-block !important; /* Убиваем display: block от темы */
        float: left !important;            /* Жестко возвращаем левое обтекание */
        margin: 4px 10px 4px 0 !important; /* Сбрасываем маркер margin: 20px auto */
    }
}

