/* ==========================================================================
   05-pages.css — 페이지 전용 스타일
   (홈 히어로 · 카테고리 아카이브 · 아티클 상세)
   ========================================================================== */

/* ==================================================================
   홈 (index) — 히어로 캐러셀
   ================================================================== */
.hero {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: var(--space-9);
  width: 100%;
  max-width: var(--container-main);
}

.hero__link { display: flex; align-items: center; gap: var(--space-9); width: 100%; }

.hero__media {
  position: relative;
  pointer-events: none;
  width: 520px;
  height: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
}
.hero__media-link { display: block; width: 100%; height: 100%; }
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--transition-media);
}
.hero:hover .hero__media img { transform: scale(1.2); }

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  align-self: stretch;
  flex: 1 0;
  height: 280px;
  padding-top: 24px;
  overflow: hidden;
}

.hero__heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}

.hero__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-heading);
  font-size: var(--fs-hero-title);
  font-weight: var(--fw-bold);
  line-height: 135%;
}

.hero__title a { color: inherit; }
.hero__title a:hover { color: inherit; }

.hero__desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-loose);
  align-self: stretch;
}

/* 캐러셀 이동 버튼 */
.hero__nav {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.hero__arrow {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 8px 12px;
  gap: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  transition: background-color var(--transition-fast);
}
.hero__arrow:hover { background: var(--border-light); }
.hero__arrow img { width: 24px; height: 24px; }

/* 캐러셀 전환 애니메이션 */
.hero--animate .hero__title { animation: hero-fade-in 0.4s ease-in-out; }
.hero--animate .hero__desc,
.hero--animate .hero__media { animation: hero-fade-in 0.4s ease-out both; }

@keyframes hero-fade-in {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ==================================================================
   카테고리 아카이브
   ================================================================== */
.archive-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 16px 0 32px;
}

.archive-header__title {
  color: var(--text-strong);
  font-size: var(--fs-archive-title);
  font-weight: var(--fw-bold);
  line-height: 135%;
  margin: 0;
}

.archive-header__desc {
  color: var(--text-secondary);
  font-size: 20px;
  font-weight: var(--fw-medium);
  line-height: 140%;
  white-space: pre-wrap;
}

/* ==================================================================
   아티클 상세
   ================================================================== */
.article-container {
  max-width: var(--container-article);
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.article-header { margin-bottom: var(--space-7); }

.article-tags {
  display: flex;
  flex-wrap: wrap;
  margin-top: 16px;
}
.article-tags a {
  margin: 0 var(--space-2) 10px 0;
  color: var(--color-primary);
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-semibold);
}
.article-tags a:hover { text-decoration: underline; }

.article-header__title {
  margin: 36px 0 0;
  color: var(--text-strong);
  font-size: var(--fs-page-title);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.article-header__meta {
  display: flex;
  align-items: center;
  margin-top: var(--space-5);
  min-height: fit-content;
}
.article-header__meta-inner {
  display: flex;
  align-items: center;
  padding-top: var(--space-2);
  font-size: var(--fs-body-lg);
}
.article-header__author {
  margin-right: var(--space-1);
  color: var(--text-body);
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.article-header__date {
  font-size: var(--fs-meta-sm);
  line-height: 1.5;
  color: var(--text-tertiary);
}

.article-header__thumb {
  width: 100%;
  max-width: 700px;
  aspect-ratio: 7 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-5);
}
.article-header__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 바이라인 (Words/Edit 크레딧) */
.article-byline {
  margin-top: var(--space-6);
  color: var(--text-tertiary);
  font-size: var(--fs-meta-sm);
}
.article-byline strong { color: var(--text-secondary); font-weight: var(--fw-semibold); }

/* --- 공유하기 --- */
.article-share {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-8) 0 50px;
}
.article-share .share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  transition: background-color var(--transition-fast), transform 0.15s ease-out;
}
.article-share .share-btn:hover { background: var(--border-light); }
.article-share .share-btn:active { transform: scale(0.9); }
.article-share img { width: 24px; height: 24px; }

/* --- 댓글 --- */
.comments { margin-top: var(--space-6); }

.comments__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-7);
  padding-top: var(--space-7);
  border-top: 1px solid var(--border-light);
}
.comments__title { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--text-strong); }
.comments__inquiry { font-size: var(--fs-meta-sm); color: var(--text-secondary); }
.comments__inquiry a { color: var(--color-primary-hover); }
.comments__inquiry a:hover { text-decoration: underline; }

.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.comment-form__row { display: flex; align-items: center; gap: var(--space-3); }
.comment-form__avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}
.comment-form__avatar img { width: 100%; height: 100%; }
.comment-form__input {
  flex: 1 1;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-default);
  font-size: var(--fs-meta);
  resize: vertical;
}
.comment-form__input:focus { outline: none; border-color: var(--color-primary); }
.comment-form__submit { align-self: flex-end; }

.comments__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.comment-item {
  background-color: var(--bg-subtle);
  border-radius: 20px;
  padding: 20px;
}
.comment-item__head { display: flex; align-items: center; margin-bottom: var(--space-2); gap: var(--space-2); }
.comment-item__avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}
.comment-item__avatar img { width: 100%; height: 100%; }
.comment-item__name { font-size: var(--fs-meta-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.comment-item__text {
  font-size: var(--fs-meta-sm);
  font-weight: var(--fw-medium);
  color: var(--text-body);
  line-height: 1.5;
  word-break: break-word;
}

.comment-item--reply { margin-top: 17px; margin-left: var(--space-3); }
.comment-item--reply .comment-item__avatar { width: 18px; height: 18px; }
.comment-item--reply .comment-item__text { margin-left: 32px; }

/* ==================================================================
   반응형
   ================================================================== */
@media (max-width: 1024px) {
  .hero { gap: var(--space-6); }

  .hero__media { width: 332px; height: 186.75px; border-radius: var(--radius-md); }
  .hero__text { height: 204px; padding-top: 16px; }
  .hero__title { font-size: var(--fs-archive-title); line-height: 140%; }
  .hero__desc { font-size: var(--fs-meta); }

  .archive-header { gap: var(--space-2); padding: 0 0 16px; }
  .archive-header__desc { font-size: 19px; line-height: 150%; }
}

@media (max-width: 768px) {
  /* 히어로: 이미지가 위, 텍스트가 아래 */
  .hero { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .hero__media { order: -1; width: 100%; height: auto; aspect-ratio: 312 / 175.5; }
  .hero__text { order: 1; height: 210px; padding-top: 0; justify-content: space-between; flex: none; width: 100%; align-self: stretch; }
  .hero__title { font-size: 20px; -webkit-line-clamp: 3; }

  .archive-header { padding: 0 0 var(--space-3); }
  .archive-header__title { font-size: var(--fs-section-title); line-height: 140%; }
  .archive-header__desc { font-size: var(--fs-meta); line-height: 150%; }

  /* 상세페이지 */
  .article-container { padding: 24px 16px 60px; }
  .article-header__title { margin-top: 28px; font-size: var(--fs-section-title); }
  .article-tags a { font-size: var(--fs-body); margin: 0 var(--space-1) var(--space-2) 0; }
  .article-header__meta-inner { flex-direction: column; align-items: flex-start; gap: var(--space-1); font-size: var(--fs-caption); }
  .article-header__author { font-size: var(--fs-caption); margin-right: 0; }
  .article-header__date { font-size: var(--fs-caption); }

  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 22px; }
  .article-body h3 { font-size: 20px; }

  .comments__head { flex-direction: column; align-items: flex-start; gap: var(--space-4); margin-top: var(--space-6); padding-top: var(--space-6); }
  .comment-form__avatar { width: 40px; height: 40px; }
  .comment-item--reply .comment-item__text { margin-left: 28px; }
}
