:root {
    --primary: #4a6fa5;
    --primary-dark: #2a4a6d;
    --accent: #d4b483;
    --light: #f9f9f9;
    --dark: #333;
    --gray: #ddd;
    --white: #fff;
}

/* Базовые стили */
body {
 font-family: 'Montserrat', 'Open Sans', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--light);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* Шапка и подвал */
.site-header .logo-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--white);
    display: block; /* Важно для корректного отображения */
    margin: 0; /* Убираем возможные отступы */
    padding: 0; /* Убираем возможные внутренние отступы */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Если изображение обернуто в ссылку */
.site-header .logo-link {
    display: inline-block; /* или flex */
    overflow: hidden; /* Обрезаем все, что выходит за границы */
    border-radius: 50%;
    width: 80px;
    height: 80px;
}
.site-header, footer {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between; /* Распределяем пространство между элементами */
    align-items: center;
    padding: 15px 0;
    width: 100%;
}
.site-header h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: 1px;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none; /* Убираем подчеркивание */
    color: inherit; /* Наследуем цвет текста */
    transition: transform 0.3s ease; /* Анимация при наведении */
}

.header-brand:hover {
    transform: scale(1.02); /* Легкое увеличение при наведении */
    text-decoration: none; /* Убедимся, что подчеркивание не появится */
}

/* Форма поиска */
.search-container {
    margin: 30px auto;
    max-width: 600px;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-input-container {
    position: relative;
    display: flex;
}

.search-input-container input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid var(--gray);
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}
logo-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--white);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.header-brand:hover .logo-image {
    transform: rotate(5deg); /* Легкий поворот при наведении */
}

.header-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    margin: 0;
    transition: color 0.3s ease;
    text-decoration: none !important; /* Добавляем это свойство */
}
.header-brand, 
.header-brand:link, 
.header-brand:visited, 
.header-brand:hover, 
.header-brand:active, 
.header-brand:focus {
    text-decoration: none !important;
}

.header-brand:hover .header-title {
    color: var(--accent); /* Изменение цвета при наведении */
}
.logo-image:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}


.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.search-button:hover {
    background: var(--primary-dark);
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-row select {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--gray);
    border-radius: 30px;
    font-size: 1rem;
    appearance: none;
    background-color: var(--white);
    cursor: pointer;
}

.reset-btn {
    color: var(--primary);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 30px;
    transition: all 0.3s;
}

.reset-btn:hover {
    background: rgba(74, 111, 165, 0.1);
}

/* Карточки молитв */
.prayers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.prayer-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.prayer-card:hover {
    transform: translateY(-5px);
}

.card-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

/* Улучшенные шрифты для карточек */
.card-header h3 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.category {
    display: inline-block;
    background: rgba(74, 111, 165, 0.1);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.card-content {
    padding: 15px;
    flex-grow: 1;
    color: #555;
    line-height: 1.6;
	
}
.card-content br {
    display: block;
    content: "";
    margin-bottom: 0.5em; /* Добавляем дополнительный отступ после переноса строки */
}


.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid #f0f0f0;
    background: #f9f9f9;
}

.read-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
    transition: all 0.3s;
}

.read-btn:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.share-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(74, 111, 165, 0.3);
}

/* Страница одной молитвы */
.prayer-single {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.prayer-single h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.prayer-meta {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prayer-content {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    line-height: 1.8;
	
    
    white-space: pre-line; /* Сохраняет переносы строк, но не другие пробелы */

}
.prayer-content br {
    display: block;
    content: "";
    margin-bottom: 0.5em;
}

.prayer-actions {
    margin-top: 40px;
    text-align: center;
}

.btn-share {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-share:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-share i {
    font-size: 1.1rem;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
}

.page-nav, .page-num {
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.page-nav {
    color: var(--primary);
    border: 1px solid var(--gray);
}

.page-num {
    color: var(--dark);
    border: 1px solid var(--gray);
}

.page-num.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-nav:hover, .page-num:hover:not(.active) {
    background: rgba(74, 111, 165, 0.1);
}

.page-dots {
    padding: 8px 5px;
    display: inline-block;
}

/* Сообщения */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.no-results i {
    font-size: 2rem;
    color: var(--accent);
}


/* Стили для кнопок озвучки */
.audio-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.player-controls, .tts-controls {
    display: flex;
    gap: 10px;
}

.audio-control {
    background: #4a6fa5;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.audio-control:hover {
    background: #3a5a6d;
    transform: translateY(-1px);
}

.audio-control i {
    font-size: 14px;
}

.hidden {
    display: none !important;
}

/* Скрываем стандартный аудиоплеер */
audio {
    display: none;
}
/* Подсветка текста */
mark {
    background-color: rgba(212, 180, 131, 0.3);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* Адаптивность */
@media (max-width: 768px) {
	.site-header .container {
        flex-direction: column; /* Элементы вертикально */
        text-align: center;
    }
    
    .header-brand {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .header-title {
        white-space: normal;
        font-size: 1.5rem;
    }
    
    
     .logo-image {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
    
    
	
	.prayer-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .audio-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .player-controls, .tts-controls {
        width: 100%;
    }
    
    .audio-control {
        width: 100%;
        justify-content: center;
    }
    .prayers-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-row select, .reset-btn {
        width: 100%;
    }
    
    .reset-btn {
        text-align: center;
    }
    
    .pagination {
        flex-wrap: wrap;
    }

    .prayer-single {
        padding: 20px;
    }
}