/* ───────── Catalog page layouts ("sheets") ─────────
   A sheet fills whatever box holds it: a page of the book, a card in the profile strip, a tile in the panel.
   Every size inside is in cqw (a percent of the sheet's own width), so a sheet looks identical at any size.
   The photo takes all the height the text leaves free, so a short text means a bigger photo and no empty paper.
   --k is a text scale that sheet.js lowers a little when a long text would push the photo below its minimum. */

.sheet {
  --k: 1;
  --paper: #FBFAFF;
  --ink: #17163B;
  --ink-2: #4B4972;
  --chip: #EEEDF8;
  --price: #FFC23D;
  --accent: var(--h1, #2F2BEA);
  position: absolute; inset: 0; overflow: hidden; container-type: inline-size;
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); direction: rtl; text-align: start;
  font-family: var(--font, 'Estedad', Tahoma, sans-serif);
}
.sh-photo { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #E4E2F1; }
.sh-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.sh-bg { display: none; }
/* "Show the whole photo": the photo is not cropped and sits on a soft, blurred enlargement of itself */
.fit-contain .sh-img { object-fit: contain; }
.fit-contain .sh-bg { display: block; transform: scale(1.25); filter: blur(16px) saturate(1.25) brightness(.92); }

.sh-text {
  flex: none; position: relative; display: flex; flex-direction: column; align-items: flex-start;
  gap: calc(2.2cqw * var(--k)); padding: calc(5.2cqw * var(--k)) 6.4cqw calc(6cqw * var(--k));
}
.sh-text > :empty { display: none; }
.sh-title {
  margin: 0; font-family: var(--font-display, 'Lalezar', serif); font-weight: 400; color: var(--ink);
  font-size: calc(7cqw * var(--k)); line-height: 1.32; text-wrap: balance; overflow-wrap: anywhere;
}
.sh-price {
  display: inline-block; padding: calc(1.1cqw * var(--k)) calc(3cqw * var(--k)); border-radius: 2.4cqw;
  font-weight: 900; font-size: calc(4.3cqw * var(--k)); line-height: 1.5; color: #1E1405; background: var(--price);
  box-shadow: 0 1.4cqw 3cqw -1.6cqw rgba(160, 100, 0, .55); font-variant-numeric: tabular-nums;
}
.sh-specs { list-style: none; margin: 0; padding: 0; align-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(1.8cqw * var(--k)); }
.sh-specs li {
  padding: calc(1.5cqw * var(--k)) calc(2.6cqw * var(--k)); border-radius: 2cqw; background: var(--chip);
  color: #2D2B57; font-weight: 700; font-size: calc(3.3cqw * var(--k)); line-height: 1.55; overflow-wrap: anywhere;
}
.sh-body { margin: 0; color: var(--ink-2); font-size: calc(3.7cqw * var(--k)); line-height: 1.85; white-space: pre-line; overflow-wrap: anywhere; }
.sheet.clamped .sh-body { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 3); overflow: hidden; }

/* ── فقط عکس / عکس با متن زیر کتاب: the photo is the page, in its own proportions ── */
.sheet-image .sh-text, .sheet-classic .sh-text { display: none; }

/* ── عکس و توضیح: a large photo and a short caption ── */
.sheet-caption .sh-photo { min-height: 58%; }
.sheet-caption .sh-title, .sheet-caption .sh-price, .sheet-caption .sh-specs { display: none; }
.sheet-caption .sh-text { padding-top: calc(4.4cqw * var(--k)); padding-bottom: calc(5cqw * var(--k)); }
.sheet-caption .sh-text::before { content: ''; width: 9cqw; height: .9cqw; border-radius: 1cqw; background: var(--accent); }
.sheet-caption .sh-body { color: var(--ink); font-weight: 600; font-size: calc(4.2cqw * var(--k)); line-height: 1.75; }

/* ── عکس، تیتر و متن ── */
.sheet-article .sh-photo { min-height: 34%; }
.sheet-article .sh-price, .sheet-article .sh-specs { display: none; }
.sheet-article .sh-text::before { content: ''; width: 9cqw; height: .9cqw; border-radius: 1cqw; background: var(--accent); margin-bottom: calc(.6cqw * var(--k)); }
.sheet-article .sh-title { font-size: calc(7.6cqw * var(--k)); }

/* ── محصول: name, price, details ── */
.sheet-product .sh-photo { min-height: 36%; }
.sheet-product .sh-title { font-size: calc(6.6cqw * var(--k)); }
.sheet-product .sh-specs { margin-top: calc(.8cqw * var(--k)); }
.sheet-product .sh-body { font-size: calc(3.4cqw * var(--k)); line-height: 1.8; }
