/*
Theme Name: OBF 2026
Description: WordPress theme based on obf2025ru with dobro.ru styling for charity foundation
Version: 1.0.1
Author: OBF Team
Text Domain: knd
License: GPL v2 or later
*/

/* Dobro.ru styles are enqueued via functions.php (dobro-style handle) */

/* Additional Theme Styles */

/* Mobile Menu Styles */
.toggle_menu {
    background: none;
    border: none;
    cursor: pointer;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.toggle_menu span {
    background-color: var(--primary-color);
    border-radius: 2px;
    height: 3px;
    transition: all 0.3s ease;
    width: 24px;
}

.toggle_menu.icon_anim span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.toggle_menu.icon_anim span:nth-child(2) {
    opacity: 0;
}

.toggle_menu.icon_anim span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 768px) {
    .toggle_menu {
        display: flex;
    }
    
    .header__nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white-color);
        border-top: 1px solid var(--anti-flash-white-color);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        z-index: 99;
    }
    
    .header__nav.active {
        display: block;
    }
    
    .header__nav ul {
        flex-direction: column;
        padding: 20px;
    }
    
    .header__nav-item {
        margin: 0 0 16px 0;
    }
}

/* WordPress Specific Styles */
.wp-block-image {
    margin-bottom: 1.5rem;
}

.wp-block-image img {
    border-radius: 8px;
    height: auto;
    max-width: 100%;
}

.wp-block-quote {
    border-left: 4px solid var(--secondary-color);
    margin: 2rem 0;
    padding-left: 1.5rem;
}

.wp-block-quote cite {
    color: var(--grey-color);
    font-size: var(--font-size-small);
    font-style: normal;
}

/* Breadcrumbs */
.breadcrumbs {
    background-color: var(--anti-flash-white-color);
}

.breadcrumbs ul {
    align-items: center;
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumbs li {
    color: var(--grey-color);
    font-size: var(--font-size-small);
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin: 0 8px;
}

.breadcrumbs a {
    color: var(--secondary-color);
}

/* Pagination */
.posts-navigation,
.post-navigation {
    margin: 3rem 0;
}

.nav-links {
    display: flex;
    justify-content: space-between;
}

.nav-previous,
.nav-next {
    flex: 1;
}

.nav-next {
    text-align: right;
}

.nav-links a {
    background-color: var(--secondary-color);
    border-radius: 8px;
    color: var(--white-color);
    display: inline-block;
    padding: 12px 24px;
    transition: background-color 0.3s ease;
}

.nav-links a:hover {
    background-color: var(--custom-color-hover);
    text-decoration: none;
}

/* Comments */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--anti-flash-white-color);
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--anti-flash-white-color);
    border-radius: 8px;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.comment-meta {
    color: var(--grey-color);
    font-size: var(--font-size-small);
    margin-bottom: 1rem;
}

/* Forms */
.comment-form,
.search-form {
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    background-color: var(--white-color);
    border: 1px solid var(--input-border-color);
    border-radius: 8px;
    font-size: var(--font-size-normal);
    padding: 12px 16px;
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
}

/* Search Form */
.search-form {
    position: relative;
}

.search-field {
    padding-right: 50px;
}

.search-submit {
    background-color: var(--secondary-color);
    border: none;
    border-radius: 0 8px 8px 0;
    color: var(--white-color);
    cursor: pointer;
    height: 100%;
    position: absolute;
    right: 0;
    top: 0;
    width: 50px;
}

/* Widget Styles */
.widget {
    background-color: var(--white-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.widget-title {
    border-bottom: 2px solid var(--secondary-color);
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget li {
    border-bottom: 1px solid var(--anti-flash-white-color);
    padding: 0.5rem 0;
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--grey-color);
    font-size: var(--font-size-small);
}

.widget a:hover {
    color: var(--secondary-color);
}

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link {
    background-color: var(--secondary-color);
    color: var(--white-color);
    left: 6px;
    padding: 8px 16px;
    position: absolute;
    text-decoration: none;
    top: -40px;
    z-index: 999999;
}

.skip-link:focus {
    top: 6px;
}

/* Back to Top Button */
.back-to-top {
    background-color: var(--secondary-color);
    border: none;
    border-radius: 50%;
    bottom: 20px;
    color: var(--white-color);
    cursor: pointer;
    font-size: 18px;
    height: 50px;
    opacity: 0;
    position: fixed;
    right: 20px;
    transition: all 0.3s ease;
    visibility: hidden;
    width: 50px;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--custom-color-hover);
}

/* ===== Children Section (page-with-children) ===== */
.children-section {
    padding: 0 0 60px;
}

.children-section .news-feed-row--category {
    margin-bottom: 24px;
}

.children-section .news-card--regular .news-card__image-container {
    height: 180px;
}

/* Без fadeIn при скролле — иначе карточки мигают (opacity: 0 → 1) */
.children-section .news-card,
.children-section .category-post-card {
    animation: none !important;
    opacity: 1;
    transform: none;
}

.children-section .news-card__overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* ===== 404 Page ===== */
.page-404 {
    padding: 80px 0;
    min-height: calc(100vh - var(--dobro-header-height) - 200px);
    display: flex;
    align-items: center;
}

.page-404__container {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.page-404__logo-wrap {
    margin-bottom: 24px;
}

.page-404__logo-wrap img,
.page-404__logo-wrap .custom-logo {
    max-width: 200px;
    height: auto;
}

.page-404__code {
    font-size: 120px;
    font-weight: 700;
    line-height: 1;
    color: var(--dobro-primary);
    margin: 0 0 8px;
    letter-spacing: -4px;
}

.page-404__title {
    font-size: var(--dobro-font-size-3xl);
    font-weight: 600;
    color: var(--dobro-gray-800);
    margin: 0 0 16px;
}

.page-404__description {
    font-size: var(--dobro-font-size-lg);
    color: var(--dobro-gray-500);
    line-height: 1.6;
    margin: 0 0 32px;
}

.page-404__search {
    margin-bottom: 32px;
}

.page-404__search-form {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
    border-radius: var(--dobro-radius-lg);
    overflow: hidden;
    box-shadow: var(--dobro-shadow-md);
}

.page-404__search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--dobro-gray-200);
    border-right: none;
    border-radius: var(--dobro-radius-lg) 0 0 var(--dobro-radius-lg);
    font-size: var(--dobro-font-size-base);
    outline: none;
    transition: border-color 0.3s ease;
}

.page-404__search-input:focus {
    border-color: var(--dobro-primary);
}

.page-404__search-btn {
    padding: 14px 20px;
    background-color: var(--dobro-primary);
    color: var(--dobro-white);
    border: none;
    border-radius: 0 var(--dobro-radius-lg) var(--dobro-radius-lg) 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-404__search-btn:hover {
    background-color: var(--dobro-primary-hover);
}

.page-404__actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.page-404__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--dobro-radius-full);
    font-size: var(--dobro-font-size-base);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-404__btn--primary {
    background-color: var(--dobro-primary);
    color: var(--dobro-white);
}

.page-404__btn--primary:hover {
    background-color: var(--dobro-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--dobro-shadow-md);
    text-decoration: none;
    color: var(--dobro-white);
}

.page-404__btn--secondary {
    background-color: var(--dobro-gray-100);
    color: var(--dobro-gray-700);
}

.page-404__btn--secondary:hover {
    background-color: var(--dobro-gray-200);
    transform: translateY(-2px);
    box-shadow: var(--dobro-shadow-sm);
    text-decoration: none;
    color: var(--dobro-gray-800);
}

.page-404__links {
    padding-top: 32px;
    border-top: 1px solid var(--dobro-gray-200);
}

.page-404__links-title {
    font-size: var(--dobro-font-size-lg);
    font-weight: 500;
    color: var(--dobro-gray-600);
    margin: 0 0 16px;
}

.page-404__links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    justify-content: center;
}

.page-404__links-list a {
    color: var(--dobro-primary);
    text-decoration: none;
    font-size: var(--dobro-font-size-base);
    font-weight: 500;
    transition: color 0.3s ease;
}

.page-404__links-list a:hover {
    color: var(--dobro-primary-hover);
    text-decoration: underline;
}

/* 404 Mobile */
@media (max-width: 768px) {
    .page-404 {
        padding: 48px 16px;
    }

    .page-404__code {
        font-size: 80px;
    }

    .page-404__title {
        font-size: var(--dobro-font-size-2xl);
    }

    .page-404__description {
        font-size: var(--dobro-font-size-base);
    }

    .page-404__search-form {
        flex-direction: column;
        border-radius: var(--dobro-radius-lg);
    }

    .page-404__search-input {
        border-right: 2px solid var(--dobro-gray-200);
        border-bottom: none;
        border-radius: var(--dobro-radius-lg) var(--dobro-radius-lg) 0 0;
    }

    .page-404__search-input:focus {
        border-color: var(--dobro-primary);
    }

    .page-404__search-btn {
        border-radius: 0 0 var(--dobro-radius-lg) var(--dobro-radius-lg);
        padding: 12px;
    }

    .page-404__actions {
        flex-direction: column;
        align-items: center;
    }

    .page-404__btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .header__actions,
    .back-to-top,
    .nav-links {
        display: none;
    }
}