/* ========================================================================
   HOMEPAGE MOBILE FINAL POLISH
   Keeps the centered manuscript cover while using the available phone
   viewport more effectively.
   ======================================================================== */

@media (max-width: 640px) {
  .book-cover-container {
    min-height: 100svh;
    min-height: 100dvh;
    padding: max(0.55rem, env(safe-area-inset-top)) 0.7rem max(0.7rem, env(safe-area-inset-bottom));
    align-items: stretch;
  }

  .book-wrapper-3d {
    width: 100%;
    display: flex;
  }

  .book-cover {
    width: 100%;
    min-height: calc(100dvh - 1.25rem);
    min-height: calc(100svh - 1.25rem);
    padding: 2rem 1.2rem 1.35rem 1.85rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .cover-header {
    margin-top: 0.05rem;
    margin-bottom: 0.5rem;
  }

  .cover-title {
    max-width: 100%;
    padding-inline: 0.15rem;
    font-size: clamp(2.05rem, 9.5vw, 2.9rem);
    line-height: 0.99;
    overflow-wrap: normal;
    word-break: normal;
  }

  .cover-subtitle {
    max-width: 100%;
    font-size: clamp(0.78rem, 3vw, 0.88rem);
  }

  .cover-crest {
    margin: 0.55rem 0;
  }

  .cover-crest svg {
    width: 76px;
  }

  .cover-content {
    width: 100%;
  }

  .cover-content > .cover-description {
    max-width: 315px;
    font-size: clamp(0.82rem, 3.15vw, 0.9rem);
    line-height: 1.5;
  }

  .cover-btn {
    width: min(100%, 315px);
    min-height: 50px;
    margin-inline: auto;
    margin-top: 0.9rem;
  }

  .cover-stats {
    width: min(100%, 355px);
    margin-top: 0.85rem;
    padding-top: 0.75rem;
  }

  .cover-footer {
    width: 100%;
    margin-top: 0.8rem;
    padding-top: 0.55rem;
  }

  .cover-author,
  .cover-publisher {
    text-align: center;
  }
}

@media (max-width: 380px) {
  .book-cover {
    padding-left: 1.65rem;
    padding-right: 0.95rem;
  }

  .cover-title {
    font-size: 2rem;
  }

  .cover-description {
    max-width: 290px !important;
  }
}
