/* ============================================================
   EASTAR e-Book — Apple 스타일 라이트 테마 (공통)
   ============================================================ */
:root {
  --red: #d12149;          /* 로고 레드 */
  --red-dark: #b01a3c;
  --bg: #ffffff;
  --bg-soft: #f5f5f7;      /* Apple 섹션 그레이 */
  --bg-soft2: #fafafc;
  --text: #1d1d1f;         /* Apple 본문 블랙 */
  --muted: #6e6e73;        /* Apple 보조 그레이 */
  --line: rgba(0, 0, 0, .10);
  --card: #ffffff;
  --shadow: 0 4px 22px rgba(0, 0, 0, .08);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, .14);
  --radius: 18px;
  --radius-lg: 28px;
  --nav-h: 52px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Pretendard", "Apple SD Gothic Neo", "맑은 고딕", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -.01em;
}
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- 상단 내비게이션 (Apple 프로스티드 바) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  height: var(--nav-h); padding: 0 22px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand-logo { height: 24px; width: auto; display: block; }
.brand-divider { width: 1px; height: 18px; background: var(--line); }
.brand-title { font-size: 15px; font-weight: 600; letter-spacing: -.2px; color: var(--text); }
.brand .sub { color: var(--muted); font-weight: 500; font-size: 13px; }
.topbar .spacer { flex: 1; }
.bar-logo { height: 22px; width: auto; }

/* 상단 네비게이션 (E-Books / Eastar SHOP 탭) */
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav-link {
  display: inline-flex; align-items: center;
  padding: 7px 14px; border-radius: 980px;
  font-size: 15px; font-weight: 600; letter-spacing: -.2px;
  color: var(--muted); transition: background .15s, color .15s;
}
.topnav-link:hover { background: var(--bg-soft); color: var(--text); }
.topnav-link.active { color: var(--text); background: var(--bg-soft); }

/* 버튼 공통 (Apple pill) */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid transparent; border-radius: 980px;
  padding: 9px 16px; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
  font-family: var(--font); letter-spacing: -.01em;
}
.btn:hover { background: #ececef; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.primary { background: var(--red); border-color: transparent; color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.icon-btn {
  width: 44px; height: 44px; padding: 0; justify-content: center; font-size: 17px;   /* 44px — 모바일 터치 타깃 권장 크기 */
  background: var(--bg-soft); border-radius: 50%;
}
.icon-btn:hover { background: #ececef; }

/* ============================================================
   로딩 스플래시 (진입 시 3초)
   ============================================================ */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: #05070c; overflow: hidden;
  transition: opacity .6s ease, visibility .6s ease;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-bg { position: absolute; inset: 0; }
.splash-img {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.08); transition: opacity .8s ease, transform 4s ease;
}
.splash-img.on { opacity: 1; transform: scale(1); }
.splash-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, .5), rgba(5, 7, 12, .85)),
    radial-gradient(70% 70% at 50% 42%, rgba(5, 7, 12, .12), rgba(5, 7, 12, .55));
}
.splash-inner { position: relative; z-index: 2; text-align: center; animation: splashUp .8s ease both; }
@keyframes splashUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.splash-logo {
  height: 34px; width: auto; display: block; margin: 0 auto;
  background: #fff; padding: 16px 22px; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}
.splash-title {
  margin-top: 20px; color: rgba(255, 255, 255, .92);
  font-size: 18px; font-weight: 600; letter-spacing: 2px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}
.splash-title .t-mobile { display: none; }   /* 모바일에서만 표시(EASTARJET) */
.splash-bar { margin: 26px auto 0; width: 180px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 0; background: #fff; transition: width linear; }
.splash-skip {
  position: absolute; z-index: 3; right: 18px; bottom: 18px;
  background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 980px;
  padding: 8px 16px; font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: var(--font); backdrop-filter: blur(4px); transition: .15s;
}
.splash-skip:hover { background: rgba(255, 255, 255, .26); color: #fff; }

/* E-Shop 진입 스플래시 — 판매 상품 2x2 4분할 (E-Books 단일 사진 스플래시와 구분) */
.shop-splash-grid {
  position: absolute; inset: 0; display: grid;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 4px; background: #05070c;
}
.shop-splash-cell {
  position: relative; overflow: hidden; background: #14141c;
  opacity: 0; transform: scale(1.06);
  animation: shopSplashIn .7s cubic-bezier(.16, 1, .3, 1) forwards;
}
.shop-splash-cell:nth-child(1) { animation-delay: 0s; }
.shop-splash-cell:nth-child(2) { animation-delay: .09s; }
.shop-splash-cell:nth-child(3) { animation-delay: .18s; }
.shop-splash-cell:nth-child(4) { animation-delay: .27s; }
/* 사진이 잘리지 않도록 전체를 담아서 표시(여백은 어두운 갤러리 톤) */
.shop-splash-cell img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 14px; box-sizing: border-box; }
@keyframes shopSplashIn { to { opacity: 1; transform: scale(1); } }
/* 상품이 잘 보이도록 E-Books보다 옅은 스크림 */
.shop-splash-scrim {
  background: linear-gradient(180deg, rgba(5, 7, 12, .26), rgba(5, 7, 12, .52));
}
.shop-splash .splash-title { letter-spacing: 3px; }
/* 모바일: 세로 3분할 — 사진은 화면을 가득 채우고(이전 사이즈), 하단 띠 중앙에 EASTAR SHOP/게이지바
   라벨은 사진 가로폭 정도로 축소 */
@media (max-width: 640px) {
  .shop-splash-grid { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr 1fr; bottom: 92px; }
  .shop-splash-cell:nth-child(n+4) { display: none; }
  .splash.shop-splash { align-items: flex-end; padding-bottom: 36px; }
  .shop-splash .splash-title { font-size: 13px; letter-spacing: 1.5px; }
  .shop-splash .splash-bar { width: 52px; }
}

/* ============================================================
   메인 — 히어로 + 카테고리 (Apple bento)
   ============================================================ */
.cat-grid {
  position: relative;   /* 정중앙 별 장식(.cat-grid-star)의 기준 */
  max-width: 1180px; margin: 40px auto 90px; padding: 0 22px;   /* Shop·홈페이지 본문과 같은 폭 */
  display: grid; grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);   /* 두 행 높이 균등 — 별 장식이 항상 교차점에 놓이게 */
  gap: 24px;
}
/* 2×2 정중앙의 별 장식 — 이스타항공의 별 상징. +(정방향) 4갈래가 카드 사이 간격에 놓여 네 칸을 구분한다 */
.cat-grid-star {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 5; pointer-events: none;
}
/* 카드가 정확히 4장(2×2)일 때만 별을 표시 — 카테고리 추가/DB 장애로 개수가 달라지면 교차점이 어긋나므로 숨김 */
.cat-grid:not([data-count="4"]) .cat-grid-star { display: none; }
.cat-grid-star svg { display: block; }
.cat-card {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--bg-soft);
  color: var(--text); box-shadow: var(--shadow);
  transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s;
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.cat-card .cat-body { position: relative; z-index: 2; text-align: center; padding: 30px 22px 22px; }
.cat-card h2 { margin: 0 0 8px; font-size: 23px; font-weight: 700; letter-spacing: -.012em; line-height: 1.2; }
.cat-card .cat-body p {
  margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-card .cat-go { color: var(--red); font-size: 15px; font-weight: 500; }
.cat-card .cat-cover {
  position: relative; width: 100%; margin-top: auto;
  /* 1180px 광폭 그리드에선 1/1.3(세로형)이면 카드가 900px 가까이 커짐 → 1/0.9로 낮춰 균형 */
  aspect-ratio: 1 / 0.9; overflow: hidden; background: #fff;
}
/* 표지는 잘리지 않게 전체를 표시(contain). 남는 여백은 흰 배경으로 채워 액자처럼 보이게. */
.cat-card .cat-cover img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; transition: transform .5s ease; }
.cat-card:hover .cat-cover img { transform: scale(1.05); }
/* 사진형 표지(ESG 등): 표지 칸 크기는 다른 카테고리와 동일하게 두고, 가로 사진을
   잘리지 않게 위쪽에 붙여 전체 표시 → 아래에 생기는 여백에 주제 제목을 넣는다. */
.cat-card--photo .cat-cover img { object-fit: contain; object-position: center; }
.cat-card .cat-cover-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 36px 16px 16px; text-align: center; pointer-events: none;
  background: linear-gradient(to top, rgba(255, 255, 255, .98) 58%, rgba(255, 255, 255, 0));
}
.cat-card .cap-topic { color: #1c1c21; font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.012em; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cat-card .cap-group { color: var(--red); font-size: 13px; font-weight: 700; letter-spacing: .005em; }
.cat-count {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  background: rgba(255, 255, 255, .92); color: var(--text);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 980px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
/* 카테고리 카드 테두리 색은 사용하지 않음 — 중앙 별 장식(.cat-grid-star)만으로 네 칸을 구분 */

/* ----- 카테고리 상세 (간행물 목록) ----- */
.cat-detail { max-width: 1100px; margin: 24px auto 90px; padding: 0 22px; }
.back-btn {
  background: var(--bg-soft); color: var(--text);
  border: 1px solid transparent; border-radius: 980px;
  /* 상단 탭(topnav-link)과 같은 서체 톤 — 'Home' 표기가 어디서든 동일한 굵기로 보이게 */
  padding: 9px 18px; font-size: 15px; font-weight: 600; letter-spacing: -.2px; cursor: pointer;
  font-family: var(--font); transition: background .2s;
}
.back-btn:hover { background: #ececef; }
.cat-detail-head { margin: 26px 0 30px; text-align: center; }
.cat-detail-head h2 { margin: 0 0 8px; font-size: 36px; font-weight: 700; letter-spacing: -.018em; }
.cat-detail-head p { margin: 0; color: var(--muted); font-size: 17px; }
.cat-detail .shelf { max-width: none; margin: 0; padding: 0; }

/* 간행물 카드 그리드 */
.shelf {
  max-width: 1100px; margin: 28px auto 80px; padding: 0 22px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 40px 30px;
}
.book-card { cursor: pointer; transition: transform .25s ease; min-width: 0; text-align: center; }
.book-card:hover { transform: translateY(-6px); }
.book-card .cover-wrap {
  position: relative; aspect-ratio: 1 / 1.414; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); background: #fff; border: 1px solid var(--line);
  transition: box-shadow .25s ease;
}
.book-card:hover .cover-wrap { box-shadow: var(--shadow-lg); }
.book-card .cover-wrap img { width: 100%; height: 100%; object-fit: contain; }
.book-card .badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(255, 255, 255, .9); color: var(--text); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 980px; backdrop-filter: blur(4px);
}
.book-card .badge-type { left: auto; right: 10px; background: var(--red); color: #fff; letter-spacing: .3px; }
.book-card .badge-new { background: #ffb300; color: #2b1d00; letter-spacing: .5px; }

/* ---------- 공지 배너 (메인 상단 — books.js NOTICE) ---------- */
.notice-banner {
  display: flex; align-items: center; gap: 10px;
  max-width: 980px; margin: 70px auto -52px; padding: 11px 16px;
  background: #fff8e8; border: 1px solid #f0dcae; border-radius: 12px;
  font-size: 14px; line-height: 1.5; color: #5b4a17; position: relative; z-index: 5;
}
.notice-banner .notice-ico { flex: none; }
.notice-banner span { min-width: 0; }
.notice-banner a { color: var(--red); font-weight: 600; white-space: nowrap; }
.notice-banner button {
  flex: none; margin-left: auto; border: none; background: none; cursor: pointer;
  color: #6b5d33; font-size: 14px; padding: 4px 6px; border-radius: 8px;   /* #6b5d33 — 배경 대비 4.5:1 이상 확보 */
}
.notice-banner button:hover { background: rgba(0, 0, 0, .05); }
@media (max-width: 640px) { .notice-banner { margin: 62px 14px -36px; font-size: 13px; } }
.book-card h3 { margin: 18px 4px 5px; font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card .meta { margin: 0 4px; color: var(--muted); font-size: 14px; }
/* 모바일 웹툰형 목록에서만 쓰는 우측 화살표 — PC(3열 그리드)에선 숨김 */
.book-card .book-chevron { display: none; }

.empty-state { max-width: 560px; margin: 80px auto; text-align: center; color: var(--muted); line-height: 1.8; font-size: 16px; }
.empty-state h2 { color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.empty-state code { color: var(--text); background: var(--bg-soft); padding: 2px 7px; border-radius: 6px; }

/* ============================================================
   Eastar SHOP — 쇼핑몰형 스토어프론트 (shop.html)
   ============================================================ */
.shop-body { background: var(--bg-soft); }

/* 커머스 상단바 */
.shop-top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.shop-top-inner {
  max-width: 1180px; margin: 0 auto; height: var(--nav-h);
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
}
.shop-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 980px;
  padding: 7px 14px; width: 220px; transition: width .2s, box-shadow .15s;
}
.shop-search:focus-within { box-shadow: 0 0 0 3px rgba(209, 33, 73, .12); border-color: var(--red); }
.shop-search-ico { font-size: 13px; opacity: .6; }
.shop-search input { border: none; background: none; outline: none; font: inherit; font-size: 14px; width: 100%; color: var(--text); }

/* 히어로 배너 */
.shop-hero {
  position: relative; max-width: 1180px; margin: 18px auto 0; padding: 0 22px;
}
.shop-hero-bg, .shop-hero-scrim, .shop-hero-text { border-radius: 22px; }
.shop-hero { height: 300px; }
.shop-hero-bg {
  position: absolute; inset: 0 22px; background-size: cover; background-position: center;
  background-color: #1a1a22; transition: opacity .9s ease;
}
/* 밝은 사진 위에서도 흰 문구 대비(4.5:1)가 유지되도록 스크림을 문구 폭(왼쪽 절반)까지 충분히 어둡게 */
.shop-hero-scrim { position: absolute; inset: 0 22px; background: linear-gradient(90deg, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, .35) 55%, rgba(0, 0, 0, .08) 100%); }
.shop-hero.no-img .shop-hero-bg { background: linear-gradient(120deg, #d12149, #7a1330); }
.shop-hero.no-img .shop-hero-scrim { display: none; }
.shop-hero-text { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0 48px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.shop-hero-kicker { font-size: 13px; font-weight: 700; letter-spacing: 2px; opacity: .9; }
.shop-hero-text h1 { margin: 8px 0 6px; font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.shop-hero-text p { margin: 0; font-size: 16px; opacity: .92; max-width: 460px; }
.shop-hero-btn { display: inline-flex; align-items: center; align-self: flex-start; margin-top: 18px; padding: 11px 20px; border-radius: 980px; background: #fff; color: #111; font-weight: 600; font-size: 14px; }
.shop-hero-btn:hover { background: rgba(255, 255, 255, .9); }
/* 메인(E-Books) 히어로 배너 — Shop 배너·카테고리 그리드와 같은 1180px 폭 */
.eb-hero { max-width: 1180px; }
/* 배너 클릭 영역 — 현재 표시 중인 홈페이지 이벤트의 상세 페이지로 이동(js가 href 갱신) */
.eb-hero-link { position: absolute; inset: 0 22px; z-index: 3; border-radius: 22px; }

/* 카테고리 칩 */
.shop-cats { max-width: 1180px; margin: 22px auto 4px; padding: 0 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.shop-chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 980px; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.shop-chip:hover { border-color: var(--red); color: var(--red); }
.shop-chip.active { background: var(--red); color: #fff; border-color: var(--red); }

/* 상품 그리드 */
.shop-grid {
  max-width: 1180px; margin: 18px auto 0; padding: 0 22px 20px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px;
}
.product-card {
  display: flex; flex-direction: column; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.product-card.is-sold { opacity: .78; }
.p-img { position: relative; aspect-ratio: 1 / 1; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.p-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card.is-sold .p-img img, .pd-img.is-sold img { filter: grayscale(.65); }
.p-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.p-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 4px 9px; border-radius: 980px; box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.p-badge.p-sold { background: #555; }
.p-info { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.p-cat { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.p-brand { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: -.2px; margin-top: -3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-name { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.2px; word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; }
.p-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-price { display: flex; align-items: baseline; gap: 7px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.p-off { color: var(--red); font-size: 14px; font-weight: 800; }
.p-orig { color: var(--muted); font-size: 13px; text-decoration: line-through; }
.p-now { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.p-buy {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 12px 20px; border-radius: 980px;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: filter .15s;
}
.p-buy:hover { filter: brightness(1.08); }
.p-buy.disabled { background: var(--bg-soft); color: var(--muted); cursor: default; pointer-events: none; }
.shop-empty { max-width: 1180px; margin: 30px auto; padding: 60px 22px; text-align: center; color: var(--muted); }
.shop-empty h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: var(--text); }
.shop-empty p { margin: 0; font-size: 14.5px; }

/* 상품 상세 모달 */
.pd-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.pd-modal {
  position: relative; background: var(--bg); border-radius: 20px; overflow: hidden;
  width: 100%; max-width: 860px; max-height: 90vh; display: grid; grid-template-columns: 1fr 1fr;
  box-shadow: var(--shadow-lg);
}
.pd-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .9); cursor: pointer; font-size: 16px; box-shadow: var(--shadow); }
.pd-img { background: var(--bg-soft); aspect-ratio: 1 / 1; }
.pd-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { padding: 30px 30px 28px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.pd-cat { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pd-brand { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: -.2px; margin-top: -4px; word-break: keep-all; overflow-wrap: anywhere; }
.pd-name { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.02em; word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; }
.pd-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pd-price .p-now { font-size: 24px; }
.pd-detail { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 4px 0; flex: 1; word-break: keep-all; overflow-wrap: anywhere; }
.pd-actions { margin-top: 8px; }
.pd-actions .p-buy { width: 100%; }

@media (max-width: 1000px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 380px) { .p-brand { font-size: 11px; } }   /* 10px는 판독 곤란 — 넘치는 이름은 ellipsis가 처리 */
@media (max-width: 720px) { .pd-modal { grid-template-columns: 1fr; max-height: 88vh; overflow-y: auto; } .pd-img { aspect-ratio: 4 / 3; } .pd-img img { object-fit: contain; padding: 14px; box-sizing: border-box; } }
@media (max-width: 640px) {
  .shop-top-inner { gap: 10px; padding: 0 14px; }
  .shop-search { width: 44px; padding: 7px 11px; }
  .shop-search:focus-within { width: 160px; }
  .shop-hero { height: 200px; padding: 0 14px; }
  .shop-hero-bg, .shop-hero-scrim, .eb-hero-link { inset: 0 14px; }
  .shop-hero-text { padding: 0 26px; }
  .shop-hero-text h1 { font-size: 24px; }
  .shop-hero-text p { font-size: 14px; }
  .shop-cats { padding: 0 14px; gap: 8px; }
  .shop-chip { padding: 8px 14px; font-size: 13px; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 0 14px 16px; }
  .p-name { font-size: 14px; line-height: 1.4; }
  .p-now { font-size: 17px; }
}

footer.site {
  max-width: 1100px; margin: 0 auto; padding: 30px 22px 50px;
  color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); text-align: center;
}
footer.site .admin-link { color: var(--muted); opacity: .45; margin-left: 8px; }
footer.site .admin-link:hover { opacity: 1; color: var(--red); }

/* ============================================================
   웹진 플립북 (flip.html) — 표지 랜딩 + 미리보기
   ============================================================ */
.wz-landing { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.wz-hero {
  max-width: 1000px; width: 100%; margin: 0 auto; padding: 56px 22px 36px;
  display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 48px; align-items: center;
}
.wz-cover {
  position: relative; aspect-ratio: 1 / 1.414; border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: #fff;
}
.wz-cover img { width: 100%; height: 100%; object-fit: cover; }
.wz-cover .play-btn {
  position: absolute; inset: 0; margin: auto; width: 66px; height: 66px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .9); color: var(--red); border: none; border-radius: 50%;
  font-size: 24px; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: transform .15s, background .15s; backdrop-filter: blur(4px);
}
.wz-cover .play-btn:hover { transform: scale(1.08); background: #fff; }
.wz-info h1 { margin: 0 0 12px; font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; word-break: keep-all; overflow-wrap: anywhere; }   /* 단어 중간 줄바꿈 방지 */
.wz-info .sub { color: var(--muted); font-size: 18px; margin: 0 0 26px; }
.wz-info .btn.primary { font-size: 16px; padding: 13px 24px; }
.wz-info .hint { margin-top: 16px; color: var(--muted); font-size: 14px; }
.wz-info .alt-link { display: inline-block; margin-top: 20px; color: var(--red); font-size: 14px; font-weight: 500; }
.wz-info .alt-link:hover { text-decoration: underline; }

.wz-spreads-head {
  max-width: 1000px; width: 100%; margin: 18px auto 0; padding: 0 22px;
  color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .3px;
}
.wz-spreads {
  max-width: 1000px; width: 100%; margin: 16px auto 70px; padding: 0 22px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px;
}
.wz-thumb { padding: 0; border: none; background: none; cursor: pointer; font-family: var(--font); }
.wz-thumb-img {
  position: relative; aspect-ratio: 1 / 1.414; border-radius: 8px; overflow: hidden;
  background: var(--bg-soft) center/cover no-repeat; border: 1px solid var(--line);
  display: flex; align-items: flex-end; justify-content: center;
  transition: box-shadow .15s, transform .15s;
}
.wz-thumb:hover .wz-thumb-img { box-shadow: var(--shadow); transform: translateY(-3px); }
.wz-thumb-img span { font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, .92); width: 100%; text-align: center; padding: 2px 0; }
.wz-thumb-img.loaded span { color: var(--text); }

/* 플립 오버레이 */
#flipView { position: fixed; inset: 0; z-index: 90; background: var(--bg-soft); display: flex; flex-direction: column; }
#flipView[hidden] { display: none; }
.page-skel {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #aeb3bb; font-size: 14px; background: #fff;
}
#book .page .pimg { position: relative; z-index: 1; }
#book .page.ready .page-skel { display: none; }

@media (max-width: 760px) {
  .wz-hero { grid-template-columns: 1fr; gap: 24px; padding: 30px 18px 22px; text-align: center; }
  .wz-cover { max-width: 230px; margin: 0 auto; }
  .wz-info h1 { font-size: 28px; }
  .wz-spreads { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 11px; }
}

/* ============================================================
   뷰어 (viewer.html / flip.html 플립 모드)
   ============================================================ */
body.viewer { overflow: hidden; height: 100vh; height: 100dvh; background: var(--bg-soft); }
.viewer-wrap { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.v-top { gap: 12px; }
.v-top .title { font-weight: 600; font-size: 15px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }

#stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 22px; overflow: hidden; }
#book { box-shadow: var(--shadow-lg); }
#book .page { background: #fff; overflow: hidden; }
#book .page img { width: 100%; height: 100%; object-fit: cover; }

.v-bottom {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  height: 66px; padding: 0 16px;
  background: rgba(255, 255, 255, .82); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.v-bottom input[type=range] { width: min(40vw, 320px); accent-color: var(--red); }
#pageInfo { min-width: 78px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* 사이드 패널 */
.side {
  position: fixed; top: 0; right: 0; bottom: 0; width: 320px; max-width: 86vw; z-index: 80;
  background: var(--bg); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.side.open { transform: translateX(0); }
.side .side-head { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.side .tabs { display: flex; gap: 6px; }
.side .tab { padding: 7px 14px; border-radius: 980px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.side .tab.active { background: var(--red); color: #fff; }
.side .side-body { flex: 1; overflow-y: auto; padding: 14px; }
.thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.thumb { cursor: pointer; border-radius: 8px; overflow: hidden; border: 2px solid transparent; }
.thumb.active { border-color: var(--red); }
.thumb img { width: 100%; aspect-ratio: 1/1.414; object-fit: cover; }
.thumb span { display: block; text-align: center; font-size: 12px; color: var(--muted); padding: 3px 0; }
/* 썸네일·목차·탭이 button 요소여도 기존 디자인이 유지되도록 초기화 */
button.thumb { width: 100%; padding: 0; background: none; font-family: var(--font); display: block; }
button.toc-item { width: 100%; border: none; background: none; font-family: var(--font); color: inherit; text-align: left; }
.side .tab { border: none; background: none; font-family: var(--font); }
.toc-item { padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.toc-item:hover { background: var(--bg-soft); }
.toc-item .pg { color: var(--muted); font-size: 12.5px; }

.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.show { opacity: 1; pointer-events: auto; }
/* flip 뷰어의 읽기 화면(#flipView, z-index 90)보다 위에 와야 페이지 목록 패널·배경막이 보인다 */
.flipbook .side { z-index: 95; }
.flipbook .scrim { z-index: 92; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, .85); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 단면/펼침 토글 (segmented control) */
.seg { display: inline-flex; background: var(--bg-soft); border-radius: 980px; padding: 3px; gap: 2px; }
.seg button {
  border: none; background: none; font-family: var(--font); font-size: 13px; font-weight: 500;
  color: var(--muted); padding: 6px 14px; border-radius: 980px; cursor: pointer; transition: .15s;
  white-space: nowrap; line-height: 1;
}
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }

/* 페이지 단위 표시 영역 (flip.html 읽기 모드 — transform 확대/이동) */
.flipbook #stage { display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; touch-action: none; }
.flipbook #stage.zoomed { cursor: grab; }
#stage .pages {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex: 0 0 auto; transform-origin: center center; will-change: transform;
}

/* 스크롤(연속/웹툰) 모드 — 확대 시 좌/우 포함 자유 패닝 (드래그는 JS가 처리) */
.flipbook #stage.scroll-mode { display: block; overflow: auto; touch-action: none; cursor: default; -webkit-overflow-scrolling: touch; }
/* 페이지가 화면보다 넓어지면 가로 스크롤 영역을 만들어 줌
   (.pages 에 직접 margin:auto 만 주면 넘친 왼쪽이 스크롤로 닿지 않는 영역이 됨) */
/* transform 은 !important 금지 — 핀치 줌 미리보기가 인라인 transform 으로 동작 (renderScroll 이 none 으로 초기화) */
.flipbook #stage.scroll-mode .pages { transform: none; display: block; width: max-content !important; min-width: 100%; box-sizing: border-box; margin: 0 auto; height: auto !important; padding: 10px 12px 40px; will-change: auto; }
.spage { position: relative; margin: 0 auto 8px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.spage .pimg { width: 100%; height: 100%; object-fit: contain; display: block; -webkit-user-drag: none; user-select: none; }
.spage.ready .page-skel { display: none; }
.rpage {
  position: relative; background: #fff; box-shadow: var(--shadow-lg);
  overflow: hidden; border-radius: 3px; flex: 0 0 auto;
}
.rpage .pimg { width: 100%; height: 100%; object-fit: contain; display: block; position: relative; z-index: 1; background: #fff; }
.rpage.ready .page-skel { display: none; }

/* ---------- 모바일 ---------- */
@media (max-width: 640px) {
  /* ----- 메인 카테고리: PDF 선택창처럼 가로 행(썸네일 · 제목/설명 · N종 · ›) ----- */
  .cat-grid { grid-template-columns: 1fr; grid-template-rows: none; gap: 0; margin: 18px auto 60px; padding: 0 14px; }
  .cat-card {
    display: flex; flex-direction: row; align-items: center; gap: 14px;
    min-width: 0;   /* 그리드 아이템 기본 min-width:auto 로 nowrap 제목이 카드를 밀어 가로 스크롤이 생기는 것 방지 */
    min-height: 0; padding: 13px 4px; overflow: visible;
    background: transparent; border-radius: 0; box-shadow: none;
    border-bottom: 1px solid var(--line);
    transition: background .15s ease;
  }
  .cat-card:hover { transform: none; background: var(--bg-soft); box-shadow: none; }
  /* 모바일 목록형에선 중앙 별 장식을 숨긴다 (썸네일 테두리는 공통 1px 라인) */
  .cat-grid-star { display: none; }
  .cat-card .cat-cover {
    order: -1; width: 66px; flex: none; margin-top: 0;
    aspect-ratio: 1 / 1.414; border-radius: 8px;
    border: 1px solid var(--line); background: #fff;
  }
  /* PDF 목록 썸네일과 동일하게 표지 전체를 보여줌 */
  .cat-card .cat-cover img { object-fit: cover; object-position: center; }
  .cat-card .cat-cover-cap { display: none; }   /* 작은 썸네일엔 제목 오버레이 생략(옆에 제목 텍스트가 있음) */
  .cat-card .cat-body { flex: 1; min-width: 0; text-align: left; padding: 0; }
  .cat-card h2 {
    margin: 0 0 4px; font-size: 16px; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cat-card .cat-body p {
    margin: 0; font-size: 13px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cat-card .cat-go { display: none; }
  .cat-card .cat-count {
    position: static; order: 2; flex: none; top: auto; right: auto;
    box-shadow: none; background: var(--bg-soft);
    font-size: 12px; padding: 3px 9px;
  }
  .cat-card::after {
    content: '›'; order: 3; flex: none;
    color: var(--muted); font-size: 22px; line-height: 1; padding-right: 2px;
  }
  .cat-detail-head h2 { font-size: 27px; }

  /* ----- 간행물 목록: 네이버 웹툰형 가로 행(표지 · 제목 · 발행일) ----- */
  /* (.shelf 는 JS가 인라인 display:grid 로 켜므로 1열 그리드로 유지) */
  .shelf { grid-template-columns: 1fr; gap: 0; padding: 0 14px; margin: 18px auto 60px; }
  .book-card {
    display: flex; align-items: center; gap: 14px;
    text-align: left; padding: 13px 4px;
    border-bottom: 1px solid var(--line);
    transition: background .15s ease;
  }
  .book-card:hover { transform: none; background: var(--bg-soft); }
  .book-card .cover-wrap {
    width: 66px; flex: none; border-radius: 8px;
  }
  /* 작은 썸네일에선 뱃지를 컴팩트하게 (9px는 한글 판독 한계 이하 → 10px 유지) */
  .book-card .badge { top: 5px; left: 5px; font-size: 10px; padding: 2px 7px; }
  .book-card .badge-type { left: auto; right: 5px; }
  .book-info { flex: 1; min-width: 0; }
  .book-card h3 {
    margin: 0 0 5px; font-size: 16px; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .book-card .meta { margin: 0; font-size: 13px; }
  .book-card .book-chevron {
    display: block; flex: none; color: var(--muted);
    font-size: 22px; line-height: 1; padding-right: 4px;
  }
  /* 세로 화면에선 가로로 긴 비행기 사진의 좌우가 잘리지 않도록 전체를 보여줌 */
  .splash-img { background-size: contain; background-repeat: no-repeat; }
  /* 스플래시 문구를 사진 아래 여백으로 내리고, 로고는 숨기고, 로딩바를 문구 옆에 가로 배치 */
  .splash { align-items: flex-end; padding-bottom: 30vh; }
  .splash-inner { display: flex; align-items: center; justify-content: center; gap: 14px; }
  .splash-logo { display: none; }
  .splash-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: 2px; }
  .splash-title .t-desktop { display: none; }
  .splash-title .t-mobile { display: inline; }
  .splash-bar { margin: 0; width: 86px; }
  .v-top .title { max-width: 36vw; }
  /* 읽기 모드 상단 바: 좁은 화면에선 로고·제목 숨기고 컴팩트하게 */
  #flipView .v-top { gap: 8px; padding: 0 12px; }
  #flipView .v-top .bar-logo, #flipView .v-top .title { display: none; }
  #flipView .v-top .icon-btn { width: 36px; height: 36px; font-size: 16px; }
  /* 좁은 화면: 핀치·더블탭·「화면 맞춤」으로 대체되는 버튼은 숨겨 상단바 넘침 방지 */
  #flipView .v-top #zoomIn, #flipView .v-top #zoomOut, #flipView .v-top #fsBtn { display: none; }
  #flipView .seg button { padding: 6px 12px; }
  .v-bottom { gap: 8px; }
  .v-bottom input[type=range] { width: 42vw; }
  #stage { padding: 10px; }
  .brand .sub { display: none; }
  .brand-title, .brand-divider { display: none; }
  /* 메인 상단 탭: 좁은 화면에선 부제(— 이스타항공의 모든 이야기)를 숨기고 'STAR ON AIR'만 표시.
     혹시 남는 초과분은 말줄임 처리 (shop 상단바는 .shop-top이라 영향 없음) */
  .topnav-sub { display: none; }
  .topbar .topnav { min-width: 0; flex: 1; }
  .topbar .topnav-link { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ============================================================
   다크 모드 — 시스템 설정(prefers-color-scheme) 자동 적용
   (책 페이지·표지 자체는 원본 색 유지, UI 크롬만 어둡게)
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0c0c10;
    --bg-soft: #1c1c21;
    --bg-soft2: #141418;
    --text: #f5f5f7;
    --muted: #a1a1a8;
    --line: rgba(255, 255, 255, .14);
    --card: #1c1c21;
    --shadow: 0 4px 22px rgba(0, 0, 0, .5);
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, .65);
  }
  .topbar { background: rgba(18, 18, 22, .72); }
  .btn:hover, .icon-btn:hover, .back-btn:hover { background: #2a2a31; }
  .seg button.active { background: #3a3a42; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
  .v-bottom { background: rgba(18, 18, 22, .82); }
  .cat-count { background: rgba(28, 28, 33, .92); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
  .book-card .badge:not(.badge-type) { background: rgba(28, 28, 33, .9); }
  .wz-thumb-img span { background: rgba(20, 20, 24, .85); }
  .wz-thumb-img.loaded span { color: var(--text); }
}

/* 표지 이미지 로드 실패 시 로고 폴백 — 깨진 이미지 아이콘 대신 옅은 로고 표시 */
.img-fallback { object-fit: contain !important; padding: 22%; opacity: .35; background: #f4f5f7; }

/* ---------- 접근성 공통 ---------- */
/* 화면에는 숨기고 스크린리더에만 읽히는 텍스트 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* 본문 바로가기 — 키보드 포커스 시에만 화면에 나타남 */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--red); color: #fff; padding: 10px 16px;
  border-radius: 0 0 10px 10px; font-weight: 600; font-size: 14px;
  transition: top .15s;
}
.skip-link:focus { top: 0; }
/* 키보드 포커스 표시 — 마우스 클릭에는 나타나지 않음(:focus-visible) */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, input:focus-visible {
  outline: 2px solid var(--red); outline-offset: 2px;
}

/* 시스템 '동작 줄이기' 설정 존중 — 큰 전환/애니메이션 최소화 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ============================================================
   2026-08-21 디자인 검수 반영
   ============================================================ */
/* 브랜드 필: 부제(— 이스타항공의 모든 이야기) 앞 간격 — inline-flex 안에서는 텍스트 공백이 사라지므로 margin 으로 */
.topnav-sub { margin-left: .32em; }

/* 좁은 화면: 상단 바의 spacer 가 내비와 폭을 반씩 나누지 않게 — 'STAR ON AIR' 가 말줄임되지 않도록 */
@media (max-width: 640px) {
  .topbar .spacer { flex: 0 0 0; }
  .topbar .topnav { flex: 1 1 auto; }
}

/* 1~2건뿐인 카테고리: 3열 그리드 대신 큰 표지 + 설명 + 읽기 버튼 (빈 칸 없는 피처 레이아웃) */
@media (min-width: 641px) {
  .shelf--feature { grid-template-columns: 1fr; max-width: 920px; gap: 28px; }
  .shelf--feature .book-card {
    display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 36px; align-items: center;
    text-align: left; padding: 8px 0;
  }
  .shelf--feature .book-card:hover { transform: none; }
  .shelf--feature .book-card .cover-wrap { max-width: 300px; border-radius: 16px; }
  .shelf--feature .book-card .book-info { min-width: 0; }
  .shelf--feature .book-card h3 {
    font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25;
    white-space: normal; margin: 0 0 10px;
  }
  .shelf--feature .book-card .meta { font-size: 15px; line-height: 1.6; margin: 0; }
  .shelf--feature .book-card .book-read { margin-top: 22px; padding: 11px 22px; font-size: 15px; font-weight: 600; }
  .shelf--feature .book-card:hover .book-read { background: var(--red-dark); }
}
.book-read { display: none; }                       /* 피처 레이아웃에서만 표시 */
@media (min-width: 641px) { .shelf--feature .book-read { display: inline-flex; } }

/* 뷰어 터치 타깃: 좁은 화면에서 상단 세그먼트·아이콘 버튼을 42px 이상으로 */
@media (max-width: 640px) {
  #flipView .v-top .icon-btn, .v-bottom .icon-btn { width: 42px; height: 42px; font-size: 17px; }
  #flipView .seg { padding: 3px; }
  #flipView .seg button { padding: 0 13px; min-height: 36px; font-size: 13.5px; }
  .v-bottom { min-height: 56px; }
}
.seg button { min-height: 32px; padding: 0 14px; }  /* 데스크톱도 한 줄 높이 확보 */

/* ============================================================
   2차 리디자인 (2026-08-21) — "좌석 주머니 안전카드" 문법
   종이색 바탕 · 야간비행 네이비 상단 바/히어로 · 탑승권형 섹션 헤더 · 모노스페이스 규격 라벨
   홈(body.home)과 카테고리 페이지에 한정. 뷰어·관리자는 기존 유지.
   ============================================================ */
:root {
  --navy: #10213a;
  --navy-ink: #0b1729;
  --paper-dark: #e9e3d6;
  --dash: #c9c1b0;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  body.home {
    --bg: #f7f4ee;          /* 종이 */
    --bg-soft: #efeadf;
    --bg-soft2: #fbf9f4;
    --card: #fffdf9;
    --line: rgba(29, 29, 31, .12);
  }
}
@media (prefers-color-scheme: dark) {
  body.home { --paper-dark: rgba(255, 255, 255, .14); --dash: rgba(255, 255, 255, .28); }
}
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; font-variant-numeric: tabular-nums; }

/* 홈: 알약 대신 낮은 곡률 */
.home .btn, .home .back-btn { border-radius: 10px; }
.home .topnav-link { border-radius: 8px; }
.home .btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.home .btn.ghost:hover { background: rgba(255, 255, 255, .1); }

/* 상단 바: 야간비행 네이비, 로고는 흰 칩 */
.home .topbar { background: var(--navy); border-bottom: 1px solid rgba(255, 255, 255, .08); backdrop-filter: none; -webkit-backdrop-filter: none; }
.home .brand { background: #fff; padding: 5px 9px; border-radius: 7px; }
.home .brand-logo { height: 20px; }
.home .brand-divider { background: rgba(255, 255, 255, .2); }
.home .topnav-link, .home .topnav-link.active { background: transparent; color: rgba(255, 255, 255, .92); font-family: var(--mono); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
.home .topnav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.home .topnav-sub { font-family: var(--font); text-transform: none; letter-spacing: -.01em; color: rgba(255, 255, 255, .62); font-weight: 500; font-size: 13px; margin-left: .6em; }
.home .skip-link:focus { background: #fff; color: var(--navy); }

/* 이번 호 — 편집형 히어로 */
.issue-hero { background: var(--navy); color: #f7f4ee; padding: 56px 22px 64px; overflow: hidden; }
.ih-inner {
  max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 56px; align-items: center;
}
.ih-eyebrow { display: inline-block; font-size: 12.5px; color: #f7f4ee; opacity: .78; margin-bottom: 18px; }
.ih-title { margin: 0 0 14px; font-size: clamp(30px, 4.1vw, 54px);   /* 54px — 가장 긴 제목(7화)이 1280px 이상에서 2줄에 들어가는 상한 */ font-weight: 900; letter-spacing: -.025em; line-height: 1.04; color: #fff; }
.ih-sub { margin: 0 0 22px; font-size: 17px; line-height: 1.65; color: rgba(247, 244, 238, .78); max-width: 52ch; }
.ih-toc { margin: 0 0 28px; padding: 0; list-style: none; counter-reset: toc; max-width: 46ch; border-top: 1px dashed rgba(247, 244, 238, .35); }
.ih-toc li { counter-increment: toc; display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px dashed rgba(247, 244, 238, .35); font-size: 15px; color: rgba(247, 244, 238, .9); }
.ih-toc li::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: rgba(247, 244, 238, .6); padding-top: 2px; }
.ih-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.ih-cta { padding: 13px 24px; font-size: 15px; font-weight: 700; }
.ih-cover { display: block; width: min(100%, 380px); margin-left: auto; text-decoration: none; color: var(--text); }
.ih-cover img {
  width: 100%; aspect-ratio: 1 / 1.414; object-fit: cover; display: block; border-radius: 8px 8px 0 0;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3); background: #fff;
  transition: transform .25s ease;
}
.ih-cover .spec {
  display: block; background: #fffdf9; color: #1d1d1f; font-size: 12px; padding: 11px 14px;
  border-radius: 0 0 8px 8px; border-top: 2px dashed var(--dash); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ih-cover:hover img { transform: translateY(-3px); }
/* 진입 모션 1회: 표지가 좌석 주머니에서 살짝 올라오듯 */
.issue-hero .ih-cover { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .7s cubic-bezier(.16, 1, .3, 1); }
.issue-hero .ih-text { opacity: 0; transition: opacity .5s ease .15s; }
.issue-hero.in .ih-cover, .issue-hero.in .ih-text { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .issue-hero .ih-cover, .issue-hero .ih-text { opacity: 1; transform: none; transition: none; } }

/* 홈 섹션 컨테이너: 2×2 카드 그리드 → 세로 섹션 */
.cat-grid.home-sections { display: block; grid-template-columns: none; grid-template-rows: none; max-width: 1180px; margin: 0 auto 70px; padding: 0 22px; }
.cat-grid.home-sections .cat-grid-star { display: none; }
.home-sec { padding: 46px 0 18px; }
.home-sec + .home-sec { border-top: 1px solid var(--paper-dark); }

/* 탑승권형 헤더: 왼쪽 규격 라벨 + 제목, 오른쪽 절취 스텁(건수) */
.bp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 14px; text-align: left; }
.bp-left { min-width: 0; }
.bp-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.bp-head h2 { margin: 0 0 8px; font-size: 34px; font-weight: 900; letter-spacing: -.022em; line-height: 1.1; }
.bp-head h2 a { color: inherit; }
.bp-head h2 a:hover { color: var(--red); }
.bp-head p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.bp-stub {
  flex: none; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 12px; align-items: baseline;
  padding: 12px 16px; border: 1px dashed var(--dash); border-radius: 8px; background: var(--card); color: var(--text);
  font-size: 12px; text-decoration: none; transition: border-color .15s, background .15s;
}
.bp-stub:hover { border-color: var(--red); }
.bp-stub-k { color: var(--muted); }
.bp-stub-v { font-size: 26px; font-weight: 500; letter-spacing: 0; line-height: 1; }
.bp-stub-go { grid-column: 1 / -1; font-family: var(--font); text-transform: none; letter-spacing: -.01em; color: var(--red); font-weight: 600; font-size: 13px; margin-top: 8px; }
/* 절취선: 양 끝 반원 노치 */
.bp-rule { position: relative; border-top: 2px dashed var(--dash); margin: 0 0 28px; }
.bp-rule::before, .bp-rule::after { content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); }
.bp-rule::before { left: -30px; } .bp-rule::after { right: -30px; }

/* 섹션 안 목록: .shelf 재사용(3열/모바일 리스트), 9화까지는 5열 */
.sec-shelf { max-width: none; margin: 0; padding: 0; }
.sec-grid { grid-template-columns: repeat(5, 1fr); gap: 30px 22px; }
@media (max-width: 1000px) { .sec-grid { grid-template-columns: repeat(3, 1fr); } }
.sec-grid .book-card h3 { font-size: 15.5px; margin-top: 8px; }
.sec-grid .book-card .meta { font-size: 12.5px; }
.sec-grid .book-card .cover-wrap { border-radius: 8px; }
.ep-tag { display: block; margin-top: 10px; font-size: 11px; color: var(--muted); }
.spec-strip {
  display: block; font-size: 11.5px; padding: 9px 12px; background: var(--card); border: 1px solid var(--line); border-top: 2px dashed var(--dash);
  border-radius: 0 0 8px 8px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shelf--feature .book-card .cover-wrap { border-radius: 8px 8px 0 0; }
.shelf--feature .book-card .spec-strip { max-width: 300px; }
@media (min-width: 641px) {
  .sec-shelf.shelf--feature .book-card { grid-template-columns: minmax(220px, 300px) 1fr; grid-template-rows: auto auto; column-gap: 36px; row-gap: 0; }
  .sec-shelf.shelf--feature .book-card .cover-wrap { grid-row: 1; grid-column: 1; }
  .sec-shelf.shelf--feature .book-card .spec-strip { grid-row: 2; grid-column: 1; }
  .sec-shelf.shelf--feature .book-card .book-info { grid-row: 1 / span 2; grid-column: 2; }
}
.bp-link-card {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px;
  border: 1px dashed var(--dash); border-radius: 8px; background: var(--card); color: var(--text); font-size: 15px;
}
.bp-link-card .mono { color: var(--red); font-size: 12px; }
.sec-empty { margin: 0; color: var(--muted); font-size: 15px; }

/* 카테고리 페이지 헤더도 같은 문법 */
.home .cat-detail-head { text-align: left; margin: 18px 0 24px; padding-bottom: 20px; border-bottom: 2px dashed var(--dash); }
.home .cat-detail-head h2 { font-size: 36px; font-weight: 900; letter-spacing: -.022em; }
.home .cat-detail-head p { font-size: 16px; }
.home .cat-detail-head .bp-stub { grid-template-rows: auto; }
.home .cat-detail-head .bp-stub:empty { display: none; }
.home .back-btn { font-family: var(--mono); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }

/* 푸터 */
.home footer.site { border-top: 1px dashed var(--dash); max-width: 1180px; margin: 0 auto; padding: 26px 22px 40px; }

/* 좁은 화면 */
@media (max-width: 640px) {
  .home .topbar { padding: 0 14px; }
  .home .brand { padding: 4px 7px; }
  .issue-hero { padding: 28px 16px 36px; }
  .ih-inner { grid-template-columns: 1fr; gap: 26px; }
  .ih-cover { order: -1; width: min(62vw, 240px); margin: 0 auto; }
  .ih-cover img { box-shadow: 0 18px 36px rgba(0, 0, 0, .45); }
  .ih-cover .spec { font-size: 10px; letter-spacing: .05em; padding: 9px 8px; }
  .ih-eyebrow { font-size: 11px; }
  .ih-title { font-size: 25px; }   /* 모바일 공통 크기 — 짧은 제목은 한 줄, 긴 제목은 내어쓰기 줄바꿈 */
  .ih-sub { font-size: 15px; margin-bottom: 16px; }
  .ih-toc { display: none; }   /* 모바일은 표지·제목·CTA 에 집중 */
  .ih-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 46px; }
  .cat-grid.home-sections { padding: 0 14px; margin-bottom: 40px; }
  .home-sec { padding: 30px 0 8px; }
  .bp-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .bp-head h2 { font-size: 26px; }
  .bp-stub { grid-template-columns: auto auto auto; grid-template-rows: auto; padding: 9px 12px; }
  .bp-stub-v { font-size: 18px; }
  .bp-stub-go { grid-column: auto; margin: 0 0 0 8px; }
  .bp-rule::before, .bp-rule::after { display: none; }
  .sec-grid { grid-template-columns: 1fr; }
  .sec-shelf.shelf, .home .sec-shelf { margin: 0; padding: 0; }
  .ep-tag, .spec-strip { display: none; }
  .home .cat-detail-head h2 { font-size: 27px; }
}

/* ---- 이번 호 히어로: 슬라이드 전환 (2026-08-21) ---- */
.ih-inner { display: block; }
.ih-track { display: grid; }
.ih-slide {
  grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 56px; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity .55s ease;
}
.ih-slide.active { opacity: 1; pointer-events: auto; }
.ih-title a { color: inherit; text-decoration: none; }
.ih-title a:hover { color: rgba(255, 255, 255, .82); }
/* 진입 모션은 첫 슬라이드(.active)에만 */
.issue-hero .ih-cover, .issue-hero .ih-text { opacity: 1; transform: none; transition: none; }
.issue-hero:not(.in) .ih-slide.active .ih-cover { opacity: 0; transform: translateY(18px); }
.issue-hero:not(.in) .ih-slide.active .ih-text { opacity: 0; }
.issue-hero.in .ih-slide.active .ih-cover { transition: opacity .6s ease, transform .7s cubic-bezier(.16, 1, .3, 1); }
.issue-hero.in .ih-slide.active .ih-text { transition: opacity .5s ease .15s; }
@media (prefers-reduced-motion: reduce) {
  .ih-slide { transition: none; }
  .issue-hero:not(.in) .ih-slide.active .ih-cover, .issue-hero:not(.in) .ih-slide.active .ih-text { opacity: 1; transform: none; }
}
/* 내비: 화살표 + 점 + 카운터 */
.ih-nav { display: flex; align-items: center; gap: 10px; margin-top: 34px; }
.ih-arrow {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .28); background: transparent; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; font-family: var(--font); transition: background .15s, border-color .15s;
}
.ih-arrow:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); }
.ih-arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ih-dots { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 4px; }
.ih-dot {
  width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .55); background: transparent; cursor: pointer;
  transition: background .2s, width .2s;
}
.ih-dot.active { background: #fff; width: 26px; border-radius: 6px; }
.ih-dot:hover { background: rgba(255, 255, 255, .45); }
.ih-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ih-count { margin-left: auto; font-size: 12px; color: rgba(247, 244, 238, .7); }
.ih-count b { color: #fff; font-weight: 500; }
/* 제목 내어쓰기: "N화 ·" 머리말은 고정, 본문이 길어 줄바꿈되면 둘째 줄이 본문 시작 위치에 정렬 */
.ih-title a { display: flex; align-items: baseline; }
.ih-title .ih-ep { flex: none; white-space: nowrap; margin-right: .3em; }
.ih-title .ih-tt { flex: 1 1 auto; min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .ih-slide { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .ih-text { min-width: 0; }
  .ih-nav { margin-top: 22px; gap: 8px; }
  .ih-arrow { width: 36px; height: 36px; font-size: 20px; }
  .ih-dots { gap: 5px; }
  .ih-dot { width: 8px; height: 8px; }
  .ih-dot.active { width: 20px; }
}

/* ---- 모바일: 섹션 목록 접기(첫 3개) + 더보기 (2026-08-21) ---- */
.sec-more { display: none; }
@media (max-width: 640px) {
  .sec-grid.collapsed .book-card:nth-child(n + 4) { display: none; }
  .sec-more {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; margin: 6px 0 4px;
    border: 1px dashed var(--dash); border-radius: 10px; background: var(--card); color: var(--text);
    font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .sec-more .mono { font-size: 12px; color: var(--red); }
  .sec-more:active { background: var(--bg-soft); }
}
