/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: url("fon.png") no-repeat center center fixed;
    background-size: cover;
    color: #111;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    color: inherit;
}

/* сам логотип */
.logo-link::before {
    content: "";
    width: 28px;
    height: 28px;
    display: inline-block;

    background-image: url("/assets/logo.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* меню */
.menu {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.menu a {
    text-decoration: none;
    color: #333;
    padding: 6px 10px;
    border-radius: 10px;
    transition: 0.2s;
}

.menu a:hover {
    background: #f0f0f0;
}

/* ===== LAYOUT ===== */
.layout {
    display: grid;
    gap: 20px;
    padding: 20px 24px;
    flex: 1;
    width: 100%;
    margin: 0;
    align-items: start;
}

/* Страницы без колонок — один столбец по центру (именованная area «content» без шаблона съезжала вбок) */
.layout:not(.layout--with-sidebars) {
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
    max-width: none;
}

/* Главная: боковые панели по краям, центр тянется */
.layout.layout--with-sidebars {
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(200px, 240px);
    grid-template-areas: "left content right";
    max-width: none;
}

.left {
    grid-area: left;
}

.content {
    min-width: 0;
    width: 100%;
}

.layout.layout--with-sidebars .content {
    grid-area: content;
}

.layout:not(.layout--with-sidebars) .content {
    grid-area: auto;
    max-width: 960px;
}

.right {
    grid-area: right;
}
/* ===== ФИЛЬТРЫ ===== */
.left h3 {
    margin-bottom: 10px;
}

.left a {
    display: block;
    margin: 8px 0;
    text-decoration: none;
    color: #444;
    padding: 6px 8px;
    border-radius: 8px;
}

.left a:hover {
    background: #f5f5f5;
}

/* ===== МОБИЛКА ===== */
.burger {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
}
@media (max-width: 900px) {
    .layout.layout--with-sidebars {
        grid-template-columns: 1fr;
        grid-template-areas:
            "left"
            "right"
            "content";
    }

        .burger {
        display: block;
    }

    .left, .right {
        width: 100%;
    }
    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 10px;
    }

    .header {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .menu.active {
        display: flex;
    }

    .nav-user {
        width: 100%;
        padding: 6px 10px;
    }
}


.auth-wrapper {
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.auth-card h2 {
    margin-bottom: 18px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.auth-card input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1px solid #e6e6e6;
    outline: none;
    font-size: 14px;
    transition: 0.2s;
    background: #fafafa;
}

.auth-card input:focus {
    border-color: #999;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.auth-card button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: #111;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.auth-card button:hover {
    background: #333;
}

.auth-error {
    background: #ffe5e5;
    color: #b00020;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    text-align: center;
}

.auth-extra {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: #555;
}

.auth-extra a {
    color: #1565c0;
    font-weight: 600;
    text-decoration: none;
}

.auth-extra a:hover {
    text-decoration: underline;
}

.footer {
    background: white;
    text-align: center;
    padding: 14px 20px;
    color: #666;
    font-size: 14px;
}

.nav-user {
    font-size: 14px;
    color: #555;
    align-self: center;
    padding: 0 6px;
}

.badge-admin {
    font-size: 11px;
    vertical-align: middle;
    background: #fde8cf;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 4px;
}

.left h3.mt {
    margin-top: 20px;
}

.tag-search input {
    width: 100%;
    padding: 8px 10px;
    margin: 8px 0 6px;
    border-radius: 10px;
    border: 1px solid #e6e6e6;
    font-size: 14px;
}

.tag-search button {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.small-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: #1976d2;
}

.top-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.top-list li {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.35;
}

.top-list a {
    color: #222;
}

.muted {
    color: #777;
}

.container-inner {
    max-width: 720px;
    margin: 0 auto;
}

.layout--with-sidebars .container-inner {
    max-width: none;
    width: 100%;
}

.title {
    font-size: clamp(26px, 4vw, 34px);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.subtitle {
    color: #555;
    margin-bottom: 22px;
    font-size: 15px;
}

.empty-state {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.feed {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.post-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    display: grid;
}

.post-card:not(.slim) {
    grid-template-columns: minmax(0, 200px) 1fr;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "left"
            "right"
            "content";
    }

    .left {
        display: block;
        order: 1;
    }

    .right {
        display: block;
        order: 2;
    }

    .content {
        order: 3;
    }

    .left, .right {
        width: 100%;
    }
}

.thumb {
    display: block;
    background: #eaeaea;
    min-height: 140px;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-height: 280px;
}

.thumb.sm {
    width: 120px;
    min-height: 80px;
    flex-shrink: 0;
}

.thumb.sm img {
    max-height: 140px;
}

.post-body.row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.post-body {
    padding: 16px 18px;
}

.post-card.slim .post-body {
    padding: 14px;
}

.post-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.post-text.large {
    font-size: 18px;
    line-height: 1.5;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-chip {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef3ff;
    color: #1e3a5f;
    text-decoration: none;
}

.tag-chip:hover {
    background: #dfe9ff;
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    border: none;
    background: #f0f2f6;
    color: #111;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.btn.comment:hover {
    background: #e6e9f2;
}

.btn.like {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* само сердце */
.btn.like .heart {
    font-size: 18px;
    color: #9aa0a6; /* серое */
    transition: transform 0.15s ease, color 0.2s ease;
}

/* hover эффект */
.btn.like:hover .heart {
    transform: scale(1.15);
    color: #6b7280;
}

/* активный лайк */
.btn.like.like--active .heart {
    color: #e0245e; /* красное сердце */
}

/* hover по активному */
.btn.like.like--active:hover .heart {
    color: #c2185b;
}

.btn-muted {
    cursor: default;
    opacity: 0.7;
}

.inline-form {
    display: inline;
}

.btn-danger {
    background: #ffe5e5;
    color: #8b1538;
}

.btn-danger:hover {
    background: #ffd5d8;
}

.post-page .back-link {
    display: inline-block;
    margin-bottom: 16px;
    text-decoration: none;
    font-size: 14px;
    color: #1976d2;
}

.post-single-image img {
    width: 100%;
    border-radius: 16px;
    display: block;
    max-height: 420px;
    object-fit: cover;
}

.post-single-head {
    margin: 14px 0 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.admin-bar {
    margin-top: 20px;
}

.comments-title {
    font-size: 20px;
    margin: 40px 0 16px;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e4e6eb;
    font-size: 15px;
    margin-bottom: 10px;
    font-family: inherit;
}

.comment-form button {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.comment {
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.comment-author {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.comments-block {
    margin-bottom: 40px;
}

.auth-wrapper.wide {
    align-items: flex-start;
}

.form-large {
    max-width: 640px;
}

.hint {
    font-size: 14px;
    color: #555;
    margin-bottom: 14px;
    line-height: 1.45;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 10px 0 6px;
}

.form-large textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid #e6e6e6;
    font-family: inherit;
    font-size: 15px;
}

.form-large input[type="file"] {
    margin-bottom: 10px;
    font-size: 14px;
}

.about-page .prose {
    background: #fff;
    padding: 24px 28px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    line-height: 1.65;
}

.about-page .prose p + p {
    margin-top: 14px;
}
