/* --- Magazine Style CSS --- */

/* 1. Base & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    color: #212529; /* Dark charcoal for text */
    background-color: #f8f9fa; /* Light grey background */
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.3;
}

/* 2. Header & Navigation */
.header {
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}


.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #212529;
}

/* 2. Header & Navigation 추가 스타일 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem; /* 요소 간 간격 추가 */
}


.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.nav-menu a {
    font-weight: 600;
    color: #495057;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    color: #0d6efd; /* Accent Blue */
    border-bottom-color: #0d6efd;
}

/* 3. Hero Section */
.hero-section {
    background: #343a40; /* Dark background */
    color: #ffffff;
    padding: 5rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #ced4da;
    max-width: 600px;
    margin: 0 auto;
}



/* 3. Hero Section (Dark & Trendy Style) */
.hero-section.dark-trendy {
  /* 이미지 위에 반투명 검은색 그라데이션을 덮습니다 */
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('/images/hero.png');
  /* 배경 이미지가 섹션을 꽉 채우고 중앙에 오도록 설정 */
  background-size: cover;
  background-position: center;

  padding: 7rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section.dark-trendy .hero-content {
  position: relative;
  z-index: 1;
}

.hero-section.dark-trendy .hero-title {
  font-size: 3.2rem;
  font-weight: 700;
  color: #ffffff; /* 텍스트 색상을 흰색으로 변경 */
  margin-bottom: 1rem;
  /* 텍스트가 배경에 묻히지 않도록 그림자 효과 강화 */
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-section.dark-trendy .hero-subtitle {
  font-size: 1.2rem;
  color: #e9ecef; /* 약간 톤 다운된 흰색으로 가독성 확보 */
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}


/* 4. Categories Section (Scrollable) */
.categories-section {
    position: relative;
}

.categories-wrapper {
    display: flex;
    justify-content: flex-start; /* 중앙 정렬 대신 왼쪽 정렬로 변경 */
    gap: 1.5rem;
    overflow-x: auto; /* 내용이 넘칠 경우 가로 스크롤 생성 */
    white-space: nowrap; /* 카테고리 아이템들이 줄바꿈되지 않도록 설정 */
    padding: 0.5rem 0;

    /* 스크롤바 디자인 숨기기 (기능은 유지) */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* 스크롤바 디자인 숨기기 (Chrome, Safari, Opera) */
.categories-wrapper::-webkit-scrollbar {
    display: none;
}

.category-item {
    font-weight: 600;
    color: #6c757d;
    padding: 0.5rem 0;
    position: relative;
}

.category-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #0d6efd;
    transition: width 0.3s ease;
}

.category-item:hover::after,
.category-item.active::after {
    width: 100%;
}

.category-item.active {
    color: #212529;
}

/* 5. Main Content & Layout */
.main-content {
    padding: 4rem 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
}

/* 6. Blog Posts & Cards */
.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #212529;
    padding-bottom: 1rem;
}

.section-title {
    font-size: 2rem;
}

.posts-count {
    color: #6c757d;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid #e9ecef;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.post-image {
    height: 200px;
    position: relative;
    background-color: #e9ecef;
}

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

.post-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #0d6efd;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #212529;
}

.post-excerpt {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

.post-stats {
    display: flex;
    gap: 1rem;
}

.post-stats i {
    margin-right: 0.25rem;
}

/* 7. Sidebar */
.sidebar-widget {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

/* (Sidebar list styles can be reused or refined as needed) */

/* 8. Footer */
.footer {
    background: #212529;
    color: #adb5bd;
    padding: 3rem 0 2rem;
    border-top: 5px solid #0d6efd;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-section p, .footer-section ul li a {
    color: #ced4da;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a:hover {
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #495057;
    font-size: 0.9rem;
}

/* 9. Responsive Design */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    .sidebar {
        margin-top: 3rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1.5rem;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .posts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}



/* 7. Sidebar (Refined Magazine Style) */
.sidebar-widget {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.widget-title .fas {
    color: #0d6efd; /* 포인트 색상 */
}


/* --- 최근 포스트 위젯 스타일 --- */
.recent-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-post {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease-in-out;
}

.recent-post:hover {
    background-color: #f8f9fa; /* 은은한 호버 효과 */
}

.recent-post-image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
    border-radius: 6px;
    color: #6c757d;
    font-size: 1.5rem;
}

.recent-post-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.recent-post-content h4 a:hover {
    color: #0d6efd;
}

.recent-post-meta {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.recent-post-views {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}


/* --- 카테고리 위젯 스타일 --- */
.category-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.category-link:hover {
    background-color: #0d6efd;
    color: #ffffff;
    transform: translateX(5px);
}

.category-link:hover .category-count {
    background-color: #ffffff;
    color: #0d6efd;
}

.category-count {
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

/* 8. Pagination Style */
.pagination-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

/* 모든 버튼 (숫자, 화살표) 공통 스타일 */
.pagination .page-number,
.pagination .pagination-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    border: 1px solid #dee2e6;
    color: #495057;
    background-color: #ffffff;
}

/* 숫자 버튼 크기 */
.pagination .page-number {
    min-width: 40px;
    height: 40px;
}

/* 화살표 버튼 크기 */
.pagination .pagination-btn.arrow {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

/* 호버 효과 */
.pagination .page-number:not(.active):hover,
.pagination .pagination-btn:hover {
    background-color: #f1f3f5;
    border-color: #adb5bd;
    color: #212529;
}

/* 현재 페이지 활성 스타일 */
.pagination .page-number.active {
    background-color: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
    cursor: default;
}


/* 검색 폼 스타일 */
.search-form {
    display: flex;
    align-items: center;
    background-color: #f1f3f5;
    border-radius: 50px; /* 타원형 모양 */
    padding: 0.3rem;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease-in-out;
}

.search-form:focus-within {
    border-color: #adb5bd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    width: 180px; /* 기본 너비 */
    transition: width 0.3s ease-in-out;
}

.search-input:focus {
    width: 250px; /* 클릭 시 너비 확장 */
}

.search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background-color: #0d6efd; /* 포인트 색상 */
    color: white;
    border-radius: 50%; /* 원형 버튼 */
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-button:hover {
    background-color: #0b5ed7; /* 호버 시 약간 어두운 색 */
}



/* --- 10. Post Detail Page --- */

.post-detail {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.post-detail-header {
    padding: 2rem 2.5rem;
    border-bottom: 1px solid #e9ecef;
}

.post-detail-meta {
    margin-bottom: 1rem;
}

.post-detail-category {
    background-color: #0d6efd;
    color: #ffffff;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}
.post-detail-category:hover {
    background-color: #0b5ed7;
}

.post-detail-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.3;
    color: #212529;
    margin-bottom: 1.5rem;
}

.post-detail-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.post-detail-info .info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-detail-thumbnail {
    padding: 2.5rem 2.5rem 0;
}

.post-detail-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.post-detail-content {
    padding: 2.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #343a40;
}
/* 본문 내 제목, 인용구 등 스타일 */
.post-detail-content h1,
.post-detail-content h2,
.post-detail-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: #212529;
}
.post-detail-content p {
    margin-bottom: 1.5rem;
}
.post-detail-content blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #0d6efd;
    background-color: #f8f9fa;
    color: #495057;
    font-style: italic;
}
.post-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

.post-detail-footer {
    padding: 2.5rem;
    border-top: 1px solid #e9ecef;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.post-tags .tag-item {
    background-color: #e9ecef;
    color: #495057;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}
.post-tags .tag-item:hover {
    background-color: #dee2e6;
    color: #212529;
}

.post-actions {
    display: flex;
    gap: 1rem;
}

.post-actions .like-button,
.post-actions .share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: 1px solid #dee2e6;
    background-color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-actions .like-button:hover,
.post-actions .share-button:hover {
    border-color: #0d6efd;
    background-color: #0d6efd;
    color: #ffffff;
}

.post-actions .like-button.liked {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

/* 알림(Notification) 스타일 */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 100px);
    padding: 1rem 2rem;
    border-radius: 8px;
    background-color: #212529;
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}
.notification.show {
    transform: translate(-50%, 0);
    opacity: 1;
}