/* ========================================
   기본 설정
======================================== */

:root {
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: #171717;
  font-family: Arial, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  line-height: 1.75;
}

a {
  color: inherit;
}


/* ========================================
   상단 헤더
======================================== */

.top {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 30px;
  min-height: 120px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid #ddd;
}


/* ========================================
   왼쪽 오리
======================================== */

.top .duck-link {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 54px;
  flex: 0 0 54px;

  text-decoration: none;
}

.top .duck-link img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.top .duck-link:hover {
  opacity: 0.65;
}


/* ========================================
   중앙 빛틈 로고
======================================== */

.top .wordmark {
  position: absolute;

  left: 50%;
  top: 50%;

  transform: translate(-50%, -50%);

  display: flex;
  align-items: center;
  justify-content: center;

  width: 48px;
  flex: none;

  text-decoration: none;
}

.top .wordmark picture {
  display: block;
  width: 100%;
}

.top .wordmark img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.top .wordmark:hover {
  opacity: 0.65;
}


/* ========================================
   오른쪽 메뉴
======================================== */

.top nav {
  display: flex;
  align-items: center;

  gap: 24px;
  margin-left: auto;
}

.top nav a {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.09em;
  line-height: 1.75;

  text-decoration: none;
  white-space: nowrap;
}

.top nav a:hover {
  opacity: 0.65;
}


/* ========================================
   콘텐츠 영역
======================================== */

.content {
  max-width: 880px;
  margin: 72px auto 110px;
  padding: 0 30px;
  min-height: 48vh;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: #777;
}

.content h1 {
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.35;
  letter-spacing: -0.04em;
  margin: 10px 0 32px;
}


/* ========================================
   도서 목록
======================================== */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 44px 28px;
}

.book-card {
  text-decoration: none;
}

.book-card img,
.no-cover {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f4f4f4;
}

.book-card h2 {
  font-size: 17px;
  margin: 14px 0 0;
}

.book-card p {
  margin: 0;
  color: #777;
  font-size: 14px;
}


/* ========================================
   도서 상세 페이지
======================================== */

.book-hero {
  display: grid;
  grid-template-columns: minmax(180px, 290px) 1fr;
  gap: 48px;
}

.book-hero .cover {
  display: block;
  width: 100%;
  height: auto;
}

.subtitle {
  font-size: 18px;
}


/* ========================================
   도서 정보
======================================== */

.book-detail dl {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px 16px;
  font-size: 14px;
  margin-top: 30px;
}

.book-detail dt {
  color: #777;
}

.book-detail dd {
  margin: 0;
}


/* ========================================
   구매 링크
======================================== */

.purchase {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0;
}

.purchase a {
  border: 1px solid #aaa;
  padding: 7px 14px;
  text-decoration: none;
  font-size: 13px;
}

.purchase a:hover {
  background: #171717;
  color: #fff;
}


/* ========================================
   본문
======================================== */

.prose {
  max-width: 720px;
  margin-top: 65px;
  line-height: 2;
  overflow-wrap: anywhere;
}

.prose h2 {
  margin-top: 52px;
  font-size: 23px;
}

.prose img {
  max-width: 100%;
  height: auto;
}


/* ========================================
   NOTES
======================================== */

.note-row {
  padding: 22px 0;
  border-bottom: 1px solid #ddd;
  text-decoration: none;

  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.note-row time,
.date {
  color: #777;
  font-size: 13px;
}


/* ========================================
   하단 푸터
======================================== */

.content-footer {
  border-top: 1px solid #ddd;
  max-width: 1040px;
  margin: 0 auto;
  padding: 25px 30px 45px;

  display: flex;
  justify-content: space-between;

  font-size: 12px;
}

.content-footer a {
  text-decoration: none;
}


/* ========================================
   모바일
======================================== */

@media (max-width: 640px) {

  /* 헤더 */

  .top {
    padding: 20px 22px;
    min-height: 100px;
    flex-wrap: nowrap;
  }

  /* 오리 */

  .top .duck-link {
    width: 38px;
    flex-basis: 38px;
  }

  /* 중앙 로고 */

  .top .wordmark {
    width: 38px;
  }

  /* 오른쪽 메뉴 */

  .top nav {
    gap: 10px;
  }

  .top nav a {
    font-size: 10px;
    letter-spacing: 0.03em;
  }

  /* 콘텐츠 */

  .content {
    margin: 46px auto 80px;
    padding: 0 22px;
  }

  /* 도서 상세 */

  .book-hero {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .book-hero .cover {
    max-width: 260px;
  }

  /* 도서 목록 */

  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 14px;
  }

}


/* ========================================
   작은 모바일 화면
======================================== */

@media (max-width: 380px) {

  .top {
    padding: 18px 14px;
  }

  .top .duck-link {
    width: 30px;
    flex-basis: 30px;
  }

  .top .wordmark {
    width: 30px;
  }

  .top nav {
    gap: 7px;
  }

  .top nav a {
    font-size: 9px;
    letter-spacing: 0;
  }

}


/* ========================================
   다크 모드
======================================== */

@media (prefers-color-scheme: dark) {

  body {
    background: #080808;
    color: #eee;
  }

  .top,
  .note-row,
  .content-footer {
    border-color: #444;
  }

  .eyebrow,
  .book-card p,
  .book-detail dt,
  .note-row time,
  .date {
    color: #aaa;
  }

  .book-card img,
  .no-cover {
    background: #222;
  }

  .purchase a:hover {
    background: #eee;
    color: #080808;
  }

}
/* 상단 왼쪽 오리 크기 조정 */
.top .duck-link {
  width: 36px;
  flex: 0 0 36px;
}

.top .duck-link img {
  width: 36px;
  height: auto;
}

@media (max-width: 640px) {
  .top .duck-link {
    width: 28px;
    flex-basis: 28px;
  }

  .top .duck-link img {
    width: 28px;
  }
}
/* ========================================
   도서 상세 콘텐츠
======================================== */

.book-section {
  margin-top: 64px;
}

.book-section > h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;

  margin: 0 0 24px;
  padding-bottom: 14px;

  border-bottom: 1px solid #ddd;
}

.book-section .prose {
  margin-top: 0;
  max-width: 720px;
}

.book-section .prose p {
  margin: 0 0 18px;
}

.book-section .prose ul,
.book-section .prose ol {
  padding-left: 22px;
}

@media (max-width: 640px) {
  .book-section {
    margin-top: 48px;
  }

  .book-section > h2 {
    font-size: 20px;
  }
}

@media (prefers-color-scheme: dark) {
  .book-section > h2 {
    border-color: #444;
  }
}
/* 도서 목록의 표지 이미지 크기 제한 */

.book-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 240px));
  justify-content: start;
}

.book-card img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}
/* BOOKS 목록 이미지 크기 조정 */

.content .book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 240px);
  gap: 44px 28px;
  justify-content: start;
}

.content .book-grid .book-card {
  display: block;
  width: 240px;
  max-width: 100%;
}

.content .book-grid .book-card img {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

@media (max-width: 640px) {
  .content .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 14px;
  }

  .content .book-grid .book-card {
    width: 100%;
  }

  .content .book-grid .book-card img {
    max-width: 100%;
  }
}
/* ========================================
   다크 모드 - 헤더 오리 색상 변경
======================================== */

@media (prefers-color-scheme: dark) {

  .top .duck-link img {
    filter: invert(1);
  }

}
