/* ==============================================
  ABCE Bookshop - 최종 커스텀 스타일 (그림자 적용)
==============================================
*/

/* --- 1. 폰트 및 기본 설정 --- */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500&display=swap');
@font-face { font-family: 'Normal Batang'; src: url('../fonts/NormalBatang-Regular.woff2') format('woff2'); font-display: swap; }
html, body { width: 100%; overflow-x: hidden; }
body { font-family: 'Normal Batang', serif; margin: 0; background-color: #fff; }
* { box-sizing: border-box; }

/* --- 2. 페이지 전체 레이아웃 --- */
#page { max-width: 90em; margin: 0 auto; padding: 0 2em; }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5em 0; }
.site-main { margin: 2em 0 5em; }
.site-footer { background-color: transparent; color: #555; padding: 2em 0; text-align: center; }

/* --- 3. 헤더 및 메뉴 --- */
.site-branding { order: 2; font-weight: bold; }
.main-navigation { order: 1; }
.site-title a { color: inherit; text-decoration: none; }
.main-navigation a { font-family: 'Rubik', sans-serif; color: #444; text-transform: uppercase; text-decoration: none; position: relative; padding: .5em .5em .5em 2em; }
.main-navigation a::before {
    content: ''; display: inline-block; width: .7em; height: .7em; position: absolute; left: .5em; top: 50%; transform: translateY(-50%); background-size: contain; background-repeat: no-repeat;
    background-image: url("data:image/svg+xml;utf8,<svg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='0.5' y='0.5' width='11' height='11' stroke='%23424242' fill='none'/></svg>");
}
.main-navigation .current-menu-item a::before,
.main-navigation a:hover::before {
    background-image: url("data:image/svg+xml;utf8,<svg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'><rect width='12' height='12' fill='%23424242'/></svg>");
}
.menu-toggle { display: none; }

/* --- 4. 책 목록 레이아웃 --- */
.books__blurb {
    font-size: 1.5em;
    line-height: 1.6;
    margin-bottom: 3em; /* 아래쪽 여백만 남김 */
    max-width: 100%; /* 너비를 100%로 설정하여 왼쪽 정렬의 기준을 맞춤 */
    text-align: left; /* 텍스트 좌측 정렬 */
}
.books__filter { margin-bottom: 3em; }
.books__filter input { border: 1px solid #ccc; padding: .8em; width: 100%; font-size: 1em; }
.books__section { display: flex; gap: 1em; margin-bottom: 1em; }
.books__year { font-family: "Rubik", sans-serif; font-weight: normal; flex: 0 0 6rem; position: sticky; top: 1em; align-self: flex-start; }
.books__list {
    flex: 1;
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, 240px);
/* --- 본문 링크 스타일 (밑줄 제거 및 호버 효과) --- */

/* 기본 링크 스타일: 밑줄 제거 */
main a {
  color: #333; /* 링크의 기본 텍스트 색상 */
  text-decoration: none; /* 밑줄을 완전히 제거합니다. */
  transition: color 0.2s ease; /* 색상 변경 시 0.2초 동안 부드럽게 전환되도록 설정 */
}

/* 링크에 마우스를 올렸을 때 스타일: 색상 변경 */
main a:hover {
  color: #888; /* 마우스를 올렸을 때 글자 색상을 회색으로 변경 */
}

/* --- 5. 책 카드 아이템 (그림자 추가) --- */
.books__item { background-color: #f0f0f0; display: flex; }
.books__item a { display: flex; flex-direction: column; width: 100%; padding: 1.2em; }
/* 카드 내 이미지 영역 (원본 비율 유지) */
.books__image {
    width: 100%;
    /* aspect-ratio 속성을 제거하여 비율 고정을 해제합니다. */
    background-color: #e0e0e0;
    margin-bottom: 1em;
}
.books__image img {
    width: 100%;
    height: auto; /* 이미지의 원본 비율에 맞춰 높이가 자동으로 조절됩니다. */
    display: block; /* 이미지 하단의 불필요한 여백을 제거합니다. */
    box-shadow: 4px 4px 4px rgba(0,0,0,.2);
    transition: transform 0.3s ease-in-out;
}
.books__details { text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.books__title { font-weight: normal; color: #333; min-height: 2.8em; overflow: hidden; }

/* --- 6. 모바일 레이아웃 --- */
@media (max-width: 767px) {
    .menu-toggle { display: block; }
    .main-navigation ul#primary-menu { display: none; }
    .main-navigation.toggled ul#primary-menu { display: block; }
    .books__section { flex-direction: column; }
    .books__year { position: static; }
    .books__list { justify-content: initial; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .books__list { justify-content: initial; } /* 모바일에서도 좌측 정렬 */
}
}

/* ==============================================
  모바일 메뉴 항상 펼치기 (토글 없이)
==============================================
*/

/* 모바일용 메뉴 토글 버튼을 항상 숨깁니다. */
.menu-toggle {
    display: none !important;
}

/* PC와 모바일 모두에서 네비게이션 메뉴가 항상 보이도록 설정합니다. */
.main-navigation {
    display: block !important;
    width: auto !important;
}

/* 메뉴 항목들이 가로로 정렬되도록 합니다. */
.main-navigation ul#primary-menu {
    display: flex !important; /* 항상 flexbox로 표시하여 가로 정렬 */
    flex-wrap: wrap; /* 공간이 부족하면 아래 줄로 자연스럽게 이동 */
}