/*
Theme Name: Сказки онлайн
Theme URI: 
Author: 
Author URI: 
Description: Тема для сайта терапевтических сказок
Version: 1.0
License: 
Text Domain: skazki
*/

/* ===== СБРОС СТИЛЕЙ И БАЗОВЫЕ НАСТРОЙКИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F9F5E9;
    color: #333333;
    line-height: 1.6;
}

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

:root {
    --primary: #5A4632;
    --secondary: #E6D7B8;
    --accent: #8B7355;
    --light: #F9F5E9;
    --dark: #333333;
    --hover: #6B5A45;
}

h1, h2, h3, h4 {
    font-family: Georgia, serif;
    color: var(--primary);
    font-weight: 600;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

a {
    text-decoration: none;
    color: var(--accent);
    transition: color 0.3s;
}

a:hover {
    color: var(--hover);
}

/* ===== ШАПКА ===== */
header {
    background-color: white;
    box-shadow: 0 2px 15px rgba(90, 70, 50, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--accent);
}

.logo-text h1 {
    font-size: 1.8rem;
    margin-bottom: 2px;
}

.logo-text p {
    font-size: 0.9rem;
    color: #777;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.logo-link:hover {
    color: inherit;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

nav a {
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

nav a:hover:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent);
}

.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 8px 15px;
    border: 1px solid var(--secondary);
    border-radius: 20px 0 0 20px;
    width: 200px;
    outline: none;
}

.search-box button {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 9px 15px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: var(--hover);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

/* ===== ГЕРОЙ-БАННЕР ===== */
.hero {
    background: linear-gradient(rgba(90, 70, 50, 0.8), rgba(90, 70, 50, 0.9)), url('images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 0 0 20px 20px;
}

.hero h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn:hover {
    background-color: var(--hover);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ===== БЛОК НОВОСТЕЙ ===== */
.news-section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 1.8rem;
    color: var(--primary);
}

.view-all {
    color: var(--accent);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-all:hover {
    color: var(--hover);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.news-card {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
    border: 1px solid var(--secondary);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.news-image {
    height: 180px;
    background-color: var(--secondary);
    background-size: cover;
    background-position: center;
}

.news-content {
    padding: 20px;
}

.news-date {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.news-excerpt {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.read-more {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
.main-container {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
}

/* ===== САЙДБАР С ФИЛЬТРАМИ ===== */
.sidebar {
    flex: 0 0 280px;
}

.filter-widget {
    background-color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    border: 1px solid var(--secondary);
}

.filter-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-title i {
    color: var(--accent);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
}

.filter-option input {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.filter-option label {
    cursor: pointer;
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
}

.filter-count {
    background-color: var(--secondary);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.reset-btn {
    width: 100%;
    background-color: var(--secondary);
    color: var(--primary);
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.reset-btn:hover {
    background-color: #d8c9a8;
}

/* ===== КАРТОЧКИ СКАЗОК ===== */
.content {
    flex-grow: 1;
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.results-count {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
}

.sorting select {
    padding: 8px 15px;
    border: 1px solid var(--secondary);
    border-radius: 10px;
    background-color: white;
    color: var(--dark);
    font-size: 1rem;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.story-card {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
    border: 1px solid var(--secondary);
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.story-image {
    height: 180px;
    background-color: var(--secondary);
    background-size: cover;
    background-position: center;
    position: relative;
}

.story-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(90, 70, 50, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.story-content {
    padding: 20px;
}

.story-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.story-excerpt {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.story-age {
    background-color: var(--light);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
}

.story-duration {
    color: #777;
    display: flex;
    align-items: center;
    gap: 5px;
}

.story-actions {
    display: flex;
    gap: 10px;
}

.story-btn {
    flex-grow: 1;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 0.9rem;
}

.read-btn {
    background-color: var(--accent);
    color: white;
    border: 1px solid var(--accent);
}

.read-btn:hover {
    background-color: var(--hover);
}

.listen-btn {
    background-color: white;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.listen-btn:hover {
    background-color: var(--secondary);
}

.listen-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== ПОДВАЛ ===== */
footer {
    background-color: var(--primary);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-section h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #ddd;
}

.footer-section a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
    font-size: 0.9rem;
}

/* ===== ОСОБЫЙ ТЕКСТ В ПОДВАЛЕ ===== */
.special-message {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
    border-left: 4px solid var(--secondary);
}

.special-message p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.special-message a {
    color: var(--secondary);
    font-weight: 600;
}

.special-message a:hover {
    color: white;
    text-decoration: underline;
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ КАРТОЧЕК ===== */
.story-image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.story-title a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.story-title a:hover {
    color: var(--hover);
}

.story-video-badge {
    background-color: #ff6b6b;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.story-video-badge i {
    font-size: 0.9rem;
}

.video-btn {
    background-color: #ff6b6b;
    color: white;
    border: 1px solid #ff6b6b;
}

.video-btn:hover {
    background-color: #ff5252;
}

.story-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.story-btn {
    flex: 1 1 auto;
    min-width: 100px;
}

/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ ОТДЕЛЬНОЙ СКАЗКИ ===== */
.story-single-title {
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.story-single-thumbnail {
    margin-bottom: 30px;
    text-align: center;
}

.story-single-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.story-video-wrapper {
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.story-video-wrapper h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.story-video-wrapper iframe {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 100%;
    height: 400px;
}

.story-single-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    line-height: 1.8;
}

.story-single-meta {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.story-single-meta p {
    margin-bottom: 10px;
    padding: 10px;
    background: var(--light);
    border-radius: 10px;
}

.story-single-meta strong {
    color: var(--primary);
    min-width: 120px;
    display: inline-block;
}

.story-audio-player {
    margin-top: 20px;
    padding: 20px;
    background: var(--light);
    border-radius: 10px;
}

.story-audio-player h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.story-audio-player audio {
    width: 100%;
}

/* ===== СТРАНИЦА НОВОСТИ ===== */
.single-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.3;
}

.single-meta {
    margin-bottom: 30px;
    color: #777;
    font-size: 0.95rem;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.single-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.single-meta i {
    color: var(--accent);
}

.single-thumbnail {
    margin-bottom: 30px;
}

.single-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.single-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    line-height: 1.8;
    margin-bottom: 30px;
}

.single-content h2, 
.single-content h3,
.single-content h4 {
    margin: 25px 0 15px;
    color: var(--primary);
}

.single-content p {
    margin-bottom: 20px;
}

.single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
}

.single-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--secondary);
}

.single-navigation a {
    color: var(--accent);
    font-weight: 600;
    transition: color 0.3s;
}

.single-navigation a:hover {
    color: var(--hover);
}

/* ===== РЕКЛАМНЫЙ БЛОК ===== */
.filter-widget .ad-placeholder {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 10px;
}

.filter-widget .ad-placeholder img {
    transition: opacity 0.3s;
}

.filter-widget .ad-placeholder img:hover {
    opacity: 0.9;
}

.filter-widget .fa-ad {
    color: #ff6b6b;
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.story-card, .news-card {
    animation: fadeIn 0.5s ease-out;
}

.no-results {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #777;
    grid-column: 1 / -1;
}

.hidden {
    display: none !important;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    
    nav ul {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 20px;
    }
    
    nav ul.show {
        display: flex;
    }
    
    nav li {
        border-bottom: 1px solid #eee;
        padding: 12px 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .search-box {
        order: 3;
        width: 100%;
        margin-top: 15px;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .stories-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .story-actions {
        flex-direction: column;
    }
    
    .story-btn {
        width: 100%;
    }
    
    .single-title {
        font-size: 2rem;
    }
    
    .single-meta {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== СТРАНИЦА ИЗБРАННОГО ===== */
.favorites-section {
    margin-top: 30px;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.favorite-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--secondary);
    transition: transform 0.3s, box-shadow 0.3s;
}

.favorite-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.favorite-image-link {
    display: block;
    height: 180px;
    overflow: hidden;
}

.favorite-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.favorite-item:hover .favorite-image {
    transform: scale(1.05);
}

.favorite-content {
    padding: 20px;
}

.favorite-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.favorite-title a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.favorite-title a:hover {
    color: var(--hover);
}

.favorite-excerpt {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.favorite-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.favorite-age, .favorite-duration {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #777;
}

.favorite-age i, .favorite-duration i {
    color: var(--accent);
}

.favorite-actions {
    display: flex;
    gap: 10px;
}

.favorite-read-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
}

.favorite-read-btn:hover {
    background-color: var(--hover);
    color: white;
}

.favorite-remove-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.favorite-remove-btn:hover {
    background-color: #ff5252;
}

.favorites-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    border: 1px solid var(--secondary);
}

.favorites-empty i {
    font-size: 4rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.favorites-empty h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.favorites-empty p {
    color: #777;
    margin-bottom: 25px;
}

.favorites-browse-btn {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
}

.favorites-browse-btn:hover {
    background-color: var(--hover);
}

.favorites-error {
    background: #fff3f3;
    border: 1px solid #ff6b6b;
    padding: 20px;
    border-radius: 10px;
    color: #ff5252;
    text-align: center;
}

/* ===== КНОПКА ИЗБРАННОГО ===== */
.story-favorite {
    margin: 30px 0;
    text-align: center;
}

.custom-fav-btn {
    background-color: var(--accent) !important;
    color: white !important;
    padding: 20px 40px !important;
    border: none !important;
    border-radius: 50px !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    transition: all 0.3s !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15) !important;
    min-width: 280px !important;
    line-height: 1.4 !important;
}

.custom-fav-btn:hover {
    background-color: var(--hover) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2) !important;
}

.custom-fav-btn i {
    font-size: 1.6rem !important;
}

/* КОГДА СКАЗКА В ИЗБРАННОМ — КРАСНАЯ КНОПКА */
.custom-fav-btn.fas.fa-heart,
.custom-fav-btn .fas.fa-heart,
.custom-fav-btn:has(.fas.fa-heart) {
    background-color: #ff6b6b !important;
}

.custom-fav-btn:has(.fas.fa-heart):hover {
    background-color: #ff5252 !important;
}

/* Запасной вариант через атрибут */
.custom-fav-btn[class*="fas fa-heart"] {
    background-color: #ff6b6b !important;
}

.no-favorites {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #777;
}
/* Адаптивность для избранного */
@media (max-width: 768px) {
    .favorites-grid {
        grid-template-columns: 1fr;
    }
    
    .favorite-actions {
        flex-direction: column;
    }
    
    .custom-fav-btn {
        padding: 15px 30px !important;
        font-size: 1.2rem !important;
        min-width: 240px !important;
    }
}