:root {
    --post-bg: #ffffff;
    --post-border: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
    --bg-gray: #f9fafb;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.post-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

/* 브레드크럼 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover {
    color: var(--accent-color);
}
.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* 게시글 상세 카드 */
.post-detail {
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* 게시글 헤더 */
.post-header {
    padding: 32px;
    border-bottom: 1px solid var(--post-border);
}
.post-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-gray);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
}
.post-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    line-height: 1.3;
}
.post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-gray);
    background-size: cover;
    background-position: center;
}
.author-name {
    font-weight: 600;
    color: var(--text-primary);
}
.post-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 게시글 본문 */
.post-body {
    padding: 32px;
}
.post-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* 첨부파일 */
.post-attachments {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--post-border);
}
.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-gray);
    border-radius: 8px;
    margin-bottom: 8px;
}
.attachment-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.btn-download {
    padding: 6px 16px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-download:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* 액션 버튼 영역 */
.post-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 24px 32px;
    border-top: 1px solid var(--post-border);
}
.btn-like {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--danger-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--danger-color);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-like:hover, .btn-like.active {
    background: var(--danger-color);
    color: white;
}
.btn-like.active {
    animation: likeAnim 0.3s ease;
}
@keyframes likeAnim {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.btn-share {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--success-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--success-color);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-share:hover {
    background: var(--success-color);
    color: white;
}

/* 댓글 섹션 */
.comments-section {
    margin-top: 40px;
}
.comments-header {
    padding: 32px;
    border-bottom: 1px solid var(--post-border);
    background: var(--post-bg);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border: 1px solid var(--post-border);
    border-bottom: none;
}
.comments-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* 댓글 작성 폼 */
.comment-form {
    padding: 24px 32px;
    background: var(--bg-gray);
    border: 1px solid var(--post-border);
    border-top: none;
}
.comment-form-inner {
    display: flex;
    gap: 12px;
}
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--post-border);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.comment-input-wrapper {
    flex: 1;
}
.comment-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 16px;
    border: 1px solid var(--post-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    transition: all 0.2s;
}
.comment-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.comment-textarea:disabled {
    background: var(--bg-gray);
    cursor: not-allowed;
}
.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}
.btn-comment-submit {
    padding: 8px 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-comment-submit:hover:not(:disabled) {
    background: var(--accent-hover);
}
.btn-comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-comment-cancel {
    padding: 8px 20px;
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--post-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-comment-cancel:hover {
    background: var(--bg-gray);
}

/* 댓글 리스트 */
.comments-list {
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}
.comment-item {
    padding: 24px 32px;
    border-bottom: 1px solid var(--post-border);
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-main {
    display: flex;
    gap: 12px;
}
.comment-content-wrapper {
    flex: 1;
}
.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.comment-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-author-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}
.comment-date {
    font-size: 13px;
    color: var(--text-tertiary);
}
.comment-actions-btns {
    display: flex;
    gap: 8px;
}
.btn-comment-action {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--post-border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-comment-action:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
}
.btn-comment-action.danger:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}
.comment-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 8px;
    word-break: break-word;
}
.comment-text.deleted {
    color: var(--text-tertiary);
    font-style: italic;
}
.comment-footer {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}
.btn-reply {
    font-size: 13px;
    color: var(--accent-color);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    transition: color 0.2s;
}
.btn-reply:hover {
    color: var(--accent-hover);
}

/* 대댓글 */
.replies-list {
    margin-top: 16px;
    padding-left: 52px;
}
.reply-item {
    padding: 16px 0;
    border-top: 1px solid var(--post-border);
}
.reply-item:first-child {
    border-top: none;
}

/* 하단 버튼 */
.post-bottom-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--post-border);
}
.btn-secondary:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
}
.btn-primary {
    background: var(--accent-color);
    color: white;
}
.btn-primary:hover {
    background: var(--accent-hover);
}

/* 반응형 */
@media (max-width: 768px) {
    .post-container {
        padding: 0 16px;
        margin: 20px auto;
    }
    .post-header, .post-body, .comments-header, .comment-form {
        padding: 20px;
    }
    .post-title {
        font-size: 22px;
    }
    .post-meta {
        gap: 12px;
    }
    .post-actions {
        flex-direction: column;
    }
    .btn-like, .btn-share {
        width: 100%;
        justify-content: center;
    }
    .replies-list {
        padding-left: 30px;
    }
    .comment-item {
        padding: 20px;
    }
}

/* 로딩 & 애니메이션 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.comment-edit-form {
    margin-top: 12px;
}

/* ===========================
   List Page Styles
   =========================== */

/* 리스트 페이지 전용 스타일 */
.club-header {
    max-width: 1240px;
    margin: 40px auto;
    padding: 0 20px;
}

.club-info-card {
    display: flex;
    gap: 32px;
    padding: 32px;
    background: white;
    border: 1px solid var(--post-border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.club-thumbnail {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-gray);
    flex-shrink: 0;
}

.club-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.club-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.club-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.club-desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.club-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--post-border);
    background: white;
    color: var(--text-secondary);
}

.btn-action:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
}

.btn-action.active {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-action svg {
    width: 18px;
    height: 18px;
}

/* 섹션 공통 */
.section {
    max-width: 1240px;
    margin: 60px auto;
    padding: 0 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* 슬라이더 네비게이션 */
.slider-nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--post-border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--bg-gray);
    border-color: var(--accent-color);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
}

/* 카드 슬라이더 */
.cards-slider {
    position: relative;
    overflow: hidden;
    margin: 0 -10px;
}

.cards-wrapper {
    display: flex;
    gap: 20px;
    padding: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.cards-wrapper::-webkit-scrollbar {
    height: 6px;
}

.cards-wrapper::-webkit-scrollbar-thumb {
    background: var(--post-border);
    border-radius: 3px;
}

.cards-wrapper::-webkit-scrollbar-track {
    background: var(--bg-gray);
}

/* 포스트 카드 - 슬라이더용 */
.post-card {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border: 1px solid var(--post-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

/* 그리드 내부의 카드는 유연한 너비 */
.posts-grid .post-card {
    width: 100%;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-card-image {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: var(--bg-gray);
    overflow: hidden;
}

.post-card-image.no-image {
    background: var(--bg-gray) url('/images/common/logo.svg') center/180px no-repeat;
}

.post-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.post-card-image img[loading="lazy"] {
    opacity: 0;
}

.post-card-image img.loaded {
    opacity: 1;
}

.post-card-image:not(.no-image):not(:has(img.loaded)) {
    background: linear-gradient(90deg, #f5f5f5 25%, #e8e8e8 50%, #f5f5f5 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.post-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    background: var(--danger-color);
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    z-index: 1;
}

.post-card-content {
    padding: 20px;
}

.post-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    min-height: 48px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-tertiary);
}

.post-card-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat svg {
    width: 16px;
    height: 16px;
}

/* 리스트 필터 */
.list-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--text-primary);
}

.list-count {
    font-size: 16px;
    color: var(--text-secondary);
}

.list-count strong {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.list-filters {
    display: flex;
    gap: 12px;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--post-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    cursor: pointer;
    appearance: none;
    min-width: 120px;
}

.select-wrapper::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-secondary);
    pointer-events: none;
}

/* 포스트 그리드 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 60px;
}

.page-link {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid var(--post-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    background: var(--bg-gray);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.page-link.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    font-weight: 700;
}

.page-link.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

/* 모달 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--post-border);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-gray);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--post-border);
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    line-height: 1.8;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 반응형 - List Page */
@media (max-width: 768px) {
    .club-info-card {
        flex-direction: column;
        padding: 24px;
    }
    
    .club-thumbnail {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .club-name {
        font-size: 22px;
    }
    
    .section {
        margin: 40px auto;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .list-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .post-card {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .club-actions {
        width: 100%;
    }
}