/* =========================================================
   ОБЩИЕ СТИЛИ САЙТА
   Один файл на весь сайт: index.php, article-*.php
   ========================================================= */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =========================================================
   HEADER / NAV
   ========================================================= */

.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    position: relative;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav a {
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    transition: color 0.3s;
}

.nav a:hover {
    color: #6366f1;
}

/* Mobile hamburger toggle (hidden on desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #1e293b;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   HERO (главная страница)
   ========================================================= */

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 32px;
    margin: 40px 0 60px;
    padding: 60px 48px;
    color: white;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero p {
    font-size: 20px;
    opacity: 0.95;
    max-width: 600px;
}

/* =========================================================
   СЕТКА СТАТЕЙ (главная страница)
   ========================================================= */

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
    margin-bottom: 80px;
}

.article-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-content {
    padding: 24px;
}

.card-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.card-title a {
    text-decoration: none;
    color: #1e293b;
    transition: color 0.3s;
}

.card-title a:hover {
    color: #6366f1;
}

.card-excerpt {
    color: #64748b;
    font-size: 15px;
    line-height: 1.5;
}

/* =========================================================
   СТРАНИЦА СТАТЬИ
   ========================================================= */

.article-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 1fr;
    gap: 48px;
    margin: 48px 0;
    align-items: start;
}

.article-content {
    min-width: 0;
}

.article-content h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.article-content h2 {
    font-size: 28px;
    margin: 32px 0 16px;
    font-weight: 600;
}

.article-content h3 {
    font-size: 22px;
    margin: 24px 0 12px;
}

.article-content p {
    margin-bottom: 20px;
    color: #334155;
}

.article-content ul,
.article-content ol {
    margin: 20px 0 20px 30px;
}

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

.article-image {
    width: 100%;
    border-radius: 24px;
    margin: 24px 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    min-width: 0;
}

.sidebar-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
}

.sidebar-list {
    list-style: none;
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.sidebar-list li {
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.sidebar-list li:last-child {
    border: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-list a {
    text-decoration: none;
    color: #1e293b;
    font-weight: 500;
    transition: color 0.3s;
}

.sidebar-list a:hover {
    color: #6366f1;
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 18px;
}

.footer p {
    font-size: 15px;
    line-height: 1.6;
}

.footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: #a855f7;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.copyright {
    text-align: center;
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid #1e293b;
    font-size: 14px;
}

/* =========================================================
   АДАПТИВНОСТЬ
   ========================================================= */

/* Планшеты */
@media (max-width: 1024px) {
    .article-wrapper {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        gap: 32px;
    }

    .hero h1 {
        font-size: 40px;
    }
}

/* Планшеты / крупные телефоны — переключаем на мобильную навигацию и одноколоночную статью */
@media (max-width: 900px) {
    .article-wrapper {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.1);
    }

    .nav.is-open {
        display: flex;
    }

    .nav a {
        padding: 16px 24px;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav a:last-child {
        border-bottom: none;
    }

    .header-inner {
        padding: 16px 0;
    }

    .hero {
        padding: 40px 24px;
        border-radius: 24px;
        margin: 24px 0 40px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero p {
        font-size: 17px;
    }

    .section-title {
        font-size: 26px;
        margin-bottom: 28px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 56px;
    }

    .article-content h1 {
        font-size: 30px;
    }

    .article-content h2 {
        font-size: 22px;
    }

    .article-content h3 {
        font-size: 19px;
    }

    .article-wrapper {
        margin: 28px 0;
    }

    .footer {
        padding: 40px 0 24px;
    }

    .footer-inner {
        gap: 28px;
    }
}

/* Небольшие телефоны */
@media (max-width: 480px) {
    .logo {
        font-size: 22px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 15px;
    }

    .card-content {
        padding: 18px;
    }

    .card-title {
        font-size: 19px;
    }

    .article-content h1 {
        font-size: 25px;
    }

    .article-image {
        border-radius: 16px;
    }

    .sidebar-list {
        padding: 18px;
        border-radius: 18px;
    }
}
