/* responsive.css - Адаптивные стили */

/* Планшеты (от 768px до 1024px) */
@media (max-width: 1024px) {
    /* Лента */
    .feed-layout {
        grid-template-columns: 1fr 280px;
        gap: 1.5rem;
    }
    
    /* Шапка */
    .header-nav {
        margin: 0 1rem;
        max-width: 320px;
    }
    
    .header-search {
        margin: 0 1rem;
        max-width: 300px;
    }
    
    /* Подвал */
    .footer-content {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 2rem;
    }
    
    .footer-section:first-child {
        grid-column: 1 / -1;
        text-align: center;
    }
    
    .footer-description {
        max-width: 500px;
        margin: 0 auto 1.5rem;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    /* Профиль */
    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .profile-avatar {
        margin-top: -80px;
        width: 140px;
        height: 140px;
    }
    
    .profile-stats {
        justify-content: center;
    }
}

/* Планшеты в вертикальной ориентации (от 576px до 768px) */
@media (max-width: 768px) {
    /* Переменные для мобильных */
    :root {
        --header-height: 56px;
        --container-padding: 12px;
    }
    
    /* Шапка */
    .header-content {
        padding: 0 var(--container-padding);
    }
    
    .header-nav,
    .header-search {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .btn-create-post .btn-text {
        display: none;
    }
    
    .auth-buttons {
        gap: 0.5rem;
    }
    
    .auth-buttons .btn {
        padding: 0.5rem 1rem;
        font-size: var(--font-size-xs);
    }
    
    /* Основной макет */
    .feed-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 0;
    }
    
    .feed-sidebar {
        display: none;
    }
    
    /* Форма создания поста */
    .create-post-form {
        padding: 1.25rem;
    }
    
    .create-post-header {
        gap: 0.75rem;
    }
    
    .create-post-avatar {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    /* Посты */
    .post-header {
        padding: 0.875rem 1rem;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .post-actions {
        padding: 0.75rem 1rem;
    }
    
    .post-action-buttons {
        gap: 1rem;
    }
    
    /* Карточки */
    .card-body {
        padding: 1.25rem;
    }
    
    /* Админ панель */
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .admin-main {
        padding: 1.5rem;
    }
    
    /* Страница входа/регистрации */
    .auth-layout {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem;
    }
    
    /* Подвал */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    /* Сетки */
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Модальные окна */
    .modal-content {
        max-width: 95%;
        width: 95%;
    }
    
    /* Выпадающие меню */
    .user-dropdown {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-top: 0;
    }
    
    .user-dropdown.show {
        animation: slideInDown 0.2s ease;
    }
    
    @keyframes slideInDown {
        from {
            transform: translateY(-100%);
        }
        to {
            transform: translateY(0);
        }
    }
}

/* Мобильные телефоны (до 576px) */
@media (max-width: 576px) {
    /* Типографика */
    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }
    h3 { font-size: var(--font-size-xl); }
    h4 { font-size: var(--font-size-lg); }
    
    /* Шапка */
    .header-logo .logo-subtitle {
        display: none;
    }
    
    .auth-buttons .btn-text {
        display: none;
    }
    
    .auth-buttons .btn {
        padding: 0.5rem;
        min-width: 2.5rem;
        justify-content: center;
    }
    
    /* Мобильное меню */
    .mobile-nav {
        width: 100%;
    }
    
    /* Основной контент */
    .container {
        padding: 0 0.75rem;
    }
    
    /* Формы */
    .create-post-form {
        padding: 1rem;
    }
    
    .create-post-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .create-post-media {
        justify-content: center;
    }
    
    .create-post-submit {
        width: 100%;
    }
    
    /* Посты */
    .post-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .post-author {
        flex: 1;
        min-width: 0;
    }
    
    .post-category {
        order: 1;
        width: 100%;
        text-align: center;
    }
    
    .post-actions {
        flex-wrap: wrap;
    }
    
    .post-action-buttons {
        width: 100%;
        justify-content: space-around;
    }
    
    .post-bookmark-btn {
        order: -1;
    }
    
    /* Профиль */
    .profile-info {
        padding: 1.25rem;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
        margin-top: -50px;
    }
    
    .profile-stats {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
    
    .profile-stat {
        flex: 1;
        min-width: 100px;
    }
    
    .profile-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Карточки */
    .card-header,
    .card-body,
    .card-footer {
        padding: 1rem;
    }
    
    /* Подвал */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Модальные окна */
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.25rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Сетки */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Пагинация */
    .pagination ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Админ панель */
    .admin-main {
        padding: 1rem;
    }
    
    /* Страница входа/регистрации */
    .auth-card {
        padding: 1.5rem;
        border: none;
        box-shadow: none;
    }
    
    .auth-logo {
        font-size: 2rem;
    }
    
    .auth-title {
        font-size: var(--font-size-xl);
    }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
    :root {
        --font-size-base: 0.9375rem; /* 15px */
    }
    
    .header-logo .logo-text {
        font-size: 1.5rem;
    }
    
    .btn-create-post {
        padding: 0.5rem;
        min-width: 2.5rem;
        justify-content: center;
    }
    
    .btn-create-post .btn-text {
        display: none;
    }
    
    .user-avatar {
        width: 2rem;
        height: 2rem;
    }
    
    .auth-buttons {
        gap: 0.25rem;
    }
    
    .auth-buttons .btn {
        padding: 0.375rem;
        min-width: 2rem;
    }
}

/* Адаптивность для темной темы */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .mobile-nav {
        background-color: #2d2d2d;
    }
    
    .mobile-overlay {
        background-color: rgba(0, 0, 0, 0.7);
    }
}

/* Портретная ориентация */
@media (max-height: 600px) and (orientation: portrait) {
    .auth-layout {
        padding: 1rem 0;
    }
    
    .auth-card {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .mobile-nav {
        max-height: 100vh;
    }
}

/* Ландшафтная ориентация */
@media (orientation: landscape) and (max-height: 500px) {
    .site-header {
        position: static;
    }
    
    .feed-layout {
        padding-top: 0;
    }
    
    .feed-sidebar {
        position: static;
        max-height: none;
    }
}

/* Высокое разрешение (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-text,
    .header-logo {
        font-weight: var(--font-weight-black);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Печать */
@media print {
    .site-header,
    .feed-sidebar,
    .create-post-form,
    .post-actions,
    .site-footer,
    .mobile-nav,
    .mobile-overlay {
        display: none !important;
    }
    
    .main-layout,
    .container,
    .feed-layout {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .feed-main {
        width: 100%;
    }
    
    body {
        background-color: white;
        color: black;
        font-size: 12pt;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .post-card {
        border: 1px solid #ddd;
        box-shadow: none;
        page-break-inside: avoid;
        margin-bottom: 1cm;
    }
}