/**
 * [커뮤니티 허브] /community 레이아웃
 * - 역할: 헤더 아래 본문 전체 배경 + latest 카드 그리드
 * - 작성/수정일: 2026-08-09
 */

/* 히어로·카드 영역이 끊기지 않도록 본문 섹션 전체에 배경 */
body.an-community-hub .an-page-main {
  background: var(--section-bg-color);
}

body.an-community-hub .an-cm-hub {
  background: transparent;
  overflow: visible;
}

body.an-community-hub .an-page-main,
body.an-community-hub .an-page-main__body {
  overflow: visible;
}

/**
 * [커뮤니티 허브] Swiper 히어로 배너
 * - 역할: 트랙 폭 = 그리드 · slidesPerView auto + 고정 슬라이드 폭으로 좌우 peek
 * - 작성/수정일: 2026-08-09
 */
.an-cm-hero {
  /* [커뮤니티 허브] 그리드와 동일 폭 트랙 — 작성/수정일: 2026-08-09 */
  position: relative;
  width: 100%;
  margin: 0 0 28px;
  padding: 4px 0;
  overflow: hidden;
}

.an-cm-hero__swiper {
  overflow: hidden;
  width: 100%;
}

.an-cm-hero .swiper-slide {
  /* 폭은 slidesPerView(소수)가 계산 — 작성/수정일: 2026-08-09 */
  height: auto;
  box-sizing: border-box;
}

.an-cm-hero__card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  min-height: 200px;
  padding: 36px 48px;
  overflow: hidden;
  border-radius: 0px;
  box-sizing: border-box;
  isolation: isolate;
  background-color: #171714;
  color: #f6f1e8;
  text-decoration: none;
  opacity: 1;
  -webkit-font-smoothing: antialiased;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* [커뮤니티 허브] 슬라이드 사진 = 카드 배경 cover — 작성/수정일: 2026-08-20 */
.an-cm-hero__card--dark {
  background: #171714 url("../img/community-hub/hero-dark.jpg") center / cover
    no-repeat;
}

.an-cm-hero__card--coral {
  background: #171714 url("../img/community-hub/hero-coral.jpg") center / cover
    no-repeat;
}

.an-cm-hero__card--mint {
  background: #171714 url("../img/community-hub/hero-mint.jpg?v=2") center /
    cover no-repeat;
}

.an-cm-hero__card:before {
  /* [커뮤니티 허브] 카피 쪽만 따뜻한 스크림 — 사진 채도 유지 · 글자 대비 — 작성/수정일: 2026-08-20 */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgba(22, 16, 12, 0.72) 0%,
    rgba(22, 16, 12, 0.42) 34%,
    rgba(22, 16, 12, 0.12) 58%,
    rgba(22, 16, 12, 0) 78%
  );
}

.an-cm-hero__card:hover,
.an-cm-hero__card:focus,
.an-cm-hero__card:focus-visible {
  opacity: 1;
  color: #f6f1e8;
  text-decoration: none;
  transform: translateY(-2px);
}

.an-cm-hero__copy,
.an-cm-hero__cta {
  position: relative;
  z-index: 2;
}

.an-cm-hero__copy {
  display: flex;
  flex-direction: column;
  max-width: 28em;
}

.an-cm-hero__lead {
  margin: 0;
  color: #f6f1e8;
  font-family: "Do Hyeon", sans-serif;
  font-size: clamp(1.45rem, 2.4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.an-cm-hero__sub {
  margin-top: 8px;
  color: rgba(246, 241, 232, 0.88);
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

.an-cm-hero__cta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(246, 241, 232, 0.55);
  border-radius: 999px;
  color: #f6f1e8;

  font-size: var(--fs-caption, 12px);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(246, 241, 232, 0.1);
  backdrop-filter: blur(8px);
}

.an-cm-hero__card:hover .an-cm-hero__cta,
.an-cm-hero__card:focus-visible .an-cm-hero__cta {
  background: rgba(246, 241, 232, 0.18);
  border-color: rgba(246, 241, 232, 0.78);
  color: #f6f1e8;
}

.an-cm-hero__nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-color, #e5e5e5);
  border-radius: 50%;
  background: var(--white-color, #fff);
  color: var(--title-color, #171717);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transform: translateY(-50%);
}

.an-cm-hero__nav:hover,
.an-cm-hero__nav:focus-visible {
  background: var(--section-bg-color, var(--section-bg-color, #f9f9f9));
}

/* slidesPerView ≈ 1.25 → 활성 약 80% 기준 화살표 — 작성/수정일: 2026-08-09 */
.an-cm-hero__nav--prev {
  left: max(8px, calc(50% - 40% - 8px));
}

.an-cm-hero__nav--next {
  right: max(8px, calc(50% - 40% - 8px));
}

.an-cm-hero__nav i {
  font-size: var(--fs-h6, 18px);
  line-height: 1;
}

@media (max-width: 991.98px) {
  .an-cm-hero__card {
    min-height: 180px;
    padding: 28px 24px;
  }

  .an-cm-hero__nav--prev {
    left: max(4px, calc(50% - 41% - 4px));
  }

  .an-cm-hero__nav--next {
    right: max(4px, calc(50% - 41% - 4px));
  }
}

@media (max-width: 767.98px) {
  /* [커뮤니티 허브] 모바일: 화살표 숨김(스와이프만) — 작성/수정일: 2026-08-09 */
  .an-cm-hero__nav {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .an-cm-hero {
    margin-bottom: 20px;
  }

  .an-cm-hero__card {
    min-height: 160px;
    padding: 24px 20px;
    border-radius: 0px;
  }
}

.an-cm-hub__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch; /* 행 내 카드 높이 맞춤 — 작성/수정일: 2026-08-09 */
}

@media (max-width: 991.98px) {
  .an-cm-hub__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .an-cm-hub__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

/**
 * [커뮤니티 허브] 광고 배너 2단 (파스텔)
 * - 역할: 그리드 마지막 칸 · 코랄/민트 대비
 * - 작성/수정일: 2026-08-09
 */
.an-cm-ad-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  height: 100%;
  min-height: 280px;
}

.an-cm-ad {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  flex: 1 1 0;
  min-height: 0;
  padding: 18px 18px 16px;
  overflow: hidden;
  box-sizing: border-box;
  isolation: isolate;
  background-color: #171714;
  color: #f6f1e8;
  text-decoration: none;
  opacity: 1;
  -webkit-font-smoothing: antialiased;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid transparent;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.an-cm-ad--coral {
  background: #171714 url("../img/community-hub/ad-coral.jpg") center / cover
    no-repeat;
}

.an-cm-ad--mint {
  background: #171714 url("../img/community-hub/ad-mint.jpg") center / cover
    no-repeat;
}

.an-cm-ad:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgba(22, 16, 12, 0.74) 0%,
    rgba(22, 16, 12, 0.4) 42%,
    rgba(22, 16, 12, 0.1) 72%,
    rgba(22, 16, 12, 0) 100%
  );
}

.an-cm-ad:hover,
.an-cm-ad:focus,
.an-cm-ad:focus-visible {
  opacity: 1;
  color: #f6f1e8;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.an-cm-ad__eyebrow,
.an-cm-ad__copy,
.an-cm-ad__cta {
  position: relative;
  z-index: 2;
}

.an-cm-ad__eyebrow {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 7px;
  border: 1px solid rgba(246, 241, 232, 0.38);
  border-radius: 4px;
  color: rgba(246, 241, 232, 0.82);
  font-family: "Gothic A1", sans-serif;
  font-size: var(--fs-micro, 10px);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.an-cm-ad__copy {
  display: flex;
  flex-direction: column;
  gap: 0px;
  flex: 1 1 auto;
  justify-content: center;
}

.an-cm-ad__lead {
  margin: 0;
  color: #f6f1e8;
  font-family: "Do Hyeon", sans-serif;
  font-size: clamp(1.6rem, 2.2vw, 1.8rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.an-cm-ad__sub {
  color: rgba(246, 241, 232, 0.88);
  font-size: var(--fs-body, 15px);
  font-weight: 600;
  line-height: 1.5;
  /* text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); */
}

.an-cm-ad__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(246, 241, 232, 0.55);
  color: #f6f1e8;
  font-size: var(--fs-caption, 12px);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(246, 241, 232, 0.1);
  backdrop-filter: blur(8px);
}

.an-cm-ad:hover .an-cm-ad__cta,
.an-cm-ad:focus-visible .an-cm-ad__cta {
  background: rgba(246, 241, 232, 0.18);
  border-color: rgba(246, 241, 232, 0.78);
  color: #f6f1e8;
}

/* [커뮤니티 허브] 다크모드 CTA가 본문 글자색으로 덮이지 않게 — 작성/수정일: 2026-08-20 */
html.dark .an-cm-hero__card .an-cm-hero__cta,
body.dark .an-cm-hero__card .an-cm-hero__cta,
html.dark .an-cm-ad .an-cm-ad__cta,
body.dark .an-cm-ad .an-cm-ad__cta {
  background: rgba(246, 241, 232, 0.1);
  border-color: rgba(246, 241, 232, 0.55);
  color: #f6f1e8;
}
