/* ============================================
   EDUNIX — стили
   Палитра: Небесный (белый + синий)
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Geologica:wght@300;400;500;600&family=Unbounded:wght@500;600&display=swap");

/* ============================================
   CSS-переменные
   ============================================ */
:root {
    --bg: #f0f7ff;
    --surface: #ffffff;
    --surface-2: #e8f3fd;
    --border: #c2d9f0;
    --border-soft: #ddeefa;
    --accent: #2479c7;
    --accent-hover: #1a5fa0;
    --accent-light: #ebf4fd;
    --text: #0b1d33;
    --text-muted: #3d6390;
    --text-faint: #7aadd6;
    --link: #1a5fa0;

    --nav-h: 52px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --font-display: "Unbounded", sans-serif;
    --font-body: "Geologica", sans-serif;

    --shadow-card: 0 2px 12px rgba(36, 121, 199, 0.08);
    --shadow-hover: 0 8px 28px rgba(36, 121, 199, 0.16);
}

/* ============================================
   Сброс и база
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.25;
    color: var(--text);
}

a {
    color: var(--link);
}
img {
    display: block;
    max-width: 100%;
}

/* ============================================
   Навигация
   ============================================ */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--nav-h);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-soft);
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo span {
    color: var(--accent);
}

/* Поиск в навбаре */
.nav-search {
    flex: 1;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 0 8px 0 12px;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.nav-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(36, 121, 199, 0.12);
    background: var(--surface);
}

.nav-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text);
    padding: 7px 0;
    outline: none;
    min-width: 0;
}

.nav-search input::placeholder {
    color: var(--text-faint);
}

.nav-search button {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-search button:hover {
    background: var(--accent-hover);
}

/* Ссылки навигации */
.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-links li a {
    display: block;
    padding: 6px 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition:
        color 0.2s,
        background 0.2s;
    white-space: nowrap;
}

.nav-links li a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-links li a.active {
    color: var(--accent);
    background: var(--accent-light);
}

/* ============================================
   Основной контейнер страниц
   ============================================ */
.page-wrap {
    max-width: 1440px;
    margin: 0 auto;
    padding: 40px 32px 64px;
}

/* ============================================
   Секция-заголовок
   ============================================ */
.section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 24px;
}

.section-header h1 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.section-header .count {
    font-size: 13px;
    color: var(--text-faint);
    font-weight: 400;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 48px 0;
}

/* ============================================
   Карточки статей
   ============================================ */
.article_all {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

.article {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s;
    box-shadow: var(--shadow-card);
}

.article:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border);
}

.article-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

/* Заглушка если нет картинки */
.article-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-thumb-placeholder svg {
    opacity: 0.25;
}

.article-body {
    padding: 14px 16px 16px;
}

.article-body h2 {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text);
    /* обрезаем длинные названия */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-body .date {
    font-size: 12px;
    color: var(--text-faint);
    margin: 0;
}

/* ============================================
   Карточки презентаций / литературы
   ============================================ */
.post_all {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.post {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border);
}

.post h2 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.post h3 {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.post-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-light);
    border-radius: 4px;
    padding: 2px 8px;
    width: fit-content;
}

.post .btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 8px 14px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    width: fit-content;
}

.post .btn-download:hover {
    background: var(--accent-hover);
}

/* ============================================
   Ресурсы
   ============================================ */
.urls_all {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.urls {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.urls:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border);
}

.urls h2 {
    font-size: 14px;
    font-weight: 600;
}

.urls a {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.urls a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ============================================
   Страница статьи
   ============================================ */
.article-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 32px 64px;
}

.article-detail {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 5vw, 48px);
    box-shadow: var(--shadow-card);
}

.article-title {
    font-family: var(--font-display);
    font-size: clamp(20px, 3.5vw, 30px);
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.article-cover {
    width: 100%;
    border-radius: var(--radius-md);
    margin: 24px 0;
    object-fit: cover;
    aspect-ratio: 16 / 7;
}

.article-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-faint);
    background: var(--surface-2);
    border-radius: 6px;
    padding: 4px 10px;
    margin-bottom: 20px;
}

.article-source {
    margin: 0 0 28px;
    padding: 14px 18px;
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.article-source span {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.article-source a {
    color: var(--link);
    text-decoration: none;
    word-break: break-all;
    font-size: 13.5px;
}

.article-source a:hover {
    text-decoration: underline;
}

.article-content {
    font-size: clamp(15px, 1.8vw, 16.5px);
    line-height: 1.8;
    color: var(--text);
}

.article-content p {
    margin: 0 0 18px;
}

.article-content h2,
.article-content h3 {
    margin: 32px 0 14px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
}

.article-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.article-content code {
    font-size: 13.5px;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 1px 5px;
}

.article-content pre {
    background: var(--text);
    color: #e2f0ff;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.6;
    margin: 20px 0;
}

.article-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.article-back {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-soft);
}

.article-back a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.article-back a:hover {
    color: var(--accent);
}

/* ============================================
   Адаптив
   ============================================ */
@media (max-width: 1280px) {
    .article_all {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .article_all {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .page-wrap {
        padding: 28px 20px 48px;
    }

    .article_all {
        grid-template-columns: repeat(2, 1fr);
    }

    .post_all {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-page {
        padding: 24px 16px 48px;
    }
}

@media (max-width: 600px) {
    .nav-container {
        padding: 0 16px;
        gap: 12px;
    }

    .nav-search {
        max-width: none;
        flex: 1;
    }

    .nav-links {
        display: none; /* на мобиле скрываем, можно добавить бургер */
    }

    .article_all,
    .post_all,
    .urls_all {
        grid-template-columns: 1fr;
    }

    .article-detail {
        padding: 20px;
    }
}
