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

body {
    font-family: 'Inter', sans-serif;
    background: #f4f6f8;
    color: #1f2933;
    line-height: 1.6;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* HEADER */

.header {
    background: #111827;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    height: 64px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
}

/* Ссылка в логотипе */
.logo a {
    color: inherit;       /* наследует цвет заголовка */
    text-decoration: none;
}

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

.nav a {
    margin-right: 20px;
    color: #e5e7eb;
}

.nav a:last-child {
    margin-right: 0;
}

.right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang a {
    font-size: 14px;
    color: #9ca3af;
}

/* Burger */

.burger {
    display: none;
    background: transparent !important;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

/* Mobile menu */

.mobile-nav {
    display: none;
    flex-direction: column;
    background: #111827;
    padding: 16px 20px;
}

.mobile-nav a {
    color: #e5e7eb;
    padding: 10px 0;
}

.mobile-nav hr {
    border: none;
    border-top: 1px solid #374151;
    margin: 10px 0;
}

/* MAIN */

.posts-centered {
    max-width: 900px;
    margin: 40px auto 0;
}

/* POSTS */

.post-card {
    background: #fff;
    padding: 28px;
    border-radius: 14px;
    margin-bottom: 28px;
    transition: transform .2s, box-shadow .2s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.post-card h2 {
    margin-bottom: 12px;
    font-size: 24px;
}

.excerpt {
    color: #4b5563;
    margin-bottom: 16px;
}

.meta {
    font-size: 14px;
    color: #6b7280;
}

/* ARTICLE PAGE (для отдельной статьи) */

.post-article {
    max-width: 960px;
    margin: 40px auto;
    background: #fff;
    padding: 36px;
    border-radius: 14px;
}

/* Ссылка в заголовке статьи */
.post-article h1 a {
    color: inherit;       /* наследует цвет заголовка */
    text-decoration: none;
}

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

.post-article h1 {
    font-size: 32px;
    margin-bottom: 16px;
}

.post-content {
    font-size: 19px;
    line-height: 1.8;
    color: #1f2933;
}

.post-content p {
    margin-bottom: 16px;
}

.post-content h2,
.post-content h3 {
    margin-top: 24px;
    margin-bottom: 12px;
}

.post-content pre {
    background: #f4f4f5;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.post-content code {
    background: #f4f4f5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* FOOTER */

.footer {
    background: #111827;
    color: #9ca3af;
    margin-top: 80px;
    padding: 20px 0;
    text-align: center;
}

/* MOBILE */

@media (max-width: 900px) {
    .nav {
        display: none;
    }

    .burger {
        display: block;
    }

    .mobile-nav {
        display: none;
    }
}

.mobile-nav.open {
    display: flex;
}
/* INPUT и TEXTAREA */
input,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;   /* светлая серая граница */
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    color: #1f2933;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
}

/* Фокус */
input:focus,
textarea:focus {
    border-color: #2563eb;        /* синий акцент */
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Плейсхолдер */
input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

/* Размер textarea по умолчанию */
textarea {
    min-height: 120px;
    resize: vertical; /* можно менять высоту */
}

/* Кнопка отправки формы (пример) */
button,
input[type="submit"] {
    padding: 12px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover,
input[type="submit"]:hover {
    background: #1e40af; /* чуть темнее */
}
/* Ошибка */
input.error,
textarea.error {
    border-color: #ef4444; /* красная граница */
}

input.error:focus,
textarea.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}
/* Сообщения под полем (опционально) */
.form-message {
    font-size: 14px;
    margin-top: -12px;
    margin-bottom: 12px;
}

.form-message.error {
    color: #ef4444;
}


/* Красный фон/блок — ошибка */
.bg-error {
    background-color: #fee2e2; /* светло-красный фон */
    color: #991b1b; /* темный красный текст */
    padding: 8px 12px;
    border-radius: 6px;
}

/* Зелёный фон/блок — успех */
.bg-success {
    background-color: #dcfce7; /* светло-зелёный фон */
    color: #166534; /* темный зеленый текст */
    padding: 8px 12px;
    border-radius: 6px;
}

/* Контейнер пагинации */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 40px 0;
    font-family: 'Inter', sans-serif;
}

/* Кнопки пагинации */
.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 16px;
    background: #fff;
    color: #2563eb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 80px;
    text-align: center;
}

/* Hover для ссылок */
.pagination a:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* Текущая страница */
.pagination span.current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    cursor: default;
}

/* Заблокированные кнопки (например, нет предыдущей) */
.pagination a.disabled {
    color: #9ca3af;
    border-color: #d1d5db;
    background: #f4f4f8;
    pointer-events: none;
}
.category-header {
    max-width: 960px;         /* совпадает с шириной статей */
    margin: 40px auto 24px;   /* сверху и снизу отступы */
    padding: 16px 20px;
    background: #e0f2fe;      /* светлый голубой фон */
    color: #0369a1;           /* темно-голубой текст */
    border-radius: 12px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}
.breadcrumb-wrapper {
    max-width: 960px;           /* совпадает с шириной контента */
    margin: 16px auto 32px;     /* отступ сверху и снизу */
    padding: 12px 20px;         /* внутренние отступы */
    background-color: #f3f4f6;   /* светло-серый фон */
    border-radius: 12px;         /* скругление */
    border: 1px solid #e5e7eb;  /* очень светлая граница, почти незаметная */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* лёгкая тень */
    font-size: 14px;
    color: #1f2933;             /* тёмный текст */
    display: inline-block;       /* ширина под контент */
}

/* Ссылки внутри breadcrumb */
.breadcrumb-wrapper a {
    color: #2563eb;             /* синий цвет ссылок */
    text-decoration: none;
}

.breadcrumb-wrapper a:hover {
    text-decoration: underline;
}

/* Разделитель */
.breadcrumb-wrapper span.separator {
    margin: 0 6px;
    color: #6b7280;             /* светло-серый разделитель */
}
.link-box {
    max-width: 960px;
    margin: 24px auto;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;     /* аккуратная рамка */
    border-radius: 12px;
}

.link-box-item {
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.link-box-item:last-child {
    border-bottom: none;
}

.link-box-item a {
    color: #2563eb;
    font-size: 16px;
    text-decoration: none;
}

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

.bb-toolbar {
  margin-bottom: 6px;
}
.bb-toolbar button {
  padding: 4px 8px;
  cursor: pointer;
}
.select-field {
    width: 100%;
    padding: 12px 44px 12px 16px; /* место под стрелку */
    font-size: 16px;
    font-family: 'Inter', sans-serif;

    color: #1f2933;
    background-color: #ffffff;

    border: 1px solid #d1d5db;
    border-radius: 10px;

    appearance: none;        /* убираем стандартную стрелку */
    -webkit-appearance: none;
    -moz-appearance: none;

    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.select-wrapper {
    position: relative;
    max-width: 960px;
}

.select-wrapper::after {
    content: "▾";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #6b7280;
    pointer-events: none;
}
.select-field:hover {
    border-color: #9ca3af;
}

.select-field:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    outline: none;
}
.touch-links {
    max-width: 960px;
    margin: 32px auto;
    padding: 16px;
    background: #f3f4f6;
    border-radius: 16px;
}

.touch-link {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 20px;
    margin-bottom: 12px;

    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;

    font-size: 17px;
    font-weight: 600;

    color: #1f2933;
    text-decoration: none;

    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.touch-link:last-child {
    margin-bottom: 0;
}

.touch-link:hover {
    background: #f9fafb;
}

/* Тач-эффект */
.touch-link:active {
    transform: scale(0.97);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.12);
}

/* Стрелка справа */
.touch-link::after {
    content: "›";
    font-size: 22px;
    color: #9ca3af;
}
.dark .touch-link {
    background: #111827;
    border: 1px solid #1f2937;
    color: #f9fafb;
}

.dark .touch-link:hover {
    background: #1f2937;
}

.dark .touch-link:active {
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
}

.dark .touch-link::after {
    color: #6b7280;
}

.tags {
    margin-top: 20px;
}

.tags strong {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.tag-button {
    display: inline-block;
    margin: 4px 6px 4px 0;
    padding: 6px 12px;
    font-size: 14px;
    color: #fff;
    background-color: #337ab7;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-button:hover {
    background-color: #23527c;
    transform: translateY(-2px);
}
.post-meta {
    margin: 15px 0;
    font-size: 14px;
    color: #555;
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* расстояние между элементами */
    align-items: center;
}

.post-meta .meta-item {
    display: inline-flex;
    align-items: center;
}

.post-meta .meta-item.date::before {
    content: "\1F4C5"; /* иконка календаря */
    margin-right: 5px;
}

.post-meta .meta-item.category::before {
    content: "\1F4D1"; /* иконка категории */
    margin-right: 5px;
}

.post-meta a {
    color: #337ab7;
    text-decoration: none;
    transition: color 0.3s;
}

.post-meta a:hover {
    color: #23527c;
}
.post-divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, #337ab7, #66c0f4);
    margin: 20px 0;
    border-radius: 1px;
}
/* SHARE */

.share-box {
    margin: 40px 0;
    padding: 20px;
    background: #f1f3f5;
    border-radius: 12px;
}

.share-title {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.share-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, box-shadow .15s ease;
}

.share-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,.15);
}

/* Цвета */

.share-btn.tg { background: #229ED9; }
.share-btn.vk { background: #0077FF; }
.share-btn.tw { background: #111827; }
/* ===== DARK MODE: SHARE ===== */

body.dark .share-box {
    background: #111827;
}

body.dark .share-title {
    color: #9ca3af;
}

body.dark .share-btn {
    box-shadow: 0 4px 10px rgba(0,0,0,.4);
}

body.dark .share-btn:hover {
    box-shadow: 0 10px 22px rgba(0,0,0,.7);
}

/* TAG PAGE */

.tag-header {
    max-width: 720px;
    margin: 40px auto 30px;
}

.tag-header h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.tag-count {
    font-size: 14px;
    color: #6b7280;
}

.empty {
    text-align: center;
    color: #6b7280;
    margin: 40px 0;
}
.post-tags {
    margin-top: 30px;
}

.tag {
    display: inline-block;
    background: #eef2ff;
    color: #3730a3;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    margin: 0 6px 6px 0;
    text-decoration: none;
}
/* TAG HERO */

.tag-hero {
    background: linear-gradient(180deg, #f9fafb, #f3f4f6);
    padding: 60px 20px 50px;
    border-bottom: 1px solid #e5e7eb;
}

.tag-hero-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.tag-badge {
    display: inline-block;
    background: #eef2ff;
    color: #4338ca;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.tag-title {
    font-size: 34px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #111827;
}

.tag-title strong {
    color: #4338ca;
}

.tag-meta {
    font-size: 15px;
    color: #6b7280;
}
.posts-centered {
    margin-top: 40px;
}
/* ================== ТЕМНАЯ ТЕМА ================== */
body.dark {
    background: #121212;
    color: #e5e7eb;
}

body.dark a {
    color: #60a5fa;
}

body.dark a:hover {
    text-decoration: underline;
}

body.dark .header {
    background: #1f2937;
    color: #fff;
}

body.dark .nav a {
    color: #d1d5db;
}

body.dark .mobile-nav {
    background: #1f2937;
}

body.dark .post-card,
body.dark .post-article,
body.dark .category-header,
body.dark .breadcrumb-wrapper,
body.dark .link-box,
body.dark .touch-links,
body.dark .share-box,
body.dark .tag-hero {
    background: #1e1e2e;
    color: #e5e7eb;
    border-color: #374151;
}

body.dark .post-content {
    color: #f3f4f6;
}

body.dark input,
body.dark textarea,
body.dark .select-field {
    background: #1e1e2e;
    color: #e5e7eb;
    border-color: #374151;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
    color: #9ca3af;
}

body.dark button,
body.dark input[type="submit"] {
    background: #2563eb;
    color: #fff;
}

body.dark .footer {
    background: #1f2937;
    color: #d1d5db;
}
.theme-toggle {
    background: transparent !important;  /* полностью прозрачный фон */
    border: none !important;             /* убираем рамку */
    outline: none !important;            /* убираем контур */
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.theme-toggle:hover,
.theme-toggle:focus,
.theme-toggle:active {
    background: transparent !important;  /* прозрачный фон во всех состояниях */
    outline: none !important;            /* убираем контур */
}

.theme-toggle .icon {
    display: inline-block;
    transition: transform 0.3s, opacity 0.3s;
}

.theme-toggle:hover .icon {
    transform: rotate(20deg);            /* лёгкая анимация при наведении */
}
.related-posts {
    margin-top: 60px;
}

.related-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #111827;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.related-card {
    display: block;
    padding: 18px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    transition: all .2s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

.related-name {
    font-size: 16px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 6px;
}

.related-date {
    font-size: 13px;
    color: #6b7280;
}
.vote-box {
    margin-top: 40px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    text-align: center;
}

.vote-title {
    margin-bottom: 14px;
    font-weight: 600;
}

.vote-btn {
    border: none;
    background: #e5e7eb;
    padding: 10px 18px;
    margin: 0 6px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
}

.vote-btn.up:hover { background: #d1fae5; }
.vote-btn.down:hover { background: #fee2e2; }

.vote-msg {
    margin-top: 10px;
    font-size: 14px;
    color: #6b7280;
}
/* ===== DARK MODE ===== */
body.dark .vote-box {
    background: #111827;
    color: #e5e7eb;
}

body.dark .vote-title {
    color: #f3f4f6;
}

body.dark .vote-btn {
    background: #1f2937;
    color: #e5e7eb;
}

body.dark .vote-btn.up:hover {
    background: #064e3b;
}

body.dark .vote-btn.down:hover {
    background: #7f1d1d;
}

body.dark .vote-msg {
    color: #9ca3af;
}
/* ===== DARK MODE: related posts ===== */

body.dark .related-title {
    color: #f3f4f6;
}

body.dark .related-card {
    background: #111827;
    border-color: #1f2937;
}

body.dark .related-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,.6);
}

body.dark .related-name {
    color: #e5e7eb;
}

body.dark .related-date {
    color: #9ca3af;
}
/* ===== TAG CLOUD ===== */

.tag-cloud {
    position: sticky;
    top: 90px;
    width: 260px;
    padding: 18px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
}

.tag-cloud-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #111827;
}

.tag-cloud-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud-item {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    transition: all .15s ease;
}

.tag-cloud-item:hover {
    background: #2563eb;
    color: #fff;
}

/* Размеры тегов */
.tag-size-1 { font-size: 12px; }
.tag-size-2 { font-size: 13px; }
.tag-size-3 { font-size: 14px; }
.tag-size-4 { font-size: 15px; }
.tag-size-5 { font-size: 16px; }
@media (max-width: 1024px) {
    .tag-cloud {
        display: none;
    }
}
body.dark .tag-cloud {
    background: #111827;
    border-color: #1f2937;
}

body.dark .tag-cloud-title {
    color: #f3f4f6;
}

body.dark .tag-cloud-item {
    background: #1f2937;
    color: #d1d5db;
}

body.dark .tag-cloud-item:hover {
    background: #2563eb;
    color: #fff;
}
.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
}

@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
}
.posts-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
}
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.form-box {
    max-width: 420px;
    margin: 60px auto;
    padding: 28px;
    background: #fff;
    border-radius: 14px;
}

.field {
    margin-bottom: 16px;
}

.field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.field-error {
    font-size: 13px;
    color: #dc2626;
    margin-top: 4px;
}

.msg.error {
    background: #fee2e2;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 14px;
}

/* Dark mode */
body.dark .form-box {
    background: #111827;
}

body.dark .field input {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}
