/* Сброс и нормализация */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #FFFFFF;
    font-size: 16px;
    line-height: 1.5;
    color: #1F2937;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Хедер */
header {
    background: #FFFFFF;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 80px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1F2937;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    display: flex;
    align-items: center;
    margin-left: -1rem;
}

.burger-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 60;
    margin-left: auto;
    order: 2;
}

.burger-toggle span {
    width: 100%;
    height: 3px;
    background: #1F2937;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-toggle.active span:nth-child(2) {
    opacity: 0;
}

.burger-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin-left: 7%;
    order: 1;
}

.nav-item {
    position: relative;
    color: #1F2937;
    text-decoration: none;
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-item i {
    font-size: 1rem;
    color: #0066FF;
    transition: color 0.3s;
    margin-right: 0.75rem;
}

.nav-item:hover i {
    color: #0055CC;
}

.nav-item > span {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-item > span::after,
.nav-item > a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: #0066FF;
    transition: width 0.3s;
}

.nav-item:hover > span::after,
.nav-item:hover > a::after {
    width: 100%;
}

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

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: #FFFFFF;
        flex-direction: column;
        align-items: flex-start;
        padding: 4rem 1.5rem;
        transition: right 0.3s ease;
        z-index: 50;
        overflow-y: auto;
        margin-left: 0;
    }

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

    .nav-item {
        width: 100%;
        font-size: 1.25rem;
        padding: 0.5rem 0;
        white-space: nowrap;
    }

    .nav-item i {
        font-size: 1.125rem;
        margin-right: 0.75rem;
    }

    .nav-item > span {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Blog content styles */
.container {
    max-width: 1400px;
    margin: 80px auto 40px;
    padding: 20px;
    flex: 1;
    overflow: visible;
}

.content-wrapper {
    display: flex;
    flex-direction: row-reverse;
    gap: 2rem;
    overflow: visible;
    min-height: 100vh;
}

.post-container {
    flex: 5;
    margin-left: 1rem;
    margin-right: 2rem;
}

h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.post-thumbnail {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-thumbnail-preview {
    width: 100px;
    height: auto;
    float: left;
    margin-right: 1rem;
    border-radius: 4px;
}

.sidebar {
    flex: 1;
    padding: 20px;
    margin-left: 1rem;
    margin-right: 1rem;
    margin-top: 4rem;
    align-self: flex-start;
    height: auto;
}

.sidebar h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    color: #0066FF;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
}

.sidebar ul li a:hover {
    color: #0055CC;
}

.sidebar ul li a.active {
    font-weight: 600;
    color: #003087;
}

.toc {
    position: sticky;
    top: 120px;
    z-index: 20;
    margin-top: 20px;
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toc h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
}

.toc ul {
    list-style: none;
    padding-left: 10px;
}

.toc ul li {
    margin-bottom: 8px;
}

.toc ul li.subheading {
    padding-left: 15px;
}

.toc ul li a {
    color: #0066FF;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.toc ul li a:hover {
    color: #0055CC;
}

.meta {
    display: flex;
    gap: 15px;
    font-size: 1rem;
    color: #4B5563;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta span {
    padding: 5px 10px;
    border-radius: 4px;
    background: #f9f9f9;
}

.meta span i.fa-user {
    color: #0066FF;
}

.meta span i.fa-folder {
    color: #28A745;
}

.meta span i.fa-calendar {
    color: #FF6F61;
}

.meta span i.fa-clock {
    color: #6F42C1;
}

.content {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #000;
}

.content h2, .content h3 {
    margin: 1.5rem 0;
}

.content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

.content iframe {
    max-width: 100%;
    width: 560px;
    height: 315px;
    margin: 10px 0;
}

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    overflow-x: auto;
    display: block;
}

.content th, .content td {
    border: 1px solid #333;
    padding: 10px 12px;
    text-align: left;
}

.content th {
    background-color: #f4f4f4;
    font-weight: 600;
}

.content td {
    background-color: #fff;
}

.content ul, .content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.content a {
    color: #00f;
    text-decoration: none;
}

.content a:visited {
    color: #00f;
}

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

.share-links {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.share-links h3 {
    font-size: 1.25rem;
    margin-right: 20px;
}

.share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.3s;
}

.share-link.facebook {
    background: #3B5998;
    color: #fff;
}

.share-link.twitter {
    background: #1DA1F2;
    color: #fff;
}

.share-link.linkedin {
    background: #0077B5;
    color: #fff;
}

.share-link.reddit {
    background: #FF4500;
    color: #fff;
}

.share-link:hover {
    opacity: 0.9;
}

.share-link i {
    font-size: 1.2rem;
}

/* Footer */
footer {
    background: #1F2937;
    color: #FFFFFF;
    padding: 2rem 0 1rem;
    width: 100%;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #FFFFFF;
}

.footer-section nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section a {
    color: #D1D5DB;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #FFFFFF;
}

.social-links {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.social-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    transition: transform 0.3s;
}

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

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

.footer-bottom p {
    font-size: 0.875rem;
    color: #D1D5DB;
}

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

.footer-legal a {
    color: #D1D5DB;
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-legal a:hover {
    color: #FFFFFF;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 80px auto 20px;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .post-container {
        margin-right: 0;
        margin-left: 0;
    }

    .sidebar {
        display: none;
    }

    h1 {
        font-size: 1.6rem;
    }

    .meta {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 10px;
    }

    .meta span {
        padding: 3px 8px;
    }

    .content iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .share-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .share-links h3 {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-legal {
        justify-content: center;
    }
}