/* Common Styles - Общие стили для всех страниц сайта "Новая Страница" (банкротство) */

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

/* CSS Variables */
:root {
    --primary-color: #5d9ba4;
    --secondary-color: #2d3e50;
    --accent-color: #5d9ba4;
    --orange-accent: #f26651;
    --white: #ffffff;
    --light-gray: #f3f4f6;
    --text-dark: #333333;
    --text-light: #666;
}

/* Base Styles */
body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

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

/* Header */
header {
    background: transparent;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s;
}

header.scrolled {
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

header .container {
    background: var(--white);
    padding: 12px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    max-width: 90%;
    margin: 0 auto;
    overflow: visible;
}

.logo {
    flex-shrink: 0;
    min-width: 120px;
    display: block;
    order: 1;
}

.logo a {
    display: block;
    text-decoration: none;
    line-height: 0;
}

.logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
    display: block;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: center;
    flex: 1;
    justify-content: center;
    min-width: 0;
    order: 2;
    overflow: visible;
}

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    padding-bottom: 5px;
}

nav a:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

nav a:hover:before {
    width: 100%;
}

.header-contacts {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    order: 3;
}

.phone {
    font-size: 16px;
    font-weight: 700;
    color: var(--orange-accent);
    text-decoration: none;
    transition: opacity 0.3s;
}

.phone:hover {
    opacity: 0.8;
}

.btn-cabinet {
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 18px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-cabinet:hover {
    background: #4e8991;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    order: 2;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h3 {
    color: var(--white);
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 700;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Навигация: межстрочный интервал (специфичность + !important из-за возможных переопределений) */
#contacts .footer-top .footer-col ul li {
    margin-bottom: 4px !important;
}

#contacts .footer-top .footer-col ul li a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 14px;
    line-height: 0.85 !important;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
}

.footer-col p {
    color: #cbd5e0;
    font-size: 13px;
    line-height: 1.6;
}

.logo-footer {
    height: 55px;
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.social-links a {
    display: inline-block;
    transition: transform 0.3s;
}

.social-links a:hover {
    transform: scale(1.1);
}

.social-links img {
    width: 28px;
    height: 28px;
    opacity: 0.9;
    transition: opacity 0.3s, transform 0.3s;
    /* Белые иконки, прозрачный фон (без голубого круга) */
    filter: brightness(0) invert(1);
}

.social-links a:hover img {
    opacity: 1;
    transform: scale(1.15);
}

.footer-description {
    color: #cbd5e0;
    font-size: 13px;
    line-height: 1.5;
}

.footer-requisites {
    color: #cbd5e0;
    font-size: 12px;
    line-height: 1.5;
}

.footer-legal-full {
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.footer-legal-full p {
    color: #cbd5e0;
    font-size: 12px;
    line-height: 1.6;
    text-align: justify;
}

.footer-bottom {
    text-align: center;
}

.footer-copyright {
    color: #cbd5e0;
    font-size: 14px;
}

/* Buttons */
.btn {
    padding: 18px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--orange-accent);
    color: var(--white);
}

.btn-primary:hover {
    background: #e5533f;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1024px) {
    header .container {
        max-width: 95%;
        padding: 12px 20px;
    }

    nav {
        gap: 15px;
    }

    nav a {
        font-size: 14px;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Средняя ширина: nav на отдельной строке на всю ширину — все 8 пунктов видны */
@media (min-width: 769px) and (max-width: 1100px) {
    nav {
        flex: 1 1 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    nav {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 10px;
        transform: translateX(-100%);
        transition: transform 0.3s;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        z-index: 999;
    }

    nav.active {
        transform: translateX(0);
    }

    nav a {
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid var(--light-gray);
    }

    .header-contacts {
        flex-direction: row;
        gap: 15px;
    }

    header .container {
        flex-wrap: wrap;
    }

    .logo img {
        height: 40px;
    }

    .footer-top {
        gap: 25px;
    }

    .social-links {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .header-contacts {
        flex-direction: column;
        width: 100%;
        order: 3;
        margin-top: 10px;
    }

    .btn-cabinet {
        width: 100%;
        text-align: center;
    }
}

/* ==================== BLOG ARTICLE SIDEBAR STYLES ==================== */
/* Стили для боковой панели (sidebar) в статьях блога */

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.back-to-blog:hover {
    background: #f7fafc;
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateX(-3px);
}

.back-to-blog::before {
    content: "←";
    font-size: 1.2rem;
}

.categories-sidebar {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.categories-sidebar h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    margin-bottom: 0.5rem;
}

.category-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-btn:hover {
    background: #f7fafc;
    border-color: var(--accent-color);
}

.category-btn.active {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

.related-articles {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.related-articles h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1.25rem;
}

.related-article-item {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    transition: transform 0.2s ease;
}

.related-article-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.related-article-item:hover {
    transform: translateX(5px);
}

.related-article-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.related-article-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-article-date {
    font-size: 0.8rem;
    color: #718096;
}

/* Адаптивные стили для sidebar */
@media (max-width: 992px) {
    .categories-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .categories-list li {
        margin-bottom: 0;
    }

    .category-btn {
        width: auto;
        padding: 0.6rem 1rem;
        white-space: nowrap;
    }

    .related-articles {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .related-article-item {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .related-articles {
        grid-template-columns: 1fr;
    }
}
