.book-reference h2,
.book-section > h2,
.book-order h2 {
  margin-bottom: 20px;
}

.reader-comments {
  max-width: 780px;
  margin-inline: auto;
}

.reader-comments > h2 { text-align: center; }

.reader-comment {
  --bubble: #faf0db;
  --bubble-header: #ecd8b2;
  --bubble-footer: #f4e6ca;
  --bubble-ink: #503b27;
  --avatar-size: clamp(34px, 7vw, 54px);
  position: relative;
  padding-block-start: calc(var(--avatar-size) / 2);
  margin-block: 0 22px;
  margin-inline-end: clamp(12px, 10%, 78px);
}
.reader-comment:nth-of-type(even) {
  --bubble: #edf3e9;
  --bubble-header: #d4e3d0;
  --bubble-footer: #e2ecde;
  --bubble-ink: #334b3d;
  margin-inline: clamp(12px, 10%, 78px) 0;
}
.reader-comment-avatar {
  position: absolute;
  z-index: 1;
  inset-block-start: 0;
  inset-inline: 0;
  margin-inline: auto;
  display: grid;
  place-items: center;
  width: var(--avatar-size);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--paper);
  background: var(--bubble-header);
  color: var(--bubble-ink);
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 700;
  text-transform: uppercase;
}
.reader-comment header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: -12px calc(-1 * clamp(12px, 3vw, 20px)) 10px;
  padding: calc(var(--avatar-size) / 2 + 6px) clamp(12px, 3vw, 20px) 8px;
  border-radius: 16px 16px 0 0;
  background: var(--bubble-header);
}
.reader-comment h3 { font: 600 1rem var(--sans); margin: 0; }
.reader-comment-bubble {
  position: relative;
  min-width: 0;
  padding: 12px clamp(12px, 3vw, 20px);
  border-radius: 16px;
  background: var(--bubble);
  color: var(--bubble-ink);
}
.reader-comment-bubble .prose p { color: inherit; margin-bottom: .5em; }
.reader-comment footer {
  color: inherit;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: .8rem;
  margin: 8px calc(0px - clamp(12px, 3vw, 20px)) -12px;
  padding: 6px clamp(12px, 3vw, 20px);
  border-radius: 0 0 16px 16px;
  background: var(--bubble-footer);
}
.reader-comment footer > :is(time, span) {
  overflow-wrap: anywhere;
}
.reader-screenshot {
  display: grid;
  place-items: center;
  min-width: 36px;
  min-height: 36px;
  margin-inline-start: auto;
}
.reader-screenshot-dialog {
  max-width: min(680px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}
.reader-screenshot-dialog::backdrop { background: #0009; }
.reader-screenshot-dialog button {
  float: inline-end;
  margin-inline-start: 12px;
  cursor: pointer;
}
.reader-screenshot-dialog img { max-height: 70vh; object-fit: contain; }

@media (max-width: 899px) {
  .reader-comments > h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: 16px;
  }

  .reader-comments > .reader-comment {
    --avatar-size: 38px;
    margin: 0 0 18px;
  }

  .reader-comment header {
    justify-content: center;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .reader-comment-bubble .prose {
    font-size: 1rem;
    line-height: 1.7;
  }

  .reader-screenshot {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (min-width: 900px) {
  .reader-comments {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 20px;
    max-width: none;
  }

  .reader-comments > :is(h2, p) {
    grid-column: 1 / -1;
    margin-block: 0;
  }

  .reader-comments > .reader-comment {
    --avatar-size: 40px;
    margin: 0;
  }
}

@media (min-width: 1280px) {
  .reader-comments {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.book-reference-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf7;
}

.book-reference-table:focus-visible {
  outline: 3px solid #bc8938;
  outline-offset: 3px;
}

.book-reference table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  text-align: left;
}

.book-reference th,
.book-reference td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.book-reference thead {
  background: var(--green);
  color: #fffdf7;
}

.book-reference tbody th {
  width: 50%;
  font-weight: 600;
}

.book-reference tbody tr:nth-child(even) {
  background: #f2efe5;
}

.book-reference td:last-child {
  font-variant-numeric: tabular-nums;
}

.book-section-block {
  border-top: 1px solid var(--line);
  padding-block: 18px;
}

.book-section-block.has-images {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: start;
  gap: 26px;
}

.book-section-block .prose {
  font-size: 1rem;
  line-height: 1.75;
}

html[lang=si] .book-section-block .prose {
  line-height: 1.85;
}

.book-section-block .prose :is(h1, h2, h3, h4, h5, h6) {
  margin-block: .8em .4em;
  font-size: 1.2em;
  line-height: 1.45;
}

.book-section-block .prose > :first-child {
  margin-block-start: 0;
}

.book-section-prose :is(p, ul, ol, blockquote) {
  margin-block: 0 .95em;
}

.book-section-prose div + div,
.book-section-prose :is(p, ul, ol, blockquote) + div {
  margin-block-start: .95em;
}

.book-section-prose div + :is(p, ul, ol, blockquote) {
  margin-block-start: .95em;
}

.book-section-block .prose :is(ul, ol) {
  padding-inline-start: 1.5em;
}

.book-section-block .prose blockquote {
  margin-inline: 0;
  padding-inline-start: 1em;
  border-inline-start: 2px solid var(--line);
}

.book-section-prose > :is(p, div, ul, ol, blockquote):last-child {
  margin-bottom: 0;
}

.book-section-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.book-section-images figure {
  margin: 0;
}

.book-section-images img {
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  border-radius: 9px;
}

.book-section-images figcaption {
  padding: 8px 12px;
  font-size: 13px;
}

.book-section-compact {
  padding-block: 24px 48px;
}

.book-section-compact .book-tabs {
  margin-bottom: 24px;
}

.book-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 20px;
  align-items: start;
}

.book-order-summary,
.book-order-form {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf7;
}

.book-order-summary {
  background: #eeeade;
}

.book-about-content {
  min-width: 0;
}

.book-about-content .book-section-block {
  padding-block: 16px;
}

.book-order-summary img {
  width: 160px;
  max-height: 145px;
  object-fit: contain;
  margin: 0 auto 12px;
}

.book-order-summary h3,
.book-order-summary p {
  margin-bottom: 10px;
}

.book-order-summary dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-block: 8px;
}

.book-order-summary dl > div:last-child {
  font-weight: 700;
}

.book-order-summary dd {
  margin: 0;
  white-space: nowrap;
}

.book-order-summary a {
  text-decoration: underline;
}

.book-order-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 16px;
}

.book-order-fields label {
  display: grid;
  align-content: start;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}

.book-order-fields input,
.book-order-fields select,
.book-order-fields textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #a5a89d;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: 400 16px/1.4 var(--sans);
}

.book-order-fields textarea {
  resize: vertical;
}

.book-order-fields textarea:focus-visible {
  outline: 3px solid #bc8938;
  outline-offset: 3px;
}

.book-field-wide {
  grid-column: 1 / -1;
}

.book-videos {
  padding-top: 0;
}

.book-video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.book-video-grid .video-entry {
  min-width: 0;
  margin-bottom: 0;
  padding-bottom: 16px;
  overflow-wrap: anywhere;
}

.book-video-grid h3 {
  margin: 12px 0 6px;
  font-size: 18px;
}

@media (max-width: 700px) {
  .book-video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-order,
  .book-section-block.has-images {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .book-order-fields,
  .book-video-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.book-order-form [data-order-whatsapp][hidden] { display: none; }
