@charset "utf-8";

/* 기본 색상 변수 */
:root {
  --thread-font: 'Pretendard';
  --box-border-color: #363639;
  --box-shadow-soft: 0 16px 24px -12px rgba(0,0,0,.08);
}

/* 메인 전체 */
#main_body {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 14px;
  line-height: 1.5;
  padding: 40px 0;
  gap: 16px;
}

/* 카드 공통 */
.main-card {
  width: 100%;
  max-width: 800px;
  background: #fff;
  color: #363639;
  border: 1px solid var(--box-border-color);
  box-shadow: var(--box-shadow-soft);
  box-sizing: border-box;
  padding: 40px 24px;
  text-align: center;
}

.main-card[aria-label="안내"] {
  height: 340px;
  overflow: hidden;
  padding: 32px 24px;

  display: flex;
  flex-direction: column;
  justify-content: center;
}


.main-row {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 800px;
  margin: 0 16px;
  align-items: stretch;
}

.main-row .main-card.half {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  box-sizing: border-box;
  max-height: 278px;
}

.section-scroll {
  max-height: 278px;
  overflow-y: auto;
  padding-right: 6px;
}
.section-scroll::-webkit-scrollbar {
  width: 6px;
}
.section-scroll::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* 배너 그리드 */
.banner-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  justify-items: center;
}
.banner-grid img {
  width: 100%;
  height: auto;
  display: block;
}

/* 메인 배너(상단 3열용) */
.main-banners {
  display: grid;
  grid-template-columns: repeat(3, 200px);
  gap: 2px;
  justify-content: center;
  margin-top: 16px;
}
.main-banners .banner {
  display: block;
  width: 200px;
  height: 40px;
  overflow: hidden;
}
.main-banners .banner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0.65;
  transition: opacity 0.6s ease;
}
.main-banners .banner:hover img {
  opacity: 1;
}

/* 뱃지 공통 */
.badgeable {
  position: relative;
  overflow: visible;
}
.badgeable::after {
  content: attr(data-alt);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  padding: 2px 4px;
  background: var(--badge-bg, #8EE3AF);
  color: #363639;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  white-space: nowrap;
}
.badgeable:hover::after { opacity: 1; }

/* 순환 색상 보조 */
.badgeable:nth-child(4n+1)::after { background: #8EE3AF; }
.badgeable:nth-child(4n+2)::after { background: #CCBFE3; }
.badgeable:nth-child(4n+3)::after { background: #FFC1A5; }
.badgeable:nth-child(4n+4)::after { background: #FFEAA5; }

/* extra 아이콘 */
.extra-icons {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.extra-icon {
  display: inline-block;
  position: relative;
}
.extra-icon.badgeable::after {
  left: 50%;
  top: 100%;
  transform: translate(-50%, 10%);
  z-index: 10;
}

/* 텍스트 유틸 */
.main-label { font-weight: 500; margin-right: 8px; }
.sub-text { opacity: 0.65; }
.copy-links a {
  display: inline;
  margin: 0 4px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.copy-links { white-space: nowrap; }
.copy-line {
  display: block;
  cursor: pointer;
  position: relative;
  padding: 0 6px;
  margin-bottom: 2px;
}
.copy-line::after {
  content: "클립보드 복사";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  padding: 2px 4px;
  background: #EEE7FA;
  color: #A580E8;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.copy-line:hover::after { opacity: 1; }
.copy-line.copied::after { content: "복사 완료!"; opacity: 1; }

/* 최신글 영역 좌측 정렬 */
.recent-box, .lt, .lt * { text-align: left !important; }
.lt_title { display: none !important; }

/* 반응형 */
@media (max-width: 768px) {
  #main_body { padding: 24px 0; }
  .main-card { padding: 32px 16px; }
  .main-row { flex-direction: column; }
  .main-card[aria-label="안내"] { height: auto; }
  .main-banners { grid-template-columns: repeat(1, 200px); }
}

/* PC에서 브라우저 기준 중앙 정렬 */
@media (min-width: 769px) {
  #main_body {
    min-height: 100vh;             /* 브라우저 전체 높이 차지 */
    justify-content: center;       /* 수직 중앙 정렬 */
    align-items: center;           /* 수평 중앙 정렬 */
    padding: 0;                    /* 위아래 여백 제거 */
  }
}

.main-banners .banner {
  display: block;
  width: 200px;
  height: 40px;
  overflow: hidden;
}
.main-banners .banner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0.8;
  transition: opacity 0.4s ease;
}
.main-banners .banner:hover img {
  opacity: 1;
}


.banner-grid img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 0.4s ease;
}
.banner-grid img:hover {
  opacity: 1;
}

/* --- 수정 및 정리 완료본 --- */

/* 하단 2단 구조 비율 (좌: 최신글 40%, 우: 이웃집 60%) */
.main-row {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 800px;
  align-items: stretch;
  justify-content: space-between; /* 양쪽 여유 유지 */
  margin: 0 auto; /* 중앙 정렬 */
}

/* 비율 지정 */
.main-card[aria-label="최근 갱신된 글"] {
  flex: 0 0 40%;
  max-width: 40%;
}

.main-card[aria-label="이웃"] {
  flex: 0 0 60%;
  max-width: 60%;
}

/* 반응형: 모바일에서는 세로 정렬 */
@media (max-width: 768px) {
  .main-row {
    flex-direction: column;
  }
  .main-card[aria-label="최근 갱신된 글"],
  .main-card[aria-label="이웃"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}


.main-card[aria-label="이웃"] .section-scroll {
  display: block;
  max-height: 260px;
  overflow-y: auto;
  background-color: #fff;
}

.main-card[aria-label="이웃"] .section-scroll::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}

.main-card[aria-label="이웃"] .section-scroll::-webkit-scrollbar-track {
  background: #fFf;
}

.main-card[aria-label="이웃"] .section-scroll::-webkit-scrollbar-thumb {
  background-color: #d4b8ff;
  border-radius: 0;
}

.main-card.half h2 {
  text-align: left;
  font-weight: 500;
  font-size: 16px;
  margin: 0 0 12px;
}


/* 최근 갱신된 글 카드만: 늘어나는(스트레치) 거 막고, 내용만큼 높이 */
.main-row .main-card.half[aria-label="최근 갱신된 글"] {
  max-height: none !important;
  height: auto !important;
  align-self: flex-start; /* 이 줄이 핵심: 같은 줄 카드 높이 맞추느라 늘어나는 걸 막음 */
}

/* 최근 갱신된 글만: 스크롤 박스도 내용만큼 */
.main-row .main-card.half[aria-label="최근 갱신된 글"] .section-scroll {
  max-height: none !important;
  overflow-y: visible !important;
  padding-right: 0; /* 스크롤바 여백도 필요 없으면 */
}
