/**
 * 페이지 헤더 스타일
 *
 * 각 페이지 상단의 헤더 이미지 및 타이틀 스타일
 * - .page-header: 페이지 헤더 컨테이너
 * - .page-image: 배경 이미지
 * - .page-title: 페이지 타이틀 텍스트
 */

/* ==================== 페이지 헤더 ==================== */
.page-header {
  width: var(--full-width);
  margin-top: 0;
  height: 350px;
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
  z-index: 1;

  & .page-image {
    position: absolute;
    width: var(--full-width);
    height: 100%;
    object-fit: cover;
  }

  & .page-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: var(--full-width);
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
  }

  & .page-content-wrapper {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--content-width);
    max-width: var(--content-max-width);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
  }

  & .page-title {
    width: 100%;
    margin: 0;

    & .page-title-text {
      text-align: start;
      margin: 0;
      font-family: var(--font-main);
      font-size: 50px;
      font-weight: 600;
      color: white;
      text-shadow:
        2px 2px 8px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.7);

      /* 2개가 있을 때만 첫번째를 작게 */
      &:first-child:not(:last-child) {
        margin-bottom: 0;
        font-size: 30px;
        line-height: 25px;
      }
    }

    & a .page-title-text-one {
      text-align: start;
      margin: 0;
      font-family: var(--font-main);
      font-size: 50px;
      font-weight: 600;
      color: white;
      text-shadow:
        2px 2px 8px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.7);
    }
  }

  /* 카테고리 바 (Breadcrumb) */
  & .category-bar {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    padding: 12px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  & .category-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: var(--content-width);
    max-width: var(--content-max-width);
    margin: 0 auto;
  }

  & .parent-category {
    font-size: 20px;
    font-weight: 700;
    color: #333;
  }

  & .category-separator {
    font-size: 20px;
    color: #999;
    font-weight: 300;
  }

  & .child-categories {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }

  & .child-category {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 10px;
    background-color: rgba(240, 240, 240, 0.8);
    transition: all 0.3s ease;

    &:hover {
      background-color: rgba(230, 230, 230, 1);
      color: #333;
      transform: translateY(-1px);
    }

    &.current {
      background-color: var(--bg-nav-primary);
      color: white;
      font-weight: 700;
    }
  }
}

/* ==================== 반응형: 모바일 ==================== */
@media screen and (max-width: 1100px) {
  .page-header {
    & .page-title {
      & .page-title-text {
        font-size: 36px;

        &:first-child:not(:last-child) {
          font-size: 22px;
        }
      }
    }

    & .category-bar {
      padding: 8px 0;
    }

    & .category-wrapper {
      padding: 0 16px;
      gap: 8px;
    }

    & .parent-category {
      font-size: 16px;
    }

    & .category-separator {
      font-size: 16px;
    }

    & .child-category {
      font-size: 14px;
      padding: 4px 10px;
    }
  }
}

@media screen and (max-width: 770px) {
  .home .page-header .container {
    padding: 0;
  }

  .page-header .page-title {
    max-width: var(--full-width);
  }
}
