/* Главная: баннер, создание поста, истории, компактные события в правой колонке.
   Подключать после style.css. Посты и сообщества — в style.css. */

.hero-banner {
    --hero-overlay: 55;
    background-color: #172033;
    background-image: var(--hero-image, url('https://images.unsplash.com/photo-1573804941575-58e6266d4878?ixlib=rb-4.0.3&auto=format&fit=crop&w=1400&q=80'));
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: var(--radius-card);
    padding: 48px 40px;
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        rgba(17, 24, 39, calc(var(--hero-overlay) / 100)) 0%,
        rgba(17, 24, 39, calc(var(--hero-overlay) / 220)) 68%,
        rgba(17, 24, 39, 0.08) 100%
    );
    pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 640px; }
.hero-content h1 {
    font-family: "Caveat", cursive;
    font-weight: 500;
    font-size: clamp(48px, 7vw, 84px);
    line-height: 0.92;
    letter-spacing: 0.01em;
    margin: 0 0 8px;
    text-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.hero-content p { font-size: 16px; margin-bottom: 24px; opacity: 0.94; max-width: 420px; }

.create-post { display: flex; flex-direction: column; gap: 16px; }
.create-post-top { display: flex; gap: 12px; align-items: center; }
.create-post input,
.create-post textarea {
    flex: 1;
    background: var(--bg-color);
    border: none;
    padding: 14px 20px;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    min-width: 0;
    color: var(--text-main);
}
.create-post textarea { resize: vertical; min-height: 72px; border-radius: 16px; }
.create-post-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    gap: 16px;
}
.post-tools { display: flex; gap: 20px; flex-wrap: wrap; }
.post-tool {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
}
.post-tool:hover { color: var(--primary); }

.guest-composer {
    display: grid;
    gap: 14px;
    padding: 18px 20px;
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.10), transparent 42%),
        var(--card-bg);
}
.guest-composer-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.guest-composer-main .avatar {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(37, 99, 235, 0.18);
}
.guest-composer-copy { min-width: 0; }
.guest-composer-copy h2 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.guest-composer-copy p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
}
.guest-composer-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.guest-composer-features li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.06);
    color: #1E3A8A;
    font-size: 12px;
    font-weight: 600;
}
.guest-composer-features svg,
.guest-composer-features i {
    width: 14px;
    height: 14px;
    color: var(--primary);
}
.guest-composer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.guest-composer-actions .btn-primary,
.guest-composer-actions .btn-outline {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}
.guest-composer-actions .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(37, 99, 235, 0.28);
    color: var(--primary);
    background: #fff;
}
.guest-composer-actions .btn-outline:hover {
    background: rgba(37, 99, 235, 0.06);
}

.stories-wrapper {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
}
.stories-wrapper::-webkit-scrollbar { display: none; }
.story {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 72px;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
}
.story-avatar-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, var(--primary), var(--secondary-blue));
}
.story-avatar-wrap.add-story {
    background: var(--bg-color);
    border: 2px dashed #CBD5E0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}
.story-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}
.story span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
}
.story-label {
    display: block;
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.stories-card { overflow: hidden; }

/* Компактная карточка события в правой колонке главной */
.sidebar-right .event-card {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    cursor: pointer;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}
.sidebar-right .event-date {
    background: #FEF2F2;
    color: var(--danger);
    padding: 8px;
    border-radius: var(--radius-sm);
    text-align: center;
    min-width: 50px;
}
.sidebar-right .event-date span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.sidebar-right .event-date strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
}
.sidebar-right .event-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.sidebar-right .event-info p {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.sidebar-right .event-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-top: 10px;
}

@media (max-width: 900px) {
    .hero-banner {
        border-radius: 0;
        min-height: 200px;
        padding: 24px 16px;
        margin-bottom: 8px;
    }
    .hero-content { max-width: none; }
    .hero-content h1 {
        font-family: "Caveat", cursive;
        font-weight: 500;
        font-size: clamp(42px, 12vw, 64px);
        line-height: 0.95;
    }
    .hero-content p { max-width: none; font-size: 14px; margin-bottom: 16px; }
    .hero-content .btn-primary { padding: 10px 16px; font-size: 13px; width: auto; }

    .create-post input,
    .create-post textarea { padding: 12px 16px; font-size: 15px; }
    .create-post-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding-top: 12px;
    }
    .post-tools { width: 100%; justify-content: space-between; }
    .post-tool { flex: 1; justify-content: center; padding: 8px 0; }
    .post-tool span { display: none; }
    .create-post-bottom .btn-primary {
        width: 100%;
        padding: 12px;
        border-radius: 12px;
    }

    .guest-composer {
        gap: 12px;
        padding: 14px 16px 16px;
    }
    .guest-composer-main { gap: 10px; }
    .guest-composer-main .avatar {
        width: 40px;
        height: 40px;
    }
    .guest-composer-copy h2 { font-size: 15px; }
    .guest-composer-copy p {
        font-size: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .guest-composer-features {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }
    .guest-composer-features li {
        justify-content: center;
        padding: 8px 4px;
        border-radius: 12px;
        font-size: 11px;
        gap: 4px;
    }
    .guest-composer-features span { line-height: 1; }
    .guest-composer-actions {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        gap: 8px;
    }
    .guest-composer-actions.is-single {
        grid-template-columns: 1fr;
    }
    .guest-composer-actions .btn-primary,
    .guest-composer-actions .btn-outline {
        width: 100%;
        min-height: 42px;
    }

    .stories-wrapper {
        padding: 0 16px;
        margin: 0 -16px;
    }
}

.stories-empty { align-self: center; margin: 0; }
.story-avatar-wrap.is-seen { background: #E2E8F0; }
.people-list { display: flex; flex-direction: column; gap: 10px; }
.person-hit {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
}
.person-hit img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.person-hit strong, .person-hit small { display: block; }
.person-hit small { color: var(--text-muted); }
.story-dialog {
    width: min(420px, calc(100% - 24px));
    padding: 20px;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(23, 32, 51, 0.2);
}
.story-dialog::backdrop { background: rgba(23, 32, 51, 0.55); }
.story-dialog h3 { margin: 0 0 6px; }
.story-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.story-dialog img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.story-viewer {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(8, 12, 24, 0.94);
}
.story-viewer[hidden] { display: none !important; }
body.story-open { overflow: hidden; }
.story-frame { width: min(420px, 100%); color: #fff; }
.story-progress { display: flex; gap: 4px; margin-bottom: 10px; }
.story-bar {
    flex: 1;
    height: 3px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.35);
    overflow: hidden;
}
.story-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
}
.story-frame-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.story-frame-top img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.story-frame-top div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.story-frame-top strong { font-size: 14px; }
.story-frame-top span { color: rgba(255, 255, 255, 0.75); font-size: 12px; }
.story-stage {
    position: relative;
    height: min(72vh, 720px);
    background: #000;
    border-radius: 18px;
    overflow: hidden;
}
.story-stage img,
.story-stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    display: block;
}
.story-stage p {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 56px 16px 18px;
    color: #fff;
    font-size: 15px;
    line-height: 1.4;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    pointer-events: none;
}
.story-hit {
    position: absolute;
    top: 0;
    bottom: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.story-hit-prev { left: 0; width: 32%; }
.story-hit-next { right: 0; width: 68%; }
.story-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}
@media (max-width: 700px) {
    .story-viewer { padding: 0; align-items: stretch; }
    .story-frame {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: max(10px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
    }
    .story-stage { flex: 1; height: auto; min-height: 0; border-radius: 16px; }
}
.post-tool input { display: none; }
