/* ==========================================================================
   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);}

.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);
    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);
     margin: 0;}

.archive-header__desc {
  color: var(--text-secondary);
   /* 20px */
    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);}
.article-tags a:hover { text-decoration: underline;}

.article-header__title {
  margin: 36px 0 0;
  color: var(--text-strong);
     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);}
.article-header__author {
  margin-right: var(--space-2);  /* 작성자-날짜 간격 8px */
  color: var(--text-body);
    white-space: nowrap;}
.article-header__date {
    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);}
.article-byline strong { color: var(--text-secondary);}

/* --- 공유하기 --- */
.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 {   color: var(--text-strong);}
.comments__inquiry {  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);
   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: #f8f8f8;  /* 요청 지정값 */
  border-radius: 20px;
  padding: 20px;}

.comment-list > .comment:first-child {
  padding-top: 20px;
  margin-top: 0;
  border-top: 0;
}
.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 {   color: var(--text-strong);}
.comment-item__text {
    color: var(--text-body);
   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;}

  .archive-header { gap: var(--space-2); padding: 0 0 16px;}
  .archive-header__desc {  /* 19px */}
}

@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 {  /* 20px */ -webkit-line-clamp: 3;}

  .archive-header { padding: 0 0 var(--space-3);}

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

  /* 본문/헤딩 모바일 크기는 GP 타이포그래피의 모바일 필드가 담당한다 */

  .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;}
}

/* 모바일: 댓글 패딩 축소 */
@media (max-width: 768px) {
  .comment-item { padding: 12px; }
  .comment-list > .comment:first-child { padding-top: 12px; }
}
