/* 게시글 상세 페이지 공통 스타일 */

/* =====================================================
   읽기 진행 표시기
   ===================================================== */
.reading-progress {
  position: fixed;
  top: calc(var(--common-header-offset, 52px) - 1px);
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-subtle);
  z-index: 1000;
}
.reading-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.1s ease-out;
}

/* =====================================================
   브레드크럼 네비게이션
   ===================================================== */
.breadcrumb {
  margin-bottom: 16px;
}
.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}
.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}
.breadcrumb__item:not(:last-child)::after {
  content: "›";
  color: var(--text-muted);
}
.breadcrumb__item a {
  color: var(--text-medium);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb__item a:hover {
  color: var(--accent-strong);
}
.breadcrumb__item.is-current {
  color: var(--text-strong);
  font-weight: 600;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================================================
   그리드 레이아웃 (데스크톱 사이드바)
   ===================================================== */
.post-detail-layout {
  max-width: 1200px;
}
.post-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 1024px) {
  .post-detail-grid {
    grid-template-columns: 1fr 280px;
  }
}
.post-detail-content {
  min-width: 0;
}

/* =====================================================
   메타 통계 (읽음/좋아요/댓글)
   ===================================================== */
.post-meta-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-medium);
}
.post-meta-stat i {
  color: var(--accent);
}
.post-meta-stat--first {
  margin-left: auto;
}

/* =====================================================
   이전/다음 게시글 네비게이션
   ===================================================== */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
  padding: 0 clamp(16px, 3vw, 24px);
}
.post-nav__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-small);
  text-decoration: none;
  transition: all 0.2s ease;
}
.post-nav__link:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}
.post-nav__link--prev { text-align: left; }
.post-nav__link--next { text-align: right; }
.post-nav__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-strong);
  text-transform: uppercase;
}
.post-nav__title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-strong);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-nav__link[hidden] { display: none; }

/* =====================================================
   스티키 사이드바 (데스크톱)
   ===================================================== */
.post-sidebar {
  display: none;
}
@media (min-width: 1024px) {
  .post-sidebar {
    display: block;
  }
}
.sidebar-sticky {
  position: sticky;
  top: var(--common-header-offset, 52px);
}
.sidebar-section {
  background: var(--surface);
  border-radius: var(--radius-medium);
  border: 1px solid var(--border-subtle);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-subtle);
}
.sidebar-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-strong);
}
.sidebar-section__title i {
  color: var(--accent);
}
.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-list__item {
  border-bottom: 1px dashed var(--border-subtle);
}
.sidebar-list__item:last-child {
  border-bottom: none;
}
.sidebar-list__link {
  display: block;
  padding: 10px 0;
  font-size: 0.85rem;
  color: var(--text-medium);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}
.sidebar-list__link:hover {
  color: var(--accent-strong);
}
.sidebar-list__empty {
  padding: 10px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =====================================================
   플로팅 액션 버튼
   ===================================================== */
.floating-actions {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}
.fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-medium);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
}
.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.fab--like { color: var(--helpful-color); }
.fab--like[aria-pressed="true"] {
  background: var(--helpful-color);
  color: #fff;
}
.fab--share { color: var(--accent-strong); }
.fab--copy { color: var(--text-medium); }
.fab--top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}
.fab--top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =====================================================
   토스트 알림
   ===================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--text-strong);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.toast__icon { color: #22c55e; }

/* =====================================================
   관련 게시글 (모바일)
   ===================================================== */
.related-posts-mobile {
  margin-top: 24px;
}
@media (min-width: 1024px) {
  .related-posts-mobile {
    display: none;
  }
}
.related-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-strong);
}
.related-section__title i { color: var(--accent); }

/* =====================================================
   인기 게시글
   ===================================================== */
.popular-posts__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.popular-posts__item {
  border-bottom: 1px dashed var(--border-subtle);
}
.popular-posts__item:last-child {
  border-bottom: none;
}
.popular-posts__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  text-decoration: none;
  transition: color 0.2s;
}
.popular-posts__link:hover {
  color: var(--accent-strong);
}
.popular-posts__rank {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--text-muted);
}
.popular-posts__rank--top {
  background: var(--accent);
  color: #fff;
}
.popular-posts__title {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.popular-posts__link:hover .popular-posts__title {
  color: var(--accent-strong);
}
.popular-posts__empty {
  padding: 10px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =====================================================
   상세 페이지 카드 스타일
   ===================================================== */
[data-community-post-detail] .news-card.is-expanded {
  margin-bottom: 0;
}
[data-community-post-detail] .news-card__preview {
  cursor: default;
}
[data-community-post-detail] .news-card__preview:hover {
  background: transparent;
}
.news-card.is-expanded .news-card__expand-icon { display: none; }
.news-article__lead { display: none; }

/* 댓글 폼 */
.comment-form__submit {
  opacity: 1 !important;
  transform: scale(1) !important;
}
.comment-form__submit:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed;
}

/* =====================================================
   모바일 반응형
   ===================================================== */
@media (max-width: 768px) {
  .reading-progress {
    top: calc(var(--common-header-offset, 52px) - 1px);
  }
  .breadcrumb {
    margin-bottom: 12px;
  }
  .breadcrumb__list {
    font-size: 0.8rem;
    gap: 6px;
  }
  .breadcrumb__item.is-current {
    max-width: 150px;
  }
  .post-meta-stat {
    font-size: 0.8rem;
  }
  .post-meta-stat--first {
    margin-left: 0;
  }
  .post-nav {
    grid-template-columns: 1fr;
    padding: 0 14px;
  }
  .post-nav__link--next {
    text-align: left;
  }
  .floating-actions {
    bottom: 16px;
    right: 16px;
    gap: 8px;
  }
  .fab {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
  .related-posts-mobile {
    margin-top: 20px;
  }
  .related-section__title {
    font-size: 0.95rem;
    margin-bottom: 10px;
  }
}

@media (max-width: 380px) {
  .breadcrumb__list {
    font-size: 0.75rem;
  }
  .breadcrumb__item.is-current {
    max-width: 120px;
  }
  .post-meta-stat {
    width: 100%;
  }
  .floating-actions {
    bottom: 12px;
    right: 12px;
  }
  .fab {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
}
