/* Дополнительные стили для мобильных устройств */

/* Мобильное меню */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: flex;
    flex-direction: column;
    width: 24px;
    height: 18px;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: white;
    transition: all 0.3s ease;
}

.screen-reader-text {
    position: absolute;
    left: -9999px;
}

@media (max-width: 768px) {
    .main-navigation {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--gradient-primary);
        z-index: 9999;
        transition: var(--transition);
        padding: 2rem 0;
        overflow-y: auto;
    }
    
    .main-navigation.is-open {
        left: 0;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 0 2rem;
    }
    
    .main-navigation li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .main-navigation a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
        border-radius: 0;
    }
    
    .main-navigation a::before {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block !important;
        position: relative;
        z-index: 10000;
    }
    
    .mobile-menu-toggle.active .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active .hamburger span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Оверлей для мобильного меню */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
    }
    
    body.menu-open {
        overflow: hidden;
    }
}

/* Дополнительные стили для подвала */
@media (max-width: 768px) {
    .footer-content {
        display: block;
    }
    
    .footer-section {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .newsletter-form input {
        border-radius: 25px;
    }
}

/* Кнопка "Наверх" */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Стили для подвала */
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #ecf0f1;
}

.footer-links {
    list-style: none;
    padding: 0;
}

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

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ffd700;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #ffd700;
    transform: translateY(-3px);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #34495e;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.newsletter-form input::placeholder {
    color: #bdc3c7;
}

.newsletter-form input:focus {
    outline: none;
    border-color: #ffd700;
}

/* Хлебные крошки */
.breadcrumbs {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: #667eea;
    text-decoration: none;
}

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

/* Навигация между постами */
.post-navigation {
    margin: 3rem 0;
}

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

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

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

@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
    }
    
    .nav-next {
        text-align: left;
    }
}

/* Советы по приготовлению */
.recipe-tips {
    background: #e8f5e8;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid #27ae60;
}

.recipe-tips h3 {
    color: #27ae60;
    margin-bottom: 1rem;
}

/* Пагинация */
.pagination-wrapper {
    text-align: center;
    margin: 3rem 0;
}

.page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.page-numbers:hover,
.page-numbers.current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Герой секция */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    margin-bottom: 3rem;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
}

/* Адаптация контента для мобильных */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .site-header {
        padding: 1rem 0;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .site-branding {
        flex: 1;
    }
    
    .site-title {
        font-size: 1.75rem;
    }
    
    .site-description {
        display: none;
    }
    
    /* Герой секция */
    .hero-section {
        padding: 2.5rem 0;
        margin: -1rem -16px 2rem -16px;
    }
    
    .hero-content {
        padding: 0 1rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-section p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    /* Форма поиска */
    .search-form {
        max-width: 100%;
        flex-direction: column;
        border-radius: var(--border-radius);
    }
    
    .search-input {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
        padding: 1rem 1.25rem;
    }
    
    .search-button {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        padding: 1rem 1.25rem;
    }
    
    /* Категории */
    .categories-section {
        margin: 0 -16px;
        padding: 3rem 0;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .category-card {
        padding: 2rem 1.5rem;
    }
    
    .category-icon {
        font-size: 2.5rem;
    }
    
    /* Рецепты */
    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .recipe-card {
        margin: 0 auto;
        max-width: 400px;
    }
    
    .recipe-content {
        padding: 1.5rem;
    }
    
    .recipe-title {
        font-size: 1.25rem;
    }
    
    /* Секции */
    section {
        margin-bottom: 3rem;
    }
    
    section h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
    
    /* Пагинация */
    .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-numbers a,
    .page-numbers span {
        padding: 0.5rem 0.75rem;
        margin: 0.25rem;
        min-width: 40px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
    }
    
    .category-card {
        padding: 1.5rem 1rem;
    }
    
    .recipe-content {
        padding: 1.25rem;
    }
    
    .recipe-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cooking-time {
        align-self: flex-start;
    }
}

/* Страница рецепта на мобильных */
@media (max-width: 768px) {
    .recipe-single {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .breadcrumbs {
        font-size: 0.8rem;
        margin-bottom: 1.5rem;
    }
    
    .recipe-header h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .recipe-featured-image {
        height: 250px;
        margin: 1rem auto;
    }
    
    .recipe-description {
        font-size: 1rem;
    }
    
    .recipe-info {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .info-item {
        padding: 0.75rem;
    }
    
    .info-label {
        font-size: 0.8rem;
    }
    
    .info-value {
        font-size: 1.1rem;
    }
    
    .recipe-content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin: 2rem 0;
    }
    
    .recipe-ingredients,
    .recipe-instructions {
        padding: 1.5rem;
    }
    
    .recipe-ingredients h2,
    .recipe-instructions h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .instructions-list li {
        padding: 1.25rem;
        padding-left: 3.5rem;
        margin: 1rem 0;
    }
    
    .instructions-list li::before {
        left: 1.25rem;
        top: 1.25rem;
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.85rem;
    }
    
    .recipe-tips {
        padding: 1.5rem;
    }
    
    .recipe-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .recipe-meta-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-next {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .recipe-info {
        grid-template-columns: 1fr;
    }
    
    .recipe-single {
        padding: 1rem;
    }
    
    .recipe-ingredients,
    .recipe-instructions {
        padding: 1.25rem;
    }
    
    .instructions-list li {
        padding-left: 3rem;
    }
    
    .instructions-list li::before {
        left: 1rem;
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.8rem;
    }
}

/* Архивные страницы на мобильных */
@media (max-width: 768px) {
    .archive-header {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .archive-title {
        font-size: 1.75rem;
    }
    
    .archive-description {
        font-size: 1rem;
    }
    
    .archive-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .filter-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .filter-options {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .sort-section {
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .sort-section select {
        width: 100%;
        max-width: 200px;
    }
}

/* Подвал на мобильных */
@media (max-width: 768px) {
    .site-footer {
        padding: 2rem 0 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-section h4 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .newsletter-input-group {
        flex-direction: column;
    }
    
    .newsletter-input-group input {
        border-radius: var(--border-radius);
        margin-bottom: 0.5rem;
    }
    
    .newsletter-btn {
        border-radius: var(--border-radius);
        padding: 0.875rem 1rem;
    }
    
    .footer-stats {
        justify-content: center;
        gap: 3rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-menu ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* Улучшения для сенсорных устройств */
@media (hover: none) and (pointer: coarse) {
    .recipe-card:hover,
    .category-card:hover,
    .btn:hover {
        transform: none;
    }
    
    .recipe-card:active,
    .category-card:active {
        transform: translateY(-4px);
    }
    
    .btn:active {
        transform: translateY(-1px);
    }
    
    /* Увеличиваем области касания */
    .main-navigation a,
    .btn,
    .filter-btn,
    .social-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .categories-section {
        padding: 2rem 0;
    }
    
    .recipe-featured-image {
        height: 200px;
    }
}

/* Высокие экраны (планшеты в портретной ориентации) */
@media (min-width: 481px) and (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .recipe-info {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Анимации для мобильных устройств */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-to-top,
    .main-navigation {
        transition: none;
    }
} 