/*
  NOTICE (소식) PAGE
  biz-place.kr/notice 의 실제 _notice.css를 그대로 확인하여 마크업 구조·박스 모델·
  rem 단위 체계를 그대로 재현. 실제 게시물 사진이 없는 썸네일은 프로젝트 브랜드
  그라디언트로 대체했다.

  모바일 sticky 타이틀: 원본은 article.title에 position:sticky를 직접 사용하지만,
  이 프로젝트의 style.css는 html,body에 overflow-x:hidden을 적용 중이라 일부
  렌더링 엔진에서 position:sticky가 정상 동작하지 않는 경우가 있다(examples.css와
  동일한 이슈). 그래서 이 페이지도 JS로 fixed 전환하는 방식(is-stuck 클래스)으로
  동일한 sticky 룩앤필을 재현한다.
*/

.notice-main {
  position: relative;
  margin: 0 auto;
  width: 127.2rem;
  max-width: 100%;
}

.notice-main::before {
  content: "";
  display: block;
  width: 100%;
  height: 15rem;
  background-color: transparent;
}

.notice-main article {
  position: relative;
  display: flex;
  width: 100%;
}

/* ---------- BANNER ---------- */
article.notice-banner {
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: center;
  padding: 0 0 0 10.8rem;
  height: 28.8rem;
  background-image: url('../img/notice-hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

article.notice-banner h1 {
  width: 100%;
  font-size: 2.9rem;
  font-weight: 500;
  color: #fff;
  line-height: 2.9rem;
}

article.notice-banner h2 {
  margin: 3rem 0 0 0;
  max-width: 60rem;
  font-size: 1.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  line-height: 2.6rem;
}

/* ---------- TITLE ---------- */
.notice-title-slot {
  position: relative;
  width: 100%;
}

article.notice-title {
  justify-content: center;
  align-items: center;
  margin: 13rem 0 0 0;
  height: 15rem;
  font-size: 5rem;
  font-weight: 700;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

/* ---------- LISTS (grid) ----------
   3열(40.8rem 기준)로 시작해서, 창 너비가 줄면 카드가 비율대로 함께 줄어들다가
   카드 2개가 들어갈 최소 폭(30rem) 아래로 내려가는 순간 자연스럽게 2열로,
   더 줄면 1열로 재배치된다 (675px 미만은 아래 모바일 미디어쿼리가 강제 1열 처리). */
article.notice-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(34rem, 1fr));
  grid-template-rows: repeat(auto-fill, 1fr);
  row-gap: 3.2rem;
  column-gap: 2rem;
  padding: 9rem 3rem;
}

article.notice-lists section {
  position: relative;
  padding: 35rem 0 0 0;
  width: 100%;
  height: 45rem;
  border-radius: 2rem;
  box-shadow: 0.5rem 0.5rem 2rem rgba(0, 0, 0, 0.2);
  overflow: hidden;
  cursor: pointer;
  background-color: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

article.notice-lists section:hover {
  transform: translateY(-0.4rem);
  box-shadow: 0.5rem 1rem 2.4rem rgba(0, 0, 0, 0.26);
}

article.notice-lists section .thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 32rem;
  background: no-repeat 100% 100% / 100% 100% url('../img/notice-list-bg.png');
}

article.notice-lists section .thumb-info {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  padding: 0 2.4rem;
  box-sizing: border-box;
}

/* TODO: 로고 이미지 생기면 이 텍스트 로고를 <img class="thumb-logo">로 교체 */
article.notice-lists section .thumb-logo {
  margin: 0 0 1.2rem 0;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
}

article.notice-lists section .thumb-info h2 {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 3.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

article.notice-lists section h1 {
  word-break: keep-all;
  margin: 1rem 0 0 0;
  padding: 0 2.4rem;
  width: 100%;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 2.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- PAGE (pagination) ---------- */
article.notice-page {
  justify-content: center;
  align-items: center;
  padding: 0 0 20rem 0;
  width: 100%;
}

article.notice-page a,
article.notice-page span {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.6rem;
  width: 4rem;
  height: 4rem;
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--color-sub);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

article.notice-page a:hover {
  color: var(--color-text);
  background-color: var(--color-bg-soft);
}

article.notice-page a.current {
  color: #fff;
  background: var(--gradient);
  font-weight: 700;
}

article.notice-page a.disabled {
  color: rgba(200, 200, 200, 1);
  cursor: default;
  pointer-events: none;
}

/* ---------- EMPTY STATE ---------- */
article.notice-lists .empty {
  grid-column: 1 / -1;
  justify-content: center;
  padding: 8rem 0;
  width: 100%;
  font-size: 1.6rem;
  color: var(--color-sub);
  text-align: center;
}

/* ---------- responsive ---------- */
@media (max-width: 675px) {
  .notice-main {
    margin: 0 auto;
    width: 100%;
  }

  .notice-main::before {
    height: 6rem;
  }

  /* BANNER */
  article.notice-banner {
    margin: 0 auto;
    padding: 0 0 0 2rem;
    width: calc(100% - 3rem);
    height: 13rem;
    border-radius: 1.4rem;
  }

  article.notice-banner h1 {
    font-size: 2rem;
    line-height: 2.4rem;
  }

  article.notice-banner h2 {
    margin: 1.2rem 0 0 0;
    padding: 0 2rem 0 0;
    font-size: 1.1rem;
    line-height: 1.8rem;
  }

  /* TITLE (JS is-stuck 방식, 상세 설명은 상단 주석 참고) */
  .notice-title-slot {
    height: 12rem;
  }

  article.notice-title {
    position: absolute;
    left: 0;
    top: 6rem;
    margin: 0;
    width: 100%;
    height: 6rem;
    font-size: 2rem;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 5;
  }

  article.notice-title.is-stuck {
    position: fixed;
    top: 5rem;
    box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.06);
  }

  /* LISTS */
  article.notice-lists {
    grid-template-columns: 100%;
    row-gap: 3.2rem;
    justify-content: center;
    margin: 0 auto;
    padding: 4rem 0;
    width: calc(100% - 3rem);
  }

  article.notice-lists section {
    padding: 27rem 0 0 0;
    width: 100%;
    min-height: 30.8rem;
    height: 105%;
    border-radius: 2rem;
  }

  article.notice-lists section .thumb {
    height: 26rem;
  }

  article.notice-lists section .thumb-info {
    padding: 0 1.6rem;
  }

  article.notice-lists section .thumb-logo {
    margin: 0 0 0.8rem 0;
    font-size: 1.7rem;
  }

  article.notice-lists section .thumb-info h2 {
    font-size: 2.3rem;
    line-height: 3.4rem;
    word-break: keep-all;
  }

  article.notice-lists section h1 {
    margin: 1rem 0 0 0;
    padding: 0 1.5rem;
    font-size: 1.5rem;
    line-height: 2.4rem;
  }

  /* PAGE */
  article.notice-page {
    padding: 0 0 6rem 0;
  }
}
