/* =========================
   BASE
========================= */

:root {
    --text: #111;
    --muted: #777;
    --line: #e6e6e6;
    --accent: #b00020;
    --sidebar-column-width: 300px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: normal;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

/* =========================
   LINKS (FIX underline)
========================= */

a {
    color: inherit;
    text-decoration: none;
}

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

/* =========================
   LAYOUT
========================= */

.container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}

.main-content {
    padding: 30px 0;
}

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

.site-header {
    border-bottom: 1px solid var(--line);
}

.top-line {
    font-size: 10px;
    color: var(--muted);
}

.top-line-inner {
    height: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================
   BRAND
========================= */

.brand {
    display: inline-flex;
    align-items: center;
}

.brand-row {
    display: flex;
    align-items: center;
    padding: 14px 0 12px;
}

.brand-logo {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
}

.nav-brand-mark {
    display: none;
    text-decoration: none;
}

.nav-brand-logo {
    display: block;
    width: auto;
    max-height: 25px;
}

.main-nav.is-sticky .nav-brand-mark {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}
/* =========================
   SEARCH
========================= */

.search-form {
    display: flex;
    border-bottom: 1px solid var(--line);
}

.search-form input {
    border: none;
    padding: 8px;
    outline: none;
    font-size: 14px;
}

.search-form button {
    border: none;
    background: none;
    cursor: pointer;
    font-weight: bold;
}

/* =========================
   NAVIGATION
========================= */

.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 2px solid #c40000;
}

.nav-inner {
    display: flex;
    gap: 24px;
    height: 42px;
    align-items: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
}

/* =========================
   GRID
========================= */

.news-home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) var(--sidebar-column-width);
    gap: 28px;
}

/* =========================
   TITLES
========================= */

.section-title {
    font-size: 15px;
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
}

/* =========================
   META
========================= */

.news-meta {
    font-size: 12px;
    color: var(--muted);
}

/* =========================
   IMPORTANT (LEFT)
========================= */

.important-item {
    padding: 0 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.important-item h3 {
    font-size: 24px;
    margin: 6px 0;
    line-height: 1.2;
}

.important-item p {
    margin: 0;
    color: var(--muted);
}

.news-list-image {
    display: block;
    margin: 10px 0;
}

.news-list-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #f3f3f3;
}

/* =========================
   LATEST (CENTER)
========================= */

.latest-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.latest-item h3 {
    font-size: 17px;
    margin: 4px 0;
    line-height: 1.25;
}

/* =========================
   RIGHT COLUMN
========================= */

.sidebar-category-block .section-title {
    font-size: 15px;
    font-weight: 700;
}

.sidebar-category-list {
    min-width: 0;
    padding-top: 4px;
}

.sidebar-category-block + .sidebar-category-block {
    margin-top: 22px;
}

.sidebar-category-item {
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
}

.sidebar-category-item:last-of-type {
    border-bottom: 0;
}

.sidebar-category-item .news-meta {
    display: none;
}

.sidebar-category-item a {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    color: #222;
}

.sidebar-category-item a:hover {
    color: var(--accent);
}

/* номер/маркер (опционально, как у РБК) */
.sidebar-category-item::before {
    content: "—";
    margin-right: 6px;
    color: var(--muted);
}

/* =========================
   TAGS
========================= */

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

.tag-cloud a {
    font-size: 13px;
    color: var(--muted);
}

.tag-cloud a:hover {
    color: var(--accent);
}

.all-tags-link {
    margin: 10px 0 0;
    font-size: 13px;
}

.all-tags-link a {
    color: var(--accent);
}

/* =========================
   THEMES
========================= */

.theme-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    line-height: 1.35;
}

.theme-list span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
}

.theme-description {
    margin: -8px 0 18px;
    color: #555;
    font-size: 17px;
    line-height: 1.5;
}

.news-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.news-theme {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: #222;
    font-size: 13px;
    font-weight: 700;
}

.news-theme:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.news-theme-related {
    margin: 28px 0 0;
    border-top: 2px solid var(--accent);
}

.theme-related-block {
    padding: 16px 0 0;
}

.theme-related-block + .theme-related-block {
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.theme-related-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.25;
}

.theme-related-item {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.theme-related-item a {
    display: inline-block;
    margin-top: 3px;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
}

.theme-related-more {
    display: inline-flex;
    margin-top: 12px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}

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

.site-footer {
    background: #111;
    color: #aaa;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 6px;
    min-height: 86px;
    font-size: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #ddd;
    font-size: 13px;
}

.footer-links a {
    text-decoration: none;
}

/* =========================
   UTILS
========================= */

.muted {
    color: var(--muted);
}

/* =========================
   ERROR PAGES
========================= */

.error-page {
    max-width: 680px;
    min-height: 52vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px 0 64px;
}

.error-code {
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.error-page h1 {
    margin: 8px 0 12px;
    font-size: 46px;
    line-height: 1.05;
    font-weight: 800;
}

.error-page p {
    max-width: 560px;
    margin: 0;
    color: #555;
    font-size: 18px;
    line-height: 1.55;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.error-primary-link,
.error-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
}

.error-primary-link {
    background: var(--accent);
    color: #fff;
}

.error-primary-link:hover {
    background: #8f001a;
    color: #fff;
}

.error-secondary-link {
    border: 1px solid var(--line);
    color: #222;
}

.error-secondary-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* =========================
   ABOUT PAGE
========================= */

.about-page {
    width: calc(66.6667% - 21.3333px);
    max-width: 800px;
    padding: 18px 0 56px;
}

.about-kicker {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.about-text {
    color: #333;
    font-size: 18px;
    line-height: 1.65;
}

.about-text p {
    margin: 0 0 18px;
}

/* =========================
   AUTHORS PAGE
========================= */

.authors-page {
    max-width: 860px;
    padding: 18px 0 56px;
}

.authors-list {
    display: grid;
    gap: 18px;
}

.author-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.author-card:last-child {
    border-bottom: none;
}

.author-card-photo {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f3f3;
}

.author-card-body {
    min-width: 0;
}

.author-card-name {
    margin: 0 0 4px;
    font-size: 22px;
    line-height: 1.25;
}

.author-card-summary,
.author-card-description,
.authors-empty {
    margin: 0;
    color: #444;
    font-size: 16px;
    line-height: 1.55;
}

.author-card-summary {
    font-style: italic;
}

.author-card-description {
    margin-top: 8px;
}

.author-card-description p {
    margin: 0 0 12px;
}

.author-card-description p:last-child {
    margin-bottom: 0;
}

.author-application-link {
    margin: 28px 0 0;
    font-size: 17px;
    font-weight: 700;
}

.author-application-page {
    max-width: 700px;
    padding: 18px 0 56px;
}

.author-dashboard-page {
    width: calc(66.6667% - 21.3333px);
    max-width: 800px;
    padding: 18px 0 56px;
}

.author-application-intro {
    margin: 0 0 24px;
    color: #444;
    line-height: 1.55;
}

.author-application-field {
    margin-bottom: 18px;
}

.author-application-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.author-application-field label,
.author-application-field input,
.author-application-field textarea {
    display: block;
    width: 100%;
}

.author-application-field input[type="file"] {
    padding: 0;
    border: 0;
}

.author-profile-photo-preview {
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 0 10px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f3f3;
}

.markdown-help {
    margin-top: 8px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.markdown-help summary {
    cursor: pointer;
    font-weight: 700;
}

.markdown-help ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.markdown-help code {
    padding: 1px 4px;
    border-radius: 3px;
    background: #f3f3f3;
}

.author-article-images [data-image-fields] {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.author-article-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.author-rejection-notice {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-left: 4px solid #b00020;
    background: #fff3f4;
    color: #65101d;
    line-height: 1.5;
}

.author-rejection-notice p {
    margin: 6px 0 0;
}

.author-article-actions .author-application-submit {
    padding: 7px 10px;
    font-size: 13px;
}

.author-article-preview-link {
    margin-left: 4px;
    font-size: 14px;
}

.author-article-image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.author-article-image-previews img {
    width: 86px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
}

.author-article-image-preview {
    position: relative;
    cursor: grab;
}

.author-article-image-preview.is-dragging {
    opacity: 0.45;
}

.author-article-image-delete {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #b00020;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 18px;
}

.author-application-field label {
    margin-bottom: 6px;
    font-weight: 700;
}

.author-application-field input,
.author-application-field textarea {
    box-sizing: border-box;
    padding: 9px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font: inherit;
}

.author-application-field small,
.author-application-error {
    display: block;
    margin: 5px 0 0;
    color: #666;
    font-size: 13px;
}

.author-application-error {
    color: #b00020;
}

.author-application-submit {
    padding: 10px 16px;
    border: 0;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.author-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 28px;
}

.author-dashboard-note {
    margin: -10px 0 24px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.author-dashboard-preview {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 0 0 24px;
    padding: 0 0 22px;
    border-bottom: 1px solid var(--line);
}

.author-dashboard-preview-photo {
    flex: 0 0 auto;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f3f3;
}

.author-dashboard-preview-photo-placeholder {
    border: 1px solid var(--line);
}

.author-dashboard-actions .author-application-submit {
    text-decoration: none;
}

.author-dashboard-links {
    margin: 0 0 28px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: #fafafa;
    font-size: 15px;
}

.author-dashboard-links > * {
    display: inline;
    vertical-align: baseline;
}

.author-dashboard-links > *:not(:last-child)::after {
    content: "/";
    display: inline-block;
    margin: 0 9px;
    color: var(--muted);
}

.author-dashboard-links a,
.author-dashboard-links button {
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    padding: 0 !important;
    margin: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: #222;
    cursor: pointer;
    font: inherit;
    line-height: inherit;
    text-decoration: none;
}

.author-dashboard-links a:hover,
.author-dashboard-links button:hover {
    color: var(--accent);
    text-decoration: underline;
}

.author-logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.author-articles-table {
    width: 100%;
    border-collapse: collapse;
}

.author-articles-table th,
.author-articles-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.author-articles-table th {
    color: #555;
    font-size: 13px;
}

.author-article-edit-disabled {
    color: #888;
    font-size: 13px;
}

@media (max-width: 900px) {
    .about-page {
        width: 100%;
    }

    .author-dashboard-page {
        width: 100%;
    }
}

.author-detail-page {
    max-width: 860px;
    padding: 18px 0 56px;
}

.author-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 28px;
    margin-bottom: 28px;
}

.author-detail-photo {
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f3f3;
}

.author-detail-intro {
    min-width: 0;
}

.author-external-link {
    display: inline-flex;
    margin-top: 14px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}

.author-articles {
    margin-top: 28px;
}

.author-article-item {
    display: grid;
    grid-template-columns: 156px minmax(0, 1fr);
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.author-article-item:last-of-type {
    border-bottom: none;
}

.author-article-image {
    display: block;
    width: 156px;
    aspect-ratio: 1 / 1;
    background: #f3f3f3;
    overflow: hidden;
}

.author-article-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-article-body {
    min-width: 0;
}

.author-article-body h3 {
    margin: 4px 0 7px;
    font-size: 22px;
    line-height: 1.25;
}

.author-article-body h3 a {
    color: var(--text);
}

.author-article-body h3 a:hover {
    color: var(--accent);
}

.author-article-body p {
    margin: 0;
    color: #555;
    font-size: 15px;
    line-height: 1.45;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 760px) {
    .news-home-grid {
        grid-template-columns: 1fr;
    }

    .brand-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .search-form {
        width: 100%;
    }

    .nav-inner {
        overflow-x: auto;
        white-space: nowrap;
    }

    .error-page h1 {
        font-size: 34px;
    }

    .error-page p {
        font-size: 16px;
    }

    .author-detail-header {
        flex-direction: column;
    }

    .author-article-item {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
    }

    .author-article-image {
        width: 92px;
    }

    .author-article-body h3 {
        font-size: 18px;
    }

    .category-news-item {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
    }

    .category-news-item-no-image {
        grid-template-columns: 1fr;
    }

    .category-news-image {
        width: 92px;
    }

    .category-news-item h2 {
        font-size: 18px;
    }
}

/* =========================
   NEWS DETAIL
========================= */

.news-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-column-width);
    gap: 36px;
}

.news-detail-main {
    max-width: 820px;
}

.detail-meta {
    margin-bottom: 10px;
}

.news-detail-title {
    margin: 0 0 16px;
    font-size: 42px;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.news-detail-summary {
    margin: 0 0 24px;
    font-size: 20px;
    line-height: 1.45;
    color: #444;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 24px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.article-author-photo {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f3f3;
}

.article-author-body {
    min-width: 0;
}

.article-author-label {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    text-transform: uppercase;
}

.article-author-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.article-original-author {
    color: var(--muted);
    font-weight: 400;
}

.article-author-body p {
    margin: 4px 0 0;
    color: #555;
    font-size: 13px;
    line-height: 1.45;
}

.news-featured-image {
    position: relative;
    margin: 0 0 24px;
}

.news-featured-image-small {
    max-width: 320px;
}

.news-featured-image-medium {
    max-width: 520px;
}

.news-featured-image-large {
    max-width: 680px;
}

.news-featured-image-full {
    max-width: none;
}

.news-featured-image.is-expanded {
    float: none;
    width: 100%;
    max-width: none;
    margin: 0 0 24px;
}

.news-featured-image-small,
.news-featured-image-medium {
    float: left;
    width: min(50%, 520px);
    margin: 0 22px 14px 0;
}

.news-featured-image img {
    display: block;
    width: 100%;
    height: auto;
    background: #f3f3f3;
}

.single-image-toggle {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    opacity: 0;
    transition: opacity 140ms ease, background 140ms ease;
}

.single-image-toggle::before,
.single-image-toggle::after {
    content: "";
    display: block;
}

.single-image-toggle::before {
    width: 46px;
    height: 46px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.34);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

.single-image-toggle::after {
    position: absolute;
    width: 18px;
    height: 3px;
    margin: 34px 0 0 34px;
    border-radius: 999px;
    background: #fff;
    transform: rotate(45deg);
    transform-origin: center;
}

.news-featured-image:hover .single-image-toggle,
.single-image-toggle:focus-visible {
    background: rgba(0, 0, 0, 0.08);
    opacity: 1;
}

.news-featured-image.is-expanded .single-image-toggle {
    cursor: zoom-out;
}

.news-featured-image figcaption {
    position: relative;
    z-index: 2;
    margin-top: 8px;
    color: var(--muted);
    background: #fff;
    font-size: 12px;
    line-height: 1.4;
}

.news-featured-image figcaption span::before {
    content: " / ";
}

.news-detail-text {
    font-size: 18px;
    line-height: 1.65;
}

.news-detail-text p {
    margin: 0 0 18px;
}

.news-detail-text h2,
.news-detail-text h3 {
    margin: 30px 0 12px;
    line-height: 1.25;
}

.news-detail-text h2 {
    font-size: 26px;
}

.news-detail-text h3 {
    font-size: 21px;
}

.news-detail-text ul,
.news-detail-text ol {
    margin: 0 0 20px;
    padding-left: 24px;
}

.news-detail-text li {
    margin: 0 0 8px;
}

.news-detail-text blockquote {
    margin: 24px 0;
    padding: 2px 0 2px 18px;
    border-left: 3px solid var(--accent);
    color: #444;
}

.news-detail-text a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.news-tags {
    clear: both;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.news-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f1f1;
    color: #333;
    font-size: 13px;
    text-decoration: none;
}

.news-tag:hover {
    background: #e0e0e0;
    color: #000;
}

.article-source-link {
    margin: 20px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.article-source-link a {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.article-gallery {
    position: relative;
    margin: 0 0 24px;
    outline: none;
}

.article-gallery-viewport {
    position: relative;
    width: 100%;
    min-height: 260px;
    background: #f3f3f3;
    overflow: hidden;
}

.article-gallery-slide {
    display: none;
    margin: 0;
}

.article-gallery-slide.is-active {
    position: relative;
    display: block;
}

.article-gallery-slide.is-contained-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--gallery-image);
    background-position: center;
    background-size: cover;
    filter: blur(22px);
    opacity: 0.22;
    transform: scale(1.08);
}

.article-gallery-slide img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    background: transparent;
}

.article-gallery-slide.is-cover-image img {
    object-fit: cover;
}

.article-gallery-slide figcaption {
    position: relative;
    z-index: 1;
    padding: 8px 0 0;
    color: var(--muted);
    background: #fff;
    font-size: 12px;
    line-height: 1.4;
}

.article-gallery-slide figcaption span::before {
    content: " / ";
}

.news-gallery .article-gallery-viewport {
    height: clamp(260px, 58vw, 560px);
    min-height: 0;
}

.news-gallery .article-gallery-slide.is-active {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-gallery .article-gallery-slide img {
    height: calc(100% - 34px);
    max-height: none;
}

.news-gallery .article-gallery-slide:not(.has-caption) img {
    height: 100%;
}

.news-gallery .article-gallery-slide figcaption {
    box-sizing: border-box;
    height: 34px;
    padding-top: 5px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.3;
}

.article-gallery-button {
    position: absolute;
    top: min(260px, 45%);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    transform: translateY(-50%);
}

.article-gallery-button:hover,
.article-gallery-button:focus-visible {
    background: rgba(0, 0, 0, 0.72);
}

.article-gallery-prev {
    left: 12px;
}

.article-gallery-next {
    right: 12px;
}

.news-gallery .article-gallery-button {
    top: 0;
    bottom: 34px;
    width: max(10%, 44px);
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-size: 46px;
    opacity: 0;
    transform: none;
    transition: background 140ms ease, opacity 140ms ease;
}

.news-gallery .article-gallery-button:hover,
.news-gallery .article-gallery-button:focus-visible {
    background: rgba(0, 0, 0, 0.18);
    opacity: 1;
}

.news-gallery:hover .article-gallery-button {
    opacity: 0.55;
}

.news-gallery:hover .article-gallery-button:hover,
.news-gallery:hover .article-gallery-button:focus-visible {
    opacity: 1;
}

.news-gallery .article-gallery-prev {
    left: 0;
}

.news-gallery .article-gallery-next {
    right: 0;
}

.article-gallery-counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.article-embeds {
    display: grid;
    gap: 18px;
    margin: 24px 0;
}

.article-embed {
    margin: 0;
}

.article-embed-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
}

.article-embed-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.article-embed figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.tag-description {
    margin: -8px 0 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    color: #444;
    font-size: 13px;
    line-height: 1.45;
}

.tag-description p {
    margin: 0 0 8px;
}

.tag-description a {
    color: var(--muted);
    font-size: 12px;
    font-weight: 300;
    overflow-wrap: anywhere;
}

.tag-description a:hover {
    color: #555;
}

.news-detail-sidebar {
    padding-top: 4px;
}

@media (max-width: 900px) {
    .news-home-grid,
    .news-detail-grid {
        grid-template-columns: 1fr;
    }

    .news-detail-title {
        font-size: 32px;
    }

    .news-detail-text {
        font-size: 17px;
    }

    .news-featured-image-small,
    .news-featured-image-medium {
        float: none;
        width: 100%;
        max-width: none;
        margin: 0 0 24px;
    }

    .article-gallery-viewport {
        min-height: 180px;
    }

    .article-gallery-button {
        top: min(180px, 45%);
        width: 34px;
        height: 34px;
        font-size: 24px;
    }
}

/* =========================
   CATEGORY PAGE
========================= */

.category-page {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
}

/* -------------------------
   LEFT COLUMN (MAIN)
------------------------- */

.category-main {
    min-width: 0;
}

.page-title {
    margin: 0 0 20px;
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.category-news-item {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.category-news-item-no-image {
    grid-template-columns: 1fr;
}

.category-news-item:last-of-type {
    border-bottom: none;
}

.category-news-image {
    display: block;
    width: 140px;
    aspect-ratio: 1 / 1;
    background: #f3f3f3;
    overflow: hidden;
}

.category-news-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-news-body {
    min-width: 0;
}

.category-news-item h2 {
    margin: 4px 0 7px;
    font-size: 22px;
    line-height: 1.25;
}

.category-news-item h2 a {
    color: var(--text);
}

.category-news-item h2 a:hover {
    color: var(--accent);
}

.category-news-item p {
    margin: 0;
    color: #555;
    font-size: 15px;
    line-height: 1.45;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.pagination-link,
.pagination-current,
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--line);
}

.pagination-link:hover {
    border-color: var(--accent);
}

.pagination-current {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    font-weight: 800;
}

.pagination-ellipsis {
    border-color: transparent;
    color: var(--muted);
}

.tag-article-cards {
    margin: 0 0 28px;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--line);
}

.tag-article-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.tag-article-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.tag-article-card:hover {
    border-color: #d0d0d0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.tag-article-card-image {
    display: block;
    background: #f3f3f3;
}

.tag-article-card-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.tag-article-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 10px 10px 12px;
}

.tag-article-card h3 {
    margin: 0 0 7px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.tag-article-card h3 a {
    color: #111;
}

.tag-article-card h3 a:hover {
    color: var(--accent);
}

.tag-article-card p {
    margin: 0;
    color: #555;
    font-size: 12px;
    line-height: 1.38;
}

.tag-article-sidebar .tag-article-cards {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.category-archive-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 10px 0 0;
}

.category-archive-heading {
    margin: 24px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: #222;
    font-size: 15px;
    font-weight: 700;
}

.category-archive-links a,
.category-archive-current {
    color: #333;
    font-size: 13px;
    line-height: 1.8;
}

.category-archive-current {
    font-weight: 700;
}

.category-archive-links a:hover {
    color: var(--accent);
}

.category-archive-links > * + *::before {
    content: "/";
    display: inline-block;
    margin: 0 9px;
    color: var(--muted);
}

/* -------------------------
   RESPONSIVE
------------------------- */

@media (max-width: 1100px) {
    .tag-article-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .category-page {
        grid-template-columns: 1fr;
    }

    .category-sidebar {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--line);
        padding-top: 20px;
    }

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

.tag-article-sidebar-grid {
    grid-template-columns: minmax(0, 1fr);
}


.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    line-height: 1.8;
    margin: 24px 0;
}

.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    color: #222;
    line-height: 1.15;
    text-decoration: none;
}

.tag-cloud-item:hover {
    color: #b00020;
    text-decoration: underline;
}

.tag-cloud .tag-weight-1 {
    font-size: 13px;
}

.tag-cloud .tag-weight-2 {
    font-size: 16px;
}

.tag-cloud .tag-weight-3 {
    font-size: 20px;
}

.tag-cloud .tag-weight-4 {
    font-size: 32px;
}

.tag-cloud .tag-weight-5 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.15;
}
