/* A book's page: the cover and the facts, then every exercise as a number.
 *
 * Sixty rows of «هانون قطعه شماره ۴۱» is a list nobody reads to the end. In a
 * book like this the number is the name, so the number is what the page is
 * made of — a grid that can be scanned in one look and tapped anywhere.
 */

.book-page { padding-bottom: 60px; }

/* ---- who wrote it, how many, what is free ---- */

.book-head {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 28px);
  margin: clamp(18px, 3vw, 40px) 0 clamp(24px, 4vw, 40px);
  flex-wrap: wrap;
}

.book-cover {
  flex: 0 0 auto;
  width: clamp(110px, 18vw, 170px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.book-cover.is-blank {
  display: grid;
  place-items: center;
  font-size: 46px;
  background: rgba(255, 255, 255, 0.03);
}

.book-about { flex: 1 1 320px; min-width: 0; }
.book-about h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.35;
}
.book-facts {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.95rem;
}
.book-blurb {
  margin: 0 0 18px;
  color: #cfd6e4;
  line-height: 2;
  /* Some of these run to a paragraph and a half. Enough to know what the
     book is; the exercises are what the page is for. */
  max-width: 68ch;
}
.book-about .cta {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #14181f;
  font-weight: 700;
}
.book-about .cta:hover { filter: brightness(1.06); }

.book-page h2 {
  margin: clamp(24px, 4vw, 40px) 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
}
.book-hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.9;
}

/* ---- the exercises ---- */

.ex-grid {
  display: grid;
  /* Tiles find their own number of columns: about eleven on a desktop, four
     on a phone, and always the same size — a grid of numbers where the
     numbers are different sizes reads as a mistake. */
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}

.ex {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.ex:hover {
  border-color: var(--accent);
  background: rgba(255, 209, 102, 0.08);
  transform: translateY(-2px);
}
.ex-n { font-size: 1.3rem; font-weight: 700; }

/* Locked, and saying so quietly: the tile still opens — the song page is
   where the offer is made — so it is dimmed, not barred. */
.ex.is-locked { color: var(--muted); }
.ex.is-locked .ex-n { font-weight: 600; }
.ex-lock {
  position: absolute;
  top: 5px;
  inset-inline-end: 6px;
  font-size: 9px;
  opacity: 0.65;
}

.book-more {
  margin: clamp(24px, 4vw, 36px) 0 0;
  color: var(--muted);
  line-height: 2;
}
.book-more a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
