/* ==================== Глобальні стилі ==================== */
@import url('https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent-color: #2563eb;
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== Preloader Styles ==================== */
.site-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.preloader-logo {
    width: 120px;
    height: 120px;
    animation: preloaderBounce 1.2s ease-in-out infinite;
}

.preloader-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 30px rgba(37, 99, 235, 0.2));
}

.preloader-ring {
    animation: preloaderSpin 2s linear infinite;
    transform-origin: 100px 100px;
}

.preloader-dots {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.preloader-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6, #7c3aed);
    animation: preloaderDotBounce 1.2s ease-in-out infinite;
}

.preloader-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.preloader-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

.preloader-text-label {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 600;
    letter-spacing: 0.04em;
    animation: fadeInUp 0.8s ease infinite alternate;
}

@keyframes preloaderBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

@keyframes preloaderSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes preloaderDotBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.fade-in-element {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-element.visible {
    animation: fadeInUp 0.6s ease-out forwards;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -1;
    transition: all 0.2s ease;
}

.skip-link:focus,
.skip-link:active {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: 0.75rem 1rem;
    background: rgba(37, 99, 235, 0.95);
    color: white;
    border-radius: 0.5rem;
    z-index: 1000;
    text-decoration: none;
}

body.auth-page {
    background: #f5f7fb;
    color: #111827;
}

.auth-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
    background: transparent;
}

body.auth-page .auth-bg::before,
body.auth-page .auth-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #c7d2fe, #4f46e5);
    opacity: 0.12;
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

body.auth-page .auth-bg::before {
    width: 180px;
    height: 180px;
    top: 15%;
    left: 15%;
}

body.auth-page .auth-bg::after {
    width: 240px;
    height: 240px;
    right: 10%;
    bottom: 10%;
    animation-delay: 1s;
}

body.auth-page .auth-bg .particle {
    display: none;
}

.auth-bg .particle:nth-child(1) {
    width: 110px;
    height: 110px;
    top: 8%;
    left: 6%;
    animation-duration: 20s;
}

.auth-bg .particle:nth-child(2) {
    width: 72px;
    height: 72px;
    top: 16%;
    right: 10%;
    animation-duration: 16s;
    animation-delay: 2s;
}

.auth-bg .particle:nth-child(3) {
    width: 96px;
    height: 96px;
    top: 50%;
    left: 10%;
    animation-duration: 22s;
    animation-delay: 1s;
}

.auth-bg .particle:nth-child(4) {
    width: 58px;
    height: 58px;
    bottom: 18%;
    right: 18%;
    animation-duration: 18s;
    animation-delay: 3s;
}

.auth-bg .particle:nth-child(5) {
    width: 84px;
    height: 84px;
    bottom: 6%;
    left: 20%;
    animation-duration: 24s;
    animation-delay: 4s;
}

.auth-bg .particle:nth-child(6) {
    width: 42px;
    height: 42px;
    top: 40%;
    right: 30%;
    animation-duration: 14s;
    animation-delay: 5s;
}

.auth-bg .particle:nth-child(7) {
    width: 54px;
    height: 54px;
    top: 68%;
    right: 14%;
    animation-duration: 20s;
    animation-delay: 2s;
}

.auth-bg .particle:nth-child(8) {
    width: 32px;
    height: 32px;
    bottom: 32%;
    left: 60%;
    animation-duration: 16s;
    animation-delay: 6s;
}

.auth-bg .particle:nth-child(9) {
    width: 38px;
    height: 38px;
    top: 32%;
    left: 70%;
    animation-duration: 18s;
    animation-delay: 1.5s;
}

.auth-bg .particle:nth-child(10) {
    width: 72px;
    height: 72px;
    bottom: 12%;
    right: 40%;
    animation-duration: 22s;
    animation-delay: 2.5s;
}

@keyframes floatParticle {
    0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.65; }
    20% { transform: translate3d(18px, -12px, 0) scale(1.04); opacity: 0.85; }
    40% { transform: translate3d(-18px, 22px, 0) scale(0.96); opacity: 0.72; }
    60% { transform: translate3d(12px, 14px, 0) scale(1.02); opacity: 0.82; }
    80% { transform: translate3d(-10px, -18px, 0) scale(0.98); opacity: 0.7; }
    100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.65; }
}

.auth-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    padding: 2rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.2);
}

.auth-card h1, .auth-card h2 {
    text-align: center;
}

.auth-card h1 {
    color: #111827;
    margin-bottom: 0.5rem;
}

.auth-card h2 {
    color: #4b5563;
    margin-bottom: 1.5rem;
}

/* Mobile optimizations */
@media (max-width: 720px) {
    .site-nav { padding: 0.5rem 1rem; }
    .site-header { box-shadow: none; }
    .site-container, .container { padding-left: 0.75rem; padding-right: 0.75rem; }
    .logo-image { max-height: 34px; }
    .mobile-menu-toggle { display: block; background: transparent; color: #111827; box-shadow: none; }
    nav.primary-nav { display: none; }
    .hero-content h1 { font-size: clamp(1.4rem, 5.5vw, 2.25rem); }
    .hero-content p { font-size: 0.96rem; }
    .featured-card-large-image, .featured-image, .section-card-image, .sidebar-link-image { height: auto; object-fit: cover; }
    .featured-card-large { border-radius: 12px; }
    .post-card { padding: 0.85rem; }
    .post-card .post-card-top { gap: 0.5rem; }
    .author-avatar { width: 44px; height: 44px; }
    .author-of-week-avatar { width: 56px; height: 56px; border-radius: 8px; }
    .btn, .auth-btn, .post-author, .nav-link { padding: 0.6rem 0.9rem; }
    .category-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0.5rem; }
    .category-bar .category-btn { flex: 0 0 auto; }
}

body.auth-page .auth-card h1 {
    color: #0f172a;
}

body.auth-page .auth-card h2 {
    color: #475569;
}

body.auth-page label,
body.auth-page .auth-link,
body.auth-page .form-group input,
body.auth-page .form-group textarea,
body.auth-page .form-group select {
    color: #0f172a;
}

body.auth-page .form-group input,
body.auth-page .form-group textarea,
body.auth-page .form-group select {
    background: #fff;
}

main {
    flex: 1;
}

/* ==================== Навігація ==================== */
.site-header {
    background: #ffffff;
    color: #111827;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Auth buttons in header */
.auth-buttons {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}
.auth-buttons.mobile-auth {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    border: 1px solid rgba(15,23,42,0.06);
    color: #0f172a;
    background: transparent;
}
.auth-btn:hover { transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }
.auth-btn .auth-icon { display:inline-grid; place-items:center; width:1.15rem; height:1.15rem; font-size:1.05rem; }
.auth-btn--primary {
    background: var(--accent-color);
    color: white;
    border-color: rgba(37,99,235,0.9);
    box-shadow: 0 8px 18px rgba(37,99,235,0.12);
}
.auth-btn--ghost {
    background: transparent;
    color: #0f172a;
    border-color: rgba(15,23,42,0.06);
}

@media (max-width: 720px) {
    .nav-right .auth-buttons { display: none; }
    .mobile-auth { display: flex; }
}

/* Combined auth combo */
.auth-combo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #0f172a;
}
.auth-combo__part {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: inherit;
    padding: 0.25rem 0.4rem;
}
.auth-combo__icon { display: inline-grid; place-items:center; color: var(--accent-color); }
.auth-combo__sep { color: rgba(15,23,42,0.4); padding: 0 0.25rem; }
.auth-combo__login .auth-combo__text { display: inline-block; }
.auth-combo__register { color: var(--accent-color); }

@media (max-width: 720px) {
    .auth-combo { gap: 0.25rem; }
    .auth-combo__text { display: none; }
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.02em;
    position: relative;
}


.hero-content h1 {
    font-size: clamp(2.75rem, 5vw, 4.2rem);
    margin-bottom: 1rem;
    line-height: 1.03;
    letter-spacing: -0.03em;
}

.hero-content p {
    max-width: 720px;
    margin: 0 auto 1.75rem;
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.85;
}

.hero-content .btn-primary {
    padding: 0.95rem 1.85rem;
    font-size: 1rem;
    border-radius: 999px;
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.18);
}

.homepage-sections {
    padding: 2.5rem 0 1.75rem;
}

.top-featured-posts {
    margin-bottom: 2rem;
}

.top-featured-posts .section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.top-featured-posts .section-heading h2 {
    font-size: 1.45rem;
    margin: 0;
}

.top-featured-posts .section-heading p {
    margin: 0;
    color: #64748b;
    font-size: 0.96rem;
}

.featured-slider-container {
    position: relative;
    overflow: hidden;
    padding: 1rem 0;
}

.featured-slider-track {
    display: flex;
    gap: 1rem;
    transition: transform 0.4s ease;
    will-change: transform;
}

.featured-slide {
    min-width: 100%;
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
}

.featured-card-large {
    width: min(100%, 1150px);
    overflow: hidden;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
    display: flex;
    flex-direction: column;
    min-height: 280px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.featured-card-large:hover {
    transform: translateY(-8px);
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.16);
    border-color: rgba(59, 130, 246, 0.3);
}

.featured-card-large-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.featured-card-large:hover .featured-card-large-image {
    transform: scale(1.04);
}

.featured-card-large-content {
    padding: 1.4rem 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.featured-card-label {
    display: inline-flex;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.featured-card-large-title {
    color: #0f172a;
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
    line-height: 1.2;
}

.featured-card-large-title:hover {
    color: #1d4ed8;
}

.featured-card-large-meta {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: auto;
}

.slider-control {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255, 255, 255, 0.88);
    color: #1d4ed8;
    font-size: 1.75rem;
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    z-index: 2;
}

.slider-control:hover {
    transform: translateY(-50%) scale(1.03);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.slider-prev {
    left: 1rem;
}

.slider-next {
    right: 1rem;
}

.slider-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.55rem;
    z-index: 2;
}

.slider-counter {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(148, 163, 184, 0.7);
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.slider-dot.active,
.slider-dot:hover {
    background: #1d4ed8;
    transform: scale(1.15);
}

@media (max-width: 900px) {
    .featured-slider-container {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding: 0 0 2.2rem;
    }

    .featured-slider-track {
        gap: 0;
    }

    .featured-slide {
        padding: 0 0.75rem;
        box-sizing: border-box;
    }

    .featured-card-large {
        width: 100%;
        min-height: auto;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .featured-card-large-image {
        height: 50vh;
        min-height: 240px;
    }

    .featured-card-large-content {
        padding: 1rem 1rem 1.2rem;
    }

    .featured-card-large-title {
        font-size: 1.05rem;
        line-height: 1.35;
    }

    .featured-card-large-meta {
        font-size: 0.9rem;
    }

    .slider-control {
        width: 2.8rem;
        height: 2.8rem;
        font-size: 1.4rem;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    }

    .slider-prev {
        left: 0.35rem;
    }

    .slider-next {
        right: 0.35rem;
    }

    .slider-dots {
        bottom: 0.35rem;
    }

    .slider-counter {
        right: 0.5rem;
        bottom: 0.4rem;
        font-size: 0.78rem;
    }
}

.featured-card-large-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.featured-card-large-content {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.featured-card-large-title {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.3;
}

.featured-card-large-title:hover {
    color: #1d4ed8;
}

.featured-card-large-meta {
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-top: auto;
}

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

.section-cards {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.section-card {
    padding: 1.5rem;
    border-radius: 1rem;
    background: #ffffff;
    border: 1px solid rgba(59, 130, 246, 0.12);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.08);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.section-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.28);
}

.section-card-image {
    width: 100%;
    display: block;
    border-radius: 0.85rem;
    margin-bottom: 1rem;
    object-fit: cover;
    max-height: 220px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-card:hover .section-card-image {
    transform: scale(1.05);
}

.section-card h2 {
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
}

.section-card p {
    color: #4b5563;
    margin-bottom: 1rem;
    line-height: 1.7;
}

@media (max-width: 980px) {
    .section-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .section-cards {
        grid-template-columns: 1fr;
    }
}

.logo-icon-wrap {
    width: 2.15rem;
    height: 2.15rem;
    display: grid;
    place-items: center;
    position: relative;
    flex-shrink: 0;
}

.logo-icon-ring {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    filter: blur(0.3px);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 6px 14px rgba(37, 99, 235, 0.12);
    animation: spinSlow 10s linear infinite;
}

.logo-icon-core {
    position: absolute;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 0.38rem;
    background: #eff6ff;
    transform: rotate(45deg);
    box-shadow:
        inset 0 0 0 1px rgba(37, 99, 235, 0.06),
        0 0 8px rgba(96, 165, 250, 0.1);
}

.logo-icon-core::before,
.logo-icon-core::after {
    content: '';
    position: absolute;
    background: #2563eb;
    border-radius: 999px;
}

.logo-icon-core::before {
    width: 0.18rem;
    height: 0.68rem;
    left: 0.5rem;
    top: 0.26rem;
}

.logo-icon-core::after {
    width: 0.68rem;
    height: 0.18rem;
    left: 0.26rem;
    top: 0.5rem;
}

.logo-icon-spark {
    position: absolute;
    width: 0.35rem;
    height: 0.35rem;
    background: #fff;
    border-radius: 50%;
    right: 0.1rem;
    top: 0.12rem;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-text {
    font-size: 2rem;
    color: #0f172a;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    font-family: 'Permanent Marker', cursive;
    line-height: 1;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 45%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.logo-image {
    width: 3.2rem;
    height: 3.2rem;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.16);
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    display: block;
    flex-shrink: 0;
}

.footer-logo-image {
    width: 2.8rem;
    height: 2.8rem;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.16);
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    margin-right: 0.65rem;
    flex-shrink: 0;
}

.logo-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    color: #312e81;
    background: rgba(192, 132, 252, 0.12);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    border: none;
    background: #111827;
    color: #ffffff;
    padding: 0.35rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
    transform: translateY(-1px);
    box-shadow: 0 22px 38px rgba(0, 0, 0, 0.24);
    background: #0f172a;
}

.mobile-menu-toggle .menu-bar {
    display: block;
    width: 1.3rem;
    height: 0.18rem;
    background: #ffffff;
    border-radius: 999px;
    margin: 0.24rem auto;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-menu {
    display: none;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding: 1rem 1.25rem 1.25rem;
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
}

.mobile-menu.open {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 1000px;
    opacity: 1;
    padding: 1rem 1.25rem 1.25rem;
}

.mobile-menu .nav-link,
.mobile-menu .btn-logout,
.mobile-menu .btn-primary {
    width: 100%;
    text-align: left;
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

.mobile-menu .nav-link {
    background: #f8fafc;
}

.mobile-menu .btn-logout,
.mobile-menu .btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: transparent;
}

.nav-link, .btn-logout {
    text-decoration: none;
    color: #111827;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    cursor: pointer;
}

.nav-link:hover,
.btn-logout:hover {
    background: rgba(37, 99, 235, 0.06);
    color: #0f172a;
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.14);
}

/* Grouped Navigation */
.nav-links-group,
.nav-user-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Icon Links in Nav */
.nav-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #5b21b6;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-icon-link svg {
    width: 20px;
    height: 20px;
}

.nav-icon-link:hover {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 10px;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
}

/* Profile Dropdown */
.profile-dropdown-wrapper {
    position: relative;
}

.profile-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    padding: 0;
}

.profile-trigger:hover {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.2);
}

.profile-trigger img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.profile-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 280px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.1);
    z-index: 2000;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.profile-dropdown-info {
    flex: 1;
    min-width: 0;
}

.profile-dropdown-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-dropdown-link {
    color: #7c3aed;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
    display: block;
    margin-top: 0.25rem;
}

.profile-dropdown-link:hover {
    text-decoration: underline;
}

.profile-dropdown-divider {
    height: 1px;
    background: #f3f4f6;
}

.profile-dropdown-menu {
    padding: 0.5rem 0;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: transparent;
    border: 0;
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    font-weight: 500;
    text-align: left;
}

.profile-dropdown-item:hover {
    background: #f9fafb;
    color: #7c3aed;
}

.profile-dropdown-item--danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.profile-dropdown-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.profile-dropdown-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 10px;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
}

.profile-dropdown-logout {
    padding: 0.5rem 0;
}

/* ==================== Контейнери ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-footer {
    background: #f8fafc;
    color: #0f172a;
    border-top: 1px solid rgba(59, 130, 246, 0.12);
    margin-top: 2rem;
    padding: 3rem 0 1rem;
}

.footer-bottom {
    background: #f1f5f9;
    padding: 1rem 0;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.footer-brand {
    max-width: 420px;
}

.footer-logo {
    margin-bottom: 0.9rem;
}

.footer-logo-icon {
    transform: scale(0.92);
}

.footer-logo .logo-text {
    color: #0f172a;
    background: linear-gradient(90deg, #0f172a, #1d4ed8, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-text {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-socials {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.footer-socials a {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.footer-socials a:hover {
    background: #eef2ff;
    color: #1d4ed8;
    transform: translateY(-1px);
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.footer-columns h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4f46e5;
    margin-bottom: 0.8rem;
}

.footer-columns a {
    display: block;
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 0.45rem;
    transition: color 0.2s ease;
}

.footer-columns a:hover {
    color: #1d4ed8;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1rem;
}

.footer-bottom-links a {
    color: #64748b;
    text-decoration: none;
}

.footer-bottom-links a:hover {
    color: #1d4ed8;
}

.legal-page {
    padding: 3rem 0;
}

.legal-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.legal-tag {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4f46e5;
    background: #eef2ff;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}

.legal-card h1 {
    font-size: 2rem;
    margin-bottom: 0.7rem;
    color: #0f172a;
}

.legal-card > p {
    color: #475569;
    margin-bottom: 1.5rem;
}

.legal-content h2 {
    font-size: 1rem;
    margin: 1.2rem 0 0.4rem;
    color: #0f172a;
}

.legal-content p {
    color: #475569;
    line-height: 1.75;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    40% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.auth-card h1, .auth-card h2 {
    text-align: center;
}

.auth-card h1 {
    color: #111827;
    margin-bottom: 0.5rem;
}

.auth-card h2 {
    color: #4b5563;
    margin-bottom: 1.5rem;
}

/* ==================== Форми ==================== */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.45rem;
    color: #374151;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: #111827;
    transition: all 0.2s ease;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-weight: 600;
}

.form-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

textarea {
    resize: vertical;
    min-height: 130px;
}

/* ==================== Кнопки ==================== */
.btn {
    padding: 0.8rem 1.1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    background: #2563eb;
    color: #ffffff;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.16);
}

.btn-secondary:hover {
    background: #2563eb;
}

.btn-danger {
    background: #1d4ed8;
    color: #fff;
}

.btn-danger:hover {
    background: #1e40af;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ==================== Повідомлення ==================== */
.alert {
    padding: 0.95rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border-left-color: #dc2626;
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border-left-color: #16a34a;
}

.alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-left-color: #2563eb;
}

/* ==================== Головна сторінка ==================== */
.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
    padding: 1.75rem 0 3rem;
}

#postsFeed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.feed-panel {
    width: 100%;
    min-width: 0;
}

.sidebar-panel {
    position: sticky;
    top: 5.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-card {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    padding: 1.4rem;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.07);
    position: relative;
    overflow: hidden;
}

.sidebar-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 30%);
}

.sidebar-card h3 {
    position: relative;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #0f172a;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar-list {
    display: grid;
    gap: 0.8rem;
}

.sidebar-link {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: center;
    text-decoration: none;
    color: #1f2937;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid rgba(59, 130, 246, 0.12);
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.sidebar-link:hover {
    background: #eef4ff;
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.sidebar-link::after {
    content: '›';
    font-size: 1.1rem;
    color: rgba(37, 99, 235, 0.75);
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-link-image {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 16px;
    flex-shrink: 0;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: #ffffff;
}

/* Featured card styles */
.featured-card {
    display: block;
    margin-bottom: 1rem;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f1f8ff 100%);
    border: 1px solid rgba(37,99,235,0.12);
    box-shadow: 0 12px 28px rgba(37,99,235,0.06);
}
.featured-link { display: flex; gap: 0.75rem; text-decoration: none; color: inherit; padding: 0.9rem; align-items: center; }
.featured-image { width: 86px; height: 86px; object-fit: cover; border-radius: 10px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.6); }
.featured-body { display: flex; flex-direction: column; gap: 0.35rem; }
.featured-body h4 { font-size: 1rem; margin: 0; font-weight: 800; color: #0f172a; }
.featured-body p { margin: 0; color: #475569; font-size: 0.85rem; max-width: 220px; }
.featured-cta { margin-top: 0.25rem; font-weight: 700; color: var(--accent-color); font-size: 0.85rem; }

@media (max-width: 900px) {
    .featured-body p { max-width: 160px; }
}

.sidebar-link-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link-content span {
    font-weight: 700;
    line-height: 1.25;
}

.sidebar-link small {
    color: #4b5563;
    font-size: 0.82rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.stats-grid div {
    background: linear-gradient(180deg, #eff6ff 0%, #ecfeff 100%);
    border-radius: 10px;
    padding: 0.7rem;
}

.stats-grid strong {
    display: block;
    font-size: 1rem;
    color: #111827;
}

.stats-grid span {
    color: #6b7280;
    font-size: 0.85rem;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    text-decoration: none;
    color: #374151;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: #f9fafb;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-link:hover {
    background: #eef2ff;
    color: #1d4ed8;
    transform: translateY(-1px);
}

.sidebar-link-image {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid rgba(37, 99, 235, 0.12);
    background: #ffffff;
}

.sidebar-link-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-link-content span {
    font-weight: 600;
    line-height: 1.3;
}

.sidebar-link small {
    color: #6b7280;
    font-size: 0.84rem;
}

.feed-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 1.25rem;
    margin-bottom: 1.35rem;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
    align-items: center;
}

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

.search-box input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #d1d5eb;
    border-radius: 16px;
    padding: 0.95rem 1rem;
    color: #111827;
    font-size: 0.98rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.sort-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.4rem;
    align-items: center;
}

.sort-btn {
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid #d1d5eb;
    background: #f8fafc;
    color: #344054;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 110px;
}

.sort-btn.active,
.sort-btn:hover {
    background: #e0e7ff;
    color: #1d4ed8;
    border-color: #c7d2fe;
}

.category-bar {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.category-bar::-webkit-scrollbar {
    height: 6px;
}

.category-bar::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.25);
    border-radius: 999px;
}

.category-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    padding: 0.6rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-btn.active,
.category-btn:hover {
    background: #e0e7ff;
    color: #1d4ed8;
    border-color: #c7d2fe;
}

.info-banner,
.post-create {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    color: #374151;
}

.info-banner a {
    color: #1d4ed8;
    text-decoration: none;
}

.post-card {
    background: #ffffff;
    border: 1px solid rgba(59, 130, 246, 0.14);
    border-radius: 18px;
    padding: 1rem;
    margin-bottom: 0;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
    text-align: left;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
    justify-content: center;
}

.posts-grid .post-card {
    max-width: 360px;
    margin: 0 auto;
    padding: 1rem;
    border-radius: 18px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.posts-grid .post-card .post-card-image,
.posts-grid .post-card .post-card-image-link {
    border-radius: 14px;
    overflow: hidden;
}

.posts-grid .post-card .post-card-image {
    height: 180px;
    object-fit: cover;
    margin-bottom: 0.85rem;
}

.posts-grid .post-card .post-card-body {
    gap: 0.6rem;
}

.posts-grid .post-card .post-card-title {
    font-size: 1.05rem;
    line-height: 1.35;
}

.posts-grid .post-card p {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.55;
}

.posts-grid .post-card .post-card-meta {
    margin-top: auto;
    font-size: 0.8rem;
    color: #64748b;
}

.posts-grid .post-card .post-card-actions {
    margin-top: 0.35rem;
    gap: 0.6rem;
}

.soft-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: end;
    margin: 0 0 1.4rem;
    padding: 1rem;
    border: 1px solid #e3e8f2;
    border-radius: 16px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 12px 28px rgba(15,23,42,0.04);
}

.soft-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 180px;
}

.soft-field-label {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.soft-field input,
.soft-field select {
    padding: 0.7rem 0.8rem;
    border: 1px solid #d7deeb;
    border-radius: 10px;
    font: inherit;
    background: #fff;
}

.soft-toolbar-actions {
    display: flex;
    gap: 0.6rem;
    margin-left: auto;
}

.soft-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.soft-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.soft-meta {
    margin-top: 0;
}

.home-page .post-card,
.home-page .post-card .post-card-body,
.home-page .post-card .post-title,
.home-page .post-card .post-description,
.home-page .post-card .read-more-btn {
    text-align: left;
}

.post-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.16);
    border-color: rgba(37, 99, 235, 0.36);
    background: linear-gradient(135deg, #ffffff 0%, rgba(59, 130, 246, 0.02) 100%);
}

.posts-feed.loading {
    min-height: 360px;
}

.loading-placeholder {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.skeleton-card {
    background: linear-gradient(90deg, #edf2f7 0%, #f8fafc 50%, #edf2f7 100%);
    background-size: 200% 100%;
    border-radius: 18px;
    min-height: 220px;
    animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.post-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.post-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.14);
}

.author-block {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.author-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: #f8fafc;
}

.post-author {
    color: #0f172a;
    font-weight: 700;
    text-decoration: none;
}

.post-date {
    color: #64748b;
    font-size: 0.88rem;
}

.post-image,
.post-detail-image {
    width: 100%;
    height: 220px;
    max-height: 220px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.post-card-body {
    margin-bottom: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    display: block;
    color: #0f172a;
    font-size: 1.06rem;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 0.45rem;
    line-height: 1.3;
}

.post-title:hover {
    color: #2563eb;
}

.post-description {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 0.45rem;
    font-size: 0.94rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-content-preview {
    color: #475569;
    line-height: 1.65;
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.read-more-btn {
    align-self: flex-start;
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.18);
    transition: background 0.2s ease, transform 0.2s ease;
}

.read-more-btn:hover {
    background: rgba(37, 99, 235, 0.16);
    transform: translateY(-1px);
}

.post-footer {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    border-top: 1px solid #eff6ff;
    padding-top: 0.9rem;
}

.post-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.55rem 0.8rem;
}

.post-stat-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: #2563eb;
}

.post-action {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #111827;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
}

.post-action.liked {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* ==================== Сторінка публікації ==================== */
.post-page-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.back-link {
    margin: 1rem 0;
}

.post-detail {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.post-detail-header {
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.post-detail-title {
    font-size: 2rem;
    color: #111827;
    margin-top: 0.4rem;
}

.post-detail-meta {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    color: #6b7280;
    font-size: 0.9rem;
    align-items: center;
}

.post-author-block {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.2rem;
}

.post-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.post-author-name {
    color: #111827;
    font-weight: 700;
}

.post-detail-description {
    color: #111827;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.post-detail-content {
    color: #374151;
    line-height: 1.9;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.post-detail-content h2,
.post-detail-content h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

.post-detail-content p,
.post-detail-content ul,
.post-detail-content ol {
    margin-bottom: 1rem;
}

.post-detail-content blockquote {
    border-left: 4px solid #c7d2fe;
    padding: 1rem 1.25rem;
    margin: 1.2rem 0;
    background: #f8fafc;
    color: #334155;
    border-radius: 0.75rem;
}

.post-detail-content code,
.post-detail-content pre {
    background: #f8fafc;
    padding: 0.9rem;
    border-radius: 0.85rem;
    overflow-x: auto;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    color: #6b7280;
    font-size: 0.95rem;
    margin: 1rem 0 1.3rem;
}

.breadcrumbs a {
    color: #2563eb;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    opacity: 0.6;
}

.post-primary-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.95rem;
    color: #475569;
    font-size: 0.95rem;
}

.post-category-badge {
    background: #eef2ff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.post-readtime {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
}

.post-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.post-action {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #111827;
    padding: 0.65rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.post-action:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.post-action.liked {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.post-action.share-btn {
    background: #eef2ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.post-action.share-btn:hover {
    background: #dbeafe;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.post-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #2563eb;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.post-tag:hover {
    background: #eff6ff;
    transform: translateY(-1px);
}

.post-action.bookmark-btn.active {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0c4a6e;
}

.comment-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    color: #475569;
    font-size: 0.95rem;
}

.comment-sort-btn {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #334155;
    border-radius: 999px;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
}

.comment-sort-btn.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.comments-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.comments-meta-text {
    color: #475569;
    font-size: 0.96rem;
}

/* ==================== Коментарі ==================== */
.comments-section {
    margin-top: 1.5rem;
}

.comments-title {
    font-size: 1.2rem;
    color: #111827;
    margin-bottom: 1rem;
}

.comment-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.comment {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #4f46e5;
    border-radius: 10px;
    padding: 0.9rem;
    margin-bottom: 0.8rem;
}

.comment--nested {
    margin-left: 1.5rem;
    border-left-color: #7c3aed;
}

.comment-author {
    color: #111827;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.comment-time {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.comment-content {
    color: #374151;
    line-height: 1.6;
}

.comment-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.comment-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.55rem;
}

.reply-form {
    margin-top: 0.85rem;
}

.reply-textarea,
#commentContent {
    width: 100%;
    min-height: 110px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 1rem;
    background: #f8fafc;
    resize: vertical;
    color: #111827;
    font-size: 0.95rem;
}

.reply-form-actions,
.comment-form .form-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.75rem;
}

.comment-reply-btn,
.comment-sort-btn {
    transition: background 0.2s ease, color 0.2s ease;
}

.comment-reply-btn:hover {
    color: #3730a3;
}

.related-posts-section {
    margin-top: 2rem;
}

.related-posts-title {
    font-size: 1.2rem;
    color: #111827;
    margin-bottom: 1rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.related-post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.1);
}

.related-post-card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #f8fafc;
}

.related-post-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.related-post-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
}

.related-post-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: #6b7280;
}

@media (max-width: 900px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

.reply-form-container {
    margin-top: 0.6rem;
}

.reply-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.7rem;
}

.reply-textarea {
    width: 100%;
    min-height: 90px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.7rem;
    resize: vertical;
}

.reply-form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.btn-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
}

.notifications-page {
    padding: 2rem 0 3rem;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.notification-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
}

.notification-item.unread {
    border-left: 4px solid #4f46e5;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.3rem;
}

.notification-meta small {
    color: #6b7280;
}

/* ==================== Профіль ==================== */
.profile-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 1.5rem;
    padding: 2rem 0 3rem;
    align-items: start;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.35rem;
    margin-left: 0.3rem;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.profile-card,
.profile-posts {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.profile-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(59, 130, 246, 0.16);
    border-radius: 24px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 42%);
    pointer-events: none;
}

.profile-form .form-group {
    margin-bottom: 1rem;
}

.form-hint {
    display: block;
    margin-top: 0.3rem;
    color: #6b7280;
    font-size: 0.85rem;
}

.profile-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.profile-user {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.profile-avatar {
    width: 104px;
    height: 104px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.2);
    background: #f9fafb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.profile-user-info {
    flex: 1;
    min-width: 0;
}

.profile-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-header h1 {
    font-size: 1.45rem;
    margin-bottom: 0.15rem;
}

.profile-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #2563eb;
    background: #eff6ff;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
}

.profile-bio-text {
    color: #475569;
    margin: 0.25rem 0 0.35rem;
    line-height: 1.6;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    color: #64748b;
    font-size: 0.9rem;
}

.profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.profile-stat-card {
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: 16px;
    padding: 0.75rem 0.8rem;
}

.profile-stat-card strong {
    display: block;
    font-size: 1.05rem;
    color: #0f172a;
    margin-bottom: 0.15rem;
}

.profile-stat-card span {
    color: #64748b;
    font-size: 0.8rem;
}

.profile-form {
    margin-top: 1rem;
}

.profile-posts {
    padding: 1.5rem;
}

.profile-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-posts-header h3 {
    font-size: 1.2rem;
}

.profile-posts .post-card {
    margin-bottom: 0.9rem;
}

/* ==================== Адмінка ==================== */
.admin-users-page {
    padding: 2rem 0 3rem;
}

.admin-users-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-users-header h1 {
    font-size: 1.8rem;
    margin-top: 0.4rem;
}

.admin-users-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-users-table th,
.admin-users-table td {
    text-align: left;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.admin-users-table th {
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-active {
    background: #ecfdf3;
    color: #15803d;
}

.status-restricted {
    background: #fff7ed;
    color: #c2410c;
}

.status-blocked {
    background: #fef2f2;
    color: #b91c1c;
}

.admin-actions-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-action-select {
    width: auto;
    min-width: 140px;
}

/* ==================== Пагінація ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(14px);
}

.cookie-banner-content {
    flex: 1;
    min-width: 220px;
}

.cookie-banner-content strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    color: #0f172a;
}

.cookie-banner-content p {
    margin: 0;
    line-height: 1.6;
    color: #1f2937;
    font-size: 1rem;
}

.cookie-banner-link {
    display: inline-block;
    margin-top: 0.6rem;
    color: #1d4ed8;
    text-decoration: underline;
    font-size: 1rem;
}

.cookie-banner-link:hover {
    color: #0f172a;
}

#cookieBannerAccept {
    white-space: nowrap;
}

.cookie-banner.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .cookie-banner {
        padding: 0.85rem 0.9rem;
        text-align: center;
    }

    .cookie-banner-content {
        width: 100%;
    }

    .cookie-banner button {
        width: 100%;
    }
}

.pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    min-width: 2.2rem;
}

.pagination-item.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.pagination-nav {
    font-weight: 700;
}

/* ==================== Завантаження ==================== */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== 404 сторінка ==================== */
.error-page {
    position: relative;
    min-height: 70vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 3rem 0;
}

.error-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 3rem 2rem;
    max-width: 560px;
    text-align: center;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    animation: fadeUp 0.7s ease both;
}

.error-tag {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 700;
    margin-bottom: 1rem;
}

.error-card h1 {
    font-size: 3rem;
    color: #111827;
    margin-bottom: 0.8rem;
}

.error-card p {
    color: #4b5563;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.error-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #c7d2fe, #4f46e5);
    opacity: 0.12;
    animation: float 6s ease-in-out infinite;
}

.orb-one {
    width: 180px;
    height: 180px;
    top: 15%;
    left: 15%;
}

.orb-two {
    width: 240px;
    height: 240px;
    right: 10%;
    bottom: 10%;
    animation-delay: 1s;
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-18px) scale(1.05);
    }
}

/* ==================== Утиліти ==================== */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.hidden {
    display: none;
}

.no-posts {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
}

.auth-link a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

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

.create-post-wrapper {
    max-width: 760px;
    margin: 2rem auto;
}

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

    .home-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar-panel {
        display: none;
    }
}

@media (max-width: 900px) {
    .profile-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    nav {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    #postsFeed {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-user {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .profile-posts-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Profile badges */
    .profile-badges {
        display: flex;
        gap: 0.4rem;
        margin-top: 0.25rem;
    }
    .badge-chip {
        display: inline-block;
        background: linear-gradient(90deg, #eef2ff, #fff);
        color: #1e293b;
        border: 1px solid rgba(59,130,246,0.12);
        padding: 0.18rem 0.5rem;
        border-radius: 999px;
        font-size: 0.78rem;
        font-weight: 600;
    }

    .post-detail-title {
        font-size: 1.6rem;
    }

    .post-card-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .feed-toolbar {
        padding: 1rem;
    }

    .feed-toolbar,
    .sort-toolbar,
    .category-bar {
        width: 100%;
    }

    .category-bar {
        gap: 0.5rem;
        margin-top: 0.6rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .category-btn,
    .sort-btn {
        flex: 1 1 auto;
        min-width: 120px;
    }

    .sort-toolbar {
        justify-content: stretch;
    }

    .post-card {
        padding: 1rem;
    }

    .post-image {
        height: 180px;
    }

    .post-footer {
        gap: 0.45rem;
    }
}

/* Homepage: make posts full-bleed on small screens */
@media (max-width: 600px) {
    .home-page .container {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .home-page .home-layout {
        padding-left: 0;
        padding-right: 0;
        gap: 0;
    }

    .home-page #postsFeed {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        padding: 0.5rem;
    }

    .home-page .post-card {
        border-radius: 0;
        margin: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }

    .home-page .post-card .post-image,
    .home-page .post-detail-image {
        border-radius: 0;
    }
}

.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
    padding: 0.55rem 0.75rem;
    justify-content: space-around;
    align-items: center;
    gap: 0.5rem;
}

/* ==================== Оновлена головна: editorial platform ==================== */
.home-page {
    background: #f6f8fc;
    color: #14213d;
}

.home-page .home-main {
    overflow: hidden;
    background: radial-gradient(circle at 12% 4%, rgba(99, 102, 241, 0.08), transparent 27rem), #f6f8fc;
}

.home-page .home-main > .container {
    max-width: 1480px;
}

.home-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 2rem;
    min-height: 440px;
    margin: 1.25rem 0 1.25rem;
    padding: clamp(2.2rem, 5vw, 5rem);
    overflow: hidden;
    border-radius: 32px;
    color: #fff;
    background: linear-gradient(118deg, #121a3a 0%, #1e2760 52%, #3d2b76 100%);
    box-shadow: 0 28px 70px rgba(31, 41, 91, 0.24);
}

.home-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.28;
    background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(90deg, #000, transparent 86%);
}

.home-hero-copy,
.home-hero-aside,
.hero-metrics { position: relative; z-index: 1; }
.home-hero-copy { max-width: 700px; }
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 1.3rem;
    color: #c4b5fd;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.hero-eyebrow-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #a78bfa; box-shadow: 0 0 0 5px rgba(167,139,250,.15); }
.home-hero h1 { max-width: 720px; margin: 0 0 1rem; color: #fff; font-size: clamp(2.7rem, 6vw, 5.5rem); line-height: .98; letter-spacing: -.065em; }
.home-hero-lead { max-width: 650px; margin: 0; color: #dbe3ff; font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.75; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.3rem; }
.hero-badges span { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .8rem; border-radius: 999px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.16); color: #e9eaff; font-size: .8rem; font-weight: 700; }
.home-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.3rem; margin-top: 1.6rem; }
.home-hero .btn-primary { padding: .9rem 1.3rem; border: 0; background: #a78bfa; color: #17133b; box-shadow: 0 15px 30px rgba(167,139,250,.25); }
.home-hero .btn-primary:hover { background: #c4b5fd; }
.hero-text-link, .hero-aside-link { color: #fff; font-weight: 700; text-decoration: none; }
.hero-text-link:hover, .hero-aside-link:hover { color: #c4b5fd; }
.hero-text-link span, .hero-aside-link span { margin-left: .35rem; color: #c4b5fd; }
.home-hero-aside { align-self: center; justify-self: end; width: min(100%, 350px); padding: 1.5rem 0 1.5rem 2rem; border-left: 1px solid rgba(255,255,255,.2); }
.hero-aside-label { margin-bottom: 1rem; color: #a5b4fc; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-aside-title { font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 800; line-height: 1.08; letter-spacing: -.04em; }
.hero-aside-title em { color: #c4b5fd; font-style: normal; }
.hero-aside-line { width: 48px; height: 3px; margin: 1.4rem 0; border-radius: 5px; background: #a78bfa; }
.home-hero-aside p { margin: 0 0 1.3rem; color: #cbd5f5; font-size: .92rem; line-height: 1.7; }
.hero-aside-link { font-size: .9rem; }
.hero-metrics { grid-column: 1 / -1; display: flex; gap: 2.7rem; margin-top: auto; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.16); }
.hero-metric { display: flex; align-items: baseline; gap: .55rem; }
.hero-metric strong { font-size: 1.45rem; letter-spacing: -.04em; }
.hero-metric span { color: #aab5dc; font-size: .8rem; }
.home-hero-glow { position: absolute; z-index: 0; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.home-hero-glow-one { width: 360px; height: 360px; right: 19%; top: -210px; background: rgba(129, 140, 248, .22); }
.home-hero-glow-two { width: 220px; height: 220px; right: -60px; bottom: -120px; background: rgba(192, 132, 252, .18); }

.topic-strip { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.1rem 0 1.7rem; }
.topic-strip-heading { display: grid; gap: .2rem; min-width: 180px; color: #14213d; font-weight: 800; }
.topic-strip-heading small { color: #8390a8; font-size: .75rem; font-weight: 500; }
.topic-list { display: flex; flex: 1; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; }
.topic-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .65rem .9rem; border: 1px solid #e0e6f1; border-radius: 999px; background: rgba(255,255,255,.75); color: #35415d; font-size: .85rem; font-weight: 700; text-decoration: none; transition: transform .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease; }
.topic-pill span { color: #7c3aed; font-size: 1rem; }
.topic-pill:hover { transform: translateY(-2px); border-color: #a78bfa; color: #5b21b6; box-shadow: 0 8px 20px rgba(99,102,241,.12); }
.home-page .top-featured-posts { padding-top: 1rem; }
.home-page .top-featured-posts .section-heading h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); letter-spacing: -.04em; }
.featured-showcase { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1rem; margin-top: 1rem; }
.featured-showcase-main { display: flex; flex-direction: column; min-height: 340px; border-radius: 24px; overflow: hidden; background: linear-gradient(135deg, #111827 0%, #312e81 55%, #7c3aed 100%); color: #fff; text-decoration: none; position: relative; box-shadow: 0 20px 40px rgba(15,23,42,.18); border: 1px solid rgba(255,255,255,.16); }
.featured-showcase-main::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(2,6,23,.18)); pointer-events: none; }
.featured-showcase-main-image { width: 100%; height: 220px; object-fit: cover; border-bottom: 1px solid rgba(255,255,255,.14); }
.featured-showcase-content { display: flex; flex: 1; flex-direction: column; gap: .75rem; padding: 1.2rem 1.25rem 1.3rem; position: relative; z-index: 1; }
.featured-showcase-content h3 { font-size: 1.3rem; line-height: 1.2; }
.featured-showcase-content p { color: rgba(255,255,255,.82); font-size: .95rem; line-height: 1.6; }
.featured-showcase-meta { margin-top: auto; color: #c7d2fe; font-size: .85rem; font-weight: 600; }
.featured-card-label { display: inline-flex; align-self: flex-start; width: fit-content; padding: .45rem .8rem; border-radius: 999px; background: rgba(255,255,255,.18); color: #f8fafc; border: 1px solid rgba(255,255,255,.22); box-shadow: 0 8px 18px rgba(0,0,0,.18); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.featured-showcase-side { display: grid; gap: .8rem; }
.featured-showcase-side-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.05rem; border: 1px solid #e3e8f2; border-radius: 18px; background: rgba(255,255,255,.95); color: #18243e; text-decoration: none; box-shadow: 0 10px 24px rgba(15,23,42,.04); transition: transform .2s ease, border-color .2s ease; }
.featured-showcase-side-card:hover { transform: translateY(-2px); border-color: #a78bfa; }
.featured-showcase-side-card h4 { font-size: 1rem; line-height: 1.35; margin-top: .4rem; }
.featured-showcase-side-card p { color: #64748b; font-size: .85rem; margin-top: .35rem; }
.featured-showcase-arrow { color: #7c3aed; font-size: 1.15rem; font-weight: 700; }
.home-page .home-layout { padding-top: 2rem; }
.home-page .feed-toolbar { border-color: #e2e8f4; background: rgba(255,255,255,.82); }

@media (max-width: 800px) {
    .home-hero { grid-template-columns: 1fr; min-height: auto; padding: 2.5rem 1.5rem 1.7rem; border-radius: 24px; }
    .home-hero-aside { justify-self: stretch; width: 100%; padding: 1.3rem 0 0; border-top: 1px solid rgba(255,255,255,.2); border-left: 0; }
    .hero-metrics { gap: 1.2rem; justify-content: space-between; }
    .hero-metric { display: grid; gap: .05rem; }
    .featured-showcase { grid-template-columns: 1fr; }
    .topic-strip { display: block; }
    .topic-list { justify-content: flex-start; margin-top: .9rem; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .4rem; }
    .topic-pill { flex: 0 0 auto; }
}

@media (max-width: 480px) {
    .home-hero h1 { font-size: 2.75rem; }
    .home-hero-actions { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .hero-metrics { gap: .7rem; }
    .hero-metric strong { font-size: 1.15rem; }
    .hero-metric span { font-size: .7rem; }
    .latest-news-grid { grid-template-columns: 1fr; }
    .latest-news-card { min-height: auto; }
}

.mobile-bottom-nav-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #475569;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 0.35rem;
    padding: 0.55rem 0.75rem;
    border-radius: 16px;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
    min-width: 0;
}

.mobile-bottom-nav-link:hover,
.mobile-bottom-nav-link:focus {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    transform: translateY(-1px);
}

.mobile-bottom-nav-icon {
    font-size: 1.3rem;
    line-height: 1;
}

@media (max-width: 600px) {
    body {
        padding-bottom: 5.5rem;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .post-page-wrap {
        padding: 1rem 0 4.5rem;
    }

    .post-detail {
        padding: 1.25rem;
    }

    .post-detail-title {
        font-size: 1.75rem;
    }

    .post-detail-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    .comment-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

.messages-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1rem;
    min-height: 640px;
    height: calc(100vh - 2rem);
    max-height: calc(100vh - 2rem);
    padding: 1rem 0 0;
    position: sticky;
    top: 1rem;
    align-items: stretch;
}

.messages-sidebar {
    background: linear-gradient(145deg, rgba(248, 251, 255, 0.98), rgba(234, 242, 255, 0.98));
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 26px;
    padding: 1rem;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.messages-sidebar__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.95rem;
}

.messages-sidebar__top h3 {
    margin: 0;
    font-size: 1rem;
    color: #102542;
}

.messages-sidebar__top p {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: #6b7a95;
}

.messages-sidebar__action {
    border: 0;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.messages-sidebar__action:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.messages-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 0.9rem;
    border-radius: 999px;
    background: #f8fbff;
    border: 1px solid #dfeaff;
    margin-bottom: 0.9rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.messages-search__icon {
    color: #6780ab;
    font-size: 0.95rem;
}

.messages-search {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    color: #14213d;
}

.message-user-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-user-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem;
    border-radius: 18px;
    color: #19253d;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.message-user-link:hover,
.message-user-link.active {
    background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
    border-color: rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.message-user-link.active {
    position: relative;
    background: linear-gradient(135deg, #f5f9ff 0%, #e8f1ff 100%);
}

.message-user-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 62%;
    border-radius: 999px;
    background: linear-gradient(180deg, #2563eb 0%, #3b82f6 100%);
}

.message-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.14);
}

.message-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.message-user-name {
    font-weight: 700;
    color: #14213d;
}

.message-user-subtitle {
    font-size: 0.8rem;
    color: #6b7a95;
}

.messages-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 26px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.06);
}

.message-user-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.2rem;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #e8f0ff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.07) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.chat-contact__meta {
    display: flex;
    flex-direction: column;
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #14213d;
}

.chat-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: #1f8b55;
    font-weight: 600;
}

.chat-status-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.chat-badge {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.messages-list {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.04), transparent 28%), #f8fbff;
}

.message-form {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.messages-list::-webkit-scrollbar {
    width: 8px;
}

.messages-list::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.18);
    border-radius: 999px;
}

.message-item {
    display: flex;
    justify-content: flex-start;
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
}

.message-item.me {
    justify-content: flex-end;
    align-self: flex-end;
}

.message-bubble {
    display: inline-block;
    width: auto;
    max-width: min(82%, 540px);
    padding: 0.85rem 0.95rem;
    border-radius: 20px 20px 20px 8px;
    background: #eef4ff;
    color: #14213d;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid rgba(37, 99, 235, 0.08);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    line-height: 1.55;
    animation: messageAppear 0.2s ease both;
}

.message-item.me .message-bubble {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    border: 0;
    border-radius: 20px 20px 8px 20px;
}

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

.message-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    opacity: 0.82;
    margin-top: 0.4rem;
}

.message-form {
    display: flex;
    align-items: flex-end;
    gap: 0.7rem;
    padding: 0.8rem 1rem 0.95rem;
    border-top: 1px solid #e8f0ff;
    background: rgba(255, 255, 255, 0.96);
}

.message-form textarea {
    flex: 1 1 auto;
    min-height: 46px;
    max-height: 112px;
    resize: none;
    border: 1px solid #d8e6ff;
    border-radius: 18px;
    padding: 0.8rem 0.95rem;
    font: inherit;
    line-height: 1.4;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
    background: #fcfdff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.message-form textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.7rem;
    margin: 0 1rem 0.2rem;
    width: fit-content;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(37, 99, 235, 0.1);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.typing-indicator span {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: #2563eb;
    animation: typingBlink 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingBlink {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.telegram-send-btn {
    border: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.telegram-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.28);
}

.message-empty,
.message-empty-state {
    color: #6b7280;
    text-align: center;
    padding: 2rem 1rem;
}

.message-empty-state__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.9rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    background: linear-gradient(135deg, #e8f0ff 0%, #dcecff 100%);
    color: #2563eb;
}

.message-empty-state h3 {
    margin: 0 0 0.35rem;
    color: #15233d;
}

.message-empty-state p {
    margin: 0 auto;
    max-width: 320px;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .messages-layout {
        grid-template-columns: 1fr;
        position: static;
        height: auto;
        max-height: none;
        min-height: 0;
        gap: 0.75rem;
    }

    .messages-sidebar {
        order: 2;
        padding: 0.85rem;
        border-radius: 20px;
    }

    .messages-panel {
        border-radius: 20px;
    }

    .message-user-list {
        max-height: 320px;
    }

    .chat-header {
        padding: 0.8rem 0.9rem;
        flex-wrap: wrap;
    }

    .message-form {
        padding: 0.7rem 0.8rem 0.8rem;
    }

    .message-form textarea {
        min-height: 42px;
    }
}

@media (max-width: 640px) {
    .messages-list {
        padding: 0.8rem;
        gap: 0.65rem;
    }

    .message-bubble {
        max-width: 92%;
        padding: 0.75rem 0.85rem;
        border-radius: 16px 16px 16px 8px;
    }

    .message-item.me .message-bubble {
        border-radius: 16px 16px 8px 16px;
    }

    .message-form textarea {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .nav-right {
        width: 100%;
        justify-content: space-between;
    }

    .post-detail {
        padding: 1rem;
    }
}

/* ==================== Мобільна адаптація ==================== */
html {
    overflow-x: hidden;
}

img,
video,
iframe,
embed,
object,
svg {
    max-width: 100%;
    height: auto;
}

* {
    word-break: break-word;
}

@media (max-width: 1024px) {
    .site-nav {
        flex-wrap: nowrap;
        gap: 0.75rem;
        padding: 0.9rem 1rem;
        position: relative;
    }

    .site-nav .logo {
        width: auto;
        justify-content: flex-start;
        flex: 0 0 auto;
    }

    .nav-right {
        width: auto;
        margin-left: auto;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .nav-right .nav-link,
    .nav-right .btn-logout,
    .nav-right .btn-primary {
        flex: 1 1 160px;
        min-width: 120px;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }

    .footer-socials {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 1001;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-menu {
        position: static;
        box-shadow: none;
        border-top: none;
        padding: 0;
        max-height: 0;
    }

    .mobile-menu.open {
        display: flex;
        padding: 1rem 1rem 1.25rem;
    }
}

@media (max-width: 600px) {
    .site-nav {
        align-items: center;
        justify-content: space-between;
    }

    .logo {
        justify-content: flex-start;
        text-align: left;
        flex: 0 0 auto;
    }

    .nav-right {
        justify-content: flex-end;
        margin-left: auto;
    }

    .nav-right .nav-link,
    .nav-right .btn-logout,
    .nav-right .btn-primary {
        width: auto;
        flex: 1 1 100%;
        text-align: center;
    }

    .footer-top {
        padding-bottom: 1.5rem;
    }

    .footer-socials {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .messages-sidebar,
    .messages-panel,
    .profile-card,
    .profile-posts,
    .post-detail,
    .create-post-wrapper,
    .auth-card {
        width: 100%;
    }

    .message-bubble {
        max-width: 100%;
    }

    .notification-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .notification-item,
    .message-user-link {
        padding: 0.85rem;
    }

    .footer-bottom,
    .site-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 820px) {
    .hero-content {
        padding: 0 1rem;
    }

    .section-card {
        padding: 1.25rem;
    }
}

/* Додаткові блоки головної сторінки */
.editorial-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 1.2rem 0 1rem; }
.editorial-section-heading h2 { margin: .15rem 0 0; color: #14213d; font-size: clamp(1.45rem, 2.5vw, 2rem); letter-spacing: -.04em; }
.section-kicker { display: block; color: #7c3aed; font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.section-more-link, .sidebar-action-link { color: #5b21b6; font-size: .86rem; font-weight: 800; text-decoration: none; }
.section-more-link span, .sidebar-action-link span { margin-left: .3rem; }
.latest-news-section { padding: .4rem 0 1.7rem; }
.latest-news-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.latest-news-card { display: flex; flex-direction: column; gap: .8rem; min-height: 250px; padding: 1rem; border: 1px solid #e3e8f2; border-radius: 20px; background: rgba(255,255,255,.95); color: #18243e; text-decoration: none; box-shadow: 0 10px 25px rgba(15,23,42,.04); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.latest-news-card:hover { transform: translateY(-3px); border-color: #a78bfa; box-shadow: 0 18px 32px rgba(99,102,241,.12); }
.latest-news-card-image { width: 100%; height: 120px; object-fit: cover; border-radius: 14px; background: #e5e7eb; }
.latest-news-card-body { display: flex; flex-direction: column; gap: .5rem; }
.latest-news-time { color: #7b879f; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.latest-news-card strong { font-size: 1rem; line-height: 1.35; }
.latest-news-card p { color: #64748b; font-size: .9rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.latest-news-author { margin-top: auto; color: #7b879f; font-size: .78rem; }
.latest-news-author span { color: #7c3aed; }
.author-of-week-card h3 { margin: .3rem 0 1rem; }
.author-of-week { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.author-of-week img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #eef2ff; }
.author-of-week div { display: grid; gap: .2rem; }
.author-of-week strong { color: #17223d; }
.author-of-week span { color: #7b879f; font-size: .78rem; }
.newsletter-card { color: #fff; background: linear-gradient(145deg, #4c1d95, #312e81); border: 0; }
.newsletter-card h3 { margin: .6rem 0 .5rem; color: #fff; text-transform: none; font-size: 1.3rem; }
.newsletter-card p { position: relative; margin: 0 0 1rem; color: #ddd6fe; font-size: .87rem; line-height: 1.6; }
.newsletter-icon { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: .7rem; background: rgba(255,255,255,.15); color: #c4b5fd; }
.newsletter-form { display: flex; gap: .4rem; position: relative; }
.newsletter-form input { min-width: 0; flex: 1; padding: .7rem .75rem; border: 1px solid rgba(255,255,255,.2); border-radius: .7rem; outline: 0; background: rgba(255,255,255,.12); color: #fff; font: inherit; }
.newsletter-form input::placeholder { color: #c4b5fd; }
.newsletter-form button { width: 2.7rem; border: 0; border-radius: .7rem; background: #c4b5fd; color: #24114e; font-size: 1.2rem; cursor: pointer; }
.newsletter-card small { display: block; margin-top: .65rem; color: #c4b5fd; font-size: .7rem; }
.newsletter-card small.is-success { color: #bbf7d0; }
.theme-toggle { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; margin: 0 .25rem; border: 1px solid #e1e7f1; border-radius: 50%; background: #fff; color: #5b21b6; cursor: pointer; font-size: 1rem; }
.theme-toggle:hover { background: #f1edff; transform: rotate(12deg); }
.mobile-theme-toggle { display: none; width: auto; height: auto; padding: .7rem .9rem; border-radius: .7rem; font: inherit; font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Dark theme removed: rules intentionally omitted */
.slug-preview { margin-top: .35rem; color: #8995aa; font-size: .75rem; }
.advanced-content-panel { margin: 1rem 0; padding: .85rem 1rem; border: 1px solid #e1e7f1; border-radius: .8rem; background: #f8fafc; }
.advanced-content-panel summary { color: #4c1d95; font-weight: 800; cursor: pointer; }
.advanced-content-panel[open] summary { margin-bottom: 1rem; }
.seo-preview { display: grid; gap: .25rem; margin-top: .8rem; padding: .9rem; border-left: 3px solid #7c3aed; background: #fff; }
.seo-preview strong { color: #1a0dab; font-size: 1rem; }
.seo-preview span { color: #16803c; font-size: .78rem; }
.seo-preview p { margin: 0; color: #64748b; font-size: .8rem; }
.publish-actions { display: flex; gap: .7rem; margin-top: 1rem; }
.publish-actions .btn { flex: 1; }
.quality-meter { margin: 1rem 0; color: #64748b; font-size: .78rem; }
.quality-meter > span { margin-right: .35rem; }
.quality-meter strong { color: #5b21b6; }
.quality-meter > div { height: 6px; margin-top: .4rem; overflow: hidden; border-radius: 99px; background: #e5e7eb; }
.quality-meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f59e0b, #22c55e); transition: width .3s ease; }
.dark-theme .advanced-content-panel, .dark-theme .seo-preview { background: #1b253d; border-color: #34415f; }
.dark-theme .seo-preview strong { color: #a5b4fc; }
.content-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-bottom: .5rem; }
.content-tool { padding: .4rem .65rem; border: 1px solid #dbe3f0; border-radius: .5rem; background: #fff; color: #4b5563; font: inherit; font-size: .78rem; cursor: pointer; }
.content-tool:hover { border-color: #a78bfa; color: #5b21b6; }
.content-counter { margin-left: auto; color: #8995aa; font-size: .75rem; }
.embed-row { display: flex; gap: .5rem; margin-top: .65rem; }
.embed-row input { flex: 1; min-width: 0; padding: .65rem .75rem; border: 1px solid #dbe3f0; border-radius: .6rem; font: inherit; }
.content-preview-modal { position: fixed; z-index: 1500; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(15,23,42,.65); }
.content-preview-modal[hidden] { display: none !important; }
.content-preview-dialog { position: relative; width: min(800px, 100%); max-height: 90vh; overflow: auto; padding: clamp(1.4rem, 4vw, 3rem); border-radius: 1.25rem; background: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.25); }
.content-preview-dialog h2 { margin: .35rem 0 .75rem; color: #14213d; font-size: clamp(1.7rem, 4vw, 2.6rem); }
.content-preview-dialog > p { margin-bottom: 1.5rem; color: #64748b; }
.preview-close { position: absolute; top: .8rem; right: 1rem; border: 0; background: transparent; color: #64748b; font-size: 1.8rem; cursor: pointer; }
.embed-placeholder { margin: 1rem 0; padding: 3rem 1rem; border-radius: .9rem; background: #eef2ff; color: #5b21b6; text-align: center; font-weight: 700; }
.post-video-embed { position: relative; aspect-ratio: 16 / 9; margin: 1.5rem 0; overflow: hidden; border-radius: 1rem; background: #0f172a; }
.post-video-embed iframe { width: 100%; height: 100%; border: 0; }
.reading-progress { position: fixed; z-index: 1600; top: 0; left: 0; width: 0; height: 4px; background: linear-gradient(90deg, #7c3aed, #a78bfa); box-shadow: 0 0 12px rgba(124,58,237,.5); transition: width .1s linear; }
.post-author-card { display: flex; align-items: center; gap: 1rem; margin: 1.4rem 0; padding: 1.25rem; border: 1px solid #e1e7f1; border-radius: 1rem; background: #fff; }
.post-author-card > img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.post-author-card-info { flex: 1; }
.post-author-card-info > a { color: #14213d; text-decoration: none; }
.post-author-card-info strong { font-size: 1.15rem; }
.post-author-card-info p { margin: .35rem 0; color: #64748b; font-size: .85rem; line-height: 1.5; }
.author-profile-link { color: #5b21b6; font-size: .8rem; font-weight: 800; text-decoration: none; }
.author-profile-link span { margin-left: .3rem; }
.back-to-top { position: fixed; z-index: 1200; right: 1.4rem; bottom: 1.4rem; display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border: 0; border-radius: 50%; background: #4c1d95; color: #fff; font-size: 1.3rem; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.image-lightbox { position: fixed; z-index: 1700; inset: 0; display: flex; align-items: center; justify-content: center; padding: 4rem; background: rgba(2,6,23,.92); }
.image-lightbox[hidden] { display: none !important; }
.image-lightbox > img { max-width: min(1100px, 92vw); max-height: 84vh; object-fit: contain; border-radius: .6rem; box-shadow: 0 30px 90px rgba(0,0,0,.4); }
.lightbox-close, .lightbox-nav { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.lightbox-close { top: 1.1rem; right: 1.4rem; width: 2.7rem; height: 2.7rem; border-radius: 50%; font-size: 1.8rem; }
.lightbox-nav { top: 50%; width: 3.2rem; height: 3.2rem; border-radius: 50%; font-size: 2.5rem; transform: translateY(-50%); }
.lightbox-prev { left: 1.2rem; }
.lightbox-next { right: 1.2rem; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(167,139,250,.7); }
.post-media-gallery img { cursor: zoom-in; }
.dark-theme .post-author-card { background: #151c31; border-color: #34415f; }
.dark-theme .post-author-card-info > a { color: #fff; }
.dark-theme .post-author-card-info p { color: #aab5c9; }
.dark-theme .content-tool, .dark-theme .embed-row input, .dark-theme .content-preview-dialog { background: #151c31; border-color: #34415f; color: #e5e7eb; }
.dark-theme .content-preview-dialog h2 { color: #fff; }

@media (max-width: 900px) {
    .latest-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-news-card:nth-child(2) { border-right: 0; }
    .latest-news-card:nth-child(n+3) { border-top: 1px solid #dfe5f0; }
    .latest-news-card:nth-child(3) { padding-left: 0; }
}
@media (max-width: 720px) {
    .desktop-nav .theme-toggle { display: none; }
    .mobile-theme-toggle { display: inline-flex; align-items: center; gap: .5rem; }
}
/* ==================== Модерація постів ==================== */
.moderation-header {
    align-items: flex-start;
    gap: 1rem;
}
.moderation-subtitle {
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.95rem;
}
.moderation-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin: 1rem 0 1.2rem;
}
.moderation-stat-card {
    padding: 1rem 1.1rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}
.moderation-stat-card strong {
    display: block;
    margin-top: 0.25rem;
    color: #111827;
    font-size: 1.35rem;
}
.moderation-stat-label {
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.moderation-preview-cell {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 240px;
}
.moderation-preview-btn {
    white-space: nowrap;
}
.moderation-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1800;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.72);
}
.moderation-preview-modal[hidden] {
    display: none !important;
}
.moderation-preview-dialog {
    position: relative;
    width: min(780px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 1.4rem 1.5rem 1.6rem;
    border-radius: 1.2rem;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}
.moderation-preview-media {
    margin-bottom: 1rem;
}
.moderation-preview-media img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 0.9rem;
    background: #f8fafc;
}
.moderation-preview-content {
    margin-top: 0.85rem;
    color: #334155;
    line-height: 1.7;
    white-space: pre-wrap;
}
.moderation-title-link {
    color: #111827;
    font-weight: 700;
    text-decoration: none;
}
.moderation-title-link:hover {
    color: #2563eb;
    text-decoration: underline;
}
.moderation-preview-meta {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}
.moderation-preview-image {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 0.7rem;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}
.moderation-preview-meta p {
    margin: 0;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.45;
}
.moderation-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.moderation-pill.pending {
    background: #fef3c7;
    color: #92400e;
}
.moderation-pill.published {
    background: #dcfce7;
    color: #166534;
}
.moderation-pill.rejected {
    background: #fee2e2;
    color: #b91c1c;
}
.moderation-pill.draft {
    background: #e0e7ff;
    color: #4338ca;
}
.admin-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
@media (max-width: 900px) {
    .moderation-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .editorial-section-heading { align-items: flex-start; flex-direction: column; }
    .moderation-overview { grid-template-columns: 1fr; }
    .latest-news-grid { grid-template-columns: 1fr; }
    .latest-news-card, .latest-news-card:first-child, .latest-news-card:nth-child(3) { padding: 1rem 0; border-right: 0; border-top: 1px solid #dfe5f0; }
    .latest-news-card:first-child { border-top: 0; }
    .post-media-gallery { grid-template-columns: 1fr; }
    .post-media-item:first-child { grid-column: auto; }
    .post-media-item .post-detail-image,
    .post-media-item:first-child .post-detail-image { height: 240px; }
    .content-counter { width: 100%; margin-left: 0; }
    .embed-row { flex-direction: column; }
    .publish-actions { flex-direction: column; }
    .post-author-card { align-items: flex-start; flex-direction: column; }
    .image-lightbox { padding: 3rem 1rem; }
    .lightbox-nav { width: 2.5rem; height: 2.5rem; }
}

@media (max-width: 600px) {
    .site-nav {
        align-items: center;
        justify-content: space-between;
    }

    .logo {
        justify-content: flex-start;
        text-align: left;
        flex: 0 0 auto;
    }

    .nav-right {
        justify-content: flex-end;
        margin-left: auto;
    }

    .nav-right .nav-link,
    .nav-right .btn-logout,
    .nav-right .btn-primary {
        width: auto;
        flex: 1 1 100%;
        text-align: center;
    }

    .footer-top {
        padding-bottom: 1.5rem;
    }

    .footer-socials {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .messages-sidebar,
    .messages-panel,
    .profile-card,
    .profile-posts,
    .post-detail,
    .create-post-wrapper,
    .auth-card {
        width: 100%;
    }

    .message-bubble {
        max-width: 100%;
    }

    .notification-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .notification-item,
    .message-user-link {
        padding: 0.85rem;
    }

    .footer-bottom,
    .site-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
