/* RuCredits.su — custom styles */

/* ===== Шапка ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    padding: 0;
}
.header-inner {
    max-width: 1190px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 20px;
}
.header-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.header-logo__text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #9b2d30;
    letter-spacing: -0.02em;
}
.header-logo__dot {
    color: #333;
}

/* Навигация */
.header-nav {
    display: none;
}
@media (min-width: 992px) {
    .header-nav {
        display: block;
    }
}
.header-nav__list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.header-nav__list > li {
    position: relative;
}
.header-nav__list > li > a {
    display: block;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}
.header-nav__list > li > a:hover {
    color: #9b2d30;
    background: #f8f0f0;
}

/* Подменю */
.header-nav__dropdown {
    position: relative;
}
.header-nav__arrow {
    font-size: 0.7em;
    margin-left: 2px;
    opacity: 0.6;
}
.header-nav__submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    min-width: 220px;
    padding: 6px;
    margin-top: 4px;
    z-index: 100;
}
.header-nav__dropdown:hover .header-nav__submenu {
    display: block;
}
.header-nav__submenu li a {
    display: block;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s;
}
.header-nav__submenu li a:hover {
    background: #f8f0f0;
    color: #9b2d30;
}

/* Гамбургер */
.header-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.header-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    margin: 0 auto;
    transition: all 0.3s;
    border-radius: 2px;
}
.header-toggle--open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.header-toggle--open span:nth-child(2) {
    opacity: 0;
}
.header-toggle--open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
@media (min-width: 992px) {
    .header-toggle {
        display: none;
    }
}

/* Мобильное меню */
@media (max-width: 991px) {
    .header-nav--open {
        display: block;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #e0e0e0;
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        z-index: 899;
    }
    .header-nav--open .header-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px;
    }
    .header-nav--open .header-nav__list > li > a {
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 8px;
    }
    .header-nav--open .header-nav__submenu {
        display: block;
        position: static;
        box-shadow: none;
        border: none;
        padding: 0 0 0 20px;
        margin-top: 0;
    }
    .header-nav--open .header-nav__submenu li a {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
}

/* Отключаем старую шапку WP */
#masthead.site-header.full { display: none !important; }
.site-header-inner.fixed, .site-branding, .top-menu, .humburger { display: none !important; }
#site-navigation.main-navigation { display: none !important; }
.mobile-menu-placeholder { display: none !important; }
.header-separator { display: none !important; }

/* Переопределение отступов для site-content */
.site-content { padding-top: 20px !important; }
#masthead { margin-bottom: 0 !important; }

/* Hero-блок на главной */
.hero-block {
    background: linear-gradient(135deg, #9b2d30 0%, #7a1f22 100%);
    color: #fff;
    padding: 60px 20px;
    text-align: center;
    border-radius: 0 0 12px 12px;
    margin-bottom: 40px;
}
.hero-block h1 {
    color: #fff;
    font-size: 2.2rem;
    margin-bottom: 16px;
}
.hero-block__subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 24px;
}
.hero-block .btn-primary {
    background: #fff;
    color: #9b2d30;
    border: none;
}
.hero-block .btn-primary:hover {
    background: #f0f0f0;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: #9b2d30;
    color: #fff;
}
.btn-primary:hover {
    background: #7a1f22;
}

/* Карточки разделов */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 40px 0;
}
.section-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}
.section-card:hover {
    border-color: #9b2d30;
    box-shadow: 0 4px 20px rgba(155, 45, 48, 0.15);
    transform: translateY(-2px);
}
.section-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.section-card__icon--red {
    background: #9b2d30;
    color: #fff;
}
.section-card__icon svg {
    width: 32px;
    height: 32px;
}
.section-card__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.section-card__desc {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}
@media (max-width: 768px) {
    .sections-grid {
        grid-template-columns: 1fr;
    }
}

/* Видео-блок */
.video-block {
    margin: 24px 0;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 16px;
}
.video-block__title {
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1.05rem;
}
.video-block__frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 6px;
}
.video-block__frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Мультиколоночный футер */
.site-footer {
    background: #2a2a2a;
    color: #ccc;
    padding: 40px 0 20px;
}
.site-footer h4 {
    color: #fff;
    margin-bottom: 16px;
    font-size: 1rem;
}
.footer-columns {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}
.footer-col a {
    color: #ccc;
    display: block;
    padding: 4px 0;
    text-decoration: none;
    font-size: 0.9rem;
}
.footer-col a:hover {
    color: #9b2d30;
}
.footer-col--about p {
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.footer-copyright {
    color: #888;
    font-size: 0.85rem;
}
.footer-disclaimer {
    border-top: 1px solid #444;
    margin-top: 30px;
    padding-top: 20px;
    font-size: 0.8rem;
    color: #888;
}
@media (max-width: 768px) {
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Подменю в навигации */
.top-menu .menu-item-has-children {
    position: relative;
}
.top-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    z-index: 100;
    padding: 8px 0;
}
.top-menu .menu-item-has-children:hover .sub-menu {
    display: block;
}
.top-menu .sub-menu li {
    display: block;
}
.top-menu .sub-menu a {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
}
.top-menu .sub-menu a:hover {
    background: #f8f8f8;
    color: #9b2d30;
}

/* Оглавление (TOC) */
.toc {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0;
}
.toc__title {
    font-weight: 700;
    margin-bottom: 12px;
    cursor: pointer;
}
.toc__list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.toc__list a {
    color: #9b2d30;
    text-decoration: none;
    display: block;
    padding: 4px 0;
}
.toc__list a:hover {
    text-decoration: underline;
}
.toc__sub {
    padding-left: 20px;
}

/* Карточки статей */
.post-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    display: block;
}
.post-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.post-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 16px 16px 8px;
}
.post-card__meta {
    padding: 0 16px 16px;
    font-size: 0.85rem;
    color: #999;
}

/* Похожие статьи */
.related-posts {
    margin: 40px 0;
}
.related-posts__title {
    font-size: 1.3rem;
    margin-bottom: 20px;
}
.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 768px) {
    .related-posts__grid {
        grid-template-columns: 1fr;
    }
}

/* FAQ-блок */
.faq-block {
    margin: 32px 0;
}
.faq-block__title {
    font-size: 1.3rem;
    margin-bottom: 20px;
}
.faq-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 0;
}
.faq-item__q {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.faq-item__a {
    color: #555;
    line-height: 1.6;
}

/* Блок автора */
.author-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 32px 0;
    padding: 24px;
    background: #f8f8f8;
    border-radius: 8px;
}
.author-box__ava {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #9b2d30;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
}
.author-box__name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
}
.author-box__role {
    color: #9b2d30;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.author-box__bio {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Теги статьи */
.entry-tags {
    margin: 24px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.entry-tags__label {
    font-weight: 700;
    margin-right: 8px;
}
.entry-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 16px;
    color: #555;
    text-decoration: none;
    font-size: 0.85rem;
}
.entry-tag:hover {
    background: #9b2d30;
    color: #fff;
}

/* Лид-абзац */
.entry-lead {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 24px;
    font-weight: 500;
}

/* Адаптивные таблицы */
@media (max-width: 768px) {
    .table-responsive table {
        display: block;
    }
    .table-responsive thead {
        display: none;
    }
    .table-responsive tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 12px;
    }
    .table-responsive td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        text-align: right;
    }
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 700;
        margin-right: 12px;
        text-align: left;
    }
}

/* Плавный скролл */
html {
    scroll-behavior: smooth;
}

/* Последние статьи на главной */
.home-articles {
    margin: 40px 0;
}
.home-articles__title {
    font-size: 1.5rem;
    margin-bottom: 24px;
}
.home-articles__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 768px) {
    .home-articles__grid {
        grid-template-columns: 1fr;
    }
}

/* SEO-текст на главной */
.home-seo-text {
    margin: 40px 0;
    line-height: 1.7;
    color: #444;
}
.home-seo-text h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
}
