@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=Pretendard:wght@400;600&display=swap");

:root {
  --bg-color: #050505;
  --text-main: #ffffff;
  --text-muted: #888888;
  --accent: #e50914;
  /* 강렬한 레드 포인트 (원하시면 화이트나 블루로 변경 가능) */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Pretendard", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

/* =========================================
   Header (공통 & 스크롤 효과)
========================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem 4rem;
  z-index: 1000;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0) 100%);
  transition: all 0.3s ease;
}

.site-header.scrolled {
  padding: 1rem 4rem;
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 1px;
}

/* 티스토리 카테고리 글 갯수(c_cnt) 스타일 */
.c_cnt {
  font-size: 0.75rem;
  color: var(--accent);
  margin-left: 4px;
}

/* =========================================
   PC 뷰 (화면 너비 1025px 이상)
========================================= */
@media (min-width: 1025px) {

  /* 햄버거 버튼과 오버레이 메뉴 숨기기 */
  .menu-toggle,
  .menu-overlay {
    display: none !important;
  }

  /* 티스토리 '분류 전체보기' 껍데기 숨기기 (대메뉴만 깔끔하게 나열하기 위함) */
  .gnb-pc .tt_category>li>a.link_tit {
    display: none;
  }

  /* 실제 대메뉴 리스트를 가로로 배치 */
  .gnb-pc .category_list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 3rem;
  }

  /* 대메뉴 기준점 */
  .gnb-pc .category_list>li {
    position: relative;
    padding: 1rem 0;
  }

  /* 대메뉴 텍스트 스타일 */
  .gnb-pc a.link_item {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main);
    transition: color 0.3s;
  }

  .gnb-pc a.link_item:hover {
    color: var(--accent);
  }

  /* 🚨 소메뉴 (드롭다운) 박스 설정 */
  .gnb-pc .sub_category_list {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 8px;
    min-width: 160px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    list-style: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  }

  /* 🚨 마우스 올렸을 때 소메뉴 등장 */
  .gnb-pc .category_list>li:hover .sub_category_list {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
  }

  /* 소메뉴 텍스트 스타일 */
  .gnb-pc .sub_category_list a.link_sub_item {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    transition: color 0.2s;
    display: block;
  }

  .gnb-pc .sub_category_list a.link_sub_item:hover {
    color: var(--text-main);
  }
}

/* =========================================
   모바일/태블릿 뷰 (화면 너비 1024px 이하)
========================================= */
@media (max-width: 1024px) {

  /* PC용 메뉴 숨기기 */
  .gnb-pc {
    display: none;
  }

  .site-header {
    padding: 1.5rem 2rem;
  }

  /* 모바일 여백 줄임 */

  /* 햄버거 버튼 */
  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 5px;
  }

  .menu-toggle span {
    display: block;
    width: 30px;
    height: 2px;
    background-color: var(--text-main);
    transition: all 0.3s ease;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* 풀스크린 오버레이 메뉴 */
  .menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(5, 5, 5, 0.98);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    overflow-y: auto;
    padding: 5rem 0;
  }

  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* 모바일 메뉴 리스트 스타일 */
  .gnb-mobile .tt_category {
    list-style: none;
    padding: 0;
    text-align: center;
  }

  .gnb-mobile a.link_tit {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 2rem;
    display: block;
  }

  .gnb-mobile .category_list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .gnb-mobile a.link_item {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-main);
  }

  .gnb-mobile .sub_category_list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .gnb-mobile a.link_sub_item {
    font-size: 1.1rem;
    color: var(--text-muted);
  }
}

/* Hero Section */
.hero-section {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=1920&q=80") center/cover no-repeat;
  opacity: 0.4;
  z-index: -1;
  transform: scale(1.05);
  animation: slowZoom 20s infinite alternate;
}

@keyframes slowZoom {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.1);
  }
}

.hero-title {
  font-size: 6vw;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.scroll-indicator span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.scroll-indicator .line {
  width: 60px;
  height: 1px;
  background: var(--text-main);
}

/* Stats Bar */
.stats-bar {
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
  background: #0a0a0a;
}

.stats-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.stat-item .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.stat-item .value {
  font-size: 2rem;
  font-weight: 900;
  font-family: "Inter", sans-serif;
}

.stat-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.prof-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.prof-name {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Parallax Section */
.parallax-section {
  position: relative;
  height: 120vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.parallax-bg {
  position: absolute;
  top: -40%;
  left: 0;
  width: 100%;
  height: 180%;
  background: url("./images/parallax_bg.png") center/cover no-repeat;
  opacity: 0.4;
  z-index: 1;
  will-change: transform;
}

.parallax-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom,
      rgba(5, 5, 5, 1) 0%,
      rgba(5, 5, 5, 0) 30%,
      rgba(5, 5, 5, 0) 70%,
      rgba(5, 5, 5, 1) 100%);
  z-index: 2;
}

.parallax-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 2rem;
}

.layer {
  will-change: transform;
}

.parallax-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5rem;
  color: var(--accent);
  display: block;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  opacity: 0.8;
}

.parallax-title {
  font-size: 10vw;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  margin: 0;
  text-transform: uppercase;
  color: var(--text-main);
}

.parallax-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 2.5rem auto 0;
  line-height: 1.8;
  font-weight: 400;
  opacity: 0.7;
}

/* =========================================
   Subpage Hero Banner (목록/상세페이지용)
========================================= */
.sub-hero-section {
  position: relative;
  height: 40vh;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #222;
  margin-top: 80px;
  /* 헤더가 fixed이므로 겹치지 않게 여백 */
}

.sub-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 원하시는 다른 배경 이미지로 교체 가능 */
  background: url("https://images.unsplash.com/photo-1550745165-9bc0b252726f?auto=format&fit=crop&w=1920&q=80") center/cover no-repeat;
  opacity: 0.15;
  z-index: 0;
  filter: grayscale(100%);
}

.sub-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 2rem;
}

.sub-label {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 4px;
  display: block;
  margin-bottom: 0.5rem;
}

.sub-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -1px;
  text-transform: uppercase;
  word-break: keep-all;
}

.sub-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  /* 배너 안에서 제목과 여백 */
}

/* Main Content (Grid) */
.main-content {
  max-width: 1400px;
  margin: 8rem auto;
  padding: 0 4rem;
}

.section-header {
  margin-bottom: 3rem;
  border-bottom: 1px solid #333;
  padding-bottom: 1rem;
}

.section-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 2px;
}

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

.post-item {
  cursor: pointer;
}

.post-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #111;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  filter: grayscale(20%);
}

.post-item:hover .post-thumb img {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.post-cat {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.post-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  transition: color 0.3s;
}

.post-item:hover .post-title {
  color: var(--text-muted);
}

.post-date {
  font-size: 0.9rem;
  color: #666;
}

/* Comments Section */
.comments-section {
  max-width: 1400px;
  margin: 0 auto 8rem;
  padding: 0 4rem;
}

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

/* 최근 댓글 갯수 제한 (최대 6개) */
.comment-grid>a:nth-child(n+7) {
  display: none;
}

.comment-item {
  background: #111;
  padding: 2rem;
  display: block;
  transition: background 0.3s;
  border-left: 2px solid transparent;
}

.comment-item:hover {
  background: #1a1a1a;
  border-left-color: var(--accent);
}

.cmt-desc {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-style: italic;
  color: #ccc;
}

.cmt-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #666;
}

.cmt-name {
  font-weight: 700;
  color: var(--text-main);
}

/* 댓글 헤더 레이아웃 조정 (좌측: 이름/날짜, 우측: 삭제버튼) */
.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.reply-meta-left {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.reply-action {
  font-size: 0.75rem;
  font-weight: 700;
  color: #555;
  letter-spacing: 1px;
  transition: color 0.3s;
}

.reply-action:hover {
  color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid #1a1a1a;
  padding: 8rem 4rem 4rem;
  background: #050505;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 6rem;
  text-align: left;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  letter-spacing: 1px;
}

.footer-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 400px;
}

.footer-col h3 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.3s;
  letter-spacing: 1px;
}

.social-links a:hover {
  color: var(--accent);
  padding-left: 5px;
}

.credit-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.credit-text strong {
  color: var(--text-main);
}

.footer-bottom {
  border-top: 1px solid #1a1a1a;
  padding-top: 3rem;
  text-align: center;
}

.copyright {
  color: #444;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .footer-desc {
    max-width: 100%;
  }
}

/* --- Post Detail (본문 상세 페이지) --- */
.post-detail {
  grid-column: 1 / -1;
  /* 🚨 이 줄을 추가하세요! (그리드 전체 너비 사용) */
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 0;
}

.detail-header {
  text-align: center;
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #333;
}

.post-detail .detail-header {
  display: none;
}

.detail-cat {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 0.9rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

.detail-title {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  word-break: keep-all;
}

.detail-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

/* 티스토리 에디터에서 작성된 본문 내용 스타일 제어 */
.tistory-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #dddddd;
}

.tistory-content p {
  margin-bottom: 1.5rem;
}

.tistory-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
}

.tistory-content h2,
.tistory-content h3 {
  color: var(--text-main);
  margin: 3rem 0 1rem;
}

.tistory-content a {
  color: var(--accent);
  text-decoration: underline;
}

/* --- Comments Area --- */
.comments-area {
  margin-top: 6rem;
  padding-top: 3rem;
  border-top: 1px solid #333;
}

.comments-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

/* 댓글 리스트 */
.comment-list {
  margin-bottom: 4rem;
}

.comment-reply {
  padding: 1.5rem 0;
  border-bottom: 1px solid #222;
}

.reply-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.reply-name {
  font-weight: 700;
  color: var(--text-main);
}

.reply-date {
  font-size: 0.85rem;
  color: #666;
}

.reply-desc {
  color: #ccc;
  line-height: 1.6;
}

/* 댓글 입력 폼 */
.comment-form {
  background: #111;
  padding: 2rem;
  border-radius: 4px;
}

.form-inputs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.input-field {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid #444;
  color: var(--text-main);
  padding: 0.8rem 0;
  font-family: inherit;
  transition: border-color 0.3s;
}

.input-field:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.input-textarea {
  width: 100%;
  height: 100px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #444;
  color: var(--text-main);
  padding: 0.8rem 0;
  font-family: inherit;
  resize: none;
  margin-bottom: 1.5rem;
  transition: border-color 0.3s;
}

.input-textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.submit-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 1rem 2rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.3s;
}

.submit-btn:hover {
  background: #b90710;
  /* 포인트 컬러보다 살짝 어두운 색 */
}

/* --- Floating TOC --- */
.toc-container {
  position: fixed;
  top: 150px;
  right: 5%;
  /* 화면 우측에 배치 */
  width: 250px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-left: 1rem;
  border-left: 1px solid #333;
  display: none;
  /* 기본적으로 숨김 (본문 페이지에서만 스크립트로 켬) */
  z-index: 50;
}

/* 화면이 작아지면 TOC 숨김 처리 */
@media (max-width: 1400px) {
  .toc-container {
    display: none !important;
  }
}

.toc-item {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.8rem;
  line-height: 1.4;
  transition: all 0.3s;
}

.toc-item.h3 {
  padding-left: 1rem;
  /* 소제목은 들여쓰기 */
  font-size: 0.8rem;
}

.toc-item:hover,
.toc-item.active {
  color: var(--accent);
  font-weight: 700;
  transform: translateX(5px);
}

/* =========================================
   Pagination (페이징)
========================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid #222;
  /* 본문과 구분되는 얇은 선 */
}

/* PREV / NEXT 버튼 */
.page-nav {
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 2px;
  font-size: 0.85rem;
  transition: color 0.3s;
  cursor: pointer;
}

.page-nav:hover {
  color: var(--text-main);
}

/* 숨겨진(비활성화된) PREV/NEXT 버튼 처리 */
.page-nav.no-more-prev,
.page-nav.no-more-next {
  opacity: 0.2;
  pointer-events: none;
}

/* 숫자 버튼 그룹 */
.page-numbers {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* 개별 숫자 버튼 기본 스타일 (다른 페이지) */
.page-numbers a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 50%;
  background: transparent;
  transition: all 0.3s;
  text-decoration: none;
}

/* 다른 페이지 마우스 오버 시 */
.page-numbers a[href]:hover {
  background: #1a1a1a;
  color: var(--text-main);
}

/* 🚨 핵심: 현재 활성화된 페이지 (href 속성이 없는 a 태그) */
.page-numbers a:not([href]) {
  background: var(--accent);
  /* 빨간색 포인트 */
  color: #fff;
  font-weight: 900;
  pointer-events: none;
  /* 클릭 방지 */
}

/* =========================================
   티스토리 기본 구독 버튼 커스텀
========================================= */
/* 구독하기 버튼 본체 */
.btn_menu_toolbar.btn_subscription {
  background-color: var(--accent) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 4px !important;
  /* 원래 동그란 버튼을 각지게 변경 */
  font-family: "Inter", sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3) !important;
  transition: transform 0.3s ease !important;
}

.btn_menu_toolbar.btn_subscription:hover {
  transform: translateY(-3px) !important;
  background-color: #b90710 !important;
}

/* "+" 아이콘 색상 변경 */
.btn_menu_toolbar.btn_subscription .txt_tool_id {
  color: #ffffff !important;
}