@charset "UTF-8";

/* ==========================================================================
   Home: 沼田研の推し本 プレビュー（Topicの下、最新3件）
   ========================================================================== */
.p-book {
    width: 100%;
    padding: 0 21svw;
    margin: var(--section-margin) auto;
}

.p-book__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2.5%;
    margin-top: 3em;
}

/* 3枚並べつつ、なるべく大きく見せる（画面幅に応じて滑らかにサイズが変わる） */
.p-book__item {
    width: calc((100% / 3) - 5%);
}

/* 1:1.414（A判用紙の比率）の箱の中央にタイトルと著者を表示する */
.p-book__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5em;
    width: 100%;
    aspect-ratio: 1 / 1.414;
    padding: clamp(0.4rem, calc(-1.9rem + 9.2vw), 5rem);
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    font: inherit;
    color: var(--color-White);
}

/* 3色からランダムに1色（表示側でクラスを付与）。本の表紙画像を敷く */
.p-book__card--green {
    background-color: var(--color-NUMATA-Green);
    background-image: url('../../images/common/recommend-book-green.webp');
    background-size: cover;
    background-position: center;
}

.p-book__card--orange {
    background-color: var(--color-NUMATA-Orange);
    background-image: url('../../images/common/recommend-book-orange.webp');
    background-size: cover;
    background-position: center;
}

.p-book__card--lightblue {
    background-color: var(--color-NUMATA-LightBlue);
    background-image: url('../../images/common/recommend-book-blue.webp');
    background-size: cover;
    background-position: center;
}

.p-book__title {
    font-weight: 700;
    font-size: var(--font-size-Text-R);
    line-height: 1.5;
    /* 長いタイトルは2行で...省略 */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.p-book__author {
    max-width: 100%;
    font-size: var(--font-size-Text-S);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media screen and (max-width: 767px) {
    .p-book {
        width: 100%;
        padding: 0 25px;
    }

}

/* ==========================================================================
   詳細モーダル（ホーム・一覧ページ共通）
   ========================================================================== */
.c-book-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5em;
    background-color: rgba(25, 36, 76, .8);
}

.c-book-modal[hidden] {
    display: none;
}

.c-book-modal__panel {
    position: relative;
    width: min(90vw, 32em);
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.5em 2em;
    background-color: var(--color-White);
    border-radius: 4px;
}

.c-book-modal__close {
    position: absolute;
    top: .5em;
    right: .5em;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-Primary);
}

.c-book-modal__title {
    font-size: var(--font-size-Text-L);
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: .5em;
}

.c-book-modal__author,
.c-book-modal__nickname {
    font-size: var(--font-size-Text-S);
    color: var(--color-gray);
    margin-bottom: .3em;
}

/* 推しの一言: 短い見出し的な一文として強調表示する */
.c-book-modal__catchphrase {
    margin-top: .8em;
    padding: .8em 0;
    font-size: var(--font-size-Text-R);
    font-weight: 700;
    line-height: 1.6;
    color: var(--color-Primary);
}

.c-book-modal__comment {
    margin-top: 1em;
    font-size: var(--font-size-Text-R);
    line-height: 1.8;
    white-space: pre-wrap;
}

.c-book-modal__comment:empty,
.c-book-modal__author:empty,
.c-book-modal__nickname:empty,
.c-book-modal__catchphrase:empty {
    display: none;
}