/* ============================================
   ДАТА ПОВЕРХ ИЗОБРАЖЕНИЯ (НОВОСТИ / BLOG LAYOUT)
   ============================================ */

.published-date-top {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #667eea;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #667eea;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
    gap: 4px;
    width: fit-content !important;
}

.published-date-top time {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #667eea;
}

.published-date-top time span {
    font-size: 18px;
    font-weight: 800;
    color: #667eea;
    line-height: 1;
}

/* Скрываем стандартную дату в blog layout */
.content-wrap .published-date,
.blog-item .published,
.items-row .published,
.item .published {
    display: none !important;
}

/* ============================================
   УЛУЧШЕНИЕ КАРТОЧЕК НОВОСТЕЙ (BLOG LAYOUT)
   ============================================ */

article.item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 30px;
    padding: 20px;
}

article.item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.entry-image {
    position: relative;
    margin-bottom: 10px !important;
}

.entry-info {
    margin-bottom: 8px !important;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.entry-header {
    margin-bottom: 0 !important;
    text-align: left;
}

.entry-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

article.item:hover .entry-image img {
    transform: scale(1.05);
}

.post-format,
.item .post-format,
article.item .post-format {
    display: none !important;
}

.item h2,
h2.item-title {
    line-height: 1.35 !important;
    margin: 0 0 10px 0 !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
    font-size: 20px !important;
    text-align: left !important;
    display: block !important;
    width: 100% !important;
}

.item h2 a,
h2.item-title a {
    color: #2d3748 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
    display: inline-block;
}

.item h2 a:hover,
h2.item-title a:hover {
    color: #667eea !important;
}

.article-info dd,
.entry-info dd {
    font-size: 13px !important;
    color: #718096 !important;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.article-info dd a,
.entry-info dd a {
    color: #667eea !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    background: rgba(102, 126, 234, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.article-info dd a:hover,
.entry-info dd a:hover {
    background: rgba(102, 126, 234, 0.15);
    text-decoration: none !important;
}

.article-info dd i,
.entry-info dd i {
    margin-right: 4px;
    color: #667eea;
    font-size: 14px;
}

.item p,
.blog-item p {
    color: #4a5568 !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
    margin: 0 0 10px 0 !important;
}

.readmore {
    margin-top: 0 !important;
}

.readmore .btn {
    padding: 12px 28px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    border: none !important;
    display: inline-block !important;
    background: #667eea !important;
    color: #ffffff !important;
}

.readmore .btn:hover {
    background: #5a67d8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

/* ============================================
   НАСТРОЙКА БЛОКА ЗАГОЛОВКА СТРАНИЦЫ
   ============================================ */

section#sp-page-title .sp-page-title {
    padding: 24px 0 !important;
    text-align: center !important;
}

section#sp-page-title .sp-page-title > .container h2 {
    margin-bottom: 8px !important;
    font-size: 42px !important;
    text-align: center !important;
    color: #ffffff !important;
}

section#sp-page-title .sp-page-title > .container h3 {
    font-size: 16px !important;
    line-height: 1.4 !important;
    text-align: center !important;
    color: #ffffff !important;
    font-weight: 400 !important;
    margin: 0 auto !important;
    display: block !important;
    width: 100% !important;
}

/* ============================================
   АДАПТИВНОСТЬ БЛОКА ЗАГОЛОВКА
   ============================================ */

@media (max-width: 991px) {
    section#sp-page-title .sp-page-title { padding: 20px 0 !important; }
    section#sp-page-title .sp-page-title > .container h2 { font-size: 36px !important; }
    section#sp-page-title .sp-page-title > .container h3 { font-size: 15px !important; }
}

@media (max-width: 767px) {
    section#sp-page-title .sp-page-title { padding: 16px 0 !important; }
    section#sp-page-title .sp-page-title > .container h2 { font-size: 30px !important; }
    section#sp-page-title .sp-page-title > .container h3 { font-size: 14px !important; }
}

@media (max-width: 480px) {
    section#sp-page-title .sp-page-title { padding: 12px 0 !important; }
    section#sp-page-title .sp-page-title > .container h2 { font-size: 26px !important; }
    section#sp-page-title .sp-page-title > .container h3 { font-size: 13px !important; }
}

/* ============================================
   АДАПТИВНОСТЬ КАРТОЧЕК НОВОСТЕЙ
   ============================================ */

@media (max-width: 992px) {
    .published-date-top { top: 10px; left: 10px; padding: 5px 10px; font-size: 12px; }
    .published-date-top time span { font-size: 16px; }
    .entry-image img { height: 250px; }
    .item h2, h2.item-title { font-size: 19px !important; }
}

@media (max-width: 768px) {
    article.item { padding: 16px !important; margin-bottom: 20px; }
    .published-date-top { top: 8px; left: 8px; padding: 4px 8px; font-size: 11px; }
    .published-date-top time span { font-size: 14px; }
    .entry-image { margin-bottom: 16px !important; }
    .entry-image img { height: 220px; }
    .item p { font-size: 14px !important; }
    .item h2, h2.item-title { font-size: 18px !important; }
    .entry-info { gap: 8px; }
}

@media (max-width: 480px) {
    .published-date-top { top: 6px; left: 6px; padding: 3px 6px; font-size: 10px; }
    .published-date-top time span { font-size: 12px; }
    .entry-image img { height: 200px; }
    article.item { padding: 12px !important; }
    .item h2, h2.item-title { font-size: 17px !important; }
}

/* ==========================================================================
   НОРМАЛИЗАЦИЯ СТРАНИЦЫ РАЗДЕЛА "ФОТО" (ITEM-PAGE)
   Абсолютно идентичная логика с карточками новостей
   ========================================================================== */

/* 1. Главный контейнер изображения: сброс float, отступы, relative для бейджа */
article.item-page .pull-left.entry-image.full-image {
    float: none !important;
    width: 100% !important;
    margin: 20px 0 10px 0 !important; /* 20px сверху (защита бейджа), 10px снизу (как в новостях) */
    text-align: center;
    position: relative !important; /* КРИТИЧНО: делает этот блок опорным для absolute бейджа */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    isolation: isolate;
}

article.item-page .pull-left.entry-image.full-image img {
    max-width: 100%;
    height: auto;
    display: block;
    width: 100%;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

/* 2. АБСОЛЮТНАЯ 1:1 КОПИЯ .published-date-top ДЛЯ ITEM-PAGE */
/* Примечание: Работает только если JS переместил .published-date-wrap внутрь .entry-image */
article.item-page .published-date-wrap {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 10 !important;
    margin: 0 !important;
    pointer-events: none;
    max-width: calc(100% - 24px);
}

article.item-page .published-date-wrap .published-date {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    color: #667eea !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: 2px solid #667eea !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    width: fit-content !important;
    pointer-events: auto !important;
    white-space: nowrap !important;
}

article.item-page .published-date-wrap time {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    color: #667eea !important;
}

article.item-page .published-date-wrap time span {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #667eea !important;
    line-height: 1 !important;
}

/* Скрываем дублирующую дату в content-wrap, если она там осталась */
article.item-page .content-wrap .published-date {
    display: none !important;
}

/* 3. Мета-информация (категория + просмотры) — стиль как в новостях */
article.item-page dl.article-info {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 8px 0 !important; /* 8px до заголовка (как в новостях) */
    padding: 0 !important;
    border: none !important;
}

article.item-page dl.article-info dd {
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    font-size: 13px !important;
    color: #718096 !important;
}

article.item-page dl.article-info dd a {
    color: #667eea !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    background: rgba(102, 126, 234, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

article.item-page dl.article-info dd a:hover {
    background: rgba(102, 126, 234, 0.15);
    text-decoration: none !important;
}

article.item-page dl.article-info dd i {
    margin-right: 4px;
    color: #667eea;
    font-size: 14px;
}

/* 4. Заголовок статьи — стиль как в новостях */
article.item-page .entry-header h2[itemprop="name"] {
    margin: 0 0 10px 0 !important; /* 0 сверху (прижат к мета), 10px снизу */
    font-size: 20px !important;
    line-height: 1.35 !important;
    color: #2d3748 !important;
    font-weight: 700 !important;
    text-align: left !important;
    display: block !important;
    width: 100% !important;
}

/* 5. Иконка «закреплено» — скрываем */
article.item-page .post-format {
    display: none !important;
}

/* 6. Галерея WidgetKit */
article.item-page .uk-scope {
    width: 100%;
    overflow: hidden;
    margin: 0 0 24px 0;
}

article.item-page .uk-scope .uk-panel {
    border-radius: 8px;
    overflow: hidden;
}

article.item-page .uk-scope .uk-panel img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
    display: block;
}

article.item-page .uk-scope .uk-panel:hover img {
    transform: scale(1.03);
}

/* 7. Пагинация */
article.item-page nav.pagenavigation {
    margin: 32px 0 24px 0 !important;
    display: flex;
    justify-content: flex-start;
}

article.item-page nav.pagenavigation ul.pagination {
    margin: 0 !important;
    padding: 0 !important;
}

article.item-page nav.pagenavigation .page-link {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 28px !important;
    border: 2px solid #667eea !important;
    border-radius: 6px !important;
    color: #667eea !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    background: transparent !important;
    transition: all 0.3s ease !important;
}

article.item-page nav.pagenavigation .page-link:hover {
    background: #667eea !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 8. СОЦИАЛЬНЫЕ ИКОНКИ — ОСТАВЛЯЕМ ТОЛЬКО VK */
article.item-page .helix-social-share {
    margin: 24px 0 0 0 !important;
    text-align: left !important;
}

article.item-page .helix-social-share ul {
    display: flex !important;
    gap: 12px;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

article.item-page .helix-social-share ul li {
    margin: 0 !important;
}

/* Скрываем все иконки кроме VK */
article.item-page .helix-social-share ul li .facebook,
article.item-page .helix-social-share ul li .twitter,
article.item-page .helix-social-share ul li .linkedin {
    display: none !important;
}

/* Показываем и стилизуем только VK */
article.item-page .helix-social-share ul li .vk,
article.item-page .helix-social-share ul li a[href*="vk.com"] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.08);
    color: #667eea !important;
    font-size: 18px;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

article.item-page .helix-social-share ul li .vk:hover,
article.item-page .helix-social-share ul li a[href*="vk.com"]:hover {
    background: #667eea !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

article.item-page .helix-social-share ul li .vk i.fa-vk::before {
    content: "\f189";
}

/* 9. Адаптив для item-page (идентичен адаптиву новостей) */
@media (max-width: 992px) {
    article.item-page .pull-left.entry-image.full-image {
        margin-top: 16px !important;
    }
    article.item-page .published-date-wrap { top: 10px !important; left: 10px !important; }
    article.item-page .published-date-wrap .published-date { padding: 5px 10px !important; font-size: 12px !important; }
    article.item-page .published-date-wrap time span { font-size: 16px !important; }
    article.item-page .entry-header h2[itemprop="name"] { font-size: 19px !important; }
}

@media (max-width: 768px) {
    article.item-page .pull-left.entry-image.full-image {
        margin-top: 12px !important;
        margin-bottom: 16px !important;
    }
    article.item-page .published-date-wrap { top: 8px !important; left: 8px !important; }
    article.item-page .published-date-wrap .published-date { padding: 4px 8px !important; font-size: 11px !important; }
    article.item-page .published-date-wrap time span { font-size: 14px !important; }
    article.item-page .entry-header h2[itemprop="name"] { font-size: 18px !important; }
    article.item-page dl.article-info { flex-direction: column; gap: 8px !important; }
}

@media (max-width: 480px) {
    article.item-page .pull-left.entry-image.full-image {
        margin-top: 10px !important;
    }
    article.item-page .published-date-wrap { top: 6px !important; left: 6px !important; }
    article.item-page .published-date-wrap .published-date { padding: 3px 6px !important; font-size: 10px !important; }
    article.item-page .published-date-wrap time span { font-size: 12px !important; }
    article.item-page .entry-header h2[itemprop="name"] { font-size: 17px !important; }
}