/* Classic Russian Font Family */
@font-face {
    font-family: 'Classic Russian';
    src: url('../crf/classicrussian.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Classic Russian';
    src: url('../crf/classicrussian_bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Classic Russian';
    src: url('../crf/classicrussian_italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Classic Russian';
    src: url('../crf/classicrussian_bolditalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

/* Сброс стилей и базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Classic Russian', 'Times New Roman', Times, serif;
    letter-spacing: 0.8px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Переопределение шрифтов для заголовков */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Classic Russian', 'Times New Roman', Times, serif !important;
}

/* Дополнительные переопределения для блоков WordPress */
.wp-block-heading h1,
.wp-block-heading h2,
.wp-block-heading h3,
.wp-block-heading h4,
.wp-block-heading h5,
.wp-block-heading h6 {
    font-family: 'Classic Russian', 'Times New Roman', Times, serif !important;
}

/* Переопределение для элементов с CSS переменными */
[style*="font-family"] h1,
[style*="font-family"] h2,
[style*="font-family"] h3,
[style*="font-family"] h4,
[style*="font-family"] h5,
[style*="font-family"] h6 {
    font-family: 'Classic Russian', 'Times New Roman', Times, serif !important;
}

/* Контейнер */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Хедер */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Верхняя полоса */
.top-bar {
    background: linear-gradient(135deg, #4a9eff 0%, #1e88e5 100%);
    color: white;
    font-size: 12px;
    padding: 8px 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.blessing-text {
    font-weight: 500;
    font-size: 1rem;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 1rem;
}

.auth-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.auth-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.separator {
    opacity: 0.7;
}

/* Основная часть хедера */
.main-header {
    background: white;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

/* Логотип и заголовок */
.logo-title-section {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Логотип */
.logo-section {
    display: flex;
    align-items: center;
}

.logo a {
    text-decoration: none;
    display: block;
}

/* Кастомный логотип WordPress */
.custom-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
    border: 2px solid #e0e0e0;
}

/* Fallback логотип */
.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a9eff 0%, #1e88e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
}

.logo-inner {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
}

.church-icon {
    font-size: 32px;
    color: #4a9eff;
}

/* Заголовок */
.title-section {
    text-align: left;
}

.site-title {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.site-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-title a:hover {
    color: #4a9eff;
}

.site-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

/* Информационные блоки */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    align-items: flex-end;
}

.info-block {
    padding: 12px 15px;
    background: #f8f9fa;
    border-left: 4px solid #4a9eff;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
}

.info-block p a {
    text-decoration: none;
}

/* Поиск */
.search-section {
    display: flex;
    align-items: center;
    max-width: 300px;
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
}

.search-form {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.search-field {
    flex: 1;
    padding: 8px 15px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    outline: none;
    font-family: 'Classic Russian', 'Times New Roman', Times, serif;
}

.search-field::placeholder {
    color: #999;
    font-style: italic;
}

.search-submit {
    background: linear-gradient(135deg, #4a9eff 0%, #1e88e5 100%);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit:hover {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    transform: scale(1.05);
}

.search-icon {
    font-size: 14px;
    color: white;
}

/* Навигация */
.main-navigation {
    background: linear-gradient(135deg, #455a64 0%, #37474f 100%);
    padding: 0;
    position: relative;
    z-index: 999;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    flex: 1;
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    min-height: 55px;
}

.nav-item:last-child .nav-link {
    border-right: none;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-icon {
    margin-left: 8px;
    font-size: 14px;
    opacity: 0.8;
}

/* Выпадающие меню */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 200px;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}


.dropdown-item:hover {
    background: #f8f9fa;
    color: #4a9eff;
    padding-left: 25px;
}


a.dropdown-link {
    text-decoration: none;
    text-transform: none;
}

/* Ховер эффекты для десктопа */
@media (min-width: 769px) {
    .nav-item:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-item:hover .nav-link {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Мобильное меню */
.mobile-menu-toggle {
    display: none;
}

.menu-button {
    background: none;
    border: none;
    padding: 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-button span {
    width: 25px;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
}

/* Основной контент */
.main-content {
    padding: 40px 0;
    background: #f5f5f5;
    min-height: 60vh;
}

.welcome-section {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 40px;
}

.welcome-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.welcome-section p {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* Адаптивные стили */
@media (max-width: 1024px) {
    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        text-align: left;
        gap: 20px;
    }
    
    .logo-title-section {
        display: flex;
        align-items: center;
        gap: 20px;
        flex: 1;
    }
    
    .logo-section {
        display: flex;
        align-items: center;
    }
    
    .title-section {
        text-align: left;
        flex: 1;
    }
    
    .info-section {
        display: flex;
        flex-direction: column;
        gap: 15px;
        max-width: 300px;
        align-items: flex-end;
    }
    
    .info-block {
        width: 100%;
        max-width: none;
    }
    
    .search-section {
        width: 100%;
        max-width: none;
        margin-top: 10px;
    }
}

@media (max-width: 700px) {
    .header-content {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .logo-title-section {
        display: flex;
        align-items: center;
        gap: 20px;
        flex: none;
        width: 100%;
    }
    
    .info-section {
        display: flex;
        flex-direction: column;
        gap: 15px;
        max-width: none;
        width: 100%;
        align-items: stretch;
    }
    
    .info-block {
        width: 100%;
        max-width: none;
    }
    
    .search-section {
        width: 100%;
        max-width: none;
        margin-top: 10px;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .header-content {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .logo-title-section {
        display: flex;
        align-items: center;
        gap: 15px;
        flex: 1;
    }
    
    .info-section {
        display: flex;
        flex-direction: column;
        gap: 15px;
        max-width: 250px;
        align-items: flex-end;
        margin-left: auto;
    }
    
    .search-section {
        width: 100%;
        max-width: none;
        margin-top: 10px;
    }
    
    .blessing-text {
        font-size: 11px;
    }
    
    .site-title {
        font-size: 24px;
    }
    
    .site-subtitle {
        font-size: 12px;
    }
    
    .logo-circle {
        width: 70px;
        height: 70px;
    }
    
    .logo-inner {
        width: 58px;
        height: 58px;
    }
    
    .church-icon {
        font-size: 28px;
    }
    
    .custom-logo {
        width: 70px;
        height: 70px;
    }
    
    .info-section {
        flex-direction: column;
        align-items: center;
    }
    
    .info-block {
        max-width: 100%;
    }
    
    /* Мобильная навигация */
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #455a64;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-item {
        flex: none;
    }
    
    .nav-link {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: flex-start;
        padding: 20px 15px;
        font-size: 14px;
    }
    
    .nav-link.has-dropdown::after {
        content: '▼';
        margin-left: auto;
        font-size: 12px;
        transition: transform 0.3s ease;
    }
    
    .nav-link.has-dropdown.active::after {
        transform: rotate(180deg);
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 0;
        display: none;
    }
    
    .dropdown-menu.active {
        display: block;
    }
    
    .dropdown-item {
        padding: 15px 30px;
        color: rgba(255, 255, 255, 0.8);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
        padding-left: 35px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-navigation {
        position: relative;
    }


    a.dropdown-link {
        color: #fff;
        text-decoration: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .main-header {
        padding: 15px 0;
    }
    
    .header-content {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .logo-title-section {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: none;
        width: 100%;
    }
    
    .info-section {
        display: flex;
        flex-direction: column;
        gap: 15px;
        max-width: none;
        width: 100%;
        align-items: stretch;
    }
    
    .info-block {
        width: 100%;
        max-width: none;
    }
    
    .search-section {
        width: 100%;
        max-width: none;
        margin-top: 10px;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
    
    .site-title {
        font-size: 20px;
    }
    
    .site-subtitle {
        font-size: 11px;
    }
    
    .logo-circle {
        width: 60px;
        height: 60px;
    }
    
    .logo-inner {
        width: 50px;
        height: 50px;
    }
    
    .church-icon {
        font-size: 24px;
    }
    
    .custom-logo {
        width: 60px;
        height: 60px;
    }
    
    .info-block {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .search-field {
        font-size: 13px;
        padding: 10px 15px;
    }
    
    .search-submit {
        padding: 10px 14px;
    }
    
    .search-icon {
        font-size: 14px;
    }
    
    .welcome-section {
        padding: 30px 20px;
    }
    
    .welcome-section h2 {
        font-size: 22px;
    }
    
    .welcome-section p {
        font-size: 14px;
    }
}

/* Поддержка старых браузеров */
@supports not (display: grid) {
    .header-content {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }
    
    .title-section {
        flex: 1;
        margin: 0 20px;
    }
}

/* Фокус для доступности */
.nav-link:focus,
.auth-links a:focus,
.menu-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content > * {
    animation: fadeInUp 0.6s ease-out;
}

/* Улучшенная типографика */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
    .site-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* WordPress специфичные стили */
.wp-block-navigation {
    margin: 0;
}

.wp-block-navigation .wp-block-navigation-item {
    margin: 0;
}

/* Совместимость с WordPress admin bar */
.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

