:root {
    --forum-font: "Px437 IBM VGA 8x16", "D2Coding", "Courier New", "Nanum Gothic Coding", "Apple SD Gothic Neo", "Malgun Gothic", monospace;
    --primary: #7655d8;
    --primary-hover: #6242c2;
    --primary-light: #f1edff;

    --background: #f7f8fb;
    --surface: #ffffff;
    --text: #202337;
    --muted: #858a9b;
    --border: #e9eaf0;
}

/* 보라색 */
[data-theme="purple"] {
    --primary: #7655d8;
    --primary-hover: #6242c2;
    --primary-light: #f1edff;
    --background: #f3f0f8;
}

/* 녹색-레트로다인그린 */
[data-theme="retrodyne_green"] {
    --primary: #7655d8;
    --primary-hover: #6242c2;
    --primary-light: #f1edff;
    --background: #0fca37;
}

/* 흑백느낌 */
[data-theme="retrodyne_grey"] {
    --primary: #1231bc;
    --primary-hover: #911122;
    --primary-light: #f1edff;
    --background: #3b3b3d70;
    --text: #172554;
}
/* 강렬한 retroyne-grey */
[data-theme="retrodyne_grey"] .nav-link,
[data-theme="retrodyne_grey"] .sidebar-title {
    color: #040404;
}

/* 파란색 */
[data-theme="blue"] {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --background: #eff3f9;
}

/* 코발트 블루 */
/* 강렬한 코발트 블루 */
[data-theme="cobalt"] {
    --primary: #1746c8;
    --primary-hover: #0c329e;
    --primary-light: #c1d2ff;

    --background: #1746c8;
    --surface: #ffffff;

    --text: #172554;
    /* --text: #ffffff; */
    /* --muted: #64748b; */
    --muted: #64748b;
    --border: #a8bff5;
}

/* 코발트 테마에서 사이드바 글자 대비 */
[data-theme="cobalt"] .nav-link,
[data-theme="cobalt"] .sidebar-title {
    color: #ffffff;
}

[data-theme="cobalt"] .nav-link:hover {
    background: rgba(255, 255, 255, 0.18);
}

[data-theme="cobalt"] .nav-link.active {
    background: #ffffff;
    color: #1746c8;
}

[data-theme="cobalt"] .create-community {
    color: #ffffff;
}

/* 빨간색 */
[data-theme="red"] {
    --primary: #dc4253;
    --primary-hover: #b92f40;
    --primary-light: #fff0f1;
    --background: #f9f1f2;
}

/* 노란색 */
[data-theme="yellow"] {
    --primary: #d59b12;
    --primary-hover: #b5810e;
    --primary-light: #fff8df;
    --background: #f9f6ec;
}

/* 초록색 */
[data-theme="green"] {
    --primary: #16966a;
    --primary-hover: #107a56;
    --primary-light: #e9f8f1;
    --background: #eff6f1;
}

/* 주황색 */
[data-theme="orange"] {
    --primary: #ea792a;
    --primary-hover: #ca5f16;
    --primary-light: #fff1e5;
    --background: #faf3ec;
}


* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--forum-font);
    font-size: 21px;
    line-height: 1.6;
    background: var(--background);
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
}

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 0 36px;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 27px;
    font-weight: 800;
    min-width: 210px;
}

.logo-icon {
    color: var(--primary);
    font-size: 30px;
}

.search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f4f5f8;
    padding: 0 18px;
    height: 42px;
    border-radius: 12px;
    flex: 1;
    max-width: 620px;
}

.search input {
    border: 0;
    outline: 0;
    background: transparent;
    width: 100%;
    font-size: 17px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 17px;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

.layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 340px;
    gap: 24px;
    max-width: 1920px;
    margin: 0 auto;
    padding: 28px;
}

.sidebar {
    padding: 10px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 17px;
    color: #555b6e;
    margin-bottom: 5px;
}

.nav-link:hover {
    background: #eceef4;
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

.sidebar-title {
    margin: 30px 16px 14px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 700;
}

.create-community {
    display: block;
    color: var(--primary);
    padding: 16px;
    font-size: 17px;
    font-weight: 600;
}

.main-content {
    min-width: 0;
}

.page-heading h1 {
    margin: 4px 0 8px;
    font-size: 30px;
}

.page-heading p {
    color: var(--muted);
    margin: 0;
    font-size: 17px;
}

.feed-tabs {
    display: flex;
    gap: 28px;
    border-bottom: 1px solid var(--border);
    margin: 28px 0 20px;
}

.feed-tabs a {
    padding: 0 4px 14px;
    color: var(--muted);
    font-size: 17px;
}

.feed-tabs a.selected {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    font-weight: 700;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

/* 코발트 블루 테마에서만 흰색 글자 */
/* [data-theme="cobalt"] .post-meta {
    color: #ffffff;
} */


.community-badge {
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 700;
}

.post-card h2 {
    font-size: 23px;
    margin: 17px 0 10px;
}

.post-description {
    font-size: 17px;
    color: #666b7b;
    line-height: 1.8;
}

.post-image {
    display: block;
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 12px;
    margin: 16px 0;
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    padding-top: 15px;
    color: #777e90;
    font-size: 16px;
}

.vote-control {
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 20px;
    padding: 8px 14px;
    font-weight: 700;
}

.widget {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 18px;
}

.widget h3 {
    font-size: 18px;
    margin: 0 0 16px;
}

.widget p {
    color: #777e90;
    font-size: 16px;
    line-height: 1.7;
}

.welcome {
    background: var(--primary-light);
    border-color: transparent;
}

.full {
    display: block;
    text-align: center;
    margin-top: 18px;
}

.community-row {
    display: flex;
    justify-content: space-between;
    padding: 11px 0;
    font-size: 16px;
}

.community-row small {
    color: var(--muted);
}

.trending {
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

@media (max-width: 1150px) {
    .layout {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .right-sidebar {
        display: none;
    }
}

@media (max-width: 720px) {
    .topbar {
        padding: 0 16px;
        gap: 12px;
    }

    .logo {
        min-width: auto;
        font-size: 21px;
    }

    .search,
    .sidebar,
    .notification {
        display: none;
    }

    .layout {
        display: block;
        padding: 16px;
    }

    .post-card {
        padding: 16px;
    }

    .header-actions {
        gap: 10px;
    }
}

.create-form {
    max-width: 650px;
}

.form-group {
    margin: 22px 0;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    font-weight: 600;
    font-size: 17px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.create-form button {
    border: none;
    cursor: pointer;
}

/* 커뮤니티 목록 */

.community-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.community-list-item {
    padding: 22px;
}

.community-list-item h3 {
    margin: 0 0 10px;
}

.community-list-item h3 a {
    color: var(--primary);
    text-decoration: none;
}

.community-list-item h3 a:hover {
    text-decoration: underline;
}

.community-list-item p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.community-list-item small,
.community-meta {
    color: var(--muted);
}

/* 커뮤니티 상세 */

.community-header h1 {
    margin-bottom: 14px;
}

.community-header p {
    line-height: 1.7;
}

.community-meta {
    margin-top: 18px;
    font-size: 16px;
}

.community-empty {
    margin-top: 20px;
    padding: 40px 20px;
    text-align: center;
}

.community-empty p {
    margin-top: 10px;
    color: var(--muted);
}

/* BOT 회원 표시 */
.bot-badge {
    display: inline-flex;
    align-items: center;

    padding: 2px 7px;
    border-radius: 5px;

    background: #e0e7ff;
    color: #3730a3;

    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

/* 상단 로그아웃 버튼 */
.header-actions form {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.header-actions form button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border: 1px solid transparent;
    box-shadow: none;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* 알림 아이콘 */
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.2s;
}

.notification-bell:hover {
    background: rgba(128, 128, 128, 0.12);
}

.notification-icon {
    font-size: 22px;
    line-height: 1;
}

/* 읽지 않은 알림 개수 */
.notification-count {
    position: absolute;
    top: -2px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 10px;
    background: #e5484d;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/*notifiction list*/
/* 알림 목록 */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.notification-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 12px;
    background: var(--card-bg, #fff);
}

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

.notification-item-content {
    flex: 1;
    min-width: 0;
}

.notification-item-content p {
    margin: 10px 0;
    overflow-wrap: anywhere;
}

.notification-item-content small {
    opacity: 0.65;
}

.notification-item-link {
    margin-top: 10px;
}

.notification-unread-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e5484d;
    flex-shrink: 0;
    margin-left: 12px;
}



.notification-post-title {
    margin: 10px 0 6px;
    font-weight: 500;
}

.notification-post-title strong {
    color: var(--text-primary, inherit);
}
/* 게시글 추천·비추천 */
.post-vote {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    border-radius: 24px;
    background: rgba(128, 128, 128, 0.10);
}

.post-vote form {
    margin: 0;
    display: inline-flex;
}

.vote-button {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 19px;
    cursor: pointer;
    padding: 3px 5px;
    opacity: 0.7;
}

.vote-button:hover {
    opacity: 1;
}

.vote-up-active {
    color: #f97316;
    opacity: 1;
}

.vote-down-active {
    color: #6366f1;
    opacity: 1;
}

.vote-score {
    min-width: 20px;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
}

/* 게시글 북마크 */

.bookmark-form {
    display: inline-flex;
    margin: 0;
}

.bookmark-button {
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.bookmark-button:hover {
    background: rgba(128, 128, 128, 0.12);
}

.bookmark-active {
    color: #eab308;
    font-weight: 700;
}

.share-button {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.share-button:hover {
    color: #2563eb;
}

.share-button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 4px;
    border-radius: 3px;
}

.post-images {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(100%, 240px), 1fr)
    );
    gap: 12px;
    margin-top: 20px;
}

.post-images img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 10px;
}

/* 게시글 목록 대표 이미지 */

.post-thumbnail-link {
    display: block;
    margin-top: 14px;
}

.post-thumbnail {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(128, 128, 128, 0.06);
}

/* 작성자 쪽지 메뉴 */
.author-menu {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    font-weight: normal;
}

.author-menu summary {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    list-style: none;
}

.author-menu summary::-webkit-details-marker {
    display: none;
}

.author-menu summary:hover {
    text-decoration: underline;
}

.author-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    min-width: 180px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: var(--text);
}

.author-menu-name {
    padding: 8px 10px;
    font-size: 14px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 5px;
}

.author-menu-dropdown a {
    display: block;
    padding: 10px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.author-menu-dropdown a:hover {
    background: var(--primary-light);
    color: var(--primary);
}


/* 회원 프로필 */
.profile-page {
    max-width: 850px;
}

.profile-page h2 {
    font-size: 21px;
    margin: 28px 0 14px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 22px;
}

.profile-header h1 {
    margin: 0 0 8px;
}

.profile-header p {
    color: var(--muted);
    margin: 0 0 16px;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
}

.profile-avatar img,
.avatar-default {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-default {
    color: #fff;
    font-size: 38px;
    font-weight: 700;
    background: var(--primary);
}

/* 회원 ID별 기본 아바타 */
.avatar-1, .avatar-5, .avatar-9 {
    background: #1746c8;
}
.avatar-2, .avatar-6, .avatar-10 {
    background: #e05a68;
}
.avatar-3, .avatar-7, .avatar-11 {
    background: #159b76;
}
.avatar-4, .avatar-8, .avatar-12 {
    background: #e58a35;
}

.profile-bio {
    padding: 16px;
    background: var(--primary-light);
    border-radius: 12px;
    line-height: 1.7;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.profile-stats > div {
    padding: 18px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}

.profile-stats strong {
    display: block;
    font-size: 24px;
    overflow-wrap: anywhere;
}

.profile-stats span {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    color: var(--muted);
}

.profile-list-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.profile-list-item a {
    display: block;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.profile-list-item small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.profile-section {
    margin: 28px 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.profile-section p,
.profile-section small {
    color: var(--muted);
}

.profile-section textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.profile-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    cursor: pointer;
}

.profile-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
}

.interest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.interest-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--text);
}

.interest-tag button {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 23px;
}

.interest-add-form {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}

.interest-add-form input {
    flex: 1;
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

@media (max-width: 600px) {
    .profile-header {
        align-items: flex-start;
        gap: 14px;
    }

    .profile-avatar {
        width: 64px;
        height: 64px;
    }

    .profile-stats {
        gap: 6px;
    }

    .profile-stats > div {
        padding: 12px 5px;
    }

    .profile-stats strong {
        font-size: 18px;
    }
}

.profile-feedback {
    padding: 12px;
    margin: 12px 0;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--text);
}

/* 상단 내 프로필 */
.header-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.header-profile:hover {
    color: var(--primary);
}

.header-profile .avatar {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.header-profile .avatar img,
.header-profile .avatar .avatar-initial {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-profile-name {
    font-weight: 600;
}

/* 게시글·댓글 작성자 아바타 */
.author-menu-trigger,
.author-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
}

.author-menu-trigger {
    cursor: pointer;
}

.author-small-avatar {
    display: inline-flex;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.author-small-avatar img,
.author-small-avatar .avatar-initial {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-small-avatar .avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.author-profile-link:hover {
    color: var(--primary);
}

.author-menu-dropdown a {
    display: block;
    text-decoration: none;
}

/* 통합 검색 */

.search-results-page {
    width: 100%;
}

.search-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 24px 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.search-tabs a {
    padding: 9px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    font-size: 17px;
}

.search-tabs a:hover,
.search-tabs a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.search-section {
    margin-bottom: 28px;
}

.search-section h2 {
    font-size: 21px;
    margin-bottom: 14px;
    color: var(--text);
}

.search-result-item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    margin-bottom: 10px;
}

.search-result-item a {
    color: var(--primary);
    text-decoration: none;
}

.search-result-item a:hover {
    text-decoration: underline;
}

.search-result-item p {
    margin: 8px 0;
    color: var(--text);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.search-result-item small,
.search-empty {
    color: var(--muted);
}

.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin: 28px 0;
}

.search-pagination a {
    color: var(--primary);
    text-decoration: none;
}


/* ===================================
   FreeShit - Reddit Dark Theme
   =================================== */

[data-theme="reddit-dark"] {
    --background: #0e1113;
    --surface: #1a1d1f;
    --text: #f2f4f5;
    --muted: #b8c5c9;
    --border: #343a40;

    --primary: #ff4500;
    --primary-hover: #e63e00;

    --secondary: #25282a;
    --accent: #ff4500;

    color-scheme: dark;
}
/* OpenForum retro typography: preserve existing theme colors. */
button, input, select, textarea { font-family: inherit; }
input, select, textarea { font-size: 1rem; }
html { font-size: 18px; }
.post-description { font-size: 18px; overflow-wrap: anywhere; }
.post-card h2, .main-content, .widget { overflow-wrap: anywhere; }
.topbar { height: auto; min-height: 72px; gap: 24px; padding-block: 10px; }
.search { min-width: 0; min-height: 46px; }
.header-actions { gap: 14px; flex-wrap: wrap; }
.feed-tabs { flex-wrap: wrap; gap: 18px; }
.community-row { gap: 8px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .topbar { flex-wrap: wrap; gap: 10px; }
    .header-actions { gap: 8px; }
}
@media (max-width: 720px) {
    html, body { font-size: 16px; }
    .topbar { padding: 8px 12px; }
    .logo { font-size: 20px; }
    .header-actions { font-size: 14px; }
    .header-actions .btn-primary { font-size: 14px; padding: 8px 10px; }
    .post-card h2 { font-size: 21px; }
    .post-description { font-size: 16px; }
    .post-actions { font-size: 14px; gap: 12px; }
    .post-meta { font-size: 13px; }
    .page-heading h1 { font-size: 26px; }
}

@media (min-width: 1151px) and (max-width: 1450px) {
    .layout {
        grid-template-columns: 240px minmax(0, 1fr) 290px;
    }
}

/* ========================================
   OPENFORUM BLACK TERMINAL THEME
   ======================================== */

body[data-theme] {
    color-scheme: dark;

    --background: #080808;
    --surface: #141414;
    --text: #dddddd;
    --muted: #999999;
    --border: #333333;

    --primary: #33ff33;
    --primary-hover: #66ff66;
    --primary-light: #0b200b;

    --card-bg: #141414;
    --text-primary: #dddddd;

    background: var(--background);
    color: var(--text);
}

/* Header */

body[data-theme] .topbar {
    background: #111111;
    color: var(--text);
    border-color: var(--border);
}

body[data-theme] .search {
    background: #080808;
    border: 1px solid var(--border);
}

body[data-theme] .search input {
    color: var(--text);
}

/* Navigation */

body[data-theme] .nav-link,
body[data-theme] .sidebar-title,
body[data-theme] .create-community {
    color: var(--text);
}

body[data-theme] .nav-link:hover,
body[data-theme] .nav-link.active {
    background: #0b200b;
    color: var(--primary);
}

body[data-theme] .sidebar-title {
    color: var(--primary);
}

/* Cards and panels */

body[data-theme] .post-card,
body[data-theme] .card,
body[data-theme] .widget,
body[data-theme] .panel {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

/* Buttons */

body[data-theme] .btn-primary {
    background: #33ff33;
    color: #080808;
    border-color: #33ff33;
}

body[data-theme] .btn-primary:hover {
    background: #66ff66;
    color: #080808;
}

/* Form controls */

body[data-theme] input:not([type="checkbox"]):not([type="radio"]),
body[data-theme] textarea,
body[data-theme] select {
    background: #101010;
    color: var(--text);
    border-color: var(--border);
}

body[data-theme] input::placeholder,
body[data-theme] textarea::placeholder {
    color: #888888;
}

/* Tables */

body[data-theme] table,
body[data-theme] th,
body[data-theme] td {
    border-color: var(--border);
    color: var(--text);
}

body[data-theme] th {
    background: #1b1b1b;
}

/* Text selection */

::selection {
    background: #33ff33;
    color: #080808;
}


/* ========================================
   OPENFORUM MOBILE NAVIGATION
   ======================================== */

.mobile-menu-toggle {
    display: none;
}

@media (max-width: 720px) {

    .topbar {
        display: flex;
        flex-wrap: wrap;
        height: auto;
        min-height: 0;
        padding: 10px 12px;
        gap: 8px;
        box-sizing: border-box;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        order: 0;
        width: 40px;
        height: 44px;
        flex-shrink: 0;
        padding: 0;
        background: transparent;
        color: var(--primary);
        border: 1px solid var(--border);
        border-radius: 4px;
        font-size: 24px;
        cursor: pointer;
    }

    .topbar .logo {
        order: 1;
        min-width: 0;
        font-size: 20px;
        flex: 1;
        overflow-wrap: anywhere;
    }

    .topbar .logo-icon {
        font-size: 20px;
    }

    .topbar .header-actions {
        order: 2;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
        margin-left: auto;
        max-width: 100%;
        font-size: 13px;
    }

    .header-profile-name {
        display: none;
    }

    .header-actions .btn-primary {
        font-size: 12px;
        padding: 7px 9px;
        white-space: nowrap;
    }

    /* Restore search on mobile */

    body[data-theme] .topbar .search {
        display: flex;
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        max-width: none;
        min-width: 0;
        height: 44px;
        margin: 0;
        padding: 0 12px;
        box-sizing: border-box;
        border-radius: 5px;
    }

    body[data-theme] .topbar .search input {
        width: 100%;
        min-width: 0;
        font-size: 16px;
        background: transparent;
    }

    /* Mobile sidebar */

    .layout > .sidebar {
        display: none;
    }

    .layout > .sidebar.mobile-open {
        display: block;
        position: static;
        width: 100%;
        height: auto;
        max-height: none;
        padding: 14px;
        margin-bottom: 14px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 5px;
        box-sizing: border-box;
    }

    .sidebar .nav-link {
        min-height: 44px;
    }

    .layout {
        display: block;
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }

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

    .right-sidebar {
        display: none;
    }

    .post-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-content img {
        max-width: 100%;
        height: auto;
    }
}

