/* book.css — OTA activity catalog (Bookme Phase 1) */

/* Full-page photo background — matches island explorer treatment */
body[data-page="activities"] main#page {
  position: relative;
  isolation: isolate;
}

.book-page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--bg);
}

.book-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.04);
  filter: blur(4px);
  transition: opacity 1.2s ease, filter 1.2s ease;
}

.book-bg-layer.is-on {
  opacity: 0.7;
  filter: blur(0);
  animation: bookBgKen 18s ease-out forwards;
}

.book-page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 25% 40%, rgba(14, 18, 15, 0.04) 0%, rgba(14, 18, 15, 0.34) 62%, var(--bg) 100%),
    linear-gradient(180deg, rgba(14, 18, 15, 0.38) 0%, rgba(14, 18, 15, 0.56) 100%);
}

html[data-theme="light"] .book-bg-layer.is-on {
  opacity: 0.66;
}

html[data-theme="light"] .book-page-bg::after {
  background:
    radial-gradient(ellipse at 25% 40%, rgba(247, 241, 230, 0.03) 0%, rgba(247, 241, 230, 0.24) 62%, var(--bg) 100%),
    linear-gradient(180deg, rgba(247, 241, 230, 0.28) 0%, rgba(247, 241, 230, 0.46) 100%);
}

body[data-page="activities"] main#page > :not(.book-page-bg) {
  position: relative;
  z-index: 1;
}

body[data-page="activities"] footer#foot {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

@keyframes bookBgKen {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}

.book-hero {
  position: relative;
  padding: clamp(130px, 20vh, 200px) 4vw clamp(48px, 8vh, 80px);
  max-width: 1600px;
  margin: 0 auto;
  text-align: center;
}

.book-hero h1 {
  font-family: "Shadows Into Light", serif;
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 1.02;
  margin: 12px auto 16px;
  max-width: 16ch;
}

.book-hero p {
  max-width: 58ch;
  margin: 0 auto;
  color: var(--fg-muted);
  line-height: 1.7;
}

.book-hero-note {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--fg-muted);
  opacity: 0.85;
}

.book-grid-wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 4vw 5rem;
}

.book-sections {
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 2vh, 1.25rem);
}

.book-category {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.book-category-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: clamp(0.85rem, 2vw, 1.1rem) clamp(1rem, 2.5vw, 1.25rem);
  border: 0;
  background: color-mix(in srgb, var(--bg-soft) 70%, transparent);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.book-category-toggle:hover {
  background: color-mix(in srgb, var(--bg-soft) 95%, transparent);
}

.book-category-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  flex: 1;
  min-width: 0;
}

.book-category-title {
  font-family: "Dream Avenue", "Basis Grotesque", serif;
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.book-category-count {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.book-category-chevron {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.3s ease;
  margin-top: -0.2rem;
}

.book-category.is-open .book-category-chevron {
  transform: rotate(-135deg);
  margin-top: 0.15rem;
}

.book-category-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}

.book-category.is-open .book-category-panel {
  grid-template-rows: 1fr;
}

.book-category-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 clamp(0.85rem, 2vw, 1.15rem) clamp(0.85rem, 2vw, 1.15rem);
}

.book-category:not(.is-open) .book-category-inner {
  padding-top: 0;
  padding-bottom: 0;
}

.book-show-more {
  display: none;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-soft) 90%, transparent);
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.book-show-more:hover {
  color: var(--fg);
  border-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .book-category-panel {
    transition: none;
  }

  .book-category:not(.is-open) .book-category-panel {
    display: none;
  }

  .book-category.is-open .book-category-panel {
    display: block;
    grid-template-rows: none;
  }
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.book-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.book-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.book-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 160px;
  overflow: hidden;
  display: block;
  color: inherit;
  text-decoration: none;
}

.book-card-title {
  color: inherit;
  text-decoration: none;
}

.book-card-title:hover {
  color: var(--accent);
}

.book-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.book-card:hover .book-card-media img {
  transform: scale(1.04);
}

.book-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
}

.book-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.1rem 1.15rem;
  gap: 0.45rem;
}

.book-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.book-card-meta .book-price {
  color: var(--accent);
  font-weight: 700;
}

.book-card h3 {
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.book-card p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--fg-muted);
  flex: 1;
}

.book-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.35rem;
}

.book-card-actions .btn {
  font-size: 0.82rem;
  padding: 0.55rem 0.95rem;
}

.book-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--fg-muted);
}

.book-custom {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 4vw 5rem;
  text-align: center;
}

.book-custom-inner {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(2rem, 5vw, 3.5rem);
  background: var(--bg-soft);
}

.book-custom h2 {
  font-family: "Shadows Into Light", serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.75rem;
}

.book-custom p {
  max-width: 52ch;
  margin: 0 auto 1.25rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

.book-island {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 0.65rem;
}

.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;
}

@media (max-width: 720px) {
  .book-hero {
    padding: clamp(110px, 18vh, 140px) 4vw clamp(32px, 6vh, 48px);
  }

  .book-hero h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
    max-width: none;
  }

  .book-hero p {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .book-grid-wrap {
    padding: 0 12px 3rem;
  }

  .book-sections {
    gap: 0.65rem;
  }

  .book-category-toggle {
    padding: 0.75rem 0.85rem;
  }

  .book-category-title {
    font-size: 1.05rem;
  }

  .book-category-inner {
    padding: 0 0.55rem 0.65rem;
  }

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

  .book-card {
    border-radius: 10px;
  }

  .book-card:hover {
    transform: none;
  }

  .book-card-media {
    aspect-ratio: 4 / 3;
    min-height: 0;
  }

  .book-card-badge {
    top: 6px;
    left: 6px;
    font-size: 0.58rem;
    padding: 0.2rem 0.4rem;
  }

  .book-card-body {
    padding: 0.55rem 0.6rem 0.65rem;
    gap: 0.3rem;
  }

  .book-card-meta {
    gap: 0.25rem 0.4rem;
    font-size: 0.58rem;
    line-height: 1.3;
  }

  .book-card-meta span:not(.book-price) {
    display: none;
  }

  .book-card-meta .book-price {
    font-size: 0.62rem;
  }

  .book-card h3 {
    font-size: 0.78rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .book-card p {
    display: none;
  }

  .book-card-actions {
    flex-direction: column;
    gap: 6px;
    margin-top: 0.2rem;
  }

  .book-card-actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.65rem;
    padding: 0.45rem 0.5rem;
    letter-spacing: 0.1em;
  }

  .book-card-actions .btn-ghost {
    display: none;
  }

  .book-island {
    font-size: 0.58rem;
    margin-top: 0.35rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .book-show-more {
    display: block;
  }
}
