/* ========================================
   Чувашские сказки - Основные стили
   ======================================== */

:root {
    /* Цветовая палитра - современные красный и желтый */
    --primary-red: #E63946;
    --primary-yellow: #F9C74F;
    --deep-red: #C1121F;
    --light-yellow: #FFE066;
    --dark-red: #780000;
    --cream: #FFF8E7;
    
    /* Градиенты */
    --gradient-main: linear-gradient(135deg, #E63946 0%, #F9C74F 100%);
    --gradient-reverse: linear-gradient(135deg, #F9C74F 0%, #E63946 100%);
    --gradient-dark: linear-gradient(135deg, #C1121F 0%, #E63946 50%, #F9C74F 100%);
    --gradient-light: linear-gradient(135deg, #FFE066 0%, #F9C74F 50%, #E63946 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(230, 57, 70, 0.9) 0%, rgba(249, 199, 79, 0.8) 100%);
    
    /* Нейтральные цвета */
    --text-dark: #1A1A2E;
    --text-gray: #6B7280;
    --bg-light: #FAFAFA;
    --bg-white: #FFFFFF;
    --border-color: #E5E7EB;
    
    /* Типография */
    --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    
    /* Анимации */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Базовые стили
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* ========================================
   Контейнер
   ======================================== */

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

/* ========================================
   Хедер и навигация
   ======================================== */

.header {
    background: var(--gradient-main);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--bg-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--bg-white);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background-color: var(--bg-white);
    border-radius: 3px;
    transition: var(--transition);
}

/* ========================================
   Hero секция
   ======================================== */

.hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-dark);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--bg-white);
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.scroll-arrow {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* ========================================
   Секции
   ======================================== */

.categories-section,
.latest-section,
.category-items {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Карточки категорий
   ======================================== */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.category-card {
    position: relative;
    padding: 2rem;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-main);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.category-card-inner {
    position: relative;
    z-index: 1;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.category-description {
    color: var(--text-gray);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.category-count {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--gradient-main);
    color: var(--bg-white);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ========================================
   Карточки элементов
   ======================================== */

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.item-card {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.item-image-link {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--gradient-light);
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.item-card-content {
    padding: 1.5rem;
}

.item-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gradient-main);
    color: var(--bg-white);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.item-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.item-title a {
    color: var(--text-dark);
}

.item-title a:hover {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.item-excerpt {
    color: var(--text-gray);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.item-link {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.item-link:hover {
    opacity: 0.8;
}

/* ========================================
   Страница элемента
   ======================================== */

.page-header {
    background: var(--gradient-main);
    padding: 3rem 0;
    color: var(--bg-white);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumbs a {
    color: var(--bg-white);
    font-weight: 500;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.page-description {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* ========================================
   Статья
   ======================================== */

.article-page {
    background: var(--bg-white);
    margin: -2rem auto 3rem;
    max-width: 900px;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}

.article-header {
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.article-category {
    padding: 0.5rem 1rem;
    background: var(--gradient-main);
    color: var(--bg-white);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.article-date {
    color: var(--text-gray);
    font-size: 0.95rem;
}

.article-images {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.article-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.article-image img {
    width: 100%;
    height: auto;
}

.article-image figcaption {
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    color: var(--text-gray);
    font-size: 0.9rem;
    text-align: center;
}

.article-image.main-image img {
    max-height: 600px;
    object-fit: cover;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.article-content h2,
.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.tag {
    padding: 0.4rem 0.8rem;
    background: var(--bg-light);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.article-navigation {
    margin-bottom: 2rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-main);
    color: var(--bg-white);
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-back:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-md);
}

.share-section {
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.share-section h3 {
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--bg-white);
    transition: var(--transition);
}

.share-btn.vk { background: #0077FF; }
.share-btn.telegram { background: #0088cc; }
.share-btn.twitter { background: #1DA1F2; }

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Футер
   ======================================== */

.footer {
    background: var(--gradient-dark);
    color: var(--bg-white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--bg-white);
    padding-left: 5px;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: var(--transition);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.8;
}

/* ========================================
   Адаптивность
   ======================================== */

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--gradient-main);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .article-page {
        padding: 2rem 1.5rem;
        margin: -1rem 1rem 2rem;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .categories-grid,
    .items-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
}
