/* ===== Страница статьи ===== */

/* Breadcrumb */
.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--gap);
    font-size: 13px;
    font-weight: 500;
}

.article-breadcrumb a {
    color: var(--fifth-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: opacity 0.2s ease;
}

.article-breadcrumb a:hover {
    opacity: 0.7;
}

.article-breadcrumb span {
    color: rgba(255, 255, 255, 0.3);
}

.breadcrumb-current {
    color: rgba(255, 255, 255, 0.45) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Article page main area */
.article-page {
    min-width: 0; /* Prevent grid blowout */
}

/* Hero image */
.article-hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: var(--gap);
}

.article-hero-img {
    width: 100%;
    aspect-ratio: 16 / 7;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.article-hero-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    font-family: "Iosevka Charon", monospace;
}

/* Article header */
.article-header {
    margin-bottom: var(--gap);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-rubric {
    display: inline-block;
    color: var(--fifth-color);
    font-family: "Iosevka Charon", monospace;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.article-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--second-color);
    margin: 0;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.article-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
}

.article-author {
    color: var(--second-color);
    font-weight: 500;
}

.article-meta-sep {
    opacity: 0.3;
}

.article-read-time {
    font-size: 13px;
    color: var(--fifth-color);
    font-family: "Iosevka Charon", monospace;
    font-weight: 500;
    background: rgba(141, 198, 63, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Article body */
.article-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: var(--gap);
}

.article-body p {
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 400;
}

.article-lead {
    font-size: 22px !important;
    line-height: 1.55 !important;
    color: var(--second-color) !important;
    font-weight: 500 !important;
}

.article-h2 {
    font-family: "Iosevka Charon", monospace;
    font-size: 24px;
    font-weight: 500;
    color: var(--second-color);
    margin: 10px 0 0;
    line-height: 1.3;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    color: var(--fifth-color);
    font-family: "Iosevka Charon", monospace;
    font-weight: 500;
    line-height: 1.3;
    margin: 10px 0 0;
}

.article-body h2 { font-size: 24px; }
.article-body h3 { font-size: 20px; }
.article-body h4 { font-size: 18px; }

/* Цитата — article-quote (manual) */
.article-quote {
    margin: 0;
    padding: 24px 28px;
    border-left: 3px solid var(--fifth-color);
    background: var(--third-color);
    border-radius: 0 12px 12px 0;
}

.article-quote p {
    font-family: "Iosevka Charon", monospace;
    font-size: 20px !important;
    font-style: italic;
    line-height: 1.5 !important;
    color: var(--second-color) !important;
    margin: 0 0 12px !important;
}

.article-quote cite {
    font-size: 13px;
    color: var(--fifth-color);
    font-style: normal;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Врезка-факт — article-inset (manual) */
.article-inset {
    background: var(--third-color);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.article-inset-label {
    color: var(--fifth-color);
    font-family: "Iosevka Charon", monospace;
    font-size: 13px;
    font-weight: 400;
}

.article-inset p {
    font-size: 15px !important;
    line-height: 1.55 !important;
    color: rgba(255, 255, 255, 0.75) !important;
    margin: 0 !important;
}

/* ===== Editor.js longread blocks ===== */

/* ── Цитата (longread-quote) ── */
.longread-quote {
    margin: 8px 0;
    padding: 24px 28px;
    border-left: 3px solid var(--fifth-color);
    background: var(--third-color);
    border-radius: 0 12px 12px 0;
}

.longread-quote blockquote {
    font-family: "Iosevka Charon", monospace;
    font-size: 20px;
    font-style: italic;
    line-height: 1.5;
    color: var(--second-color);
    margin: 0 0 12px;
    padding: 0;
    border: none;
}

.longread-quote figcaption {
    font-size: 13px;
    color: var(--fifth-color);
    font-style: normal;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.longread-quote figcaption::before {
    content: '— ';
}

/* ── Врезка / Факт (longread-inset / warning block) ── */
.longread-inset {
    margin: 8px 0;
    background: var(--third-color);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 3px solid var(--fifth-color);
}

.longread-inset .inset-label {
    color: var(--fifth-color);
    font-family: "Iosevka Charon", monospace;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.longread-inset .inset-label::before {
    content: '｢ ';
}

.longread-inset .inset-label::after {
    content: ' ｣';
}

.longread-inset p {
    font-size: 15px !important;
    line-height: 1.55 !important;
    color: rgba(255, 255, 255, 0.75) !important;
    margin: 0 !important;
}

/* ── Изображение (longread-image) ── */
.longread-image {
    margin: 8px 0;
}

.longread-image img {
    width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 12px;
    object-fit: contain;
    background: var(--third-color);
}

.longread-image figcaption {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 10px;
    text-align: center;
    font-family: "Iosevka Charon", monospace;
}

/* ── Списки ── */
.article-body ul,
.article-body ol {
    margin: 4px 0;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.article-body li {
    font-size: 18px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.85);
}

.article-body ul li::marker {
    color: var(--fifth-color);
}

.article-body ol li::marker {
    color: var(--fifth-color);
    font-family: "Iosevka Charon", monospace;
    font-weight: 600;
}

/* ── Разделитель ── */
.article-body hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 16px 0;
    position: relative;
}

.article-body hr::before {
    content: '***';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--main-color, #111);
    padding: 0 16px;
    color: rgba(255, 255, 255, 0.2);
    font-family: "Iosevka Charon", monospace;
    font-size: 14px;
    letter-spacing: 6px;
}

/* ── Таблица ── */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 15px;
    background: var(--third-color);
    border-radius: 12px;
    overflow: hidden;
}

.article-body table th {
    background: rgba(141, 198, 63, 0.08);
    color: var(--fifth-color);
    font-family: "Iosevka Charon", monospace;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.article-body table td {
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.article-body table tr:last-child td {
    border-bottom: none;
}

/* ── Embed (видео и т.д.) ── */
.longread-embed {
    margin: 8px 0;
    border-radius: 12px;
    overflow: hidden;
}

.longread-embed iframe {
    width: 100%;
    border: none;
    border-radius: 12px;
}


.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: var(--gap);
    padding-top: var(--gap);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.article-tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.article-tag:hover {
    border-color: var(--fifth-color);
    color: var(--fifth-color);
}

/* Читайте также */
.article-related {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.article-related-header {
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== Страница рубрики ===== */

/* Шапка рубрики */
.rubric-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: var(--gap);
    padding-bottom: var(--gap);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rubric-header-label {
    color: var(--fifth-color);
    font-family: "Iosevka Charon", monospace;
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 10px;
}

.rubric-header-main {
    flex: 1;
    min-width: 0;
}

.rubric-title {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--second-color);
    margin: 0 0 10px;
    line-height: 1;
}

.rubric-desc {
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    max-width: 560px;
}

.rubric-header-meta {
    flex-shrink: 0;
}

.rubric-count {
    font-family: "Iosevka Charon", monospace;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Фильтры подрубрик */
.rubric-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: var(--gap);
}

.rubric-filter {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    font-family: 'Google Sans', sans-serif;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.rubric-filter:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--second-color);
}

.rubric-filter.active {
    background: var(--fifth-color);
    border-color: var(--fifth-color);
    color: #111;
    font-weight: 700;
}

/* Герой ленты */
.feed-hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16 / 6;
}

.feed-hero-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    color: #fff;
}

.feed-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feed-hero:hover .feed-hero-img {
    transform: scale(1.02);
}

.feed-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.88) 100%);
    z-index: 1;
}

.feed-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 36px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feed-hero:hover .feed-hero-content {
    transform: translateY(-4px);
}

.feed-hero-rubric {
    font-family: "Iosevka Charon", monospace;
    font-size: 13px;
    color: var(--fifth-color);
}

.feed-hero-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
}

.feed-hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.feed-meta-sep {
    opacity: 0.4;
}

/* Мета под карточками в ленте */
.feed-item-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    margin-top: 2px;
}

/* Разделитель с меткой */
.feed-divider {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feed-divider::before,
.feed-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.feed-divider span {
    font-family: "Iosevka Charon", monospace;
    font-size: 12px;
    color: var(--fifth-color);
    white-space: nowrap;
}

/* Кнопка «Загрузить ещё» */
.feed-load-more {
    display: flex;
    padding-top: 8px;
}

.feed-load-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 28px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, gap 0.25s ease;
}

.feed-load-btn:hover {
    border-color: var(--fifth-color);
    color: var(--fifth-color);
    gap: 12px;
}

/* Другие рубрики в сайдбаре */
.sidebar-rubrics {
    background: var(--third-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-rubrics-label {
    font-family: "Iosevka Charon", monospace;
    font-size: 13px;
    color: var(--fifth-color);
}

.sidebar-rubrics-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-rubric-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-rubric-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-rubric-name {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
    transition: color 0.2s ease;
}

.sidebar-rubric-item:hover .sidebar-rubric-name {
    color: var(--second-color);
}

.sidebar-rubric-count {
    font-family: "Iosevka Charon", monospace;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.25);
}

/* ===== Список статей в ленте рубрики ===== */

.feed-list {
    display: flex;
    flex-direction: column;
}

.feed-list-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
    text-decoration: none;
    color: var(--second-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease;
    border-radius: 4px;
}

.feed-list-item:first-child {
    padding-top: 0;
}

.feed-list-item:last-child {
    border-bottom: none;
}

.feed-list-img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    transition: filter 0.25s ease;
}

.feed-list-item:hover .feed-list-img {
    filter: brightness(1.08);
}

.feed-list-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.feed-list-rubric {
    font-family: "Iosevka Charon", monospace;
    font-size: 12px;
    color: var(--fifth-color);
    font-weight: 400;
}

.feed-list-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    margin: 0;
    letter-spacing: -0.01em;
    color: var(--second-color);
    transition: color 0.2s ease;
}

.feed-list-item:hover .feed-list-title {
    color: rgba(255, 255, 255, 0.75);
}

.feed-list-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
}

/* ===== Responsive: Tablet ≤1200px ===== */
@media (max-width: 1200px) {
    .article-title {
        font-size: 34px;
    }

    .rubric-title {
        font-size: 42px;
    }
}

/* ===== Responsive: Mobile ≤768px ===== */
@media (max-width: 768px) {
    /* Breadcrumb */
    .article-breadcrumb {
        font-size: 12px;
        gap: 6px;
    }

    /* Article hero */
    .article-hero {
        border-radius: 14px;
    }

    .article-hero-img {
        aspect-ratio: 16 / 9;
    }

    .article-hero-caption {
        padding: 12px 16px;
        font-size: 11px;
    }

    /* Article header */
    .article-title {
        font-size: 28px;
        letter-spacing: -0.02em;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Article body */
    .article-body p {
        font-size: 16px;
        line-height: 1.65;
    }

    .article-lead {
        font-size: 18px !important;
        line-height: 1.5 !important;
    }

    .article-h2 {
        font-size: 20px;
    }

    .article-quote,
    .longread-quote {
        padding: 18px 20px;
    }

    .article-quote p,
    .longread-quote blockquote {
        font-size: 17px !important;
    }

    .article-inset,
    .longread-inset {
        padding: 16px 18px;
    }

    .article-body li {
        font-size: 16px;
    }

    .longread-image.stretched img {
        margin-left: -16px;
        margin-right: -16px;
        width: calc(100% + 32px);
    }

    .article-body table {
        font-size: 14px;
    }

    .article-body table th,
    .article-body table td {
        padding: 10px 12px;
    }

    /* Tags */
    .article-tags {
        gap: 8px;
    }

    .article-tag {
        padding: 5px 12px;
        font-size: 12px;
    }

    /* Related */
    .article-related .article-grid-trinity {
        grid-template-columns: 1fr 1fr;
    }

    /* === Rubric page === */
    .rubric-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .rubric-title {
        font-size: 32px;
    }

    .rubric-desc {
        font-size: 14px;
    }

    .rubric-filters {
        gap: 6px;
    }

    .rubric-filter {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Feed hero */
    .feed-hero {
        aspect-ratio: 16 / 9;
        border-radius: 16px;
    }

    .feed-hero-title {
        font-size: 22px;
    }

    .feed-hero-content {
        padding: 20px 24px;
    }

    /* Feed list */
    .feed-list-item {
        gap: 14px;
        padding: 14px 0;
    }

    .feed-list-img {
        width: 100px;
        height: 68px;
        border-radius: 8px;
    }

    .feed-list-title {
        font-size: 15px;
    }

    .feed-load-btn {
        padding: 12px 20px;
        font-size: 13px;
    }

    /* Sidebar rubrics */
    .sidebar-rubrics {
        padding: 16px;
    }

    .sidebar-rubric-name {
        font-size: 14px;
    }
}

/* ===== Responsive: Small ≤480px ===== */
@media (max-width: 480px) {
    .article-title {
        font-size: 24px;
    }

    .article-body p {
        font-size: 15px;
    }

    .article-lead {
        font-size: 17px !important;
    }

    .article-h2 {
        font-size: 18px;
    }

    .article-quote p {
        font-size: 15px !important;
    }

    .article-related .article-grid-trinity {
        grid-template-columns: 1fr;
    }

    .rubric-title {
        font-size: 26px;
    }

    .feed-hero-title {
        font-size: 18px;
    }

    .feed-hero-content {
        padding: 16px 20px;
        gap: 8px;
    }

    .feed-hero-meta {
        font-size: 12px;
    }

    .feed-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .feed-list-img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}
