/* 공통 스타일 - Goodnight Lab (Soft Editorial Blog Theme) */
:root {
    --bg-page: #f5f4f0;
    --bg-card: #ffffff;
    --bg-soft: #faf9f6;
    --bg-hover: #f0eee8;
    --border-light: #e5e2da;
    --border-mid: #cfc9bc;
    --text-main: #252932;
    --text-sub: #5c6370;
    --text-muted: #8a91a0;
    --accent-primary: #3b5bdb;
    --accent-primary-soft: #eef2ff;
    --accent-warm: #b4690e;
    --accent-warm-soft: #fef6e7;
}

body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Dotum', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-page);
    color: var(--text-main);
    font-size: 14.5px;
    line-height: 1.65;
}

.container {
    max-width: 1080px;
    margin: 24px auto;
    background: var(--bg-card);
    padding: 28px 32px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-sizing: border-box;
}

/* 헤더 & 네비게이션 (블로그 상단 타이틀 + 깔끔한 탭) */
header {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 18px;
    margin-bottom: 26px;
}

header h1 {
    margin: 0 0 14px 0;
    font-size: 25px;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.3px;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: var(--text-sub);
    font-weight: 600;
    font-size: 13.5px;
    padding: 7px 14px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: var(--bg-soft);
    transition: all 0.15s ease;
}

nav a:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
    border-color: var(--border-mid);
}

nav a.active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* 사이드 광고 */
.adz-sidebar-pc {
    margin: 14px 0 0 0;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 768px) {
    .adz-sidebar-pc {
        display: none;
    }
}

/* 모바일 탑 */
.adz-mobile-top {
    display: none;
}

@media (max-width: 768px) {
    .adz-mobile-top {
        margin: 10px 0 14px 0;
        min-height: 100px;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        overflow: hidden;

    }
}

/* 메인 레이아웃 (본문 + 사이드바) */
.main-layout {
    display: flex;
    gap: 36px;
    align-items: flex-start;
}

.content {
    flex: 3.2;
    min-width: 0;
}

/* 섹션 헤더 & 글쓰기 버튼 */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.board-header h2 {
    margin: 0;
    font-size: 17px;
    color: var(--text-main);
    font-weight: 700;
}

.btn {
    display: inline-block;
    padding: 7px 14px;
    background: var(--accent-primary);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn:hover {
    background: #2f4bc0;
}

.btn-secondary {
    background: var(--bg-soft);
    color: var(--text-sub);
    border: 1px solid var(--border-mid);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

/* 글 목록 스타일 (블로그 피드처럼 여백과 호흡을 준 리스트) */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-item {
    border-bottom: 1px solid var(--border-light);
    padding: 16px 6px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    transition: background-color 0.15s ease;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background-color: var(--bg-soft);
}

.post-item a {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: var(--text-main);
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.45;
}

.post-item a:hover {
    color: var(--accent-primary);
}

.post-date {
    color: var(--text-muted);
    font-size: 12.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 글쓰기 및 에디터 폼 스타일 */
.form-group {
    margin-bottom: 16px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14.5px;
    background-color: var(--bg-card);
    color: var(--text-main);
}

.form-control:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.editor {
    width: 100%;
    min-height: 360px;
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    padding: 16px;
    box-sizing: border-box;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.75;
    overflow-y: auto;
}

.editor:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 14px 0;
    border-radius: 8px;
}

/* 글 읽기 상세 페이지 (블로그 본문 가독성 중심) */
.post-view-header {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.post-view-header h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    line-height: 1.35;
    color: var(--text-main);
    font-weight: 800;
}

.post-view-info {
    color: var(--text-muted);
    font-size: 12.5px;
}

.post-view-content {
    min-height: 220px;
    line-height: 1.85;
    font-size: 15.5px;
    word-break: break-word;
    color: var(--text-main);
}

.post-view-content h2 {
    margin: 34px 0 14px 0;
    padding: 2px 0 2px 14px;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -0.02em;
    color: #1e293b;
    background: transparent;
    border: none;
    border-left: 3.5px solid #6b8afd;
    border-radius: 0;
}

.post-view-content a {
    color: var(--accent-primary);
}

.post-view-content img {
    max-width: 100%;
    height: auto;
    margin: 16px 0;
    border-radius: 8px;
}

.btn-group {
    margin-top: 32px;
    border-top: 1px solid var(--border-light);
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
}

/* 푸터 스타일 */
footer {
    margin-top: 44px;
    border-top: 1px solid var(--border-light);
    padding-top: 22px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

/* 페이징 네비게이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 32px 0 8px 0;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-card);
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.pagination a:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background-color: var(--accent-primary-soft);
}

.pagination .active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    font-weight: 700;
    cursor: default;
}

/* 모바일 반응형 설정 (화면 너비 768px 이하일 때) */
@media screen and (max-width: 768px) {
	html, body {
			width: 100%;
			max-width: 100%;
			overflow-x: hidden;
			margin: 0;
			padding: 0;
		}

	.container,
    .main-layout,
    .content,
    .sidebar,
    .board-wrap,
    .board-header,
    .board-list,
    .post-list,
    .post-item,
    .rec-box,
    .rec-list,
    .rec-item {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .container {
        margin: 0;
        padding: 16px 14px;
        border: none;
        border-radius: 0;
    }

    header h1 {
        font-size: 21px;
    }

	nav {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    nav a {
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 8px;
    }

	.main-layout {
        display: flex;
        flex-direction: column;
    }

	.content,
    .sidebar {
        flex: none !important;
    }
	
	/* 가로 구분선이나 박스 길이가 짧게 끊기는 요소 100% 확장 */
    hr,
    .section-divider,
    .board-title-wrap {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }	

    .post-item {
        flex-direction: column;
        gap: 4px;
        padding: 14px 4px;
    }

    .post-item a {
        white-space: normal;
        font-size: 15px;
    }

    .post-view-header h1 {
        font-size: 20px;
    }

    .editor {
        min-height: 260px;
    }
}

/* 본문 내부 테이블 및 리스트 디자인 */
.post-view-content table, .board-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
}

.post-view-content th, .post-view-content td,
.board-content th, .board-content td {
    border: 1px solid var(--border-light);
    padding: 10px 12px;
    text-align: left;
}

.post-view-content th, .board-content th {
    background-color: var(--bg-soft);
    color: var(--text-main);
    font-weight: 700;
}

.post-view-content ul, .post-view-content ol {
    padding-left: 22px;
    margin: 12px 0;
}

.post-view-content li {
    margin: 6px 0;
}

/* 사이드바 및 추천글 영역 (무거운 박스 대신 깔끔한 구분선 스타일) */
.sidebar {

    min-width: 0;
	flex: 0 0 285px;
}

.rec-box {
    background: transparent;
    border: none;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
}

.rec-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-mid);
    padding-bottom: 8px;
}

.rec-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13.5px;
}

.rec-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
    box-sizing: border-box;
}

.rec-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.rec-link {
    display: block;
    text-decoration: none;
    color: var(--text-sub);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    transition: color 0.15s ease;
}

.rec-link:hover {
    color: var(--accent-primary);
}

.rec-empty {
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
    margin: 14px 0;
}

/* 푸터 링크 */
.footer-links {
    margin-bottom: 10px;
    font-size: 13px;
}

.footer-link {
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 600;
    margin-right: 16px;
}

.footer-link:hover {
    color: var(--accent-primary);
}

.footer-link:last-child {
    margin-right: 0;
}