/* ============================================================
   «Подшивка» — единая таблица стилей.
   Простая светлая тема: белый фон, чёрный текст, один акцент.
   ============================================================ */

:root {
    --ink: #1a1a1a;
    --muted: #6b6b6b;
    --line: #e3e0da;
    --paper: #ffffff;
    --soft: #f6f4f0;
    --accent: #c2452d;
    --accent-dark: #a03722;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(26, 26, 26, .06), 0 8px 24px rgba(26, 26, 26, .07);
    --glass: rgba(255, 255, 255, .55);
    --glass-strong: rgba(255, 255, 255, .72);
    --glass-border: rgba(255, 255, 255, .65);
    --glass-blur: saturate(1.5) blur(14px);
    --glass-shadow: 0 8px 32px rgba(31, 26, 22, .12), inset 0 1px 0 rgba(255, 255, 255, .7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--paper);
    background-image: linear-gradient(180deg, rgba(255,255,255,.78) 0%, #fff 72%, #fff 100%), url('../jy6iE-Rj-3w2TTtS4yfoqDM-qipao4393eOG3tPA_kbT9uddMWIQy-xpWet8s_SvGuWJN1c5EzlqUT9x3g-lOBIW.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    color: var(--ink);
    font-family: Manrope, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

/* Парящие стеклянные виджеты-орбы на фоне */
.home-mosaic-page::before {
    top: -12vh; right: -10vw;
    width: 46vw; height: 46vw;
    background: radial-gradient(circle at 30% 30%, rgba(194,69,45,.28), rgba(255,178,120,.12) 55%, transparent 75%);
    animation: pod-float-a 26s ease-in-out infinite alternate;
}
.home-mosaic-page::after {
    bottom: -18vh; left: -12vw;
    width: 42vw; height: 42vw;
    background: radial-gradient(circle at 60% 40%, rgba(120,140,255,.22), rgba(190,120,255,.10) 55%, transparent 75%);
    animation: pod-float-b 32s ease-in-out infinite alternate;
}

@keyframes pod-float-a {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-6vw, 8vh, 0) scale(1.15) rotate(12deg); }
}
@keyframes pod-float-b {
    from { transform: translate3d(0, 0, 0) scale(1.1) rotate(8deg); }
    to { transform: translate3d(7vw, -9vh, 0) scale(1); }
}

.wrap { width: min(1120px, calc(100% - 40px)); margin: auto; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.empty-note { color: var(--muted); padding: 30px 0; }
.empty-note.is-loading { opacity: .75; }
.hidden { display: none !important; }

/* ---------- Спокойная motion-система ---------- */
:root {
    --motion-fast: 180ms;
    --motion-base: 280ms;
    --motion-slow: 360ms;
    --motion-ease: cubic-bezier(.22, .8, .25, 1);
}

@keyframes podshivka-reveal {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes podshivka-section-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.posts-grid > *,
.media-grid > *,
.cats-grid > * {
    animation: podshivka-reveal var(--motion-slow) var(--motion-ease) both;
    animation-delay: calc(var(--motion-index, 0) * 45ms);
}

/* ---------- Шапка ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--glass-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 12px 32px rgba(31, 26, 22, .07);
}

.nav-wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; letter-spacing: .08em; font-size: 13px; }
.brand > span:last-child { min-width: 0; }
.brand small { display: block; color: var(--muted); font-size: 7px; letter-spacing: .14em; margin-top: 4px; font-weight: 600; }
.brand-mark {
    position: relative; display: block; width: 38px; height: 32px; flex: 0 0 38px;
}
.brand-mark i, .wp-mark i { position: absolute; display: block; width: 27px; height: 20px; border: 2px solid var(--ink); background: var(--paper); box-shadow: inset 0 -4px 0 var(--accent); }
.brand-mark i:nth-child(1), .wp-mark i:nth-child(1) { left: 0; top: 8px; transform: rotate(-8deg) skewY(-4deg); }
.brand-mark i:nth-child(2), .wp-mark i:nth-child(2) { left: 5px; top: 5px; transform: rotate(3deg) skewY(-4deg); }
.brand-mark i:nth-child(3), .wp-mark i:nth-child(3) { left: 9px; top: 1px; transform: rotate(-2deg) skewY(-4deg); }
.brand-mark::after, .wp-mark::after { content: ""; position: absolute; z-index: 2; left: 14px; top: 8px; width: 14px; height: 2px; background: var(--ink); box-shadow: 0 5px 0 var(--ink), 0 10px 0 var(--ink); }
.brand-mark.has-logo, .wp-mark.has-logo { width: auto; min-width: 32px; height: 32px; flex: 0 0 auto; }
.brand-mark.has-logo::after, .wp-mark.has-logo::after { content: none; }
.brand-mark.has-logo img, .wp-mark.has-logo img { display: block; height: 32px; width: auto; max-width: 148px; object-fit: contain; }

body:has(.home-nav) { padding-bottom: 100px; }

.topbar nav { display: none; }
.nav-cats { display: none; }

.sidebar-toggle {
    margin-left: auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    padding: 11px 10px;
}
.sidebar-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform var(--motion-base) var(--motion-ease), opacity var(--motion-fast) ease;
}
.sidebar-open .sidebar-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-open .sidebar-toggle span:nth-child(2) { opacity: 0; }
.sidebar-open .sidebar-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 80;
    width: min(360px, 92vw);
    height: 100%;
    transform: translateX(104%);
    transition: transform var(--motion-slow) var(--motion-ease);
    background: linear-gradient(160deg, rgba(255,255,255,.85), rgba(255,255,255,.65));
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-left: 1px solid var(--glass-border);
    box-shadow: -24px 0 60px rgba(31,26,22,.16);
    overflow: auto;
}
.sidebar-open .site-sidebar { transform: none; }
.sidebar-brand { margin: 26px 0 4px; padding: 18px 18px 16px; border-radius: 18px; background: linear-gradient(150deg, rgba(255,255,255,.65), rgba(255,255,255,.35)); border: 1px solid rgba(255,255,255,.6); box-shadow: 0 10px 28px rgba(31,26,22,.08), inset 0 1px 0 rgba(255,255,255,.65); }
.sidebar-brand b { display: block; font-size: 13px; font-weight: 800; letter-spacing: .12em; }
.sidebar-brand p { margin-top: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.sidebar-panel { padding: 12px 22px 40px; }
.sidebar-foot { margin-top: 26px; padding-top: 16px; border-top: 1px solid rgba(227,224,218,.5); display: grid; gap: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.sidebar-label {
    margin: 22px 0 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.sidebar-panel > .sidebar-label:first-child { margin-top: 8px; }
.sidebar-links { display: grid; gap: 6px; }
.sidebar-links a {
    display: block;
    padding: 10px 14px;
    border-radius: 14px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    background: rgba(255,255,255,.45);
    border: 1px solid rgba(255,255,255,.6);
    box-shadow: 0 4px 14px rgba(31,26,22,.05);
    transition: transform var(--motion-base) var(--motion-ease), background var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-base) ease;
}
.sidebar-links a:hover,
.sidebar-links a.is-active {
    background: var(--glass-strong);
    color: var(--accent);
    transform: translateX(-6px);
    box-shadow: 0 10px 24px rgba(194,69,45,.16);
}
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(26,26,26,.32);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-base) var(--motion-ease);
}
.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
.sidebar-open { overflow: hidden; }

/* Ссылка в админку скрыта: вход выполняется удержанием клавиши «A». */
.admin-link { display: none !important; }

/* ---------- Кнопки и ссылки ---------- */

.btn {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) ease;
}
.btn:active { transform: translateY(1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }

.text-link { color: var(--accent); font-weight: 700; font-size: 14px; }
.text-link:hover { text-decoration: underline; }

/* ---------- Секции ---------- */

.section { padding: 56px 0; }
.section + .section { padding-top: 0; }

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}
.section-head h2, .page-title-xl {
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.1;
    letter-spacing: -.02em;
    font-weight: 800;
}

.page-intro { padding: 64px 0 36px; max-width: 720px; }
.page-intro h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -.02em; font-weight: 800; margin-bottom: 14px; }
.page-intro .lead { color: var(--muted); font-size: 17px; }

.issue-layout { display: grid; grid-template-columns: 42% 1fr; gap: clamp(24px, 5vw, 48px); align-items: start; }

.home-hero { padding: 72px 0 48px; max-width: 780px; }
.home-hero h1 { font-size: clamp(38px, 6vw, 64px); line-height: 1.04; letter-spacing: -.025em; font-weight: 800; margin-bottom: 18px; }
.home-hero h1 em { font-family: Georgia, serif; font-style: italic; color: var(--accent); }
.home-hero .lead { color: var(--muted); font-size: 17px; max-width: 560px; }

/* ---------- Док-станция внизу экрана ---------- */

.home-nav {
    position: fixed;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 10px 12px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 22px;
    background: var(--glass-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 18px 44px rgba(31, 26, 22, .22), inset 0 1px 0 rgba(255, 255, 255, .6);
    animation: pod-dock-in var(--motion-slow) var(--motion-ease) both;
}
@keyframes pod-dock-in {
    from { opacity: 0; transform: translateX(-50%) translateY(24px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.home-nav-card {
    position: relative;
    display: grid;
    place-items: center;
    justify-items: center;
    flex: 0 0 auto;
    min-width: 58px;
    padding: 0 7px;
    height: 54px;
    gap: 3px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: transform var(--motion-base) var(--motion-ease), color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-base) ease;
}
.home-nav-card:hover,
.home-nav-card:focus-visible {
    transform: translateY(-10px) scale(1.28);
    background: var(--accent);
    color: #fff;
    z-index: 2;
    box-shadow: 0 14px 26px rgba(194, 69, 45, .4);
}
.home-nav-card:hover + .home-nav-card { transform: translateY(-4px) scale(1.12); }
.home-nav-card:has(+ .home-nav-card:hover) { transform: translateY(-4px) scale(1.12); }
.home-nav-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.home-nav-icon { font-size: 22px; line-height: 1; font-weight: 800; }
.home-nav-title {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    overflow: visible;
    white-space: nowrap;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .72;
}
.home-nav-text,
.home-nav-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Живая сетка главной ---------- */

.home-mosaic-page {
    min-height: 100vh;
}

.home-mosaic-stage {
    width: min(1440px, calc(100% - 24px));
    margin: 16px auto 8px;
}
.home-mosaic {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-auto-rows: minmax(168px, 21vh);
    grid-auto-flow: dense;
    gap: 10px;
}
.home-mosaic:empty { color: var(--muted); padding: 80px 20px; text-align: center; }
.home-mosaic-cell {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 168px;
    grid-column: span 2;
    border-radius: 18px;
    background: rgba(255, 255, 255, .35);
    border: 1px solid rgba(255, 255, 255, .5);
    box-shadow: 0 10px 30px rgba(31, 26, 22, .10), inset 0 1px 0 rgba(255,255,255,.55);
    isolation: isolate;
    transition: transform var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) ease;
}
.home-mosaic-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 1.1s ease, transform 6s ease;
}
.home-mosaic-layer.is-shown {
    opacity: 1;
    transform: scale(1);
}
.home-mosaic-caption {
    position: absolute;
    left: 10px; right: 10px; bottom: 10px;
    z-index: 2;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(20, 16, 14, .38);
    backdrop-filter: blur(10px) saturate(1.4);
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    transform: translateY(0);
    opacity: 1;
    transition: transform var(--motion-base) var(--motion-ease), background var(--motion-base) ease;
}
.home-mosaic-caption b {
    display: block;
    font-size: 14px;
    line-height: 1.25;
    letter-spacing: -.01em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.home-mosaic-caption small {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,.78);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.home-mosaic-cell:hover .home-mosaic-layer.is-shown { transform: scale(1.06); }
.home-mosaic-cell:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 46px rgba(31,26,22,.20), inset 0 1px 0 rgba(255,255,255,.55);
}
.home-mosaic-cell:hover .home-mosaic-caption { background: rgba(120, 30, 18, .5); }
.home-mosaic-cell:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.home-mosaic-art,
.home-mosaic-letter {
    position: relative;
    z-index: 1;
    color: rgba(32, 24, 16, .82);
    text-align: center;
    pointer-events: none;
}
.home-mosaic-art {
    width: 100%;
    height: 100%;
}
.home-mosaic-art .mc-top,
.home-mosaic-art .mc-main,
.home-mosaic-art .mc-sub {
    color: inherit;
}
.home-mosaic-letter {
    font-size: clamp(42px, 8vw, 72px);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1;
    opacity: .55;
}

@media (max-width: 1100px) {
    .home-nav { gap: 6px; }
}
@media (max-width: 900px) {
    .home-mosaic { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(150px, 22vh); }
    .home-mosaic-cell { grid-column: span 2; }
}
@media (max-width: 700px) {
    .home-nav {
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        padding: 8px 10px;
        gap: 0;
        transform: none;
        border-radius: 18px;
    }
    @keyframes pod-dock-in {
        from { opacity: 0; transform: translateY(24px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .home-nav-card {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 2px;
        height: 58px;
        min-height: 58px;
        border-radius: 12px;
    }
    .home-nav-icon { font-size: 20px; }
    .home-nav-title { font-size: min(7.4px, 2vw); letter-spacing: .02em; }
    .home-nav-card:hover + .home-nav-card,
    .home-nav-card:has(+ .home-nav-card:hover) { transform: none; }
    .home-nav-card:hover,
    .home-nav-card:active,
    .home-nav-card:focus-visible {
        transform: translateY(-4px) scale(1.1);
        background: var(--accent);
        color: #fff;
        box-shadow: 0 10px 20px rgba(194, 69, 45, .35);
    }
    body:has(.home-nav) { padding-bottom: 88px; }
    .site-sidebar { z-index: 90; }
}
@media (max-width: 600px) {
    .home-mosaic-stage { width: calc(100% - 16px); margin-top: 10px; }
    .home-mosaic { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; grid-auto-rows: 42vw; }
    .home-mosaic-cell {
        min-height: 0;
        grid-column: span 2;
        border-radius: 14px;
    }
    .home-mosaic-caption { padding: 9px 10px; }
    .home-mosaic-caption b { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .home-mosaic-layer { transition: none; transform: none; }
}

/* Share popover */
.share-menu {
    position: fixed;
    z-index: 10001;
    min-width: 190px;
    padding: 6px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--glass-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 18px 44px rgba(31,26,22,.20), inset 0 1px 0 rgba(255,255,255,.6);
    transform-origin: 18px 0;
    animation: share-menu-in var(--motion-base) var(--motion-ease) both;
}
.share-menu.is-closing { animation: share-menu-out var(--motion-fast) var(--motion-ease) both; pointer-events: none; }
.share-menu-item {
    display: block;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: 700 12px/1.25 inherit;
    text-align: left;
    cursor: pointer;
}
.share-menu-item:hover, .share-menu-item:focus-visible { background: var(--soft); color: var(--accent); outline: none; }
@keyframes share-menu-in { from { opacity: 0; transform: translateY(-5px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes share-menu-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-4px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
    .posts-grid > *, .media-grid > *, .cats-grid > *, .home-nav-card, .home-mosaic-cell, .share-menu { animation: none; }
    .home-mosaic-cell { transition: none; }
}

/* ---------- Переход страниц в стиле Apple: мягкий глубинный зум ---------- */

.page-flip-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    overflow: hidden;
    background: #fbfaf7;
    opacity: 0;
    transition: opacity 320ms cubic-bezier(0, 0, 0.2, 1);
}
body.page-turning .page-flip-overlay { opacity: 1; }
body.page-turn-in .page-flip-overlay {
    animation: apple-veil-out 640ms cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes apple-veil-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Контент уходит вглубь, как карточка в стеке iOS */
main {
    transform-origin: 50% 40%;
    transition:
        transform 340ms cubic-bezier(0.32, 0.72, 0, 1),
        opacity 300ms cubic-bezier(0, 0, 0.2, 1),
        filter 300ms cubic-bezier(0, 0, 0.2, 1);
}
body.page-turning main {
    transform: scale(.94) translateY(14px);
    opacity: 0;
    filter: blur(10px) saturate(.85);
}

/* Вход: страница «доплывает» к зрителю с лёгким овершутом */
body.page-turn-in main {
    animation: apple-content-in 700ms cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes apple-content-in {
    from { opacity: 0; transform: scale(1.07) translateY(-10px); filter: blur(14px) saturate(1.1); }
    55% { filter: blur(0) saturate(1); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0) saturate(1); }
}

@media (prefers-reduced-motion: reduce) {
    .page-flip-overlay { display: none; }
    main { animation: none; transition: none; }
}

/* ---------- Чипы-фильтры ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
    border: 1px solid rgba(255,255,255,.65);
    background: var(--glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 4px 14px rgba(31,26,22,.06);
    border-radius: 999px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-base) ease;
}
.chip small { opacity: .55; margin-left: 4px; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip:active { transform: scale(.97); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 8px 20px rgba(26,26,26,.25); }

/* ---------- Карточка записи ---------- */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.post-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--motion-base) var(--motion-ease), transform var(--motion-base) var(--motion-ease);
}
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.post-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
}
.thumb-letter {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font: 700 44px Georgia, serif;
    color: rgba(26, 26, 26, .35);
}
.star-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--accent);
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}

.post-body { padding: 18px 20px 20px; }
.post-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.post-cat {
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 11px;
}
.post-cat:hover { text-decoration: underline; }
.post-date { color: var(--muted); }

.post-title { font-size: 19px; line-height: 1.25; letter-spacing: -.01em; margin-bottom: 8px; }
.post-title a:hover { color: var(--accent); }
.post-excerpt { color: var(--muted); font-size: 14px; }

/* ---------- Карточки рубрик ---------- */

.cats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cat-card {
    display: block;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .15s, box-shadow .2s;
}
.cat-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cat-card b { font-size: 18px; letter-spacing: -.01em; }
.cat-card p { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.cat-card span { color: var(--accent); font-size: 13px; font-weight: 700; }

/* ---------- Одиночная запись ---------- */

.back-link { display: inline-block; color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 24px; }
.back-link:hover { color: var(--accent); }

/* ---------- Навигация между объектами (профили, материалы) ---------- */

.item-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 20px;
}
.item-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 46%;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    transition: border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.item-nav-btn:hover:not(.is-disabled) { border-color: var(--accent); color: var(--accent); box-shadow: 0 6px 18px rgba(194, 69, 45, .16); transform: translateY(-1px); }
.item-nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item-nav-btn.is-disabled { opacity: .38; pointer-events: none; }
.item-nav-btn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-nav-arrow { flex: 0 0 auto; font-size: 16px; line-height: 1; }
.item-nav-counter { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; }

/* Свайп-переходы левой кнопкой мыши */
[data-swipe] { cursor: grab; }
body.swipe-active, body.swipe-active * { cursor: grabbing !important; user-select: none !important; }
.is-swiping { will-change: transform; }

@media (max-width: 640px) {
    .item-nav-btn b { display: none; }
    .item-nav-btn { padding: 11px 14px; }
}

.single-head { max-width: 760px; margin-bottom: 28px; }
.single-head h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -.02em; font-weight: 800; margin-bottom: 14px; }
.single-lead { color: var(--muted); font-size: 18px; }

.single-cover {
    aspect-ratio: 21 / 9;
    border-radius: var(--radius);
    background-size: cover;
    background-position: center;
    margin-bottom: 32px;
}

.single-content { max-width: 720px; }
.single-content p { margin-bottom: 18px; font-size: 17px; line-height: 1.75; }

.post-interactions { max-width: 720px; margin: 30px 0; }
.social-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.social-action {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 999px; background: #fff;
    color: var(--muted); cursor: pointer; font: 600 13px/1.2 inherit;
}
.social-action:hover, .social-action:focus-visible { border-color: var(--ink); color: var(--ink); outline: none; }
.social-action.is-active { color: var(--accent); border-color: var(--accent); background: #fff5f2; }
.comments { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.comments h2 { font-size: 18px; margin-bottom: 14px; }
.comments-list { display: grid; gap: 12px; margin-bottom: 18px; }
.comment { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.comment b { font-size: 13px; }
.comment time { margin-left: 8px; color: var(--muted); font-size: 12px; }
.comment p, .comments-empty { margin-top: 3px; color: var(--muted); font-size: 14px; }
.comment-form { display: grid; gap: 10px; }
.comment-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.comment-form input, .comment-form textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; }
.comment-form textarea { resize: vertical; }
.comment-form .btn { justify-self: start; }

/* ---------- Мультимедиа ---------- */

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.media-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    transition: box-shadow .2s, transform .2s;
}
.media-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.media-card.is-target { outline: 2px solid var(--accent); outline-offset: 3px; }

.media-cover {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background-color: var(--soft);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.media-card.is-featured .media-cover { outline: 2px solid var(--accent); outline-offset: -2px; }

.mc-top, .mc-main, .mc-sub {
    position: absolute;
    left: 0; right: 0;
    text-align: center;
    color: rgba(26, 26, 26, .55);
    font-family: Georgia, serif;
}
.mc-top { top: 14%; font-size: 11px; letter-spacing: .3em; }
.mc-main { top: 42%; transform: translateY(-50%); font-size: 22px; font-weight: 700; line-height: 1.15; padding: 0 12px; }
.mc-sub { bottom: 12%; font-size: 12px; letter-spacing: .2em; }

.media-info { padding: 16px 18px 18px; }
.media-info h3 { font-size: 17px; margin-bottom: 6px; }
.media-info p { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

.media-cover-play { width: 100%; border: 0; cursor: pointer; font: inherit; color: inherit; }
.media-cover-download { cursor: download; }
.media-play-badge {
    position: absolute;
    inset: auto 14px 14px auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(26, 26, 26, .78);
    color: #fff;
    font-size: 16px;
}
.media-player {
    display: block;
    width: 100%;
    margin: 4px 0 12px;
    border-radius: 8px;
    background: #111;
}
audio.media-player { height: 40px; background: transparent; }

/* ---------- Подвал ---------- */

footer {
    border-top: 1px solid rgba(227, 224, 218, .35);
    margin-top: 20px;
    padding: 10px 0 8px;
    background: rgba(255, 255, 255, .24);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.archive-page { background-image: linear-gradient(180deg, rgba(255,255,255,.76) 0%, #fff 62%, #fff 100%), url('../jy6iE-Rj-3w2TTtS4yfoqDM-qipao4393eOG3tPA_kbT9uddMWIQy-xpWet8s_SvGuWJN1c5EzlqUT9x3g-lOBIW.jpg'); }
.newspaper-hero { padding-top: 40px; }
.newspaper-summary h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.04; letter-spacing: -.025em; margin-bottom: 18px; }
.newspaper-summary h1 em { font-family: Georgia, serif; font-style: italic; color: var(--accent); }
.newspaper-summary .lead { color: var(--muted); max-width: 560px; font-size: 18px; margin-bottom: 26px; }
.issue-paper { border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; text-align: center; box-shadow: var(--shadow); }
.paper-1863 { background: #f8f4ea; color: #2c2416; } .paper-1917 { background: #f3e9e2; color: #4a2318; } .paper-1990 { background: #e9eef0; color: #1e333b; }
.issue-paper span { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; } .issue-paper h1 { font: 700 42px Georgia,serif; margin: 12px 0 6px; } .issue-paper h2 { font: 600 22px Georgia,serif; } .issue-paper hr { border: 0; border-top: 2px solid currentColor; margin: 14px 0; } .issue-paper p { font-size: 13px; } .paper-columns { margin-top: 18px; padding-top: 16px; border-top: 1px solid currentColor; font: 15px/1.7 Georgia,serif; text-align: left; column-count: 2; column-gap: 22px; }
.issue-paper.has-uploaded-cover { padding: 0; overflow: hidden; background: #fff; } .issue-paper.has-uploaded-cover img { display: block; width: 100%; max-height: 620px; object-fit: contain; }
.article-scan img { display: block; width: 100%; max-height: 420px; object-fit: contain; margin-bottom: 14px; border-radius: 6px; } .article-scan a { display: block; }
.newspaper-meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; max-width: 450px; font-size: 14px; } .newspaper-meta dt { color: var(--muted); } .reference-copy { display: block; max-width: 860px; } .reference-copy p { font-size: 17px; line-height: 1.75; margin-bottom: 16px; } .reference-copy p:last-child { margin-bottom: 0; }
.archive-issues { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; } .archive-issues article, .archive-card, .person-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.82); } .archive-issues b, .archive-issues span, .archive-card span { display: block; } .archive-issues b { font: 700 30px Georgia,serif; } .archive-issues span, .archive-card span { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; } .archive-issues p, .archive-card p, .person-card p { color: var(--muted); font-size: 14px; margin-top: 8px; } .person-card b { font-size: 18px; }
@media (max-width: 800px) { .reference-copy, .archive-issues { grid-template-columns: 1fr; } }
.archive-page .newspaper-page { background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,.72) 28%, #fff 58%, #fff 100%); }

.footer-brand { margin-bottom: 6px; }
.footer-logo { display: block; height: 22px; width: auto; max-width: 140px; object-fit: contain; margin-bottom: 4px; }
.footer-brand b { font-size: 13px; letter-spacing: .08em; }
.footer-brand p { color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 2px; max-width: 360px; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 5px 12px; padding-top: 6px; border-top: 1px solid rgba(227, 224, 218, .3); }
.footer-nav a { color: var(--muted); font-size: 12px; font-weight: 600; }
.footer-nav a:hover { color: var(--accent); }
.footer-base { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 10px; margin-top: 5px; }

/* ---------- Формы (контакты) ---------- */

.form-group { margin-bottom: 14px; }
input[type="text"], input[type="email"], textarea, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.contact-layout { display: grid; grid-template-columns: 1fr; align-items: start; }
.contact-layout #contact-form { width: 100%; max-width: 560px; }

.form-note { margin: 10px 0; font-size: 14px; }
.form-note.is-success { color: #1c7c46; }
.form-note.is-error { color: var(--accent); }

/* ---------- Адаптивность ---------- */

@media (max-width: 800px) { .issue-layout { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
    .posts-grid, .media-grid, .cats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .wrap { width: min(100% - 24px, 1120px); }
    .nav-wrap { height: auto; padding: 12px 0; }
    .brand { gap: 0; }
    .brand > span:last-child { display: none; }
    .topbar .sidebar-toggle { width: 36px; height: 36px; padding: 8px; }
    .admin-link { margin-left: auto; }
    .posts-grid, .media-grid, .cats-grid { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; align-items: start; }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .wrap { width: min(100% - 48px, 1120px); }
    .posts-grid, .media-grid, .cats-grid { gap: 18px; }
}

/* ---------- Toast-уведомления ---------- */

@keyframes toastFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastFadeOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* ---------- Богатый текст из редактора (профили и лента) ---------- */

.rich-block h3 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin: 18px 0 8px; }
.rich-block ul { list-style: disc; margin: 0 0 12px; padding-left: 26px; }
.rich-block ol { list-style: decimal; margin: 0 0 12px; padding-left: 26px; }
.rich-block li { margin-bottom: 5px; }
.rich-block table { border-collapse: collapse; width: 100%; margin: 6px 0 14px; font-size: 14px; background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rich-block td, .rich-block th { border: 1px solid var(--line); padding: 8px 12px; line-height: 1.4; }
.rich-block th { background: var(--soft); font-weight: 800; text-align: left; }
.rich-block mark { background: #fff0a8; padding: 0 4px; border-radius: 5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rich-block b, .rich-block strong { font-weight: 800; }
.rich-block a { color: var(--accent); font-weight: 700; }