/* 모두인포 — 네이버 스타일 디자인 (Design 캔버스 Main.dc.html / ProfileCard.dc.html 이식) */

:root {
  --blue: #1C6FD9;
  --blue-dark: #0B3D6B;
  --blue-tint: #EAF4FD;
  --border: #E5E5E5;
  --text: #222222;
  --muted: #666666;
  --muted2: #999999;
  --bg: #F5F6F7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Noto Sans KR', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.linkbtn {
  background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer;
}
.inline-form { display: inline; }

/* 상단 유틸 바 */
.util-bar { background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 0; }
.util-bar-inner { display: flex; justify-content: flex-end; align-items: center; gap: 16px; font-size: 12px; color: var(--muted); }
.util-bar .navlink:hover { color: var(--blue); }
.util-bar .sep { color: var(--muted2); }

/* 검색 히어로 */
.search-hero { background: #FFFFFF; padding: 28px 0 20px; }
.search-hero-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.brand { font-size: 40px; font-weight: 900; color: var(--blue); letter-spacing: -1px; }
.search-form {
  width: 640px; max-width: 100%; display: flex; align-items: center;
  border: 2px solid var(--blue); border-radius: 999px; overflow: hidden; background: #fff;
}
.search-form input {
  flex-grow: 1; border: none; outline: none; padding: 14px 22px; font-size: 15px; color: var(--text);
  font-family: inherit; background: transparent;
}
.search-form button {
  width: 56px; height: 48px; border: none; background: var(--blue); color: #fff;
  font-size: 18px; font-weight: 700; cursor: pointer;
}

/* 카테고리 탭 바 */
.tab-bar { background: #fff; border-bottom: 1px solid var(--border); }
.tab-bar-inner { display: flex; gap: 28px; overflow-x: auto; }
.tab { padding: 14px 2px; font-size: 15px; font-weight: 700; color: #444444; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.active, .tab:hover { color: var(--blue); border-bottom-color: var(--blue); }

/* 광고 */
.header-ad-wrap { padding: 16px 0 0; }
.ad-slot { width: 100%; }
.ad-placeholder {
  height: 80px; box-sizing: border-box; border: 1px dashed #D4D4D8; border-radius: 4px;
  background: #FAFAFA; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #AAAAAA; text-align: center; padding: 8px;
}
.ad-sidebar .ad-placeholder { height: 400px; }

/* 본문 3단 레이아웃 */
.main-wrap { padding: 20px 16px; }
.page-grid { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }

.side-left { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.side-right { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
/* flex 기본값인 min-width:auto는 내부 콘텐츠의 최소 크기를 그대로 반영해 3단 레이아웃이
   줄바꿈되는 원인이 되므로 0으로 재정의합니다. */
.center-col { flex-grow: 1; flex-basis: 0; min-width: 0; }

/* 실제 글 본문 화면(상세 페이지)은 좌우 사이드 없이 본문만 넓게 보여줍니다.
   너무 넓으면 읽기 불편하므로 가운데 정렬 + 읽기 좋은 폭으로 제한합니다. */
.page-grid-solo .center-col { max-width: 860px; margin: 0 auto; width: 100%; }

/* 화면이 좁아지면 좌/우 사이드를 위아래로 쌓아 카드가 찌그러지지 않게 합니다. */
@media (max-width: 900px) {
  .page-grid:not(.page-grid-solo) { flex-direction: column; }
  .page-grid:not(.page-grid-solo) .side-left,
  .page-grid:not(.page-grid-solo) .side-right { width: 100%; }
}

.box { box-sizing: border-box; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.box-title { padding: 12px 14px; font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--border); }
.box-item { padding: 10px 14px; font-size: 13px; color: #444444; }
.box-item.active { color: var(--blue); font-weight: 700; background: var(--blue-tint); }
.box-note { padding: 10px 14px; font-size: 12px; color: var(--muted); line-height: 1.6; }

.rank-row { padding: 9px 14px; display: flex; gap: 10px; font-size: 13px; border-bottom: 1px solid #F5F5F5; }
.rank-row:last-child { border-bottom: none; }
.rank-num { color: var(--blue); font-weight: 900; width: 14px; }
.rank-word { color: #333333; }

/* 글 목록 (2열 카드형, 큰 썸네일) */
.post-list-head { padding: 14px 20px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.post-grid { padding: 18px 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 640px) { .post-grid { grid-template-columns: 1fr; } }

.post-card { display: flex; flex-direction: column; gap: 10px; }
.post-thumb {
  width: 100%; height: 160px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, #DCEEFB, #9AD4F5);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--blue);
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-tag {
  display: inline-block; padding: 2px 8px; border-radius: 3px; background: var(--blue-tint);
  color: var(--blue); font-size: 11px; font-weight: 700;
}
.post-title {
  font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card:hover .post-title { color: var(--blue); }
.post-meta { font-size: 12px; color: var(--muted2); }

.pagination {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  padding: 18px; font-size: 13px; color: var(--muted); box-sizing: border-box; max-width: 100%;
}
.pagination a, .pagination span { padding: 6px 12px; border-radius: 4px; }
.pagination .current { background: var(--blue); color: #fff; font-weight: 700; }
.pagination .ellipsis { padding: 6px 4px; color: var(--muted2); }

/* 사용자 정보 카드 */
.profile-card { width: 100%; box-sizing: border-box; background: #fff; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); overflow: hidden; }
.profile-card-top { padding: 22px 20px 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; border-bottom: 1px solid #F0F0F0; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; font-weight: 900;
}
.profile-name { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; color: var(--text); }
.profile-name .sep { color: #CCCCCC; font-weight: 400; }
.profile-name .idlabel { color: var(--muted); font-weight: 500; font-size: 15px; }
.profile-name .lock { font-size: 13px; color: var(--muted2); }
.profile-email { font-size: 13px; color: var(--muted2); }
.profile-badges { display: flex; gap: 6px; margin-top: 2px; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-grade { background: var(--blue-tint); color: var(--blue); }
.badge-msg { background: #FFF6E5; color: #E8963B; }

.profile-links { display: flex; flex-direction: column; }
.profile-links a { padding: 13px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #F5F5F5; font-size: 14px; color: #333333; }
.profile-links a:hover { color: var(--blue); }
.profile-links a:last-child { border-bottom: none; }
.profile-links .count { font-size: 12px; font-weight: 700; color: #E8963B; }
.profile-links .chevron { font-size: 12px; color: #CCCCCC; }

.profile-logout { padding: 12px 20px 18px; }
.profile-logout button {
  width: 100%; box-sizing: border-box; padding: 10px 0; text-align: center; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; color: var(--muted); font-weight: 700; background: #fff; cursor: pointer;
}
.profile-logout button:hover { border-color: var(--blue); color: var(--blue); }

.profile-quicklinks { background: #FAFAFA; border-top: 1px solid #F0F0F0; display: flex; }
.profile-quicklinks a { flex: 1; padding: 13px 0; text-align: center; font-size: 12px; color: #555555; font-weight: 500; }
.profile-quicklinks a:hover { color: var(--blue); }

/* 폼 / 플래시 메시지 */
.flash-messages { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 8px; }
.flash-success { background: #ECFDF3; color: #027A48; border: 1px solid #ABEFC6; }
.flash-error { background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; }

.form-box { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 24px; max-width: 640px; margin: 0 auto; }
/* 글쓰기/글수정처럼 내용을 많이 입력하는 화면은 최대한 넓게 씁니다. */
.form-box-wide { max-width: 1180px; }
.form-box-wide textarea { min-height: 420px; }

/* 회원정보 수정 화면의 "기본 정보 / 비밀번호 변경" 탭 */
.profile-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.profile-tab { padding: 10px 2px; font-size: 14px; font-weight: 700; color: #888888; border-bottom: 2px solid transparent; }
.profile-tab.active, .profile-tab:hover { color: var(--blue); border-bottom-color: var(--blue); }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.form-row input[type="text"], .form-row input[type="email"], .form-row input[type="password"],
.form-row textarea, .form-row select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 14px;
}
.btn-primary {
  padding: 10px 20px; background: var(--blue); color: #fff; border: none; border-radius: 4px;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.btn-primary:hover { background: var(--blue-dark); }

.site-footer { margin-top: 24px; padding: 24px 0; background: #fff; border-top: 1px solid var(--border); text-align: center; font-size: 12px; color: var(--muted2); }

/* 게시글 상세 */
.post-detail-title { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.post-detail-meta { font-size: 13px; color: var(--muted2); margin-bottom: 20px; }
.post-detail-body {
  font-size: 15px; line-height: 1.8; white-space: pre-wrap; margin-bottom: 24px;
  word-break: break-word; overflow-wrap: anywhere;
}
/* 새 웹 에디터로 쓴 글(실제 HTML)은 줄바꿈을 태그가 알아서 처리하므로 pre-wrap이 필요 없습니다. */
.post-detail-body-rich { white-space: normal; }
.post-detail-body-rich p { margin: 0 0 14px; }
.post-detail-body-rich h1, .post-detail-body-rich h2, .post-detail-body-rich h3 { margin: 24px 0 10px; font-weight: 700; }
.post-detail-body-rich h1 { font-size: 24px; }
.post-detail-body-rich h2 { font-size: 20px; }
.post-detail-body-rich h3 { font-size: 17px; }
.post-detail-body-rich ul, .post-detail-body-rich ol { margin: 0 0 14px; padding-left: 24px; }
.post-detail-body-rich blockquote {
  margin: 0 0 14px; padding: 4px 16px; border-left: 3px solid var(--border); color: var(--muted);
}
.post-detail-body-rich pre {
  margin: 0 0 14px; padding: 12px 14px; background: #F5F5F7; border-radius: 6px;
  overflow-x: auto; font-size: 13px; white-space: pre-wrap;
}
.post-detail-body-rich code { font-family: 'SFMono-Regular', Consolas, monospace; }
.post-detail-body-rich img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.post-detail-body-rich a { color: var(--blue); text-decoration: underline; }

/* 글쓰기/글수정 에디터 영역 */
#editor-container { background: #fff; }
#editor-container .ql-editor { min-height: 380px; font-size: 15px; line-height: 1.8; }
.comment { padding: 12px 0; border-bottom: 1px solid #F0F0F0; font-size: 14px; }

/* 네이버메일 스타일 레이아웃 — 쪽지함(/messages) · 관리자 메일함(/admin/mailbox) 공용 */
.mail-shell { display: flex; gap: 0; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; min-height: 420px; }

.mail-sidebar { width: 160px; flex-shrink: 0; border-right: 1px solid var(--border); background: #FAFAFA; padding: 16px 12px; box-sizing: border-box; }
.mail-compose-btn { display: block; width: 100%; text-align: center; box-sizing: border-box; margin-bottom: 16px; text-decoration: none; }
.mail-folder { display: block; padding: 10px 10px; border-radius: 4px; font-size: 13px; color: #444444; }
.mail-folder.active { background: var(--blue-tint); color: var(--blue); font-weight: 700; }
.mail-folder.disabled { color: var(--muted2); cursor: not-allowed; }
.mail-folder .badge-count { float: right; font-size: 11px; color: var(--muted2); }

.mail-main { flex-grow: 1; min-width: 0; }

.mail-list-head { padding: 14px 20px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.mail-count-badge { font-size: 12px; font-weight: 700; color: var(--blue); background: var(--blue-tint); padding: 2px 8px; border-radius: 999px; }

.mail-list-row { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid #F5F5F5; font-size: 13px; color: #333333; }
.mail-list-row.unread { background: var(--blue-tint); }
.mail-list-from { width: 160px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list-subject { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list-date { flex-shrink: 0; color: var(--muted2); font-size: 12px; }

.mail-compose-box { padding: 20px 24px; max-width: 640px; }

.mail-open { padding: 24px; }
.mail-open-subject { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.mail-open-meta { font-size: 13px; color: var(--muted2); line-height: 1.7; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid #F0F0F0; }
.mail-open-body { font-size: 14px; line-height: 1.8; white-space: pre-wrap; }

@media (max-width: 640px) {
  .mail-shell { flex-direction: column; }
  .mail-sidebar { width: 100%; box-sizing: border-box; display: flex; gap: 8px; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .mail-compose-btn { width: auto; margin-bottom: 0; flex-shrink: 0; }
  .mail-list-from { width: 90px; }
}

/* 관리자 표의 작은 상태 표시(뱃지) */
.pill { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill-active { background: #ECFDF3; color: #027A48; }
.pill-normal { background: #F0F0F0; color: #555555; }

/* 홈 화면 날씨 · 증시 위젯 */
.market-box { padding: 14px 14px 16px; }
.wx-group-label { font-size: 11px; color: var(--muted2); margin: 10px 0 6px; }
.wx-group-label:first-of-type { margin-top: 2px; }
.wx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wx-city {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--blue-tint); border-radius: 8px; padding: 8px 4px;
}
.wx-city-error { background: #F6F6F6; }
.wx-name { font-size: 11px; color: var(--muted2); }
.wx-emoji { font-size: 16px; line-height: 1; }
.wx-temp { font-size: 13px; font-weight: 700; }
.wx-empty { font-size: 12px; color: var(--muted2); padding: 4px 0; }
.stx-list { display: flex; flex-direction: column; }
.stx-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 0; border-bottom: 1px solid #F5F5F5; font-size: 12px;
}
.stx-row:last-child { border-bottom: none; }
.stx-name { flex: 0 0 64px; font-weight: 700; color: var(--text); }
.stx-price { flex: 1; text-align: right; color: var(--text); }
.stx-change { flex: 0 0 auto; min-width: 96px; text-align: right; }
.stx-up { color: #D92D20; }
.stx-down { color: #1570EF; }

/* 홈 화면 전체 글 아래 '중요 일정'(공휴일 · 국제행사) 위젯 */
.events-head { padding: 14px 20px; font-size: 15px; font-weight: 700; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.evt-list { padding: 4px 20px 6px; }
.evt-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F5F5F5; font-size: 13px; }
.evt-row:last-child { border-bottom: none; }
.evt-kind { flex: 0 0 auto; font-size: 11px; color: var(--blue); background: var(--blue-tint); padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.evt-name { flex: 1; min-width: 0; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt-date { flex: 0 0 auto; color: var(--muted2); font-size: 12px; }
.evt-dday { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--blue); min-width: 40px; text-align: right; }
.evt-dday.evt-live { color: #D92D20; }
@media (max-width: 640px) { .evt-date { display: none; } }
