/* SIBINTEK editorial news design layer. Functionality stays in PHP/JS. */
:root {
    --sib-yellow: #f4c430;
    --sib-yellow-strong: #e8b900;
    --sib-ink: #202326;
    --sib-graphite: #4f5357;
    --sib-steel: #7b838c;
    --sib-line: #dde2e7;
    --sib-line-soft: #edf0f3;
    --sib-paper: #ffffff;
    --sib-panel: #f7f8f9;
    --sib-smoke: #eef1f4;
    --sib-accent-cool: #2f6f7a;
    --bg-primary: #f3f5f7;
    --bg-secondary: var(--sib-paper);
    --text-primary: var(--sib-ink);
    --text-secondary: #555c63;
    --text-muted: #818992;
    --border-color: var(--sib-line);
    --border-light: var(--sib-line-soft);
    --accent: var(--sib-yellow);
    --accent-dark: var(--sib-graphite);
    --accent-soft: #fff5cf;
    --action-bg: #202326;
    --action-text: #ffffff;
    --action-border: #202326;
    --nav-bg: #202326;
    --nav-text: #ffffff;
    --nav-hover-bg: #f4c430;
    --nav-hover-text: #202326;
    --shadow: rgba(28, 34, 40, 0.08);
    --shadow-hover: rgba(28, 34, 40, 0.14);
    --input-bg: #ffffff;
    --badge-bg: #f5f6f7;
    --radius: 8px;
}

[data-theme="dark"] {
    --sib-ink: #f4f6f7;
    --sib-graphite: #b9c0c7;
    --sib-steel: #8f98a1;
    --sib-line: #343b42;
    --sib-line-soft: #2a3036;
    --sib-paper: #1f2327;
    --sib-panel: #171b1f;
    --sib-smoke: #272d33;
    --bg-primary: #14181c;
    --bg-secondary: var(--sib-paper);
    --text-primary: #f4f6f7;
    --text-secondary: #c4cad0;
    --text-muted: #929ba5;
    --border-color: var(--sib-line);
    --border-light: var(--sib-line-soft);
    --accent: #f4c430;
    --accent-dark: #c2c8ce;
    --accent-soft: rgba(244, 196, 48, 0.13);
    --action-bg: #2c333a;
    --action-text: #f4f6f7;
    --action-border: #46505a;
    --nav-bg: #f4c430;
    --nav-text: #202326;
    --nav-hover-bg: #ffffff;
    --nav-hover-text: #202326;
    --shadow: rgba(0, 0, 0, 0.32);
    --shadow-hover: rgba(0, 0, 0, 0.42);
    --input-bg: #171b1f;
    --badge-bg: #262c32;
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(244, 196, 48, 0.18) 0 8px, transparent 8px),
        linear-gradient(180deg, #ffffff 0, #f4f6f8 88px, var(--bg-primary) 88px);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.65;
}

[data-theme="dark"] body,
body[data-theme="dark"] {
    background:
        linear-gradient(90deg, rgba(244, 196, 48, 0.2) 0 8px, transparent 8px),
        linear-gradient(180deg, #1d2227 0, #171b1f 88px, var(--bg-primary) 88px);
}

a,
button,
input,
textarea,
select {
    font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(244, 196, 48, 0.45);
    outline-offset: 3px;
}

.container {
    width: min(100% - 48px, 1220px);
    max-width: none;
    padding: 0;
}

.page-post .container {
    width: min(100% - 48px, 1040px);
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 18px 44px rgba(31, 36, 42, 0.08);
    backdrop-filter: blur(16px) saturate(150%);
}

[data-theme="dark"] .header {
    background: rgba(31, 35, 39, 0.9);
}

.header::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--sib-yellow) 0 32%, var(--sib-graphite) 32% 100%);
}

.header-content {
    min-height: 84px;
    padding: 14px 0;
}

.logo {
    min-width: 0;
}

.logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.page-index .logo {
    gap: 16px;
}

.page-index .logo-text {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
}

.logo::after {
    content: "корпоративные новости";
    display: block;
    margin-left: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.header-right,
.header-controls {
    gap: 12px;
}

.phone {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.phone:hover {
    color: var(--sib-ink);
}

.admin-btn,
.theme-toggle,
.back-btn,
.action-btn,
.like-btn-large,
.submit-btn,
.pagination a,
.pagination span {
    min-height: 40px;
    border-radius: 7px;
}

.admin-btn,
.theme-toggle,
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--sib-paper);
    color: var(--text-secondary);
    box-shadow: none;
}

.back-btn {
    position: relative;
    gap: 8px;
    border-color: var(--nav-bg);
    background: var(--nav-bg);
    color: var(--nav-text);
    box-shadow: 0 10px 24px rgba(28, 34, 40, 0.14);
}

.admin-btn,
.theme-toggle {
    min-width: 44px;
    padding: 0 12px;
}

.back-btn {
    padding: 0 18px;
    font-size: 13px;
    font-weight: 900;
    text-transform: none;
}

.admin-btn:hover,
.theme-toggle:hover,
.back-btn:hover {
    background: var(--nav-hover-bg);
    border-color: var(--nav-hover-bg);
    color: var(--nav-hover-text);
    transform: translateY(-2px);
}

.account-menu {
    position: relative;
    z-index: 30;
}

.account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    max-width: 210px;
    padding: 0 14px 0 8px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--sib-paper);
    background: color-mix(in srgb, var(--sib-paper) 88%, var(--sib-yellow) 12%);
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(28, 34, 40, 0.09);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.account-trigger:hover,
.account-menu.is-open .account-trigger {
    border-color: var(--sib-yellow);
    background: var(--sib-yellow);
    color: #202326;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(28, 34, 40, 0.14);
}

.account-avatar,
.account-signed-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: #202326;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.account-trigger:hover .account-avatar,
.account-menu.is-open .account-avatar {
    background: #fff;
    color: #202326;
}

.account-trigger-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(360px, calc(100vw - 28px));
    padding: 16px;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--sib-yellow);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(244, 196, 48, 0.12), transparent 46%),
        var(--sib-paper);
    box-shadow: 0 26px 70px rgba(28, 34, 40, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.98);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.account-menu.is-open .account-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.account-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 0.8fr 1fr 1.15fr;
    gap: 6px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid var(--border-light);
    border-radius: 7px;
    background: var(--sib-panel);
}

.account-help {
    position: absolute;
    top: -10px;
    right: -10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--sib-paper);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 900;
    cursor: help;
    box-shadow: 0 8px 20px rgba(28, 34, 40, 0.12);
}

.account-help-text {
    position: absolute;
    right: 0;
    top: calc(100% + 9px);
    width: 250px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: #202326;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
    z-index: 3;
}

.account-help:hover .account-help-text,
.account-help:focus .account-help-text {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-tab {
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.15;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.account-tab.active {
    background: var(--sib-yellow);
    color: #202326;
    box-shadow: 0 8px 18px rgba(244, 196, 48, 0.2);
}

.account-form {
    display: none;
    animation: accountPanelIn 0.22s ease both;
}

.account-form.active {
    display: grid;
    gap: 11px;
}

.account-form label {
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.account-form input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.account-form input:focus {
    border-color: var(--sib-yellow);
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.18);
}

.account-form .password-toggle {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    margin-top: -3px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.account-form .password-toggle input {
    width: 16px;
    height: 16px;
    min-height: 16px;
    accent-color: var(--sib-yellow);
    cursor: pointer;
}

.account-submit {
    width: 100%;
    min-height: 42px;
    margin-top: 3px;
    border: 1px solid #202326;
    border-radius: 7px;
    background: #202326;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.account-submit:hover {
    border-color: var(--sib-yellow);
    background: var(--sib-yellow);
    color: #202326;
    transform: translateY(-2px);
}

.account-submit-muted {
    margin-top: 14px;
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.account-signed {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--sib-panel);
}

.account-password-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.account-signed strong,
.account-signed span {
    display: block;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-signed strong {
    color: var(--text-primary);
    font-size: 14px;
}

.account-signed span {
    color: var(--text-muted);
    font-size: 12px;
}

.account-flash {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 750;
}

.account-flash-success {
    border: 1px solid rgba(47, 111, 122, 0.24);
    background: rgba(47, 111, 122, 0.1);
    color: var(--text-primary);
}

.account-flash-error {
    border: 1px solid rgba(176, 64, 64, 0.24);
    background: rgba(176, 64, 64, 0.1);
    color: var(--text-primary);
}

.comment-author-note,
.comment-login-required {
    margin-bottom: 15px;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--sib-yellow);
    border-radius: 8px;
    background: var(--sib-panel);
    color: var(--text-secondary);
    font-size: 14px;
}

.comment-author-note strong,
.comment-login-required strong {
    color: var(--text-primary);
}

.comment-login-required {
    display: grid;
    gap: 4px;
}

.comment-login-required span {
    color: var(--text-muted);
    font-size: 13px;
}

@keyframes accountPanelIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main {
    padding: 34px 0 58px;
}

.footer {
    margin-top: 52px;
    background: #2d3033;
    border-top: 5px solid var(--sib-yellow);
    color: #fff;
}

.footer p {
    color: rgba(255, 255, 255, 0.82);
}

/* Feed page */
.page-index .content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.page-index .main-content {
    min-width: 0;
}

.page-index .main-content::before {
    content: "Новости и события";
    display: block;
    margin: 0 0 14px;
    color: var(--text-primary);
    font-size: 34px;
    font-weight: 850;
    line-height: 1.08;
}

.page-index .main-content::after {
    content: "СИБИНТЕК";
    position: fixed;
    right: max(22px, calc((100vw - 1220px) / 2));
    bottom: 24px;
    z-index: -1;
    color: rgba(35, 38, 42, 0.035);
    font-size: clamp(58px, 11vw, 160px);
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

[data-theme="dark"] .page-index .main-content::after {
    color: rgba(255, 255, 255, 0.035);
}

.page-index .page-header {
    position: relative;
    margin-bottom: 24px;
    padding: 18px;
    background: var(--sib-paper);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--sib-yellow);
    border-radius: 8px;
    box-shadow: 0 20px 48px var(--shadow);
}

.page-index .page-header::before {
    content: "Фильтр ленты";
    position: absolute;
    top: -11px;
    left: 18px;
    padding: 2px 8px;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.page-index .page-header > div {
    align-items: stretch !important;
}

.page-index .search-box {
    min-width: 0;
}

.page-index .search-box input,
.page-index .sort-controls select {
    height: 46px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

.page-index .search-box input {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0 16px;
}

.page-index .sort-controls select {
    min-width: 210px;
    padding: 0 38px 0 14px;
}

.page-index .search-box input:focus,
.page-index .sort-controls select:focus {
    border-color: var(--sib-yellow);
    box-shadow: 0 0 0 4px rgba(244, 196, 48, 0.2);
}

.page-index .search-box button {
    height: 46px;
    padding: 0 20px;
    border-radius: 7px;
    border: 1px solid var(--action-border);
    background: var(--action-bg);
    color: var(--action-text);
    font-size: 13px;
    font-weight: 850;
    box-shadow: 0 12px 24px rgba(28, 34, 40, 0.16);
}

.page-index .search-box button:hover {
    background: var(--sib-yellow);
    color: #202326;
}

.page-index .post {
    position: relative;
    margin-bottom: 18px;
    padding: 24px;
    overflow: hidden;
    background: var(--sib-paper);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 32px var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.page-index .post::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--sib-yellow);
    opacity: 0;
    transition: opacity 0.2s;
}

.page-index .post:hover {
    border-color: rgba(244, 196, 48, 0.65);
    box-shadow: 0 22px 54px var(--shadow-hover);
    transform: translateY(-2px);
}

.page-index .post:hover::before {
    opacity: 1;
}

.page-index .post:first-of-type {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 42%);
    gap: 24px;
    min-height: 320px;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(244, 196, 48, 0.1), transparent 34%),
        var(--sib-paper);
}

.page-index .post:first-of-type .post-header,
.page-index .post:first-of-type .post-content,
.page-index .post:first-of-type .post-footer {
    grid-column: 1;
}

.page-index .post:first-of-type .post-preview-media {
    grid-column: 2;
    grid-row: 1 / 4;
    height: 100%;
    min-height: 264px;
    margin: 0;
    border: 0;
    border-radius: 8px;
}

.page-index .post:first-of-type .post-preview-image,
.page-index .post:first-of-type .slider-item img,
.page-index .post:first-of-type .media-slider,
.page-index .post:first-of-type .post-preview-video {
    height: 100%;
    min-height: 264px;
}

.page-index .post-title {
    margin: 0 0 10px;
    color: var(--text-primary);
    font-size: 23px;
    font-weight: 850;
    line-height: 1.22;
}

.page-index .post:first-of-type .post-title {
    max-width: 660px;
    font-size: clamp(28px, 3.4vw, 42px);
}

.page-index .post-title-link:hover {
    color: #9a7600;
}

.page-index .post-meta,
.page-post .post-meta {
    display: flex;
    gap: 9px 16px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    flex-wrap: wrap;
}

.page-index .post-meta {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.page-index .post-meta > span,
.page-post .post-meta > span {
    position: relative;
    padding-left: 13px;
}

.page-index .post-meta > span::before,
.page-post .post-meta > span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--sib-yellow);
}

.page-index .post-content {
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.72;
}

.page-index .post:first-of-type .post-content {
    max-width: 620px;
    font-size: 16px;
}

.page-index .post-preview-media {
    margin: 20px -24px 18px;
    overflow: hidden;
    background: #101214;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
}

.page-index .post-preview-image,
.page-index .slider-item img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    background: #101214;
}

.page-index .post-preview-video {
    height: 360px;
}

.page-index .post-preview-video video {
    object-fit: cover;
}

.page-index .video-overlay {
    background: rgba(0,0,0,0.18);
}

.page-index .video-icon {
    width: 54px;
    height: 54px;
    background: var(--sib-yellow);
    color: #202326;
    box-shadow: 0 16px 34px rgba(0,0,0,0.22);
}

.slider-btn,
.gallery-btn,
.lightbox-btn {
    background: rgba(244, 196, 48, 0.94);
    color: #202326;
    border: 1px solid rgba(255,255,255,0.35);
}

.slider-btn:hover,
.gallery-btn:hover,
.lightbox-btn:hover {
    background: #fff;
    color: #202326;
}

.page-index .post-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.page-index .post-actions {
    display: flex;
    align-items: center;
    gap: 30px;
}

.page-index .post-actions form {
    display: inline-flex !important;
    align-items: center;
    margin: 0;
}

.page-index .action-btn {
    min-width: 62px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    background: var(--badge-bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 850;
}

.page-index .action-btn:hover {
    border-color: var(--sib-yellow);
    background: var(--accent-soft);
    color: var(--text-primary);
}

.page-index .action-btn.like-icon-btn,
.page-index .action-btn.comment-icon-btn,
.page-index .action-btn.like-icon-btn:hover,
.page-index .action-btn.comment-icon-btn:hover {
    border-color: transparent !important;
    background: transparent !important;
}

.like-icon-btn,
.comment-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text-secondary);
    font-size: 27px;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
}

.like-icon-btn .ui-icon,
.comment-icon-btn .ui-icon {
    --icon-size: 1em;
    display: block;
    transition: color 0.18s ease, transform 0.18s ease;
}

.like-icon-btn .like-count,
.comment-icon-btn .comment-count {
    display: inline-flex;
    align-items: center;
    height: 1em;
    min-width: 1.2em;
    text-align: left;
    font-size: 0.62em;
    line-height: 1;
    transition: color 0.18s ease;
}

.like-icon-btn:hover {
    color: #d63031 !important;
    transform: none !important;
}

.comment-icon-btn:hover {
    color: var(--sib-yellow) !important;
    transform: none !important;
}

.like-icon-btn:hover .ui-icon,
.comment-icon-btn:hover .ui-icon {
    transform: scale(1.08);
}

.like-icon-btn.liked {
    color: #d63031 !important;
}

.like-icon-btn.liked .ui-icon {
    color: #d63031;
    transform: scale(1.08);
}

.like-icon-btn:disabled {
    cursor: wait;
    opacity: 0.62;
    transform: none !important;
}

.page-index .sidebar {
    top: 108px;
}

.page-index .sidebar-block {
    position: relative;
    padding: 22px;
    background: var(--sib-paper);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 14px 40px var(--shadow);
}

.page-index .sidebar-block::before {
    content: "";
    display: block;
    width: 54px;
    height: 5px;
    margin-bottom: 16px;
    background: var(--sib-yellow);
    border-radius: 3px;
}

.page-index .sidebar-title {
    margin: 0 0 14px;
    padding: 0 0 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
}

.page-index .recent-post {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.page-index .recent-post:hover {
    padding-left: 0;
    color: var(--text-primary);
}

.page-index .recent-post-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 800;
}

.page-index .recent-post:hover .recent-post-title {
    color: #9a7600;
}

.page-index .recent-post-meta {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.page-index .pagination {
    margin-top: 28px;
}

.page-index .pagination a,
.page-index .pagination span {
    min-width: 40px;
    border: 1px solid var(--border-color);
    background: var(--sib-paper);
    color: var(--text-secondary);
    box-shadow: 0 8px 20px var(--shadow);
    font-weight: 800;
    text-align: center;
}

.page-index .pagination a:hover {
    background: var(--sib-yellow);
    border-color: var(--sib-yellow);
    color: #202326;
}

.page-index .pagination .current {
    background: var(--action-bg);
    border-color: var(--action-border);
    color: var(--action-text);
}

.page-index .back-to-top {
    right: 28px;
    bottom: 28px;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: var(--sib-yellow);
    color: #202326;
    box-shadow: 0 14px 30px rgba(31, 36, 42, 0.24);
}

/* Single post */
.page-post .main {
    padding-top: 42px;
}

.page-post .post-single {
    position: relative;
    margin: 0;
    padding: 42px;
    overflow: hidden;
    background: var(--sib-paper);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 18px 52px var(--shadow);
}

.page-post .post-single::before {
    content: "";
    display: block;
    width: 74px;
    height: 6px;
    margin-bottom: 26px;
    background: var(--sib-yellow);
    border-radius: 4px;
}

.page-post .post-single::after {
    content: "СИБИНТЕК";
    position: absolute;
    top: 28px;
    right: 34px;
    color: rgba(32, 35, 38, 0.045);
    font-size: clamp(48px, 10vw, 112px);
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

[data-theme="dark"] .page-post .post-single::after {
    color: rgba(255, 255, 255, 0.045);
}

.page-post .post-single-title {
    position: relative;
    z-index: 1;
    max-width: 850px;
    margin-bottom: 18px;
    color: var(--text-primary);
    font-size: clamp(30px, 4.2vw, 52px);
    font-weight: 900;
    line-height: 1.08;
}

.page-post .post-meta {
    position: relative;
    z-index: 1;
    margin-bottom: 32px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-light);
}

.page-post .post-content-full {
    position: relative;
    z-index: 1;
    max-width: 790px;
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.86;
}

.page-post .post-content-full p {
    margin-bottom: 18px;
}

.page-post .post-media-full {
    margin: 34px 0 0;
    overflow: hidden;
    background: #101214;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.page-post .post-image-single img,
.page-post .gallery-slide img {
    width: 100%;
    height: min(68vh, 640px);
    object-fit: contain;
    background: #101214 !important;
    border-radius: 0;
}

.page-post .post-video-container {
    margin: 0;
    background: #101214;
    border-radius: 8px;
}

.page-post .post-video {
    max-height: 640px;
}

.page-post .post-actions-single {
    margin: 34px 0 38px;
    padding: 24px 0 0;
    border-top: 1px solid var(--border-light);
    background: transparent;
    text-align: left;
}

.page-post .like-btn-large {
    min-height: 48px;
    padding: 0 22px;
    border: 1px solid var(--border-color);
    background: var(--sib-paper);
    color: var(--text-secondary);
    box-shadow: 0 10px 24px var(--shadow);
    font-size: 14px;
    font-weight: 900;
}

.page-post .like-btn-large:hover {
    background: var(--sib-yellow);
    border-color: var(--sib-yellow);
    color: #202326;
    transform: translateY(-1px);
}

.page-post .like-btn-large.like-icon-btn {
    min-width: 0;
    justify-content: center;
    padding: 0;
    font-size: 18px;
}

.page-post .like-btn-large.like-icon-btn.liked {
    color: #d63031 !important;
}

.page-post .comments-section-single {
    margin-top: 34px;
    padding-top: 32px;
    border-top: 5px solid var(--sib-yellow);
}

.page-post .comments-title {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 900;
}

.page-post .no-comments {
    padding: 22px;
    background: var(--accent-soft);
    border: 1px solid rgba(244, 196, 48, 0.36);
    border-radius: 8px;
    color: var(--text-secondary);
    font-style: normal;
}

.page-post .comment {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
    padding: 16px;
    background: var(--sib-paper);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 8px 22px var(--shadow);
}

.page-post .comment-avatar {
    width: 42px;
    height: 42px;
    background: var(--action-bg);
    color: var(--sib-yellow);
    border-radius: 7px;
}

.page-post .comment-author {
    font-weight: 900;
}

.page-post .comment-form-wrapper {
    margin-top: 24px;
    padding: 24px;
    background: var(--sib-panel);
    border: 1px solid var(--border-color);
    border-top: 5px solid var(--sib-yellow);
    border-radius: 8px;
    box-shadow: 0 10px 30px var(--shadow);
}

.page-post .comment-form-wrapper h3 {
    margin-bottom: 18px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 900;
}

.page-post .input-field,
.page-post .textarea-field {
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--text-primary);
}

.page-post .input-field:focus,
.page-post .textarea-field:focus {
    border-color: var(--sib-yellow);
    box-shadow: 0 0 0 4px rgba(244, 196, 48, 0.2);
}

.page-post .submit-btn {
    min-height: 46px;
    padding: 0 22px;
    background: var(--action-bg);
    color: var(--action-text);
    border: 1px solid var(--action-border);
    border-radius: 7px;
    font-weight: 900;
}

.page-post .submit-btn:hover {
    background: var(--sib-yellow);
    color: #202326;
}

.lightbox-overlay {
    background: rgba(15, 17, 19, 0.94);
}

.lightbox-content img {
    border-radius: 8px;
}

@media (max-width: 1060px) {
    .page-index .content-wrapper {
        grid-template-columns: 1fr;
    }

    .page-index .sidebar {
        position: static;
    }
}

@media (max-width: 860px) {
    .container,
    .page-post .container {
        width: min(100% - 32px, 1220px);
    }

    .header-content {
        gap: 14px;
    }

    .page-index .post:first-of-type {
        display: block;
    }

    .page-index .post:first-of-type .post-preview-media {
        margin-top: 22px;
    }

    .page-index .post:first-of-type .post-preview-image,
    .page-index .post:first-of-type .slider-item img,
    .page-index .post:first-of-type .media-slider,
    .page-index .post:first-of-type .post-preview-video {
        height: 320px;
    }

    .page-post .post-single {
        padding: 30px;
    }
}

@media (max-width: 640px) {
    body {
        background:
            linear-gradient(90deg, rgba(244, 196, 48, 0.2) 0 6px, transparent 6px),
            var(--bg-primary);
    }

    .container,
    .page-post .container {
        width: min(100% - 24px, 1220px);
    }

    .header-content {
        min-height: auto;
        flex-direction: column;
        text-align: center;
    }

    .logo::after {
        margin-left: 0;
    }

    .header-right,
    .header-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .phone {
        width: 100%;
        justify-content: center;
    }

    .account-menu {
        width: 100%;
    }

    .account-trigger {
        width: 100%;
        max-width: none;
        justify-content: center;
    }

    .account-panel {
        left: 50%;
        right: auto;
        transform: translate(-50%, 10px) scale(0.98);
        transform-origin: top center;
    }

    .account-menu.is-open .account-panel {
        transform: translate(-50%, 0) scale(1);
    }

    .main {
        padding-top: 24px;
    }

    .page-index .main-content::before {
        font-size: 28px;
    }

    .page-index .page-header {
        padding: 16px;
    }

    .page-index .page-header > div {
        flex-direction: column;
        align-items: stretch !important;
    }

    .page-index .search-box {
        max-width: none !important;
        width: 100%;
    }

    .page-index .search-box button {
        flex: 0 0 auto;
    }

    .page-index .sort-controls,
    .page-index .sort-controls select {
        width: 100%;
    }

    .page-index .post,
    .page-index .post:first-of-type {
        padding: 18px;
    }

    .page-index .post:first-of-type .post-title,
    .page-post .post-single-title {
        font-size: 26px;
    }

    .page-index .post-preview-media {
        margin: 18px -18px 16px;
    }

    .page-index .post-preview-image,
    .page-index .slider-item img,
    .page-index .post-preview-video,
    .page-index .post:first-of-type .post-preview-image,
    .page-index .post:first-of-type .slider-item img,
    .page-index .post:first-of-type .media-slider,
    .page-index .post:first-of-type .post-preview-video {
        height: 240px;
        min-height: 240px;
    }

    .page-post .post-single {
        padding: 22px;
    }

    .page-post .post-single::after {
        display: none;
    }

    .page-post .post-content-full {
        font-size: 16px;
    }

    .page-post .comment {
        padding: 14px;
    }

    .page-post .comment-form-wrapper {
        padding: 18px;
    }
}

/* Pinned posts are controlled from admin panel. The first post is no longer promoted automatically. */
.page-index .post:first-of-type {
    display: block;
    min-height: auto;
    padding: 24px;
    background: var(--sib-paper);
}

.page-index .post:first-of-type::after {
    display: none;
}

.page-index .post:first-of-type .post-header,
.page-index .post:first-of-type .post-content,
.page-index .post:first-of-type .post-footer {
    align-self: initial;
}

.page-index .post:first-of-type .post-preview-media {
    margin: 18px 0 0;
}

.page-index .post:first-of-type .post-preview-image,
.page-index .post:first-of-type .slider-item img,
.page-index .post:first-of-type .media-slider,
.page-index .post:first-of-type .post-preview-video {
    height: 360px;
    min-height: 0;
}

.page-index .post:first-of-type .post-title {
    max-width: none;
    font-size: 23px;
    line-height: 1.22;
}

.page-index .post:first-of-type .post-content {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

.page-index .post.is-pinned {
    border-top-color: #d63031;
    box-shadow: 0 18px 46px var(--shadow-hover);
}

.pinned-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(214, 48, 49, 0.1);
    color: #d63031;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .page-index .post:first-of-type {
        padding: 18px;
    }

    .page-index .post:first-of-type .post-title {
        font-size: 23px;
    }

    .page-index .post:first-of-type .post-preview-image,
    .page-index .post:first-of-type .slider-item img,
    .page-index .post:first-of-type .media-slider,
    .page-index .post:first-of-type .post-preview-video {
        height: 240px;
        min-height: 240px;
    }
}
