/* Базовые стили с Montserrat */
* {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body { 
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; 
    margin: 0; 
    padding: 0;
    background-color: #f0f0f0;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header { 
    background: #ffffff; 
    padding: 10px 16px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    position: relative;
}

.logo-container {
    flex-shrink: 0;
}

.main-menu-container { 
    display: flex; 
    align-items: center;
}

.main-menu-container a { 
    margin-right: 12px; 
    text-decoration: none; 
    color: #354542; 
    font-weight: 500;
}

.desktop-profile {
    flex-shrink: 0;
}

/* Мобильное меню */
.mobile-menu-container {
    display: none;
    position: relative;
}

.mobile-menu-container a {
    text-decoration: none;
}

.burger-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
}

.burger-line {
    width: 100%;
    height: 3px;
    background-color: #354542;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.burger-menu-btn.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu-btn.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu-btn.active .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: right 0.3s ease;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background-color: #ffffff;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.mobile-menu-list {
    margin-bottom: 30px;
}

.mobile-menu-list .card {
    border: none;
    padding: 0;
    margin-bottom: 15px;
    background: none;
}

.mobile-menu-list .card a {
    display: block;
    padding: 12px 0;
    text-decoration: none;
    color: #354542;
    font-weight: 500;
    border-bottom: 1px solid #eee;
    transition: color 0.2s;
}

.mobile-menu-list .card a:hover {
    color: #007bff;
}

.mobile-menu-list .menu-item {
    margin-left: 20px;
    margin-top: 10px;
}

.mobile-profile-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.mobile-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    text-decoration: none;
    color: #354542;
    font-weight: 500;
    transition: color 0.2s;
}

.mobile-profile-btn:hover {
    color: #007bff;
}

.container { 
    padding: 16px; 
    /* max-width: 960px; */ 
    margin: 0 auto; 
}

.list { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 8px; 
}

/* Сетка для рецептов и продуктов - 3 в ряд */
.recipe-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Стили для карточек рецептов */
.recipe-card {
    display: flex;
    flex-direction: column;
    padding-top: 0!important;
    padding-left: 0!important;
    padding-right: 0!important;
}

.recipe-card h3 {
    margin-top: 12px;
    margin-bottom: 8px;
    margin-left: 12px;
    margin-right: 12px;
    font-size: 18px;
    font-weight: 600;
}

.recipe-short-description {
    margin-bottom: 12px;
    margin-left: 12px;
    margin-right: 12px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
}

.recipe-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
    margin-left: 12px;
    margin-right: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.recipe-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px;
    /* background-color: #f8f9fa; */
    border-radius: 4px;
}

.recipe-stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipe-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #354542;
}

.difficulty-icons {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.chef-hat-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    position: relative;
}

.chef-hat-icon::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 0;
    width: 100%;
    height: 60%;
    background: currentColor;
    clip-path: polygon(0 100%, 15% 0, 50% 15%, 85% 0, 100% 100%);
    border-radius: 2px 2px 0 0;
}

.chef-hat-icon::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 30%;
    width: 40%;
    height: 35%;
    background: currentColor;
    border-radius: 0 0 1px 1px;
}

.chef-hat-green {
    color: #90EE90;
}

.chef-hat-yellow {
    color: #FFD700;
}

.chef-hat-red {
    color: #FF6B6B;
}

.chef-hat-gray {
    color: #CCCCCC;
}

.recipe-card .thumbnail-image {
    border-radius: 5px 5px 0 0;
}

/* Адаптивность для сетки */
@media (max-width: 1024px) {
    .recipe-grid, .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .recipe-grid, .product-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.card { 
    border: 1px solid #ddd; 
    padding: 12px; 
    border-radius: 6px; 
}

.main-menu-container .card,
.mobile-menu-content .card { 
    border: none; 
}

footer { 
    padding: 12px 16px; 
    color: #777; 
    font-size: 12px; 
}

/* Типографика */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #354542;
}

p, span, div, a {
    font-family: 'Montserrat', sans-serif;
    color: #354542;
}

/* Стили для карточек с кликом */
.card.clickable {
    cursor: pointer;
}

.card.clickable:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

/* Стили для изображений */
.thumbnail-container {
    margin-bottom: 15px;
}

.thumbnail-container.centered {
    text-align: center;
}

.thumbnail-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
}

/* Стили для горизонтального расположения в карточках блога */
.blog-card-horizontal {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.blog-card-horizontal .thumbnail-container {
    flex-shrink: 0;
    width: 400px;
    margin-bottom: 0;
}

.blog-card-horizontal .thumbnail-image {
    width: 400px;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.blog-card-horizontal .card-content {
    flex: 1;
    min-width: 0;
}

.main-image-container {
    margin: 20px 0;
}

.main-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Стили для аватаров профилей */
.profile-avatar-list {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #ddd;
}

.profile-avatar-detail {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Стили для кнопок загрузки */
.load-more-container {
    text-align: center;
    margin-top: 20px;
}

.load-more-btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}

.load-more-btn:hover {
    background-color: #0056b3;
}

.htmx-indicator {
    margin-top: 10px;
}

/* Стили для хлебных крошек */
.breadcrumbs {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs a {
    color: #007bff;
    text-decoration: none;
    padding: 5px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.breadcrumbs a:hover {
    background-color: #e9ecef;
}

.breadcrumbs .separator {
    margin: 0 8px;
    color: #666;
}

.breadcrumbs .current {
    color: #354542;
    font-weight: 500;
    padding: 5px 8px;
}

/* Стили для меню */
.menu-item {
    margin-left: 12px;
}

/* Стили для форм поиска */
.search-form {
    margin-bottom: 12px;
}

.search-hint {
    font-size: 12px;
    color: #777;
}

.search-instruction {
    margin-top: 12px;
    font-size: 12px;
    color: #777;
}

/* Стили для контента блога */
.blog-content {
    line-height: 1.8;
}

.blog-content .card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.blog-content h3 {
    color: #354542;
    margin-bottom: 15px;
}

.blog-content ul {
    padding-left: 20px;
}

.blog-content li {
    margin-bottom: 8px;
}

.blog-content a {
    color: #007bff;
    text-decoration: none;
}

.blog-content a:hover {
    text-decoration: underline;
}

/* Стили для блоков контента */
.content-blocks {
    margin-top: 20px;
}

.editor-block {
    margin-bottom: 16px;
}

.editor-block.type-header {
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
}

.editor-block.type-paragraph {
    line-height: 1.8;
}

.editor-block.type-list {
    padding-left: 20px;
}

/* Стили для TOC */
.toc-item {
    margin-bottom: 4px;
}

.toc-item a {
    color: #007bff;
    text-decoration: none;
}

.toc-item a:hover {
    text-decoration: underline;
}

/* Стили для превью рецептов */
.recipe-preview {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Стили для детальных страниц авторов */
.author-posts {
    margin-top: 20px;
}

.author-posts h3 {
    margin-bottom: 15px;
}

.author-posts .card {
    margin: 8px 0;
}

.author-posts .card h4 {
    margin-bottom: 8px;
}

.author-no-posts {
    margin-top: 20px;
    color: #777;
}

/* Стили для динамических отступов TOC */
.toc-item {
    margin-bottom: 4px;
}

/* Стили для контейнеров с отступами */
.author-posts-container {
    margin-top: 20px;
}

.author-posts-container h3 {
    margin-bottom: 15px;
}

.author-posts-container .card {
    margin: 8px 0;
}

.author-posts-container .card h4 {
    margin-bottom: 8px;
}

/* Стили для контейнера аватара автора */
.author-avatar-container {
    margin: 20px 0;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }
    
    .card {
        padding: 8px;
    }
    
    .thumbnail-image {
        height: 150px;
    }
    
    .profile-avatar-list {
        width: 80px;
        height: 80px;
    }
    
    .profile-avatar-detail {
        width: 150px;
        height: 150px;
    }
    
    /* На мобильных устройствах возвращаем вертикальное расположение для карточек блога */
    .blog-card-horizontal {
        display: block;
    }
    
    .blog-card-horizontal .thumbnail-container {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .blog-card-horizontal .thumbnail-image {
        width: 100%;
        height: 200px;
    }
    
    .blog-card-horizontal .card-content {
        flex: none;
    }
    
    /* Мобильное меню - показываем бургер, скрываем десктопное меню */
    .mobile-menu-container {
        display: block;
    }
    
    .desktop-menu {
        display: none;
    }
    
    .desktop-profile {
        display: none;
    }
}

@media (max-width: 480px) {
    /* header {
        flex-direction: column;
        align-items: flex-start;
    } */
    
    .main-menu-container {
        margin-top: 10px;
        width: 100%;
    }
    
    .thumbnail-image {
        height: 120px;
    }
}
