@charset "utf-8";

/* Css Variables Theme (Light / Dark) */
:root {
    --bg-color: #f4f4f4;
    --text-color: #333;
    --header-bg: #fff;
    --footer-bg: #eaeaea;
    --border-color: #ddd;
    --point-color: #8cc63f;
    /* 밝은 배경용 포인트색 */
    --card-bg: #fff;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #fff;
    --header-bg: #1e1e1e;
    --footer-bg: #0a0a0a;
    --border-color: #333;
    --point-color: #c6ff70;
    /* 어두운 배경용 포인트색 */
    --card-bg: #222;
}

/* Reset & Basic */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

/* Accessibility */
.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;
}

/* Layout Structure */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px;
}

/* Header */
.site-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    min-height: 60px;
}

/* Utils & Theme Toggle Button */
.header-utils {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.theme-toggle-btn {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
}

/* Top Navigation (PC) */
.gnb ul {
    display: flex;
    gap: 20px;
}

.gnb a {
    font-size: 24px;
    padding: 5px 10px;
    display: inline-block;
    transition: transform 0.2s;
}

.gnb a:hover {
    transform: scale(1.2);
}

/* Bottom Navigation (Mobile) */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    transition: background-color 0.3s;
}

.mobile-nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
}

.mobile-nav a {
    font-size: 28px;
    display: block;
    padding: 10px;
}

/* Footer */
.site-footer {
    background-color: var(--footer-bg);
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
    transition: background-color 0.3s;
}

/* Responsive Utilities */
@media (max-width: 918px) {
    .d-none-mobile {
        display: none !important;
    }
}

@media (min-width: 919px) {
    .d-block-mobile {
        display: none !important;
    }

    .site-main {
        padding-bottom: 20px;
    }
}

/* Main Page specific styles */
.main-banner-spacing {
    margin-bottom: 40px;
}

.main-title {
    font-size: 32px;
    color: var(--point-color);
    margin-bottom: 10px;
}

.main-subtitle {
    font-size: 18px;
    color: #aaa;
}

.gallery {
    display: grid;
    gap: 20px;
}

.text-center {
    text-align: center;
}

.empty-msg {
    color: #666;
}

.loading-trigger {
    text-align: center;
    padding: 20px;
    color: #444;
}

@media (min-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1199px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

.post-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.post-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
}

.post-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* User Search List */
.user-search-list {
    display: grid;
    gap: 10px;
    margin-bottom: 40px;
}

/* Default (Mobile): 1 column */
.user-search-list {
    grid-template-columns: 1fr;
}

/* Small Tablet / Large Mobile: 2 columns */
@media (min-width: 500px) {
    .user-search-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 columns */
@media (min-width: 920px) {
    .user-search-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Wide Desktop: 4 columns */
@media (min-width: 1200px) {
    .user-search-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

.user-search-item {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-color);
    transition: background 0.2s, transform 0.2s;
}

.user-search-item:hover {
    background-color: var(--bg-color);
    transform: translateY(-2px);
}

.user-search-item .user-thumb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #444;
    overflow: hidden;
    flex-shrink: 0;
}

.user-search-item .user-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-search-item .user-info h4 {
    margin: 0;
    font-size: 16px;
}

.user-search-item .user-info span {
    font-size: 12px;
    color: #aaa;
}


/* Profile Page Styles */
.profile-header {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-top-row {
    display: flex;
    align-items: center;
    gap: 30px;
}

.profile-img-wrap {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #444;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-id-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.profile-id-row h2 {
    font-size: 24px;
    margin: 0;
}

.profile-stats {
    display: flex;
    gap: 25px;
    margin-bottom: 15px;
}

.profile-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-stats .stat-item span {
    font-size: 14px;
    color: #888;
}

.profile-stats .stat-item strong {
    font-size: 16px;
    color: var(--point-color);
}

.profile-intro-row {
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.profile-intro {
    white-space: pre-wrap;
    font-size: 14px;
    color: #aaa;
    line-height: 1.6;
}

.profile-homepage {
    display: inline-block;
    margin-top: 12px;
    color: var(--text-color);
    font-weight: bold;
    font-size: 14px;
    text-decoration: underline;
}

/* Mobile Specific (Profile) */
@media (max-width: 918px) {
    .profile-top-row {
        gap: 20px;
    }

    .profile-img-wrap {
        width: 84px;
        /* 120px * 0.7 */
        height: 84px;
    }

    .profile-id-row h2 {
        font-size: 20px;
    }

    .profile-stats {
        gap: 0;
        justify-content: space-around;
        width: 100%;
        margin: 20px 0 10px;
    }

    .profile-stats .stat-item {
        flex-direction: column-reverse;
        /* 숫자가 위로 가도록 역순 배치 */
        gap: 4px;
    }

    .profile-stats .stat-item strong {
        font-size: 18px;
    }

    .profile-stats .stat-item span {
        font-size: 12px;
    }
}

/* Post Detail Modal (PC) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    /* 높이 고정하여 스크롤 유도 */
    border-radius: 12px;
    display: flex;
    position: relative;
    overflow: hidden;
}

.modal-img-area {
    flex: 1.2;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}

.modal-img-area img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-info-area {
    flex: 0.8;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-left: 1px solid var(--border-color);
}

.modal-info-header {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Custom Scrollbar for Modal Body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--point-color);
}

.modal-comments-list {
    margin-top: 20px;
}

.comment-item {
    margin-bottom: 20px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-thumb {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #444;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Nav Buttons */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.modal-nav-btn:hover {
    background: var(--point-color);
    color: #000;
}

.modal-nav-prev {
    left: 20px;
}

.modal-nav-next {
    right: 20px;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 1002;
}

/* Nested Comments */
.cmt-depth-1 {
    margin-left: 0;
}

.cmt-depth-2 {
    margin-left: 15px;
}

.cmt-depth-3 {
    margin-left: 30px;
}

.cmt-depth-4 {
    margin-left: 45px;
}

.cmt-depth-5 {
    margin-left: 50px;
}

/* Mobile Comment Drawer */
.comment-drawer {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: calc(100% - 50px);
    background: var(--card-bg);
    z-index: 2000;
    transition: bottom 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
}

.comment-drawer.active {
    bottom: 0;
}

.drawer-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    position: relative;
}

.drawer-handle {
    width: 40px;
    height: 4px;
    background: #555;
    border-radius: 2px;
    margin: 0 auto 10px;
}

.drawer-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
}

/* Mobile Post Style */
@media (max-width: 918px) {
    .post-card.mobile-style .post-img img {
        object-fit: none;
        max-width: none;
        max-height: none;
    }
}