/* ==========================================================================
   JUJUBE BOOKS — design system
   ========================================================================== */

:root {
  --cream: #F4EFE4;
  --cream-2: #ECE5D6;
  --ink: #221F1A;
  --ink-soft: #6E6759;
  --line: rgba(34, 31, 26, 0.16);

  --green: #33503B;
  --green-soft: #4E7057;
  --terracotta: #C1613A;
  --terracotta-soft: #E0855C;

  --dark-bg: #171613;
  --dark-line: rgba(244, 239, 228, 0.2);
  --dark-text: #F4EFE4;
  --dark-text-soft: rgba(244, 239, 228, 0.55);

  --nav-h: 58px;
  --footer-h: 58px;
  --maxw: 1400px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; height: 100%; overflow: hidden; }

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #ffffff;
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }
button { font: inherit; cursor: pointer; }

.notranslate { }

/* --------------------------------------------------------------------------
   Top / bottom nav grid (4 columns) — used on every page
   -------------------------------------------------------------------------- */

.nav-grid, .footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  padding-right: var(--scrollbar-w, 0px);
  border-bottom: 1px solid #009465;
}

.footer-grid {
  border-bottom: none;
  border-top: 1px solid #009465;
  margin-top: auto;
}

.nav-grid a, .footer-grid > * {
  border-right: 1px solid #009465;
  padding: 18px 22px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #009465;
  display: flex;
  align-items: center;
  min-height: var(--nav-h);
}

.nav-grid a:last-child, .footer-grid > *:last-child { border-right: none; }

.nav-grid a:hover, .footer-grid a:hover { color: #009465; background: #edfc75; }

.nav-grid a.active { color: #009465; font-weight: 600; }
.footer-grid a.active { color: #009465; font-weight: 600; }

.footer-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-toggle {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.lang-toggle button {
  background: none;
  border: none;
  padding: 2px 4px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #009465;
}

.lang-toggle button.is-active { color: #009465; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }


/* dark variant of the nav/footer grid, used on grid list pages */

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

main { flex: 1; width: 100%; min-height: 0; overflow-y: scroll; -webkit-overflow-scrolling: touch; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.section { padding: 64px 0; }

.eyebrow {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Home hero
   -------------------------------------------------------------------------- */

.hero-stage {
  position: relative;
  min-height: clamp(520px, 78vh, 780px);
}

/* on PC, cap the hero to exactly one screen (nav + hero + footer, no scroll) —
   matches the reference layout. Mobile keeps the flexible min-height above,
   since the 2-column start can legitimately run longer than one screen. */
@media (min-width: 641px) {
  .hero-stage {
    height: calc(100vh - var(--nav-h) - var(--footer-h));
    min-height: 0;
    overflow: hidden; /* guarantee no page scroll, even mid-drag */
  }
}

.hero {
  position: relative;
  z-index: 2;
  padding: 90px 35px 50px;
  max-width: var(--maxw);
  margin: 0 auto;
  pointer-events: none; /* text has no links — let clicks/drags reach the images behind it */
}

.hero h1 {
  font-size: clamp(35px, 5.75vw, 70px);
  line-height: 1.7;
  font-weight: 400;
  max-width: 1025px;
  letter-spacing: -0.01em;
}
html[lang="en"] .hero h1 {
  line-height: 1.3;
}
html[lang="ko"] .hero h1 {
  font-size: clamp(32px, 5.4vw, 65px);
  font-weight: 500;
}

.hero .hero-sub {
  margin-top: 18px;
  max-width: 520px;
  color: var(--ink-soft);
  font-size: 16px;
}

/* free-form draggable scatter of book covers, à la readymag.com/designs/greennation —
   each image is randomly placed on load and can be dragged anywhere by the visitor. */
.collage-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.drag-item {
  position: absolute;
  max-width: 46vw;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform, left, top;
  transition: box-shadow 0.2s ease;
}
.drag-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.14));
}
.drag-item.dragging {
  cursor: grabbing;
  z-index: 999 !important;
}
.drag-item.dragging img {
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.22));
}

/* generic placeholder "cover" block used everywhere in place of real images —
   a plain colored swatch until a real photo exists at
   이미지/<CATEGORY>/<slug>.(jpg|png|webp); once one loads, the swatch goes
   transparent and the image shows in full (no crop, no color bleeding
   through transparent PNG edges). */
.cover-block {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--c, var(--green));
  background-image: radial-gradient(circle at 85% 12%, rgba(255,255,255,0.18), transparent 55%);
}
.cover-block img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.cover-block.has-image {
  background: transparent;
}
.cover-block.has-image img {
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   Grid list pages (BOOK / AND MORE) — dark theme, numbered 3-col grid
   -------------------------------------------------------------------------- */

.dark-page { background: #ffffff; color: var(--ink); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.card {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 26px 30px;
  display: flex;
  flex-direction: column;
}

.card:nth-child(3n) { border-right: none; }

#goods-grid { grid-template-columns: repeat(2, 1fr); }
#goods-grid .card:nth-child(3n) { border-right: 1px solid #009465; }
#goods-grid .card:nth-child(2n) { border-right: none; }
#goods-grid .card[href$="slug=jujube-ceramic-paperweight"] .cover-block img { transform: scale(0.5); }
.goods-page .card { border-color: #009465; }

.card .card-cover { aspect-ratio: 4 / 5; margin-bottom: 18px; border-radius: 2px; overflow: hidden; }

.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }

.card .card-desc { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; flex: 1; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .card:nth-child(3n) { border-right: 1px solid var(--line); }
  .card:nth-child(2n) { border-right: none; }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
  .card { border-right: none !important; }
  #goods-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Detail pages (book / goods / news) — scroll form, cream theme
   -------------------------------------------------------------------------- */

.detail-hero {
  padding: 56px 28px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.detail-cover {
  width: min(360px, 70vw);
  aspect-ratio: 3 / 4;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 28px;
}

.detail-hero .detail-kicker { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; }
.detail-hero h1 { font-size: clamp(24px, 3.4vw, 36px); font-weight: 700; max-width: 640px; }
.detail-hero .detail-meta { margin-top: 12px; color: var(--ink-soft); font-size: 14px; }

.detail-body { max-width: 720px; margin: 0 auto; padding: 40px 28px 20px; }
.detail-body h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.detail-body p { color: var(--ink); margin-bottom: 1.4em; white-space: pre-wrap; }
.detail-body p:last-child { margin-bottom: 0; }
.detail-body + .detail-body { padding-top: 0; }

.detail-image {
  max-width: var(--maxw);
  margin: 20px auto;
  padding: 0 28px;
}
.detail-image .cover-block { aspect-ratio: 16 / 9; border-radius: 3px; }

.detail-tags { max-width: 720px; margin: 0 auto; padding: 0 28px 40px; }
.detail-tags .tag-row { justify-content: center; }

.detail-rich { max-width: 720px; margin: 0 auto; padding: 0 28px 40px; }
.detail-rich-image { width: 100%; height: auto; display: block; border-radius: 3px; }
#detail-rich > img { width: 100%; height: auto; display: block; border-radius: 3px; }
#news-image-block img { width: 100%; height: auto; display: block; border-radius: 3px; }
#news-image-block img + img { margin-top: 14px; }
.detail-bib-ko { margin-top: 2em; }
.detail-inside-gallery { margin-top: 2.4em; display: flex; flex-direction: column; gap: 14px; }
.detail-inside-image { width: 100%; height: auto; display: block; border-radius: 3px; }
html[lang="en"] .detail-rich .contact-row { max-width: 75%; margin-left: auto; margin-right: auto; }
.detail-rich h3 { font-size: 19px; font-weight: 700; margin: 2em 0 0.8em; }
.detail-rich h4 { font-size: 16px; font-weight: 700; margin: 1.6em 0 0.4em; }
.detail-rich p { margin-bottom: 1.4em; }
.detail-rich blockquote {
  margin: 1.6em 0;
  padding-left: 18px;
  border-left: 2px solid var(--line);
  font-style: italic;
  color: var(--ink-soft);
}
.detail-rich blockquote p { margin-bottom: 0.4em; }
.detail-rich blockquote p:last-child { margin-bottom: 0; }

.back-link {
  display: inline-block;
  margin: 40px auto 0;
  text-align: center;
  width: 100%;
  padding-bottom: 60px;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.back-link:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   About page
   -------------------------------------------------------------------------- */

.about-stack {
  max-width: 860px;
  margin: 0 auto;
  padding: 64px 28px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about-stack .eyebrow { align-self: flex-start; font-size: 22px; font-weight: 700; letter-spacing: 0.01em; padding: 8px 22px; border: none; color: #009465; }

.about-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--green);
  border-radius: 3px;
  overflow: hidden;
}
.about-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.about-stack p { font-size: 17px; line-height: 1.8; }
.about-copy p { margin-bottom: 1.4em; }
.about-copy p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   News list page — sidebar + rows (image | text)
   -------------------------------------------------------------------------- */

.news-page { background: #edfc75; color: var(--ink); }
.news-page .news-sidebar { border-right-color: #009465; }
.news-page .news-sidebar p { color: #009465; }
.news-page .news-row-simple { border-bottom-color: #009465; }
.news-page .news-row-date { color: #009465; }
.news-page .nav-grid a:hover, .news-page .footer-grid a:hover { background: #ffffff; }

.news-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
}

.news-sidebar {
  padding: 56px 40px;
  border-right: 1px solid var(--line);
}
.news-sidebar h1 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; line-height: 1.4; }
.news-sidebar p { margin-top: 24px; font-size: 15px; color: var(--ink-soft); }

.news-list { display: flex; flex-direction: column; }

.news-row {
  display: grid;
  grid-template-columns: 340px 1fr;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}
.news-row:hover { background: rgba(34,31,26,0.04); }

.news-row .news-cover { aspect-ratio: 16 / 10; }
.news-row .news-text { padding: 30px 36px; display: flex; flex-direction: column; justify-content: center; }
.news-row .news-date { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; }
.news-row h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.news-row .news-desc { font-size: 14px; color: var(--ink-soft); }

.news-row-simple {
  display: flex;
  align-items: baseline;
  gap: 28px;
  padding: 16px 40px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  transition: background 0.2s ease;
}

a.news-row-simple:hover { background: #ffffff; }
.news-row-pinned { background: #009465; }
.news-row-pinned .news-row-date,
.news-row-pinned .news-row-title { color: #ffffff; }
a.news-row-external.news-row-pinned .news-row-title::after { color: #ffffff; }

a.news-row-simple.news-row-pinned:hover { background: #ffffff; }
a.news-row-simple.news-row-pinned:hover .news-row-date,
a.news-row-simple.news-row-pinned:hover .news-row-title { color: #009465; }
a.news-row-external.news-row-pinned:hover .news-row-title::after { color: #009465; }

.news-row-date {
  flex: 0 0 84px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.news-row-title { font-size: 15px; line-height: 1.5; }

a.news-row-external .news-row-title::after {
  content: "↗";
  margin-left: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.news-pagination {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 28px 0 40px;
  font-size: 14px;
}

.news-pagination a { color: var(--ink-soft); }
.news-pagination a:hover { color: var(--ink); }
.news-pagination .current { font-weight: 700; color: var(--ink); }

@media (max-width: 860px) {
  .news-layout { grid-template-columns: 1fr; }
  .news-sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .news-page .news-sidebar { border-bottom-color: #009465; }
  .news-row { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Contact page
   -------------------------------------------------------------------------- */

.contact-image { max-width: 640px; margin: 0 auto; padding: 0 28px; }
.contact-image .cover-block { aspect-ratio: 3508 / 2480; border-radius: 3px; }
.contact-image .cover-block img { object-fit: contain; padding: 0; }
.contact-image .cover-block::after { display: none; }

.contact-body { max-width: 640px; margin: 0 auto; padding: 48px 28px 80px; }
.contact-body h2 { font-size: 22px; font-weight: 700; margin-bottom: 18px; color: #009465; }
.contact-body p { margin-bottom: 1.2em; }
.contact-row { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #009465; font-size: 15px; }
.contact-row span:first-child { color: #009465; }
.contact-row a { font-weight: 600; }
.contact-row a:hover { color: #edfc75; }

/* --------------------------------------------------------------------------
   Catalog page
   -------------------------------------------------------------------------- */

.catalog-body { max-width: 720px; margin: 0 auto; padding: 64px 28px; text-align: center; }
.catalog-body h1 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; margin-bottom: 26px; color: #009465; }
.catalog-buttons { display: flex; justify-content: center; gap: 14px; margin-bottom: 40px; }

.pill-btn {
  border: 1px solid #009465;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #edfc75;
  color: #009465;
  display: inline-block;
}
.pill-btn:hover { background: #ffffff; border-color: #009465; }
.pill-btn.outline { background: transparent; color: var(--ink); }
.pill-btn.outline:hover { color: var(--green); border-color: var(--green); background: transparent; }

.catalog-cover { max-width: 480px; margin: 0 auto; aspect-ratio: 3 / 4.2; border-radius: 3px; overflow: hidden; box-shadow: 0 24px 60px rgba(34,31,26,0.18); }
.catalog-cover .cover-block::after { display: none; }
.catalog-note { margin-top: 22px; font-size: 13px; color: var(--ink-soft); }

.home-page { background: #edfc75; }

.home-marquee {
  background: #edfc75;
  border-top: 1px solid #009465;
  border-bottom: 1px solid #009465;
  overflow: hidden;
  white-space: nowrap;
}

.home-marquee-track {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 14px 0;
  animation: home-marquee-scroll 26s linear infinite;
}

.home-marquee-track span {
  font-size: 13px;
  letter-spacing: 0.03em;
  color: #009465;
  white-space: nowrap;
}

.home-marquee-dot {
  margin: 0 28px;
  font-size: 11px;
  color: #009465;
}

@keyframes home-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .home-marquee-track { animation: none; }
}

.book-page { background: #edfc75; }
.book-page .card { border-color: #009465; }
.book-detail-page .detail-cover { box-shadow: none; }
.book-page .card:hover { background: #ffffff; }
.book-page .nav-grid a:hover, .book-page .footer-grid a:hover { background: #ffffff; }
.book-page .card[href$="slug=tree"] .cover-block img { transform: rotate(5deg) scale(0.8); }
.book-page .card[href$="slug=inga"] .cover-block img { transform: rotate(10deg); }
.book-page .card[href$="slug=ground-cover"] .cover-block img { transform: rotate(10deg) scale(0.9); }
.book-page .card[href$="slug=meow"] .cover-block img { transform: scale(1.3); }
.book-page .card[href$="slug=steal-the-sperm-whale"] .cover-block img { transform: scale(1.3); }
.book-page .card[href$="slug=grandfathers-rainbow"] .cover-block img { transform: scale(1.3); }



