/* ===== COMMUNITY PAGE ===== */

/* ======================
   Layout
   ====================== */
.community-wrap {
    min-height: 100vh;
    background: var(--bg);
}

/* ======================
   Hero
   ====================== */
.community-hero {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-light);
    padding: 48px 0 0;
}

.community-hero-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

.community-hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--blue);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.community-hero h1 {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.community-hero-desc {
    font-size: 14px;
    color: var(--gray-dark);
    line-height: 1.7;
    max-width: 520px;
    margin-bottom: 28px;
}

/* ======================
   Tab Bar
   ====================== */
.community-tabs {
    display: flex;
    gap: 0;
    margin-top: 4px;
}

.community-tab {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.community-tab:hover {
    color: var(--ink);
}

.community-tab.active {
    color: var(--ink);
    border-bottom: 2px solid var(--ink);
}

/* ======================
   Body Layout
   ====================== */
.community-body {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 24px 80px;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 32px;
    align-items: start;
}

/* ======================
   Feed
   ====================== */
.community-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#communityPostList {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.community-post-link {
	display: block;
	min-width: 0;
	text-decoration: none;
	color: inherit;
}

.community-post-link:hover {
	color: inherit;
	text-decoration: none;
}

.community-post-title,
.community-post-body {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Login nudge */
.community-login-nudge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 12px 16px;
}

.community-login-nudge span {
    font-size: 13px;
    color: var(--gray-dark);
    line-height: 1.5;
}

.community-login-nudge-btn {
    flex-shrink: 0;
    padding: 7px 16px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
}

.community-login-nudge-btn:hover {
    background: var(--blue-light);
}

/* Hidden by default — JS controls visibility */
#composeBox { display: none; }

/* Write box (logged-in only) */
.community-write-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 11px 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.community-write-box:hover {
    border-color: var(--blue);
}

.community-write-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--blue-dim);
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.community-write-placeholder {
    flex: 1;
    font-size: 13px;
    color: var(--gray-light);
}

.community-write-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Notice card */
.community-notice-card {
    background: var(--blue-dim);
    border: 1px solid rgba(133, 183, 235, 0.35);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.community-notice-icon {
    font-size: 13px;
    color: var(--blue);
    margin-top: 1px;
    flex-shrink: 0;
}

.community-notice-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--blue);
    margin-bottom: 3px;
}

.community-notice-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
}

.community-notice-time {
    font-size: 11px;
    color: var(--gray);
    margin-top: 3px;
}

/* Post card */
.community-post-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px 18px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.community-post-card:hover {
    border-color: rgba(24, 95, 165, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.community-post-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
	min-width: 0;
}

.community-post-author-wrap {
	flex: 1;
	min-width: 0;
}

.community-post-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.community-post-avatar-img + span {
	display: none;
}

.community-post-avatar.av-blue   { background: #B5D4F4; color: #0C447C; }
.community-post-avatar.av-teal   { background: #9FE1CB; color: #085041; }
.community-post-avatar.av-coral  { background: #F5C4B3; color: #712B13; }
.community-post-avatar.av-purple { background: #CECBF6; color: #3C3489; }
.community-post-avatar.av-amber  { background: #FAC775; color: #633806; }
.community-post-avatar.av-deleted {
	background: #E5E5E5;
	color: #777;
	border: 1px dashed #BDBDBD;
}
.cpd-avatar.av-deleted {
	background: #E5E5E5;
	color: #777;
	border: 1px dashed #BDBDBD;
}

/* 아바타 색상 */
.community-post-avatar.av-0,
.cpd-avatar.av-0 {
	background: #B5D4F4;
	color: #0C447C;
}

.community-post-avatar.av-1,
.cpd-avatar.av-1 {
	background: #9FE1CB;
	color: #085041;
}

.community-post-avatar.av-2,
.cpd-avatar.av-2 {
	background: #F5C4B3;
	color: #712B13;
}

.community-post-avatar.av-3,
.cpd-avatar.av-3 {
	background: #CECBF6;
	color: #3C3489;
}

.community-post-avatar.av-4,
.cpd-avatar.av-4 {
	background: #FAC775;
	color: #633806;
}

/* 탈퇴 회원 */
.community-post-avatar.av-deleted,
.cpd-avatar.av-deleted {
	background: #E5E5E5;
	color: #777;
	border: 1px dashed #BDBDBD;
}

.community-post-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-post-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.community-post-country {
    font-size: 11px;
    color: var(--gray);
}

.community-post-time {
	font-size: 11px;
	color: var(--gray-light);
	margin-left: 8px;
	flex-shrink: 0;
	white-space: nowrap;
}

.community-post-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
    line-height: 1.4;
}

.community-post-body {
    font-size: 13.5px;
    color: var(--gray-dark);
    line-height: 1.65;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.community-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.community-post-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.community-post-tag.tag-kpop    { background: #EEEDFE; color: #3C3489; }
.community-post-tag.tag-culture { background: #F1EFE8; color: #444441; }
.community-post-tag.tag-life    { background: #E1F5EE; color: #085041; }
.community-post-tag.tag-beauty  { background: #FAECE7; color: #712B13; }
.community-post-tag.tag-drama   { background: #F4C0D1; color: #4B1528; }
.community-post-tag.tag-food    { background: #FAEEDA; color: #412402; }
.community-post-tag.tag-linked  { background: #B5D4F4; color: #0C447C; }

.community-post-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.community-post-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--gray);
}

.community-post-stat i {
    font-size: 12px;
}

.community-post-share {
    margin-left: auto;
    font-size: 12px;
    color: var(--gray-light);
    cursor: pointer;
    transition: color 0.2s;
}

.community-post-share:hover {
    color: var(--blue);
}

/* ======================
   Compose box
   ====================== */
.community-compose {
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border: 1px solid #B5D4F4;
    border-radius: 12px;
    padding: 14px 16px;
}

.community-compose.open {
    display: flex;
}

.community-compose-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.community-compose-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.community-compose-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.compose-tag {
    font-size: 11px;
    padding: 4px 10px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--gray-dark);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.compose-tag:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.compose-tag.on {
    background: #EEEDFE;
    border-color: #CECBF6;
    color: #3C3489;
    font-weight: 600;
}

.community-compose-title {
    width: 100%;
    padding: 9px 12px;
    /* border: 1px solid var(--border-light); */
    border: 1px solid #C7D7EA;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    margin-bottom: 6px;
}

.community-compose-title:focus {
    border-color: var(--blue);
}

.community-compose-title::placeholder {
    color: var(--gray-light);
    font-weight: 400;
}

.community-compose-body {
    width: 100%;
    padding: 9px 12px;
    /* border: 1px solid var(--border-light); */
    border: 1px solid #C7D7EA;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    outline: none;
    resize: none;
    line-height: 1.65;
    min-height: 90px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    margin-bottom: 6px;
}

.community-compose-body:focus {
    border-color: var(--blue);
}

.community-compose-body::placeholder {
    color: var(--gray-light);
}

.community-compose-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.community-compose-cancel {
    font-size: 12px;
    color: var(--gray-dark);
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 7px;
    padding: 6px 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.community-compose-cancel:hover {
    border-color: var(--gray);
}

.community-compose-submit {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--blue);
    border: none;
    border-radius: 7px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background var(--transition);
}

.community-compose-submit:hover {
    background: var(--blue-light);
}

/* ======================
   Sidebar
   ====================== */
.community-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
}

.community-sidebar-block {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 18px;
}

.community-sidebar-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 12px;
}

/* Topic pills */
.community-topic-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.community-topic-pill {
    display: inline-block;
    font-size: 12px;
    padding: 5px 12px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--gray-dark);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    text-decoration: none;
}

.community-topic-pill:hover,
.community-topic-pill.active {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-dim);
}

/* Hot list */
.community-hot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.community-hot-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.community-hot-num {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-light);
    min-width: 14px;
    margin-top: 1px;
}

.community-hot-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
    transition: color 0.2s;
}

.community-hot-item:hover .community-hot-text {
    color: var(--blue);
}

.community-hot-meta {
    font-size: 11px;
    color: var(--gray-light);
    margin-top: 2px;
}

/* Join box */
.community-join-box {
    background: #07080f;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.community-join-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.community-join-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.7;
}

.community-join-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: #185FA5;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    text-decoration: none;
    margin-top: 2px;
}

.community-join-btn:hover {
    background: #378ADD;
}

/* ======================
   Responsive
   ====================== */
@media (max-width: 860px) {
    .community-body {
        grid-template-columns: 1fr;
    }

    .community-sidebar {
        position: static;
    }
}

@media (max-width: 600px) {
	.community-hero-eyebrow {
	    font-family: var(--font-mono);
	    font-size: 12px;
	    font-weight: 700;
	    letter-spacing: 0.05em;
	    color: var(--blue);
	    margin-bottom: 4px;
	    display: flex;
	    align-items: center;
	    gap: 10px;	
    }		
	
    .community-hero h1 {
        font-size: 24px;
    }

    .community-hero {
        padding: 32px 0 0;
    }

    .community-body {
        padding: 20px 16px 60px;
    }

    .community-login-nudge {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .community-login-nudge-btn {
        width: 100%;
        text-align: center;
    }

    /* 탭 가로 스크롤 */
    .community-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .community-tabs::-webkit-scrollbar {
        display: none;
    }
}
/* ======================
   아이폰 SE (375px 이하)
   ====================== */
@media (max-width: 390px) {
	.community-hero-eyebrow {
		font-family: var(--font-mono);
		font-size: 12px;
		font-weight: 700;
		letter-spacing: 0.05em;
		color: var(--blue);
		margin-bottom: 4px;
		display: flex;
		align-items: center;
		gap: 10px;
	}

	.community-hero {
		padding: 24px 0 0;
	}

	.community-hero h1 {
		font-size: 20px;
	}

	.community-hero-desc {
		font-size: 13px;
	}

	.community-body {
		padding: 16px 12px 60px;
		gap: 20px;
	}

	.community-post-card {
		padding: 12px;
	}

	.community-post-meta {
		display: grid;
		grid-template-columns: 24px minmax(0, 1fr) auto;
		align-items: center;
		column-gap: 6px;
		margin-bottom: 10px;
		min-width: 0;
	}

	.community-post-avatar {
		width: 24px;
		height: 24px;
		font-size: 10px;
	}

	.community-post-author-wrap {
		min-width: 0;
		overflow: hidden;
		padding-right: 4px;
	}

	.community-post-author {
		font-size: 12px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.community-post-time {
		font-size: 10px;
		white-space: nowrap;
	}

	.community-post-title {
		font-size: 14px;
		-webkit-line-clamp: 2;
	}

	.community-post-body {
		font-size: 12px;
		-webkit-line-clamp: 2;
	}

	.community-sidebar-block {
		padding: 14px;
	}

	.community-notice-card {
		padding: 10px 12px;
	}

	.community-compose-title,
	.community-compose-body {
		min-width: 0;
		font-size: 13px;
	}

	.community-compose-footer {
		flex-wrap: wrap;
	}

	.community-compose-cancel,
	.community-compose-submit {
		flex: 1;
		text-align: center;
	}

	.community-write-box {
		padding: 9px 12px;
	}

	.community-post-tag {
		font-size: 10px;
		padding: 2px 8px;
	}

	.community-post-footer {
		gap: 8px;
	}

	.community-post-stat {
		font-size: 11px;
	}

	.community-join-box {
		padding: 16px;
	}
}

/* ======================
   갤럭시 S25 기본 (360px 이하)
   ====================== */
@media (max-width: 360px) {
	.community-hero-eyebrow {
		font-family: var(--font-mono);
		font-size: 10px;
		font-weight: 700;
		letter-spacing: 0.05em;
		color: var(--blue);
		margin-bottom: 4px;
		display: flex;
		align-items: center;
		gap: 10px;
	}

	.community-hero-desc {
		font-size: 12px;
	}

	.community-body {
		padding: 12px 10px 56px;
		gap: 16px;
	}

	.community-post-card {
		padding: 10px;
	}

	.community-post-meta {
		display: grid;
		grid-template-columns: 22px minmax(0, 1fr) auto;
		align-items: center;
		column-gap: 5px;
		margin-bottom: 10px;
		min-width: 0;
	}

	.community-post-avatar {
		width: 22px;
		height: 22px;
		font-size: 9px;
	}

	.community-post-author-wrap {
		min-width: 0;
		overflow: hidden;
		padding-right: 3px;
	}

	.community-post-author {
		font-size: 11px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.community-post-time {
		font-size: 9px;
		white-space: nowrap;
	}

	.community-post-title {
		font-size: 13px;
		-webkit-line-clamp: 2;
	}

	.community-post-body {
		font-size: 11px;
		-webkit-line-clamp: 2;
	}

	.community-post-country {
		display: none;
	}

	.community-post-tag {
		font-size: 10px;
		padding: 2px 7px;
	}

	.community-write-box {
		padding: 8px 10px;
		gap: 8px;
	}

	.community-write-placeholder {
		font-size: 12px;
	}

	.community-compose-title,
	.community-compose-body {
		font-size: 12px;
		padding: 8px 10px;
	}

	.community-sidebar-block {
		padding: 12px;
	}

	.community-join-box {
		padding: 14px;
	}

	.community-tab {
		padding: 10px 14px;
		font-size: 12px;
	}

	.community-post-footer {
		gap: 6px;
	}

	.community-post-stat {
		font-size: 10px;
	}
}