/* 유아 흡연위해예방 가정연계 — 리뉴얼 */
:root {
  --bg: #F6F1E4;
  --bg-soft: #FBF7EC;
  --bg-card: #FFFFFF;
  --ink: #1F3127;
  --ink-soft: #4E6658;
  --muted: #8A9A90;

  --sage-50:  #EDF1E7;
  --sage-100: #D7E1C9;
  --sage-200: #B9CBA3;
  --sage-300: #96B27A;
  --sage-400: #6E9855;
  --sage-500: #527A3D;
  --sage-600: #3F6130;
  --sage-700: #2E4823;

  --coral:   #EF8A6A;
  --butter:  #F2C66B;
  --sky:     #8BB8D6;
  --sky-light: #BDD9EC;
  --sky-deep: #5C9BC4;

  --line: #E5DECB;
  --line-strong: #D4CBB3;

  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  --shadow-sm: 0 2px 0 rgba(46,72,35,0.08);
  --shadow-md: 0 10px 24px -12px rgba(46,72,35,0.25), 0 2px 0 rgba(46,72,35,0.06);
  --shadow-lg: 0 30px 60px -30px rgba(46,72,35,0.35);

  --font-sans: "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1,h2,h3,h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
p { margin: 0; line-height: 1.65; color: var(--ink-soft); }

.container { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

/* Top notice */
.notice-strip {
  position: relative;
  background: var(--sage-700);
  color: #F6F1E4;
  font-size: 13px;
  padding: 9px 40px 9px 14px;
  min-height: 38px;
}
.notice-strip-inner {
  position: relative;
  min-height: 20px;
}
.notice-strip-item {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center; justify-content: center; gap: 14px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  color: inherit; text-decoration: none;
}
.notice-strip-item.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.notice-strip-item .tag {
  background: var(--butter); color: var(--sage-700);
  font-weight: 700; padding: 2px 10px;
  border-radius: 999px; font-size: 11px;
}
.notice-strip-item .title {
  max-width: 60vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #D1D5DB;
}
.notice-strip-item .more {
  font-weight: 700; text-decoration: underline;
  color: #D1D5DB;
}
.notice-strip-close {
  position: absolute;
  top: 50%; right: 12px;
  transform: translateY(-50%);
  background: transparent; border: 0; color: #F6F1E4;
  font-size: 22px; line-height: 1;
  cursor: pointer; padding: 4px 8px;
  opacity: 0.85;
}
.notice-strip-close:hover {
  opacity: 1;
}

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
/* 프론트 전 페이지 헤더(공지띠 포함) 스티키 */
#header-wrap {
  position: sticky;
  top: 0;
  z-index: 200;
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 19px; }
.brand-logo {
  height: 22px; width: auto; display: block;
}

/* Nav with dropdown */
.primary-nav { display: flex; align-items: stretch; gap: 4px; height: 100%; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-top {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600; font-size: 15px;
  color: var(--ink);
  transition: all 0.15s;
}
.nav-top:hover { background: var(--sage-100); color: var(--sage-700); }
.nav-item.active .nav-top, .nav-top.active {
  background: var(--sage-500); color: #fff;
}
.nav-drop {
  position: absolute;
  top: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  min-width: 180px;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: all 0.18s ease;
  z-index: 50;
}
.nav-item:hover .nav-drop {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-drop a {
  display: block;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink);
  white-space: nowrap;
  font-weight: 500;
}
.nav-drop a:hover { background: var(--sage-50); color: var(--sage-700); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink);
}
.icon-btn:hover { border-color: var(--sage-300); color: var(--sage-600); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700; font-size: 14px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--sage-500); color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.14); }
.btn-primary:hover { background: var(--sage-600); }
.btn-outline { background: var(--bg-card); border: 1px solid var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--sage-400); color: var(--sage-700); }

/* ========== KEY VISUAL — 그림책 표지 스타일 ========== */
.kv-hero { position: relative; overflow: hidden; }
.kv-sky {
  position: relative;
  width: 100%;
  height: clamp(520px, 72vh, 720px);
  background:
    radial-gradient(ellipse at 85% 110%, rgba(255,255,255,0.4), transparent 50%),
    linear-gradient(180deg, #8BC5E6 0%, #B8DDF1 50%, #E8F3FA 100%);
  overflow: hidden;
}

/* Sun */
.sun {
  position: absolute;
  top: 12%; right: 14%;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFE993, #F2C66B 70%, #E6A84A);
  box-shadow: 0 0 60px rgba(242,198,107,0.7);
  z-index: 2;
}
.sun-rays {
  position: absolute;
  top: 12%; right: 14%;
  width: 110px; height: 110px;
  z-index: 1;
  animation: spin 40s linear infinite;
}
.sun-rays::before, .sun-rays::after {
  content: '';
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.45);
}
.sun-rays::after { inset: -55px; border-style: dotted; opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Clouds — layered depth */
.cloud {
  position: absolute;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(92,155,196,0.15);
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 999px;
}
.cloud-a {
  width: 140px; height: 34px;
  top: 18%; left: 8%;
  animation: drift 26s linear infinite;
}
.cloud-a::before { width: 52px; height: 52px; top: -28px; left: 22px; }
.cloud-a::after  { width: 40px; height: 40px; top: -18px; left: 70px; }

.cloud-b {
  width: 100px; height: 26px;
  top: 8%; left: 40%;
  animation: drift 32s linear infinite reverse;
}
.cloud-b::before { width: 36px; height: 36px; top: -18px; left: 18px; }
.cloud-b::after  { width: 28px; height: 28px; top: -12px; left: 52px; }

.cloud-c {
  width: 120px; height: 30px;
  top: 34%; right: 6%;
  animation: drift 36s linear infinite;
}
.cloud-c::before { width: 44px; height: 44px; top: -22px; left: 18px; }
.cloud-c::after  { width: 32px; height: 32px; top: -14px; left: 62px; }

.cloud-d {
  width: 80px; height: 20px;
  top: 46%; left: 16%;
  animation: drift 30s linear infinite reverse;
  opacity: 0.85;
}
.cloud-d::before { width: 30px; height: 30px; top: -16px; left: 12px; }
.cloud-d::after  { width: 22px; height: 22px; top: -10px; left: 38px; }

.cloud-e {
  width: 60px; height: 16px;
  top: 28%; left: 28%;
  animation: drift 40s linear infinite;
  opacity: 0.7;
}
.cloud-e::before { width: 22px; height: 22px; top: -12px; left: 8px; }
.cloud-e::after  { width: 18px; height: 18px; top: -8px; left: 28px; }

@keyframes drift {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(40px); }
  100% { transform: translateX(0); }
}

/* Sparkles */
.sparkle {
  position: absolute;
  color: #fff;
  font-size: 22px;
  opacity: 0.9;
  animation: twinkle 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.8));
}
.sparkle-1 { top: 22%; left: 22%; animation-delay: 0s; }
.sparkle-2 { top: 38%; right: 28%; animation-delay: 1s; font-size: 16px; }
.sparkle-3 { top: 58%; left: 70%; animation-delay: 2s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2) rotate(20deg); }
}

/* Stage where mascot stands — hill */
.kv-stage {
  position: absolute;
  left: -10%; right: -10%;
  bottom: -8%;
  height: 32%;
  background: linear-gradient(180deg, #A9C287 0%, #6E9855 60%, #527A3D 100%);
  border-radius: 50% 50% 0 0 / 70% 70% 0 0;
  box-shadow: inset 0 8px 0 rgba(255,255,255,0.2);
  z-index: 3;
}
.kv-stage::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 10px;
  background:
    radial-gradient(circle at 15px 6px, #8CAF68 3.5px, transparent 4px),
    radial-gradient(circle at 45px 4px, #8CAF68 3.5px, transparent 4px),
    radial-gradient(circle at 75px 8px, #8CAF68 3px,   transparent 4px);
  background-size: 90px 10px;
  background-repeat: repeat-x;
}

/* Mascot — jumping bouncing */
.kv-mascot {
  position: absolute;
  left: calc(50% - 60px);
  bottom: 18%;
  transform: translateX(-50%);
  z-index: 4;
  width: 220px;
  height: 255px;
}
.mascot-bounce {
  position: relative;
  width: 100%;
  height: 100%;
  animation: bounceJump 2.4s cubic-bezier(.4,0,.2,1) infinite;
  transform-origin: bottom center;
}
.mascot-squash {
  animation: squash 2.4s cubic-bezier(.4,0,.2,1) infinite;
  transform-origin: bottom center;
}
.mascot-squash svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 16px rgba(30,50,20,0.3));
}
.mascot-shadow {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 160px;
  height: 18px;
  background: radial-gradient(ellipse, rgba(30,50,20,0.3), transparent 70%);
  animation: shadowPulse 2.4s cubic-bezier(.4,0,.2,1) infinite;
  z-index: -1;
}

@keyframes bounceJump {
  0%, 100% { transform: translateX(-50%) rotate(-2.5deg); }
  50%      { transform: translateX(-50%) rotate(2.5deg); }
}

@keyframes squash {
  0%, 100% { transform: scaleY(1) scaleX(1); }
}

@keyframes shadowPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.9; }
}

/* Companion characters — 공새 & 청소끼리 */
.kv-gongsae {
  position: absolute;
  z-index: 4;
  width: 180px;
}
.kv-gongsae svg { width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(30,50,20,0.2)); }
.kv-gongsae-left  { left: 22%; bottom: 40%; animation: floatBird 4s ease-in-out infinite; }
.kv-gongsae-right { right: 38%; bottom: calc(48% - 60px); animation: floatBird 4.6s ease-in-out infinite reverse; }
@keyframes floatBird {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-18px) rotate(4deg); }
}
.kv-cleanie {
  position: absolute;
  right: 16%;
  bottom: calc(14% - 60px);
  z-index: 4;
  width: 390px;
  animation: waddle 3s ease-in-out infinite;
}
.kv-cleanie svg { width: 100%; height: auto; filter: drop-shadow(0 8px 12px rgba(30,50,20,0.25)); }
@keyframes waddle {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50%      { transform: rotate(2deg) translateY(-4px); }
}

/* Title overlay */
.kv-title {
  position: absolute;
  left: 50%;
  top: calc(10% + 30px);
  transform: translateX(-50%);
  z-index: 6;
  text-align: center;
  max-width: 820px;
  width: 100%;
  padding: 0 28px;
}
.kv-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  color: var(--sage-700);
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(92,155,196,0.15);
}
.kv-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sage-500);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: 0.55; transform: scale(0.8); }
}
.kv-title h1 {
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: #1F3127;
  text-shadow: 0 2px 12px rgba(255,255,255,0.6);
}
.kv-accent {
  background: linear-gradient(180deg, transparent 62%, #F2C66B 62%);
  padding: 0 6px;
}

/* ========== Box Banners ========== */
.box-banners {
  padding: 64px 0 80px;
  background: var(--bg);
}
.box-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.box-banner {
  --accent-bg: var(--sage-100);
  --accent-fg: var(--sage-700);
  display: flex; align-items: center; gap: 18px;
  padding: 28px 26px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.box-banner:hover {
  transform: translateY(-4px);
  border-color: var(--sage-300);
  box-shadow: var(--shadow-md);
}
.box-banner::before {
  content: '';
  position: absolute;
  right: -40px; bottom: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--accent-bg);
  opacity: 0.35;
  transition: transform 0.3s ease;
}
.box-banner:hover::before { transform: scale(1.2); }
.box-emoji {
  width: 64px; height: 64px;
  border-radius: 20px;
  background: var(--accent-bg);
  color: var(--accent-fg);
  display: grid; place-items: center;
  font-size: 30px;
  flex-shrink: 0; position: relative; z-index: 2;
}
.box-emoji img {
  width: 70%; height: 70%;
  object-fit: contain;
}
.box-emoji img[src*="main_05"] {
  width: 63%; height: 63%;
  transform: translateY(-5px);
}
.box-text { flex: 1; position: relative; z-index: 2; }
.box-text h3 {
  font-size: 19px; font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}
.box-text p { font-size: 13px; color: var(--muted); margin: 0; }
.box-arrow {
  position: relative; z-index: 2;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink-soft);
  display: grid; place-items: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.box-banner:hover .box-arrow {
  background: var(--sage-500);
  color: #fff;
  transform: translateX(3px);
}

/* Footer */
.site-footer {
  background: #F1EADA;
  border-top: 1px solid var(--line);
  padding: 0 0 32px;
}
.footer-top {
  background: var(--line);
  border-bottom: 1px solid var(--line-strong);
  padding: 13px 0;
  margin-bottom: 40px;
}
.footer-top .container {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  align-items: center;
}
.footer-top a {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.footer-top a:hover { color: var(--sage-700); }
.footer-simple {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}
.footer-brand small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  display: block;
  margin-top: 12px;
}
.footer-brand small strong {
  color: var(--ink);
  font-weight: 700;
}
.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.footer-logo {
  height: 28px;
  width: auto;
  display: block;
}

/* ========== Sub pages ========== */
.page-hero { padding: 48px 0 32px; }
.breadcrumb {
  font-size: 13px; color: var(--ink-soft);
  display: flex; gap: 8px; margin-bottom: 20px;
}
.breadcrumb-right { justify-content: flex-end; margin: 16px 0 0; }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb a:hover { color: var(--sage-600); }
.page-hero h1 {
  font-size: clamp(30px, 3.6vw, 44px);
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.page-hero p.lead { font-size: 16px; max-width: 640px; }

.filter-bar {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin: 28px 0 40px;
  flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group .fg-label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { background: var(--sage-50); color: var(--sage-700); }
.chip.active { background: var(--sage-500); color: #fff; }

.search-inline {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-soft);
  border-radius: 999px;
  width: 260px;
}
.search-inline input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 13px; color: var(--ink); font-family: inherit;
}
.search-inline input::placeholder { color: var(--muted); }

.book-list {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px;
}
.book-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: all 0.2s;
  cursor: pointer;
}
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.book-cover {
  aspect-ratio: 4 / 5;
  position: relative;
  display: grid; place-items: center;
  padding: 20px;
  overflow: hidden;
}
.book-cover .cover-title {
  position: relative; z-index: 2;
  font-weight: 800; font-size: 20px;
  line-height: 1.25; letter-spacing: -0.02em;
  text-align: center; color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.book-cover .cover-shape { position: absolute; inset: 0; }
.book-meta { padding: 16px 18px 20px; }
.book-meta .age-chip {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sage-50);
  color: var(--sage-700);
  margin-bottom: 8px;
}
.book-meta h4 { font-size: 15px; line-height: 1.35; margin-bottom: 6px; }
.book-meta .b-sub { font-size: 12px; color: var(--muted); }

.cover-a { background: linear-gradient(140deg, #6E9855, #3F6130); }
.cover-b { background: linear-gradient(140deg, #EF8A6A, #C96B8B); }
.cover-c { background: linear-gradient(140deg, #F2C66B, #EF8A6A); }
.cover-d { background: linear-gradient(140deg, #8BB8D6, #527A3D); }
.cover-e { background: linear-gradient(140deg, #C96B8B, #6B3D5A); }
.cover-f { background: linear-gradient(140deg, #527A3D, #1F3127); }
.cover-g { background: linear-gradient(140deg, #F2C66B, #6E9855); }
.cover-h { background: linear-gradient(140deg, #8BB8D6, #C96B8B); }
.cover-shape::before {
  content: '';
  position: absolute;
  width: 200%; height: 60%;
  bottom: -20%; left: -50%;
  background: rgba(255,255,255,0.14);
  border-radius: 50%;
}

.book-card .book-cover .book-plays {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0,0,0,0.3);
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  backdrop-filter: blur(6px);
  z-index: 2;
}
.page-pagination {
  display: flex; justify-content: center; gap: 4px;
  margin: 50px 0;
}
.page-pagination button {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-weight: 600; color: var(--ink-soft); font-size: 14px;
}
.page-pagination button.active { background: var(--sage-500); color: #fff; border-color: var(--sage-500); }
.page-pagination button:hover:not(.active) { border-color: var(--sage-400); color: var(--sage-700); }

/* Viewer modal */
.viewer-overlay {
  position: fixed; inset: 0;
  background: rgba(31,49,39,0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 40px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.viewer {
  background: #fff;
  border-radius: var(--radius-lg);
  width: min(920px, 100%);
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.viewer-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.viewer-head h3 { font-size: 17px; }
.viewer-body {
  flex: 1; padding: 40px;
  background: var(--bg-soft);
  display: grid; place-items: center;
  position: relative;
}
.viewer-page {
  background: #fff;
  border-radius: var(--radius-md);
  aspect-ratio: 1.4 / 1;
  width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg);
  padding: 40px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center; gap: 16px;
}
.viewer-page .page-illustration {
  width: 180px; height: 140px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--sage-200), var(--sage-400));
  display: grid; place-items: center;
  color: #fff; font-size: 42px;
}
.viewer-page h4 { font-size: 22px; line-height: 1.4; }
.viewer-page p { font-size: 14px; max-width: 400px; }
.viewer-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.viewer-nav.prev { left: 20px; }
.viewer-nav.next { right: 20px; }
.viewer-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--muted);
}
.viewer-foot .dots { display: flex; gap: 6px; }
.viewer-foot .dots .d { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.viewer-foot .dots .d.active { background: var(--sage-500); width: 20px; border-radius: 3px; }

/* Responsive */
@media (max-width: 1024px) {
  .primary-nav .nav-top { padding: 10px 12px; font-size: 14px; }
}
@media (max-width: 960px) {
  .primary-nav { display: none; }
  .box-grid { grid-template-columns: repeat(2, 1fr); }
  .book-list { grid-template-columns: repeat(2, 1fr); }
  .footer-simple { grid-template-columns: 1fr; }
  .footer-meta { text-align: left; }
}
@media (max-width: 560px) {
  .box-grid { grid-template-columns: 1fr; }
  .kv-mascot { width: 180px; height: 210px; bottom: 20%; }
  .kv-title h1 { font-size: 26px; }
}

/* ========== KEY VISUAL — 반응형 단계별 캐릭터 재배치 ========== */
/* 태블릿 (1024 이하) */
@media (max-width: 1024px) {
  .kv-sky { height: clamp(480px, 65vh, 640px); }
  .kv-gongsae { width: 140px; }
  .kv-gongsae-left  { left: 4%; bottom: 48%; }
  .kv-gongsae-right { right: 4%; bottom: 52%; }
  .kv-cleanie { width: 300px; right: 3%; bottom: 5%; }
  .kv-mascot { left: 50%; transform: translateX(-50%); }
}

/* 모바일 (768 이하) — 좁은 폭에서 캐릭터 재배치 + 일부 장식 정리 */
@media (max-width: 768px) {
  .kv-sky { height: clamp(420px, 70vh, 540px); }

  /* 해 축소 */
  .sun, .sun-rays { width: 80px; height: 80px; top: 10%; right: 8%; }
  .sun-rays::before { inset: -20px; }
  .sun-rays::after  { inset: -36px; }

  /* 작은 구름 2개 숨김 (시각 노이즈 감소) */
  .cloud-d, .cloud-e { display: none; }
  .cloud-a { width: 100px; height: 24px; top: 12%; left: 5%; }
  .cloud-a::before { width: 38px; height: 38px; top: -22px; left: 16px; }
  .cloud-a::after  { width: 28px; height: 28px; top: -12px; left: 50px; }
  .cloud-b { width: 75px; height: 20px; top: 6%; left: 38%; }
  .cloud-b::before { width: 26px; height: 26px; top: -14px; left: 12px; }
  .cloud-b::after  { width: 20px; height: 20px; top: -8px; left: 36px; }
  .cloud-c { width: 80px; height: 22px; top: 26%; right: 4%; }
  .cloud-c::before { width: 30px; height: 30px; top: -16px; left: 12px; }
  .cloud-c::after  { width: 22px; height: 22px; top: -10px; left: 42px; }

  .sparkle    { font-size: 16px; }
  .sparkle-2  { font-size: 12px; }

  /* 공새 새 — 양옆 코너 */
  .kv-gongsae { width: 143px; }
  .kv-gongsae-left  { left: calc(3% + 100px); bottom: 52%; }
  .kv-gongsae-right { right: calc(3% + 100px); bottom: 56%; }

  /* 청소끼리 코끼리 — 우측 하단 corner */
  .kv-cleanie { width: 260px; right: 2%; bottom: 8%; }

  /* 마스코트 — 가로 정중앙 */
  .kv-mascot {
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 186px;
    bottom: 22%;
  }
  .mascot-shadow { width: 120px; height: 16px; }
}

/* 모바일 small (480 이하) — 추가 축소 + 일부 장식 더 정리 */
@media (max-width: 480px) {
  .kv-sky { height: clamp(380px, 65vh, 480px); }

  .sun, .sun-rays { width: 60px; height: 60px; }
  .sun-rays::before { inset: -16px; }
  .sun-rays::after  { inset: -28px; }

  /* 구름 추가 1개 더 정리 + 반짝이 1개 정리 */
  .cloud-c { display: none; }
  .sparkle-3 { display: none; }

  .kv-gongsae { width: 113px; }
  .kv-gongsae-left  { left: calc(2% + 100px); bottom: 56%; }
  .kv-gongsae-right { right: calc(2% + 100px); bottom: 60%; }

  .kv-cleanie { width: 195px; right: 1%; bottom: 10%; }

  .kv-mascot {
    width: 130px;
    height: 152px;
    bottom: 24%;
  }
  .mascot-shadow { width: 100px; height: 14px; }

  .kv-title h1 { font-size: 22px; }
  .kv-title { padding: 0 16px; }
  .kv-eyebrow { font-size: 11px; padding: 5px 12px; margin-bottom: 14px; }
}

/* Floating back-to-top button (메인 제외 전 페이지) */
.btn-top-scroll {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sage-700);
  color: #fff;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-top-scroll.show {
  opacity: 0.5;
  visibility: visible;
  transform: translateY(0);
}
.btn-top-scroll.show:hover {
  opacity: 1;
  background: #6E9855;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
@media (max-width: 560px) {
  .btn-top-scroll { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}
