* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f7f9fa;
    color: #0f1419;
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1200;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: #1d9bf0;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 20, 25, 0.16);
}

.sidebar-overlay {
    display: none;
}

.wrapper {
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    min-height: 100vh;
}

.sidebar {
    width: 275px;
    padding: 16px;
    border-right: 1px solid #eff3f4;
    background: #fff;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 21px;
    margin-bottom: 14px;
    color: #1d9bf0;
    font-weight: 800;
}

.sidebar .s-item {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color .2s ease;
    padding: 11px 12px;
    border-radius: 999px;
    font-weight: 500;
}

.sidebar .s-item:hover {
    background: #eff3f4;
}

.sidebar .s-item i {
    width: 24px;
}

.sidebar .s-item a {
    color: #0f1419;
    text-decoration: none;
}

.main {
    flex: 1;
    max-width: 620px;
    min-height: 100vh;
    border-right: 1px solid #eff3f4;
    border-left: 1px solid #eff3f4;
    background: #fff;
}

.board-head {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #eff3f4;
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.board-head h1 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 800;
}

.board-head p {
    color: #536471;
    font-size: 14px;
    margin-bottom: 2px;
}

.post-form {
    background: #fff;
    padding: 16px 18px;
    border-bottom: 1px solid #eff3f4;
}

.post-form textarea {
    width: 100%;
    border: 1px solid #cfd9de;
    border-radius: 16px;
    padding: 13px;
    font-size: 16px;
    min-height: 108px;
    resize: vertical;
}

.post-form textarea:focus {
    outline: none;
    border-color: #1d9bf0;
    box-shadow: 0 0 0 1px #1d9bf0;
}

.post-form button {
    background: #1d9bf0;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

.post-form button:hover {
    background: #1a8cd8;
}

.feed {
    margin-top: 0;
}

.post-card {
    background: #fff;
    border-bottom: 1px solid #eff3f4;
    margin-bottom: 0;
    padding: 14px 18px;
    transition: background-color 0.2s ease;
}

.post-card:hover {
    background: #f7f9f9;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.post-user {
    font-weight: 700;
    color: #0f1419;
}

.post-time {
    color: #536471;
    font-size: 13px;
    margin-left: 6px;
}

.post-content {
    margin-bottom: 10px;
    white-space: pre-wrap;
    line-height: 1.55;
    font-size: 15px;
}

.post-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.post-actions button {
    border: none;
    background: none;
    cursor: pointer;
    color: #536471;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 7px 10px;
}

.post-actions button:hover {
    background: #e8f5fe;
    color: #1d9bf0;
}

.post-actions button.liked {
    color: #f91880;
}

.post-actions button.following {
    color: #00ba7c;
}

.related {
    width: 350px;
    padding: 16px;
    background: #f7f9fa;
}

.card {
    background: #fff;
    border: 1px solid #eff3f4;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
}

.card h3 {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 800;
}

.card p {
    color: #536471;
    font-size: 14px;
    line-height: 1.5;
}

.follow-btn,
.follow-user-btn,
.dm-user-btn {
    background: #1d9bf0;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.follow-btn:hover,
.follow-user-btn:hover,
.dm-user-btn:hover {
    background: #1a8cd8;
}

.leads {
    color: #536471;
    font-size: 14px;
    text-align: center;
    padding: 18px;
}

[data-theme="dark"] {
    background: #15202b;
    color: #ffffff;
}

/* タブレット以下では右カラムだけ非表示、中央は維持 */
@media (max-width: 1024px) {
    .related {
        display: none;
    }

    .wrapper {
        max-width: 920px;
    }
}

/* 画面幅が768px以下のときはサイドバーを非表示にして、メインを全幅化 */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main {
        max-width: 100%;
        border-left: none;
        border-right: none;
    }
}

/* スマホ幅のみサイドバーをメニューで開閉する */
@media (max-width: 600px) {
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .board-head {
        padding-top: 58px;
    }

    .wrapper {
        position: relative;
    }

    .sidebar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(82vw, 300px);
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        z-index: 1300;
        overflow-y: auto;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.18);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.42);
        z-index: 1250;
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

