@charset "utf-8";

/* =========================
   BASE
========================= */
#bo_list {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 12px;
}

/* =========================
   SEARCH
========================= */
#bo_sch {
    display: flex;
    justify-content: flex-end;
    border: 0;
    padding: 0;
    margin: 0 0 16px 0;
}
#bo_sch form { width: 50%; }
@media (max-width: 768px) {
    #bo_sch { justify-content: stretch; }
    #bo_sch form { width: 100%; }
}

/* =========================
   CATEGORY
========================= */
#bo_cate { margin: 0 0 16px 0; }
#bo_cate h2 {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
#bo_cate ul {
    display: flex; flex-wrap: wrap; gap: 6px;
    list-style: none; padding: 0; margin: 0;
}
#bo_cate li { display: inline-block; }
#bo_cate a {
    display: block;
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--light-bg-color);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88em;
    transition: all 0.2s;
}
#bo_cate a:hover,
#bo_cate #bo_cate_on {
    background: var(--primary-color);
    color: var(--btn-primary-text, #7a3f3a);
}

/* =========================
   WRITE AREA
========================= */
.memo-write-area {
    background: var(--card-bg-color);
    border-radius: 20px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.memo-write-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.memo-write-avatar {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    overflow: hidden;
    background: var(--light-bg-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.memo-write-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.memo-write-avatar .fa-user-circle {
    font-size: 36px;
    color: var(--text-muted);
    line-height: 1;
}

.memo-write-body { flex: 1; }

.memo-input {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid var(--input-border-color, #eee);
    border-radius: 12px;
    background: #ffffff85;
    color: var(--content-font-color);
    font-size: 1.0em;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.memo-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.memo-input:focus { border-bottom-color: var(--primary-color); }

.memo-write-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.memo-select {
    padding: 6px 12px;
    border: 1px solid var(--input-border-color, #ddd);
    border-radius: 20px;
    background: var(--form-bg-color);
    color: var(--form-text-color);
    font-size: 0.88em;
    cursor: pointer;
}

.memo-submit-btn {
    padding: 7px 20px;
    background: var(--primary-color);
    color: var(--btn-primary-text, #7a3f3a);
    border: none;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.memo-submit-btn:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

/* =========================
   TOOLBAR (이미지 + 비밀글)
========================= */
.memo-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: auto;
}

.memo-img-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1em;
    transition: all 0.2s;
    background: none;
    border: none;
}
.memo-img-btn:hover {
    background: var(--light-bg-color);
    color: var(--primary-color);
}

.memo-secret-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.95em;
    transition: all 0.2s;
}
.memo-secret-btn:hover { background: var(--light-bg-color); }
.memo-secret-btn.active .memo-secret-icon,
.memo-secret-btn .fa-lock {
    color: var(--primary-color);
}

/* =========================
   이미지 미리보기
========================= */
.memo-img-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0 0;
}

.memo-img-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--card-border-color, #eee);
}
.memo-img-preview-item img {
    width: 100%; height: 100%; object-fit: cover;
}
.memo-img-remove-btn {
    position: absolute;
    top: 3px; right: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    font-size: 0.7em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.memo-img-remove-btn:hover { background: rgba(200,0,0,0.8); }

/* =========================
   이미지 그리드 (본문)
========================= */
.memo-img-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    margin-top: 8px;
    width: 100%;
}
.memo-img-link {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--card-border-color, #eee);
}
.memo-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
    display: block;
}
.memo-img-thumb:hover { opacity: 0.88; }

/* 이미지 1장일 때: 원본 비율 유지, 너비 꽉 차게 */
.memo-img-grid:has(.memo-img-link:only-child) {
    grid-template-columns: 1fr;
}
.memo-img-grid:has(.memo-img-link:only-child) .memo-img-link {
    aspect-ratio: unset;
    height: auto;
    border-radius: 12px;
    overflow: visible;
    border: none;
}
.memo-img-grid:has(.memo-img-link:only-child) .memo-img-thumb {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: unset;
    border-radius: 12px;
    border: 1px solid var(--card-border-color, #eee);
    background: none;
}

/* 이미지 3장: 첫 번째만 왼쪽 한 칸 차지, 나머지 둘이 오른쪽 */
.memo-img-grid:has(.memo-img-link:nth-child(3):last-child) {
    grid-template-columns: repeat(3, 1fr);
}

/* 이미지 4장: 2x2 */
.memo-img-grid:has(.memo-img-link:nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

/* =========================
   비밀글 스타일
========================= */
.memo-secret-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: rgba(100,100,200,0.1);
    color: #6060cc;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}

.memo-item.memo-secret {
    border-left: 3px solid rgba(100,100,200,0.35);
}

.memo-secret-placeholder {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    background: var(--light-bg-color);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.9em;
    margin: 4px 0;
}

/* =========================
   LIST
========================= */
.memo-list-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =========================
   ITEM
========================= */
.memo-item {
    display: flex;
    gap: 12px;
    background: var(--card-bg-color);
    border-radius: 20px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}
.memo-item:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

/* 아바타 + 타래선 */
.memo-avatar {
    width: 40px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.memo-avatar > img,
.memo-avatar > .fa-user-circle {
    width: 40px;
    height: 40px;
    border-radius: 40px;
    object-fit: cover;
    background: var(--light-bg-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--text-muted);
    line-height: 1;
}

/* 본문 영역 */
.memo-body { flex: 1; min-width: 0; }

/* 헤더 */
.memo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1px;
    gap: 8px;

}

.memo-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1;
    /* min-width: 0; */
}

.memo-name {
    font-weight: 700;
    font-size: 1.03em;
    color: var(--content-font-color);
}

.memo-rank {
    font-size: 0.82em;
    font-weight: normal;
}

.memo-category {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-color);
    color: var(--btn-primary-text, #7a3f3a);
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}

.memo-date {
    font-size: 0.78em;
    color: var(--text-muted);
}

/* 액션 버튼 */
.memo-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    position: absolute;
    top: 16px;
    right: 16px;
    
}

.memo-edit-btn,
.memo-delete-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: none;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82em;
    display: flex;
    margin-top: 2.5px;
    justify-content: center;
    transition: all 0.2s;
}
.memo-edit-btn:hover {
    background: var(--light-bg-color);
    color: var(--primary-color);
}
.memo-delete-btn:hover {
    background: rgba(220,50,50,0.08);
    color: var(--danger-color, #dc3232);
}

/* 본문 텍스트 */
.memo-content {
    font-size: 1.00em;
    line-height: 1.6;
    color: var(--content-font-color);
    white-space: normal;
    word-break: break-word;
}

/* =========================
   EDIT AREA
========================= */
.memo-edit-area {
    margin-top: 8px;
}

.memo-edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid var(--input-border-color, #ddd);
    background: transparent;
    color: var(--content-font-color);
    font-size: 0.95em;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.memo-edit-textarea:focus {
    border-bottom-color: var(--primary-color);
}

.memo-edit-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.memo-save-btn,
.memo-cancel-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.memo-save-btn {
    background: var(--primary-color);
    color: var(--btn-primary-text, #7a3f3a);
    margin-left: auto;
}
.memo-save-btn:hover { filter: brightness(0.95); }
.memo-cancel-btn {
    background: var(--light-bg-color);
    color: var(--text-muted);
}
.memo-cancel-btn:hover { background: var(--card-border-color); }

/* =========================
   REPLY SECTION (타래 댓글)
========================= */
.memo-reply-section {
    margin-top: 8px;
    margin-bottom: 2px
}

.memo-action-bar {
    display: flex;
    align-items: center;
    
    gap: 5px;
}

.memo-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 3px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.95em;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s;
}
.memo-like-btn:hover {
    background: var(--light-bg-color);
    color: #e0245e;
}
.memo-like-btn.liked {
    color: #e0245e;
}
.memo-like-btn.like-pop {
    transform: scale(1.3);
}
.memo-like-btn .memo-like-count {
    font-weight: 700;
}

/* 좋아요한 사람 표시 */
.memo-liked-by {
    font-size: 0.78em;
    color: var(--text-muted);
    margin-top: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.memo-liked-by i {
    color: #e0245e;
    font-size: 0.85em;
}
.memo-liked-by:hover {
    text-decoration: underline;
}
.memo-liked-by strong {
    color: var(--content-font-color);
}

/* 좋아요 목록 모달 아이템 */
.memo-liker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border-color, #eee);
    font-size: 0.9em;
}
.memo-liker-item:last-child { border-bottom: none; }
.memo-liker-item img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}
.memo-liker-item i {
    font-size: 32px;
    color: var(--text-muted);
}

.memo-reply-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 3px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.95em;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s;
}
.memo-reply-toggle:hover {
    background: var(--light-bg-color);
    color: var(--primary-color);
}
.memo-reply-toggle .memo-reply-count {
    font-weight: 700;
    color: var(--primary-color);
}

/* 댓글 영역 */
.memo-reply-area {
    margin-top: 5px;
    padding-top: 10px;
    border-top: 0px solid var(--card-border-color, #eeeeeefa);
}

/* 댓글 로딩 */
.memo-reply-loading {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 1.2em;
}

.memo-reply-empty,
.memo-reply-error {
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 0.88em;
}
.memo-reply-error { color: var(--danger-color, #dc3232); }

/* 댓글 아이템 */
.memo-reply-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 0px solid var(--card-border-color, #f0f0f0);
}
.memo-reply-item:last-child { border-bottom: none; }

.memo-reply-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-bg-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.memo-reply-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.memo-reply-avatar .fa-user-circle {
    font-size: 28px;
    color: var(--text-muted);
    line-height: 1;
}

.memo-reply-body { flex: 1; min-width: 0; }

.memo-reply-content {
    font-size: 0.98em;
    line-height: 1.6;
    color: var(--content-font-color);
    word-break: break-word;
    margin-top: 4px;
}

/* 댓글 쓰기 폼 */
.memo-reply-write {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 0px dashed var(--card-border-color, #eee);
}

.memo-reply-write-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-bg-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.memo-reply-write-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.memo-reply-write-avatar .fa-user-circle {
    font-size: 28px;
    color: var(--text-muted);
    line-height: 1;
}

.memo-reply-write-body { flex: 1; }

.memo-reply-input {
    width: 100%;
    min-height: 48px;
    padding: 4px 8px;
    border: 1px solid var(--input-border-color, #eee);
    background: #ffffff73;
    color: var(--content-font-color);
    font-size: 0.9em;
    line-height: 1.9;
    resize: none;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.memo-reply-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.memo-reply-input:focus { border-bottom-color: var(--primary-color); }

.memo-reply-write-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.memo-reply-submit-btn {
    padding: 5px 16px;
    background: var(--primary-color);
    color: var(--btn-primary-text, #7a3f3a);
    border: none;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}
.memo-reply-submit-btn:hover { filter: brightness(0.95); }

/* 댓글 이미지 미리보기 */
.memo-reply-img-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0;
}
.memo-reply-img-preview-area .memo-img-preview-item {
    width: 60px;
    height: 60px;
}

/* =========================
   EMPTY
========================= */
.memo-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.memo-empty i {
    font-size: 3em;
    display: block;
    margin-bottom: 16px;
    opacity: 0.3;
}
.memo-empty p { font-size: 1em; margin: 6px 0; }
.memo-empty-hint { font-size: 0.9em; opacity: 0.7; }

/* =========================
   PAGINATION
========================= */
.bo-pagination {
    margin-top: 24px;
    text-align: center;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    #bo_list { padding: 12px 8px; }
    .memo-item { padding: 14px 14px; }
    .memo-write-area { padding: 14px; }
    .memo-img-thumb {
        width: 100%;
        height: 100%;
    }
}

/* =========================
   해시태그
========================= */
.memo-hashtag {
    color: #5b8dee;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}
.memo-hashtag:hover {
    color: #3a6bd4;
    text-decoration: underline;
}

/* 해시태그 필터 배너 */
.memo-tag-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    margin-bottom: 12px;
    background: rgba(91, 141, 238, 0.1);
    border: 1px solid rgba(91, 141, 238, 0.3);
    border-radius: 10px;
    font-size: 0.9em;
}
.memo-tag-banner-text {
    flex: 1;
    color: #5b8dee;
    font-weight: 600;
}
.memo-tag-clear {
    background: none;
    border: 1px solid rgba(91, 141, 238, 0.4);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.85em;
    color: #5b8dee;
    cursor: pointer;
    transition: background 0.15s;
}
.memo-tag-clear:hover {
    background: rgba(91, 141, 238, 0.15);
}

/* =========================
   스포일러 접기
========================= */
.memo-spoiler-wrap {
    margin-top: 8px;
}
.memo-spoiler-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(120, 120, 180, 0.1);
    border: 1px dashed rgba(120, 120, 180, 0.4);
    border-radius: 6px;
    color: #888;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    width: 100%;
    justify-content: center;
}
.memo-spoiler-toggle:hover {
    background: rgba(120, 120, 180, 0.18);
    color: #555;
}
.memo-spoiler-content {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(120, 120, 180, 0.06);
    border-left: 3px solid rgba(120, 120, 180, 0.3);
    border-radius: 0 6px 6px 0;
    font-size: 0.95em;
}

/* 스포일러 버튼 (글쓰기 툴바) */
.memo-spoiler-btn {
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 1.1em;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}
.memo-spoiler-btn:hover {
    color: var(--text-color, #333);
    background: rgba(0,0,0,0.06);
}

/* =========================
   라이트박스
========================= */
#memo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
}
#memo-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
}
#memo-lightbox-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
#memo-lightbox-img-wrap {
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}
#memo-lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    display: block;
}
#memo-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.4em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: background 0.15s;
}
#memo-lightbox-close:hover { background: rgba(255,255,255,0.3); }

#memo-lightbox-prev,
#memo-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.2em;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: background 0.15s;
}
#memo-lightbox-prev { left: 16px; }
#memo-lightbox-next { right: 16px; }
#memo-lightbox-prev:hover,
#memo-lightbox-next:hover { background: rgba(255,255,255,0.3); }

#memo-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.9em;
    pointer-events: none;
    background: rgba(0,0,0,0.4);
    padding: 3px 12px;
    border-radius: 20px;
}
