/* ========================================
   UNREAL DEV BLOG
   Dark Developer Theme
======================================== */

/* 1. 기본 디자인 설정 */
:root {
  --bg-main: #0b1120;
  --bg-header: #101a2d;
  --bg-card: #151f32;
  --bg-card-hover: #1b2940;
  --bg-code: #080d18;
  --border: #26364f;
  --text-main: #e5edf8;
  --text-sub: #9aabc2;
  --text-muted: #71839d;
  --point: #38bdf8;
  --point-dark: #0284c7;
  --point-light: #7dd3fc;
  --radius: 12px;
  --content-width: 1240px;
}

/* 2. 전체 초기화 */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--point);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

ul,
ol {
  padding-left: 22px;
}

::selection {
  background: var(--point);
  color: #08111e;
}

/* 3. 전체 레이아웃 */
#wrap {
  width: 100%;
  min-height: 100vh;
  background: var(--bg-main);
}

#container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
}

.area-main {
  min-width: 0;
}

.area-common,
.area-view {
  width: 100%;
  min-width: 0;
}

/* 4. 상단 헤더 */
.header {
  position: relative;
  z-index: 10;
  width: 100%;
  background: rgba(16, 26, 45, 0.96);
  border-bottom: 1px solid var(--border);
}

.inner-header {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

.box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  gap: 24px;
}

.title-logo {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.7px;
}

.link_logo {
  color: #f1f7ff;
}

.link_logo:hover {
  color: var(--point);
}

.img_logo {
  max-width: 220px;
  max-height: 55px;
  object-fit: contain;
}

/* 5. 검색창 */
.util .search {
  position: relative;
}

.searchInput {
  width: 230px;
  height: 42px;
  padding: 0 15px;
  color: var(--text-main);
  background: #0b1425;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.searchInput::placeholder {
  color: var(--text-muted);
}

.searchInput:focus {
  border-color: var(--point);
}

.use-sidebar {
  display: none;
}

/* 6. 상단 메뉴 */
.area-align {
  display: flex;
  flex-direction: column;
}

.area-gnb {
  border-top: 1px solid rgba(255,255,255,0.04);
}

.area-gnb nav {
  display: flex;
  align-items: center;
  min-height: 54px;
}

.area-gnb ul {
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.area-gnb li {
  list-style: none;
}

.area-gnb a {
  display: block;
  padding: 15px 0;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
}

.area-gnb a:hover,
.area-gnb .current a {
  color: var(--point);
}

.button-menu {
  display: none;
}

/* 7. 상단 배너 */
.area-promotion {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 50px 24px;
  background-color: #101e35;
  background-position: center;
  background-size: cover;
  text-align: center;
}

.area-promotion::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(5,12,25,0.9), rgba(5,12,25,0.55));
}

.inner-promotion {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 850px;
}

.box-promotion strong {
  display: block;
  margin-bottom: 20px;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.3;
}

.link-promotion {
  display: inline-block;
  padding: 11px 24px;
  color: #06111e;
  background: var(--point);
  border-radius: 7px;
  font-weight: 700;
}

/* 8. 글 목록 공통 */
.article-type-common {
  display: flex;
  gap: 22px;
  min-width: 0;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.article-type-common:hover {
  background: var(--bg-card-hover);
  border-color: #3b5678;
  transform: translateY(-3px);
}

.article-type-common .thumbnail {
  position: relative;
  flex-shrink: 0;
  width: 190px;
  height: 135px;
  margin: 0;
  overflow: hidden;
  background-color: #0a1425;
  background-position: center;
  background-size: cover;
  border-radius: 8px;
}

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

.article-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.article-content .title {
  display: block;
  margin-bottom: 10px;
  color: var(--text-main);
  font-size: 19px;
  font-weight: 750;
  line-height: 1.5;
}

.article-content .link-article:hover .title {
  color: var(--point);
}

.article-content .summary {
  display: -webkit-box;
  margin: 0 0 15px;
  overflow: hidden;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.box-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.link-category {
  color: var(--point);
  font-weight: 600;
}

/* 9. 글 목록 제목 */
.title-search,
.title-cover {
  position: relative;
  margin: 0 0 25px;
  padding: 0 0 16px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  font-size: 23px;
  font-weight: 750;
}

.title-search::before,
.title-cover::before {
  display: inline-block;
  width: 4px;
  height: 20px;
  margin-right: 10px;
  background: var(--point);
  border-radius: 3px;
  content: "";
  vertical-align: -2px;
}

.title-search span {
  color: var(--text-muted);
  font-size: 14px;
}

/* 10. 게시글 상단 */
.article-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 260px;
  margin-bottom: 32px;
  padding: 36px;
  overflow: hidden;
  background-color: #15243a;
  background-position: center;
  background-size: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.article-header::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(0deg, rgba(5,12,25,0.96), rgba(5,12,25,0.2));
}

.article-header .inner-header {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0;
}

.article-header .category {
  margin: 0 0 12px;
  color: var(--point);
  font-size: 13px;
  font-weight: 700;
}

.title-article {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(25px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.8px;
}

.article-header .box-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #aabbd0;
  font-size: 13px;
}

/* 11. 본문 영역 */
.article-view {
  min-width: 0;
  padding: 42px;
  color: #d9e4f2;
  background: #111c2e;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.9;
}

.article-view > *:first-child {
  margin-top: 0;
}

.article-view h1,
.article-view h2,
.article-view h3,
.article-view h4 {
  color: #f0f7ff;
  font-weight: 750;
  line-height: 1.45;
  letter-spacing: -0.5px;
}

.article-view h1 {
  margin: 48px 0 22px;
  font-size: 30px;
}

.article-view h2 {
  margin: 42px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 25px;
}

.article-view h3 {
  margin: 32px 0 15px;
  color: var(--point-light);
  font-size: 20px;
}

.article-view h4 {
  margin: 25px 0 12px;
  font-size: 17px;
}

.article-view p {
  margin: 0 0 22px;
}

.article-view a {
  color: var(--point-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-view strong {
  color: #fff;
  font-weight: 750;
}

.article-view ul,
.article-view ol {
  margin: 0 0 25px;
  padding-left: 25px;
}

.article-view li {
  margin-bottom: 8px;
}

.article-view blockquote {
  margin: 28px 0;
  padding: 18px 22px;
  color: #b9cbe0;
  background: #172840;
  border-left: 4px solid var(--point);
  border-radius: 0 8px 8px 0;
}

.article-view hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* 12. 코드 블록 */
.article-view pre {
  margin: 25px 0;
  padding: 22px;
  overflow-x: auto;
  color: #d6e7fa;
  background: var(--bg-code);
  border: 1px solid #263b57;
  border-radius: 9px;
  font-family: "D2Coding", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.75;
  tab-size: 4;
  white-space: pre;
  word-break: normal;
}

.article-view code {
  font-family: "D2Coding", "Consolas", monospace;
}

.article-view :not(pre) > code {
  padding: 3px 6px;
  color: #7dd3fc;
  background: #1c3049;
  border-radius: 4px;
  font-size: 0.9em;
}

/* 13. 본문 이미지 */
.article-view img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 25px auto;
  border-radius: 8px;
}

.article-view figure {
  margin: 30px 0;
}

.article-view table {
  width: 100%;
  margin: 25px 0;
  border-collapse: collapse;
  font-size: 14px;
}

.article-view th,
.article-view td {
  padding: 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.article-view th {
  color: var(--point-light);
  background: #1b2b43;
}

.article-view td {
  background: #121f33;
}

/* 14. 게시글 하단 */
.article-footer {
  margin-top: 30px;
}

.title-footer {
  margin: 0 0 18px;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 750;
}

.article-tag,
.article-page,
.article-related {
  margin-bottom: 25px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.article-tag .box-tag a,
.area-tag .box-tag a,
.box-tag .box_tag a {
  display: inline-block;
  margin: 4px;
  padding: 5px 11px;
  color: var(--point-light);
  background: #1b3049;
  border-radius: 5px;
  font-size: 13px;
}

.article-page ul,
.list-related {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-page li {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.article-page li:last-child {
  border-bottom: 0;
}

.article-page li span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.article-page li strong {
  display: block;
  overflow-wrap: anywhere;
}

/* 15. 관련 글 */
.list-related {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.item-related {
  min-width: 0;
}

.link-related {
  display: block;
  height: 100%;
  padding: 12px;
  background: #101a2b;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.link-related:hover {
  border-color: var(--point);
}

.link-related .thumnail {
  display: block;
  width: 100%;
  height: 110px;
  margin-bottom: 10px;
  background-position: center;
  background-size: cover;
  border-radius: 5px;
}

.link-related strong {
  display: block;
  font-size: 13px;
}

.link-related .date {
  color: var(--text-muted);
  font-size: 11px;
}

/* 16. 사이드바 */
.area-aside {
  min-width: 0;
}

.area-aside > div,
.area-aside .box-profile,
.area-aside .box-category,
.area-aside .box-tag,
.area-aside .box-recent,
.area-aside .box-reply,
.area-aside .box-notice,
.area-aside .box-archive,
.area-aside .box-calendar,
.area-aside .box-visit {
  margin-bottom: 20px;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.title-sidebar {
  margin: 0 0 17px;
  padding-bottom: 13px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 750;
}

.box-profile {
  text-align: center;
  background-position: center;
  background-size: cover;
}

.box-profile .inner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.img-profile {
  width: 90px;
  height: 90px;
  margin-bottom: 15px;
  object-fit: cover;
  border: 3px solid #314967;
  border-radius: 50%;
}

.tit-g {
  margin: 0 0 8px;
  color: #fff;
  font-size: 17px;
  font-weight: 750;
}

.text-profile {
  margin: 0 0 15px;
  color: var(--text-sub);
  font-size: 13px;
}

.btn-g {
  padding: 8px 13px;
  color: #071321;
  background: var(--point);
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

/* 17. 카테고리 */
.box-category ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.box-category li {
  list-style: none;
}

.box-category a {
  display: block;
  padding: 9px 0;
  color: var(--text-sub);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 14px;
}

.box-category a:hover {
  padding-left: 5px;
  color: var(--point);
}

.box-category .c_cnt {
  margin-left: 5px;
  color: var(--text-muted);
  font-size: 12px;
}

/* 18. 최근 글 및 댓글 */
.list-recent,
.list-sidebar {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-recent li,
.list-sidebar li {
  margin-bottom: 13px;
}

.link-recent {
  display: flex;
  align-items: center;
  gap: 12px;
}

.link-recent .thumbnail {
  flex-shrink: 0;
  width: 65px;
  height: 55px;
  margin: 0;
  background-position: center;
  background-size: cover;
  border-radius: 5px;
}

.box-recent strong,
.link-sidebar strong {
  display: block;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.5;
}

.box-recent span,
.link-sidebar p {
  display: block;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.tab-recent,
.tab-sns {
  display: flex;
  gap: 15px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.tab-button a {
  color: var(--text-muted);
  font-size: 13px;
}

.tab-button.on a {
  color: var(--point);
  font-weight: 700;
}

/* 19. 방문자 수 */
.box-visit .text-total {
  margin: 0 0 12px;
  color: var(--point);
  font-size: 28px;
  font-weight: 800;
}

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

.item-visit {
  color: var(--text-sub);
  font-size: 12px;
}

/* 20. 태그 페이지 */
.area-tag .box-tag {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.area-tag .box-tag a {
  padding: 8px 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* 21. 페이지네이션 */
.area-paging {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 40px 0;
}

.area-paging a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  color: var(--text-sub);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.area-paging a:hover,
.area-paging .selected {
  color: #071321;
  background: var(--point);
  border-color: var(--point);
}

.area-paging-more {
  margin: 30px 0;
  text-align: center;
}

.paging-more {
  display: inline-block;
  padding: 10px 28px;
  color: var(--point);
  border: 1px solid var(--point);
  border-radius: 7px;
}

/* 22. 댓글 및 방명록 */
.article-reply {
  margin-top: 35px;
}

.area-reply {
  padding: 25px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.area-reply input,
.area-reply textarea {
  max-width: 100%;
  padding: 11px;
  color: var(--text-main);
  background: #0b1425;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.area-reply button {
  padding: 9px 17px;
  color: #06111e;
  background: var(--point);
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

/* 23. 비밀번호 보호글 */
.area-protected {
  padding: 50px 20px;
  text-align: center;
}

.text-protected {
  color: var(--text-sub);
}

.box-protected {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.box-protected input {
  min-width: 0;
  padding: 10px;
  color: var(--text-main);
  background: #0b1425;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.box-protected button {
  padding: 10px 18px;
  color: #071321;
  background: var(--point);
  border: 0;
  border-radius: 6px;
}

/* 24. 푸터 */
#footer {
  margin-top: 40px;
  padding: 35px 24px;
  background: #080e1a;
  border-top: 1px solid var(--border);
}

.inner-footer {
  max-width: var(--content-width);
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 12px;
}

.box-policy {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 15px;
}

.link-footer {
  color: var(--text-sub);
}

/* 25. 공통 숨김 처리 */
.display-none {
  display: none !important;
}

.blind,
.screen_out {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 26. 태블릿 */
@media (max-width: 1024px) {
  #container {
    padding: 35px 20px 60px;
  }

  .main {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 20px;
  }

  .article-type-common .thumbnail {
    width: 150px;
    height: 115px;
  }

  .article-view {
    padding: 30px;
  }
}

/* 27. 모바일 */
@media (max-width: 767px) {
  body {
    font-size: 14px;
  }

  #container {
    padding: 25px 15px 45px;
  }

  .main {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  .area-main,
  .area-aside {
    width: 100%;
  }

  .box-header {
    min-height: 65px;
  }

  .title-logo {
    font-size: 19px;
  }

  .util.use-top {
    display: none;
  }

  .use-sidebar {
    display: block;
    margin-bottom: 20px;
  }

  .use-sidebar .searchInput {
    width: 100%;
  }

  .area-gnb ul {
    flex-wrap: wrap;
    gap: 16px;
  }

  .area-gnb a {
    padding: 12px 0;
    font-size: 13px;
  }

  .area-promotion {
    min-height: 230px;
  }

  .article-type-common {
    gap: 13px;
    margin-bottom: 14px;
    padding: 13px;
  }

  .article-type-common .thumbnail {
    width: 105px;
    height: 95px;
  }

  .article-content .title {
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.4;
  }

  .article-content .summary {
    margin-bottom: 8px;
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .box-meta {
    gap: 6px;
    font-size: 10px;
  }

  .title-search,
  .title-cover {
    font-size: 20px;
  }

  .article-header {
    min-height: 210px;
    margin-bottom: 20px;
    padding: 22px;
  }

  .title-article {
    font-size: 25px;
  }

  .article-view {
    padding: 22px 17px;
    font-size: 15px;
  }

  .article-view h1 {
    font-size: 25px;
  }

  .article-view h2 {
    font-size: 21px;
  }

  .article-view h3 {
    font-size: 18px;
  }

  .article-view pre {
    padding: 15px;
    font-size: 12px;
  }

  .article-view table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .list-related {
    grid-template-columns: 1fr;
  }

  .area-aside > div,
  .area-aside .box-profile,
  .area-aside .box-category,
  .area-aside .box-tag,
  .area-aside .box-recent,
  .area-aside .box-reply,
  .area-aside .box-notice,
  .area-aside .box-archive,
  .area-aside .box-calendar,
  .area-aside .box-visit {
    padding: 18px;
  }

  #footer {
    padding: 28px 18px;
  }
}

/* 28. 작은 모바일 */
@media (max-width: 380px) {
  .article-type-common .thumbnail {
    width: 85px;
    height: 85px;
  }

  .article-content .title {
    font-size: 14px;
  }

  .article-view {
    padding: 18px 13px;
  }
}


/* 티스토리 글 목록 썸네일 */
.thumbnail {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #0b1425;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 10px;
}

/* 빈 이미지 태그는 표시하지 않음 */
.thumbnail .img-thumbnail {
  display: none;
}

/* 썸네일이 없는 게시물 */
.thumbnail:not([has-thumbnail="1"]) {
  background-image: none;
}

/* 기본 썸네일 */
.thumbnail {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #101d32;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 10px;
}

/* 실제 썸네일 이미지 */
.thumbnail[has-thumbnail="1"] {
  background-size: cover;
}

/* 이미지가 없는 게시물 */
.thumbnail:not([has-thumbnail="1"]) {
  background-color: #101d32;
  background-image:
    radial-gradient(
      circle at 80% 20%,
      rgba(0, 180, 216, 0.18),
      transparent 45%
    ),
    linear-gradient(
      135deg,
      #101d32,
      #1b3150
    );
}

/* 이미지가 없는 게시물에 기본 문구 표시 */
.thumbnail:not([has-thumbnail="1"])::after {
  content: "begin-play";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #55d6e8;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
}

/* 빈 이미지 태그 숨김 */
.thumbnail .img-thumbnail {
  display: none;
}