
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: 'Be Vietnam Pro', sans-serif;
    background: #fff8f7;
    color: #212121;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    
}




/* ========== ЗАГОЛОВОК БЛОГА ========== */
.blog-header {
    text-align: center;
    margin: 40px 0 50px;
}

.blog-title {
    font-size: 48px;
    font-weight: 700;
    color: #982030;
    margin-bottom: 15px;
}

.blog-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #982030;
    margin: 15px auto 0;
    border-radius: 2px;
}

.blog-subtitle {
    font-size: 18px;
    color: #666;
    margin-top: 10px;
}

/* ========== СЕТКА СТАТЕЙ ========== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    padding: 10px;
}

.blog-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(152, 32, 48, 0.15);
}

.blog-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 20px;
}

.blog-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #982030;
    background: #ffe7ea;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.blog-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #212121;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-card-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.blog-read-more {
    color: #982030;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.blog-read-more:hover {
    transform: translateX(5px);
    color: #6b1522;
}

/* ========== ПОДПИСКА ========== */
.subscribe-section {
    background: #ffe7ea;
    border-radius: 30px;
    padding: 0;
    margin-top: 20px;
}

.subscribe-card {
    background: transparent;
    border-radius: 30px;
    padding: 50px 40px;
    text-align: center;
}

.subscribe-card h3 {
    font-size: 28px;
    font-weight: 700;
    color: #212121;
    margin-bottom: 10px;
}

.subscribe-card p {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
}

.subscribe-form {
    display: flex;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.subscribe-form input {
    flex: 2;
    min-width: 250px;
    padding: 14px 20px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.subscribe-form input:focus {
    border-color: #982030;
}

.subscribe-form button {
    background: #982030;
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subscribe-form button:hover {
    background: #6b1522;
    transform: translateY(-2px);
}

/* ========== ФУТЕР ========== */
.footer {
    width: 100%;
    padding: 40px 20px;
    text-align: center;
    background-color: #982030;
    border-radius: 20px 20px 0 0;
    margin-top: auto;
    clear: both;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    font-size: 14px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.footer-info p {
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}






/* ========== АДАПТАЦИЯ ========== */
@media (max-width: 768px) {
    .blog-title {
        font-size: 36px;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .subscribe-card {
        padding: 30px 20px;
    }
    
    .subscribe-card h3 {
        font-size: 24px;
    }
    
    .subscribe-form {
        flex-direction: column;
    }
    
    .subscribe-form input {
        width: 100%;
    }
    
    .subscribe-form button {
        width: 100%;
    }

    .footer-links {
   
    gap: 10px;
    
}


    
}

@media (max-width: 576px) {
    .blog-title {
        font-size: 28px;
    }
    
    .blog-subtitle {
        font-size: 15px;
    }
    
    .blog-card-title {
        font-size: 18px;
    }
}



















/* ========== КОНТЕЙНЕР С SIDEBAR ========== */
.main-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.main-content {
    flex: 1;
    min-height: 100%;
}

/* ========== МЕНЮ КАТЕГОРИЙ (SIDEBAR) ========== */
.sidebar {
    width: 270px;
    background: #FAFAF9;
    overflow-y: auto;
    box-shadow: 0.1px 0 2px rgba(0,0,0,0.05);
    flex-shrink: 0;
    padding: 20px 5px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: black;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
}

.sidebar-item:hover {
    border-left-color: #7F1D1D;
    padding-left: 35px;
    color: #7F1D1D;
    background: rgba(0,0,0,0.02);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    object-fit: contain;
}

.sidebar-text {
    font-size: 15px;
    font-weight: 500;
}

.heropi a {
    font-family: 'Be Vietnam Pro', sans-serif;
    color: #7F1D1D;
    font-size: 23px;
    padding: 0px 0px 0px 25px;
    font-weight: 700;
}

.heropi p {
    color: #A8A29E;
    font-size: 13px;
    padding: 0px 25px;
    font-weight: 500;
    margin-bottom: 20px;
}

/* Адаптивность для sidebar */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        background: #FAFAF9;
        z-index: 1000;
        transition: left 0.3s ease;
        display: block;
    }
    
    .sidebar.active {
        left: 0;
    }
}


















/* ============================================================
   НАВИГАЦИЯ (ВЕРХНЕЕ МЕНЮ)
   ============================================================ */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fefcfb;
    padding: 5px 50px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 99;
    flex-wrap: wrap;
}

.logo img {
    height: 45px;
    width: auto;
    border-radius: 5px;
    object-fit: contain;
    margin: 5px;
}

/* Оверлей для затемнения */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.overlay.active {
    display: block;
}

/* Центральные ссылки навигации */
.nav-links {
    display: flex;
    gap: 5px;
    position: absolute;   
    left: 34%;
    transform: translateX(-50%);
}

.nav-links a {
    color: black;
    text-decoration: none;
    font-size: 20px;
    padding: 8px 13px;
    transition: all 0.3s ease;
    border-radius: 25px;
    font-weight: 540;
    font-family: 'Playfair Display', serif;
}

.nav-links a:hover {
    color: #94162C;
    transform: translateY(-2px);
}

.nav-links a.active {
    color: #94162C;
}

.spacer {
    width: 150px;
}

/* Кнопка для открытия категорий на мобилках — скрыта на десктопе */
.sidebar-toggle {
    display: none;
}

/* ============================================================
   ПРАВАЯ ЧАСТЬ МЕНЮ
   ============================================================ */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    margin-left: auto;
}

/* ============================================================
   ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ (ВЫПАДАЮЩИЙ)
   ============================================================ */
.language-switcher {
    position: relative;
    display: inline-block;
}

/* Кнопка текущего языка */
.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f0ef;
    border: none;
    padding: 6px 12px 6px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    font-family: inherit;
}

.lang-current:hover {
    background: #ece5e3;
}

.lang-current .lang-flag {
    font-size: 16px;
}

.lang-current .lang-code {
    font-weight: 600;
    color: #333;
}

.lang-current .lang-arrow {
    font-size: 10px;
    color: #999;
    transition: transform 0.3s ease;
}

.lang-current.active .lang-arrow {
    transform: rotate(180deg);
}

/* Выпадающий список языков */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.25s ease;
    border: 1px solid #f0ecea;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Скроллбар для выпадающего списка */
.lang-dropdown::-webkit-scrollbar {
    width: 4px;
}
.lang-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.lang-dropdown::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}
.lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Пункты выпадающего списка */
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    font-size: 14px;
}

.lang-option:hover {
    background: #f8f2f0;
    color: #982030;
}

.lang-option.active {
    background: #f8f2f0;
    color: #982030;
    font-weight: 600;
}

.lang-option .lang-flag {
    font-size: 18px;
    flex-shrink: 0;
}

.lang-option .lang-name {
    flex: 1;
}

.lang-option .lang-code-small {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    background: #f5f0ef;
    padding: 2px 8px;
    border-radius: 12px;
}

.lang-option.active .lang-code-small {
    background: #f0e5e2;
    color: #982030;
}

/* Анимация при открытии */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.lang-dropdown.open {
    animation: slideDown 0.2s ease forwards;
}

/* ============================================================
   АВТОРИЗАЦИЯ
   ============================================================ */
.auth-buttons {
    display: flex;
    align-items: center;
}

.btn-login {
    padding: 8px 22px;
    background: transparent;
    color: #333;
    border: 2px solid #ddd;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-login:hover {
    border-color: #982030;
    color: #982030;
    transform: translateY(-2px);
}

/* Меню пользователя (авторизован) */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    background: transparent;
    border: 0px;
}

.user-btn.active .user-arrow {
    transform: rotate(180deg);
}

.user-avatar {
    font-size: 18px;
}

.user-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-arrow {
    font-size: 10px;
    color: #999;
    transition: transform 0.3s ease;
}

/* Выпадающее меню пользователя */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid #f0ecea;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.user-dropdown a:hover {
    background: #f8f2f0;
    color: #982030;
}

.user-dropdown hr {
    margin: 6px 16px;
    border: none;
    border-top: 1px solid #f0ecea;
}

.user-dropdown .logout-link {
    color: #dc3545;
}

.user-dropdown .logout-link:hover {
    background: #fff5f5;
    color: #c62828;
}

/* Кнопка "Создать открытку" */
.btn-create-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #982030;
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(152, 32, 48, 0.25);
}

.btn-create-card .btn-icon {
    font-size: 16px;
}

.btn-create-card:hover {
    background: #6b1522;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(152, 32, 48, 0.35);
}

.btn-create-card:active {
    transform: translateY(0px);
}

/* ============================================================
   БУРГЕР-МЕНЮ — СКРЫТО НА ДЕСКТОПЕ
   ============================================================ */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 100;
}

.burger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #982030;
    border-radius: 3px;
    transition: all 0.3s ease;
}





/* ============================================================
   АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ И ТЕЛЕФОНОВ
   ============================================================ */
@media (max-width: 1000px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 99;
        background: #fefcfb;
        padding: 8px 20px;
        width: 100%;
    }

    .burger-menu {
        display: flex;
    }

    .nav-links {
        position: static;
        transform: none;
        display: flex !important;
        gap: 10px;
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0px;
        font-family: 'Playfair Display', serif;
    }

    .nav-links a {
        padding: 8px 12px;
        font-size: 20px;
        font-family: 'Playfair Display', serif;
    }

    .spacer {
        display: none;
    }
}

@media (max-width: 768px) {
    .spacer {
        display: none;
    }
    
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        background: #FAFAF9;
        z-index: 1000;
        transition: left 0.3s ease;
        display: block;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.active {
        left: 0;
    }
}

@media (max-width: 595px) {
    .nav-links a {
        font-size: 16px;
        font-family: 'Playfair Display', serif;
    }

    .navbar-right {   
        gap: 5px;  
    }

    .btn-create-card {
        gap: 8px;
        padding: 10px 15px;
        font-size: 12px;
    }

    .btn-login {
        padding: 8px 15px;
        font-size: 12px;
    }

    .lang-current {
        gap: 6px;
        padding: 6px 12px 6px 10px;
        font-size: 12px; 
    }

    .logo img {
        height: 35px;
        width: auto;
        border-radius: 5px;
        object-fit: contain;
        margin: 5px;
    }
}

@media (max-width: 478px) {
    .navbar {
        padding: 10px;
    }

    .navbar-right {   
        gap: 5px;  
    }

    .btn-create-card {
        gap: 8px;
        padding: 8px 10px;
        font-size: 10px;
    }

    .user-btn {
        gap: 3px;
        padding: 8px 5px 8px 5px;
        font-size: 10px;
        max-width: 85px;
    }

    .btn-login {
        padding: 7px 10px;
        font-size: 10px;
    }

    .lang-current {
        gap: 3px;
        padding: 6px 10px 6px 8px;
        font-size: 10px; 
    }

    .logo img {
        height: 28px;
        width: auto;
        border-radius: 5px;
        object-fit: contain;
        margin: 5px;
    }
}

@media (max-width: 377px) {
    .navbar {
        padding: 6px 8px;
    }

    .logo img {
        height: 20px;
    }

    .nav-links {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 5px;
    }

    .nav-links a {
        font-size: 13px;
        padding: 4px 8px;
    }

    .navbar-right {
        gap: 4px;
    }

    .btn-create-card {
        padding: 5px 8px;
        font-size: 8px;
        gap: 1px;
    }

    .user-btn {
        gap: 2px;
        padding: 3px 3px 3px 3px;
        font-size: 8px;
        max-width: 70px;
    }

    .btn-login {
        padding: 5px 8px;
        font-size: 8px;
    }

    .lang-current {
        padding: 4px 6px;
        font-size: 8px;
        gap: 2px;
    }

    .lang-current .lang-arrow {
        font-size: 7px;
    }
}


.pipi {
    height: 35px;
}




@media (max-width: 478px) {

.pipi {
    height: 27px;
}
}

@media (max-width: 377px) {

.pipi {
    height: 22px;
}
}



/* ============================================================
   АДАПТАЦИЯ ПЕРЕКЛЮЧАТЕЛЯ ЯЗЫКОВ ДЛЯ ТЕЛЕФОНОВ
   ============================================================ */

/* Планшеты и маленькие ноутбуки */
@media (max-width: 1024px) {
    .lang-current {
        padding: 4px 10px;
        font-size: 12px;
    }

    .lang-current .lang-code {
        font-size: 11px;
    }

    .lang-current .lang-arrow {
        font-size: 8px;
    }

    .lang-dropdown {
        min-width: 160px;
    }

    .lang-option {
        padding: 8px 14px;
        font-size: 13px;
    }

    .lang-option .lang-flag {
        font-size: 16px;
    }
}

/* Телефоны (768px и меньше) */
@media (max-width: 768px) {
    .language-switcher {
        position: relative;
    }

    .lang-current {
        padding: 4px 8px;
        font-size: 11px;
        border-radius: 14px;
        gap: 4px;
    }

    .lang-current .lang-code {
        font-size: 10px;
    }

    .lang-current .lang-arrow {
        font-size: 7px;
    }

    .lang-dropdown {
        position: absolute;
        top: calc(100% + 4px);
        right: 0;
        left: auto;
        min-width: 150px;
        max-height: 300px;
        border-radius: 12px;
        padding: 6px 0;
        transform: translateY(-10px) scale(0.95);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
        border: 1px solid #f0ecea;
        background: white;
        /* Убираем всё лишнее */
        width: auto;
        bottom: auto;
    }

    .lang-dropdown::after {
        display: none; /* Убираем iOS-полоску */
    }

    .lang-dropdown.open {
        transform: translateY(0) scale(1);
        opacity: 1;
        visibility: visible;
    }

    /* Убираем затемнение фона */
    .lang-dropdown.open::before {
        display: none;
    }

    .lang-option {
        padding: 8px 14px;
        font-size: 13px;
        gap: 8px;
        border-bottom: none;
        justify-content: flex-start;
    }

    .lang-option .lang-flag {
        font-size: 16px;
    }

    .lang-option .lang-name {
        font-size: 13px;
    }

    .lang-option .lang-code-small {
        font-size: 10px;
        padding: 1px 8px;
    }
}

/* Маленькие телефоны (480px и меньше) */
@media (max-width: 480px) {
    .lang-current {
        padding: 3px 6px;
        font-size: 10px;
        border-radius: 12px;
        gap: 3px;
    }

    .lang-current .lang-code {
        font-size: 9px;
    }

    .lang-current .lang-arrow {
        font-size: 6px;
    }

    .lang-dropdown {
        min-width: 130px;
        max-height: 250px;
        padding: 4px 0;
        border-radius: 10px;
        right: -10px; /* Смещаем, чтобы не вылезало за экран */
    }

    .lang-option {
        padding: 6px 12px;
        font-size: 12px;
        gap: 6px;
    }

    .lang-option .lang-flag {
        font-size: 14px;
    }

    .lang-option .lang-name {
        font-size: 12px;
    }

    .lang-option .lang-code-small {
        font-size: 9px;
        padding: 1px 6px;
    }
}

/* Очень маленькие телефоны (377px и меньше) */
@media (max-width: 377px) {
    .lang-current {
        padding: 2px 5px;
        font-size: 8px;
        border-radius: 10px;
        gap: 2px;
    }

    .lang-current .lang-code {
        font-size: 8px;
    }

    .lang-current .lang-arrow {
        font-size: 5px;
    }

    .lang-dropdown {
        min-width: 110px;
        max-height: 200px;
        padding: 4px 0;
        border-radius: 8px;
        right: -5px;
    }

    .lang-option {
        padding: 5px 10px;
        font-size: 11px;
        gap: 5px;
    }

    .lang-option .lang-flag {
        font-size: 12px;
    }

    .lang-option .lang-name {
        font-size: 11px;
    }

    .lang-option .lang-code-small {
        font-size: 8px;
        padding: 0px 5px;
    }
}