@charset "utf-8";

/* ================================================================
   메인 (index.php)
   MO        : 히어로 박스 → 주요기사 카드 3개 → 광고 → 카드 1열 → 광고 → 소식 목록(세로)
   768px~    : 히어로 박스 안 글·그림 가로, 주요기사 3열, 카드 2열
   1024px~   : 소식 목록 가로 행, 카드 설명 1줄
   1280px~   : 히어로 박스(66.67%) | 주요기사 목록, 카드 4열 (PC 시안)
   ================================================================ */

/* ---------- 히어로 + 주요 기사 ---------- */
.home-hero__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-hero__main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: clamp(20px, calc(20px + 12 * var(--fluid)), 32px);
  border-radius: var(--radius-lg);
  background: var(--primary-10);
}

.home-hero__text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.home-hero__cate {
  color: var(--primary);
  font-size: var(--fs-body1);
  font-weight: 500;
  line-height: 1.5;
}

.home-hero__title {
  color: var(--gray-a2);
  font-size: var(--fs-hero-title);
  font-weight: 700;
  line-height: clamp(28px, calc(28px + 20 * var(--fluid)), 48px); /* 20/1.4 → 32/1.5 */
}

.home-hero__desc {
  color: var(--gray-a3);
  font-size: var(--fs-body1);
  font-weight: 500;
  line-height: 1.5;
}

.home-hero__br {
  display: none;
}

.home-hero__main:hover .btn-primary {
  background: #0069db;
}

.home-hero__img {
  width: 100%;
  max-width: 310px;
  height: auto;
}

.home-hero__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-hero__list > li {
  display: flex;
}

.home-hero__list .card {
  flex: 1;
}

@media (min-width: 768px) {
  .home-hero__main {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .home-hero__img {
    flex: 0 1 310px;
    width: 40%;
  }

  .home-hero__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* PC 시안: 히어로 박스 | 주요기사 목록 */
@media (min-width: 1280px) {
  .home-hero__inner {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
  }

  .home-hero__main {
    flex: 0 0 66.667%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 29px 48px;
  }

  .home-hero__text {
    gap: 0;
    max-width: 470px;
  }

  .home-hero__cate,
  .home-hero__desc {
    line-height: 1.6;
  }

  .home-hero__title,
  .home-hero__desc {
    max-width: 370px; /* 시안 줄바꿈("…나이와 / 역할에 맞는…") 유지, 그림과 겹치지 않게 */
  }

  .home-hero__br {
    display: inline;
  }

  .home-hero__btn {
    margin-top: 26px;
  }

  /* 그림은 박스 오른쪽 위에 겹쳐 놓고, 화면이 좁아져도 글자(왼쪽 48 + 제목 370)와 겹치지 않게 줄인다 */
  .home-hero__img {
    position: absolute;
    right: 18px;
    bottom: 28px; /* 1920 시안: 위 8 / 아래 28 — 좁아져 그림이 작아져도 아래 기준 유지 */
    width: min(541px, calc((100% - 436px) * 1.0566));
    max-width: none;
  }

  /* 주요기사: 큰 카드 → 테두리 박스 안 3줄 목록 */
  .home-hero__list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0;
    min-width: 0;
    padding: 16px 0;
    border: 1px solid var(--fill-elevated);
    border-radius: var(--radius-lg);
  }

  .card--hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "tag  ."
      "title chev"
      "desc  chev";
    align-items: center;
    padding: 0 16px 16px;
    border: 0;
    border-radius: 0;
    background: none;
  }

  .card--hero .card__tag {
    grid-area: tag;
    justify-self: start;
  }

  .card--hero .card__title {
    grid-area: title;
    margin-top: 4px;
    font-size: var(--fs-title3);
    font-weight: 600;
    line-height: 1.6;
    -webkit-line-clamp: 1;
  }

  .card--hero .card__desc {
    grid-area: desc;
    margin-top: 0;
    font-size: var(--fs-caption);
    -webkit-line-clamp: 1;
  }

  .card--hero .card__foot {
    display: none;
  }

  .card--hero .card__chevron {
    grid-area: chev;
    display: flex;
    padding-left: 8px;
    color: var(--gray-a3);
  }

  .card--hero:hover .card__title {
    color: var(--gray-a1);
  }
}

/* ---------- 보험 소식 더 보기 ---------- */
.home-news {
  --title-to-list: clamp(20px, calc(20px + 4 * var(--fluid)), 24px);
  margin-top: clamp(-8px, calc(0px - 8 * var(--fluid)), 0px); /* 광고 → 제목: MO 32 / PC 16 */
}

.news-list > li {
  position: relative;
}

.news-list > li::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 1px;
  background: var(--fill-elevated);
}

.news-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 0 29px; /* 버튼 → 구분선 28 + 선 1px(::after는 padding 안에 그려짐) */
}

.news-row__title {
  display: -webkit-box;
  margin-top: 1px; /* 시안 태그 → 제목 13 */
  overflow: hidden;
  color: var(--gray-a2);
  font-size: var(--fs-title3);
  font-weight: 600;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* MO: 회색 버튼 모양 / PC: 글자 링크 + chevron */
.news-row__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  background: var(--gray-a5);
  color: var(--gray-a2);
  font-size: var(--fs-body2);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  transition: background-color var(--transition);
}

.news-row__more .icon {
  width: 16px;
  height: 16px;
}

.news-row:hover .news-row__more {
  background: var(--gray-a4);
}

@media (min-width: 1024px) {
  .news-list > li:last-child::after {
    display: none;
  }

  .news-row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px;
  }

  .news-row__tag {
    flex: none;
    justify-content: center;
    width: 100px;
  }

  .news-list > li::after {
    position: static;
    display: block;
    margin-inline: 16px;
  }

  .news-row__title {
    flex: 1;
    min-width: 0;
    margin-top: 0;
    padding: 16px;
    -webkit-line-clamp: 1;
  }

  .news-row__more {
    gap: 0;
    padding: 0 16px 0 8px;
    background: none;
    font-weight: 500;
  }

  .news-row__more .icon {
    width: 24px;
    height: 24px;
    color: var(--gray-a3);
  }

  .news-row:hover .news-row__more {
    background: none;
  }

  .news-row:hover .news-row__title {
    color: var(--gray-a1);
  }
}
