/* 공통 초기화 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    color: #333;
    font-size: 16px;
    line-height: 1.5;
}

/* 헤더 */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #343a40;
    color: white;
    padding: 18px 24px;
    position: relative;
}

.logo {
    font-size: 1.75rem;
    font-weight: bold;
    cursor: pointer;
}


/* 내비게이션 */
.nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.menu {
    list-style: none;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.menu li {
    margin-right:20px;
}

.menu li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 6px 0;
    display: inline-block;
}

.menu li a:hover {
    text-decoration: underline;
}

.hamburger {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    margin: 0 20px;
}

/* 로그인/프로필 영역 */
.auth {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

#loginBtn {
    background-color: #ffffff;
    color: #343a40;
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

#loginBtn:hover {
    background-color: #e2e6ea;
}

/* 프로필 */
.profile-container {
    position: relative;
    cursor: pointer;
}

.profile-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

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

.profile-menu {
    position: absolute;
    top: 54px;
    right: 0;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    list-style: none;
    padding: 10px 0;
    display: none;
    width: 180px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    font-size: 0.95rem;
}

.profile-menu li {
    padding: 12px 24px;
}

.profile-menu li a {
    text-decoration: none;
    color: #333;
    display: block;
    transition: background-color 0.2s ease;
}

.profile-menu li a:hover {
    background-color: #f1f1f1;
    border-radius: 4px;
}

/* 메인 콘텐츠 */
.container {

    max-width: 1200px;   /* ✅ 너비를 1200px로 고정 */
    margin: 0 auto;      /* ✅ 가운데 정렬 */
    display: flex;
    flex-wrap: wrap;
}

main {
    flex: 1;
    padding: 24px 20px;
    background: #ffffff;
    border-radius: 8px;
    width: 100%;
}

article {
    margin-bottom: 24px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 18px;
}

article h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: #222;
}

article p {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
}


/* 반응형 스타일 */
@media (max-width: 768px) {
    .logo {
        flex:3;
    }

    .nav {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        justify-content: center;
    }

    .menu {
        flex-direction: column;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.4s ease, padding 0.3s ease;
        background-color: #343a40;
        width: 100%;
        padding: 0; /* 초기에는 여백 없음 */
    }

    .menu.open {
        max-height: 300px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .menu li {
        text-align: left;
        margin-left: 20px;  /* 기존 20px → 10px으로 줄임 */
        margin-bottom: 5px; /* 메뉴 아이템 간 세로 간격도 조절 가능 */

    }

    .hamburger {
        display: block;
    }

    .container {
        flex-direction: column;
        margin: 16px;
    }

    main {
        width: 100%;
        padding: 16px 0;
    }



}


/* 푸터 */
footer {
    color: #fff;
    color: var(--text-bright-color);
    background-color: #2B5566;
    background-color: var(--dark-main-color);
    border-top: 1px solid #ddd;
}


footer .container {
    max-width: 1000px;
}


@media (min-width: 768px) {

    footer .container {
        display: flex;
        flex-wrap: wrap;
        margin-left: auto;
        margin-right: auto;
        padding: 40px 20px;
    }

    .footA {
        flex: 0 0 40%;
    }

    .footB {
        flex: 0 0 60%;
    }

    .footC {
        flex: 0 0 100%;
    }
}


/* 푸터A: 사이트 정보 */
.footA {
    margin-bottom: 30px;
}

.footA h2 {
    margin-top: 0;
    margin-bottom: 10px;
    /*font-family: 'Montserrat', sans-serif;*/
    font-size: 1.75rem;
    /*letter-spacing: 0.2em;*/
}

.footA p {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 14px;
}

.footA a {
    color: inherit;
    text-decoration: none;
}


/* 푸터B: 푸터 메뉴 */
.footB div {
    margin-bottom: 20px;
}

.footB h3 {
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: solid 1px currentColor;
    font-size: 14px;
}

.footB ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footB a {
    display: block;
    padding: 5px;
    color: inherit;
    font-size: 12px;
    text-decoration: none;
}

.footB a:hover {
    background-color: rgba(0,0,0,0.3);
}


@media (min-width: 768px) {
    .footB {
        display: flex;
    }

    .footB div {
        flex: 1;
    }

    .footB div:not(:first-child) {
        margin-left: 40px;
    }
}


/* 푸터C: 저작권 */
.footC {
    font-size: 12px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}


/* 푸터D: SNS 메뉴 */
.footD {
    margin-top: 20px;
}

.footD ul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footD a {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 2em;
    margin-right: 8px;
    padding: 0;
    color: inherit;
    font-size: 16px;
    text-decoration: none;
    border: solid 1px currentColor;
    width: 2em;
    line-height: 2em;
    border-radius: 50%;
    text-align: center;
}

.footD a:hover {
    background-color: rgba(0,0,0,0.3);
}




/* =========================
   댓글 영역
========================= */

.story-comments {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #ddd;
}

.comments-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
}

/* 댓글 작성 폼 */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    padding: 12px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.comment-form button {
    align-self: flex-end;
    background-color: #343a40;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.comment-form button:hover {
    background-color: #495057;
}

/* 댓글 목록 */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.comment-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.comment-body {
    flex: 1;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: bold;
    color: #333;
}

.comment-content {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
}

.comment-actions {
    margin-top: 6px;
    font-size: 0.85rem;
}

.comment-actions a {
    margin-right: 10px;
    color: #666;
    text-decoration: none;
}

.comment-actions a:hover {
    text-decoration: underline;
}

.comment-edit textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    resize: vertical;
}

.comment-edit-actions {
    margin-top: 8px;
    text-align: right;
}

.comment-edit-actions button {
    margin-left: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}


/* =========================
   게시글 좋아요
========================= */

.story-like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
    background-color: #f1f3f5;
    color: #333;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: background-color 0.2s, transform 0.2s;
}

.story-like i {
    color: #adb5bd;
    transition: color 0.2s, transform 0.2s;
}

.story-like.liked {
    background-color: #fff0f3;
    border-color: #ffccd5;
}

.story-like.liked i {
    color: #e63946;
    transform: scale(1.15);
}

.story-like span {
    font-weight: bold;
}


.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.page-btn {
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.page-btn:hover {
    background-color: #f1f3f5;
}

.page-btn.active {
    background-color: #343a40;
    color: #fff;
    border-color: #343a40;
}

.page-btn.prev,
.page-btn.next {
    font-weight: bold;
}