/* =========================================
   トップページ（slug: home）専用CSS
   セレクタはすべて body.page-home でスコープし、
   他LP・固定ページに干渉しない。
   PC: 768px以上 / SP: 767px以下 で切り替え。

   共通の前処理（SANGO親リセット3層・font-smoothing・wpautop副産物非表示）は
   assets/css/lp-base.css 側で当てている（page-template-page-forfront スコープ）。
   ========================================= */

body.page-home {
    --hb-blue: #1f73e8;
    --hb-blue-dark: #092b55;
    --hb-blue-bg: #eef7ff;
    --hb-blue-line: #d8e8ff;
    --hb-card-shadow: 0 8px 24px rgba(20, 80, 160, 0.12);
    --hb-card-shadow-hover: 0 14px 32px rgba(20, 80, 160, 0.18);
    --hb-radius: 16px;
}

/* SANGO親テーマの h2/h3 装飾（左の青縦線・before/after）が
   トップ用カード／見出しに乗らないよう全部消す。
   このページ内のすべての h2/h3 をトップ用に統一する。 */
body.page-home .entry-content h2,
body.page-home .entry-content h3 {
    border: 0;
    background: none;
    padding: 0;
}
body.page-home .entry-content h2::before,
body.page-home .entry-content h2::after,
body.page-home .entry-content h3::before,
body.page-home .entry-content h3::after {
    content: none;
    display: none;
    background: none;
    border: 0;
}

/* セクション本体：max-width 内寄せ + 横padding。
   セクション間の縦余白は section単位の padding で制御する。
   max-width 1120 はサイト共通の作品系幅（profile / 「針とらの作品はこちら」と同幅）。 */
body.page-home .books-home-hero,
body.page-home .books-home-featured,
body.page-home .books-home-lineup,
body.page-home .books-home-about {
    margin: 0 auto;
    max-width: 1120px;
    padding: 0 16px;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont,
        "Hiragino Sans", "Yu Gothic", sans-serif;
}

/* セクション間の縦リズム（一画面情報量を優先してコンパクトに）。
   hero の margin-top はヘッダー〜FVの隙間（profile の最初のセクション余白と同値）。 */
body.page-home .books-home-hero { margin-top: 14px; padding-bottom: 12px; }
body.page-home .books-home-featured { padding-top: 24px; padding-bottom: 8px; }
body.page-home .books-home-lineup { padding-top: 24px; padding-bottom: 8px; }
body.page-home .books-home-about { padding-top: 24px; padding-bottom: 20px; }

@media (max-width: 767px) {
    /* SPはFVがない分、背景に淡い色を敷いて寂しさを補う。
       候補（レッド兄案）：#f7fbff / #f7f9fc / #f5f9ff
       親テーマの page-forfront は #container 直下に header / 空の .bg-white /
       #content / footer を並べる構造。ヘッダー〜本文〜フッター間の
       余白を埋めるには #container にまとめて色を当てるのが確実。
       内側の #content は透明化して #container の色を透かす。
       PCでは触らない（親テーマの白を維持してFV装飾が映える）。 */
    body.page-home #container {
        background-color: #f5f9ff;
    }
    body.page-home #content.page-forfront {
        background: transparent;
    }
    /* SP左右余白を縮めてカード幅を稼ぐ（24px → 18px）。
       カードの角丸が画面端ギリにならない範囲で詰めた値。 */
    body.page-home .books-home-hero,
    body.page-home .books-home-featured,
    body.page-home .books-home-lineup,
    body.page-home .books-home-about {
        padding-left: 18px;
        padding-right: 18px;
    }
    body.page-home .books-home-hero { padding-top: 8px; padding-bottom: 8px; }
    body.page-home .books-home-featured { padding-top: 16px; padding-bottom: 12px; }
    body.page-home .books-home-lineup { padding-top: 16px; padding-bottom: 12px; }
    body.page-home .books-home-about { padding-top: 24px; padding-bottom: 12px; }
}

/* =========================================
   ファーストビュー（PC）／ ページ見出し（SP）
   PC：左コピー＋3D本3冊。
   SP：FV相当の派手な部分は出さず、短い見出し＋リードだけ表示する。
   ========================================= */

body.page-home .books-home-hero__sp-title { display: none; }
body.page-home .books-home-hero__pc { display: block; }

/* SP見出し */
body.page-home .books-home-hero__sp-h1 {
    margin: 0 0 4px;
    font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", "YuGothic", sans-serif;
    font-weight: 800;
    font-size: 22px;
    color: var(--hb-blue-dark);
    line-height: 1.3;
}

body.page-home .books-home-hero__sp-lead {
    margin: 0;
    font-size: 13px;
    line-height: 1.65;
    color: #4a5970;
}

/* PC FV: 左コピー / 右3D本3冊 ＋ PNG装飾（開かれた本・紙飛行機）。
   背景はベース色＋柔らかい光彩のみ（小さいドットはPNG装飾と二重なので削除）。
   コピーは上寄せ、書影は底辺寄せでテキスト下に開かれた本が収まる構図。 */
body.page-home .books-home-hero__pc {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 5px;
    align-items: center;
    background:
        radial-gradient(circle at 12% 20%, rgba(143, 208, 255, 0.22) 0, transparent 55%),
        radial-gradient(circle at 92% 78%, rgba(255, 232, 150, 0.20) 0, transparent 50%),
        var(--hb-blue-bg);
    border-radius: 22px;
    padding: 4px 28px;
    box-shadow: var(--hb-card-shadow);
}

/* コピーは縦中央寄せ（grid align-items: center 継承）、
   書影だけ底辺寄せにして本の絵に書影底が揃う構図にする。 */
body.page-home .books-home-hero__books {
    align-self: end;
}
body.page-home .books-home-hero__copy {
    margin-top: -64px;
}

/* PC FV装飾レイヤー：レッド兄PNG素材を absolute で重ねる。
   pointer-events: none と aria-hidden="true" でクリック導線・支援技術には透明。
   旧 ::before/::after の inline SVG は廃止し、PNGで本格的な装飾に切替。 */
body.page-home .books-home-hero__ornaments {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body.page-home .books-home-hero__ornament {
    position: absolute;
    pointer-events: none;
    user-select: none;
    display: block;
}

/* 開かれた本（左下、テキストの下に来る位置） */
body.page-home .books-home-hero__ornament--book {
    left: 16px;
    bottom: 24px;
    width: clamp(180px, 22vw, 300px);
    opacity: 0.7;
}

/* 紙飛行機（やや下：書影上端付近を飛ぶイメージ） */
body.page-home .books-home-hero__ornament--plane {
    left: 32%;
    top: 36px;
    width: clamp(70px, 7vw, 110px);
    opacity: 0.65;
    transform: rotate(-8deg);
}

/* コピーと書影は装飾レイヤーの前面に */
body.page-home .books-home-hero__copy,
body.page-home .books-home-hero__books {
    position: relative;
    z-index: 1;
}

body.page-home .books-home-hero__title {
    margin: 0 0 12px;
    font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", "YuGothic", sans-serif;
    font-weight: 800;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.45;
    letter-spacing: 0.03em;
    color: var(--hb-blue-dark);
}

body.page-home .books-home-hero__sub {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.85;
    color: #2a3b5a;
}

body.page-home .books-home-hero__books {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0px;
    align-items: end;
}

/* 3冊の表示サイズ揃え：縦長セルに contain で収めて高さを統一する。
   元PNGの僅かなピクセル差で書影サイズが揺れるのを防ぐ目的。 */
body.page-home .books-home-hero__book {
    margin: 0;
    aspect-ratio: 9 / 15;
}

body.page-home .books-home-hero__book a {
    display: block;
    height: 100%;
    transition: transform 0.18s ease;
}

body.page-home .books-home-hero__book a:hover {
    transform: translateY(-4px);
}

/* <a> > <picture> > <img> 構造で <img> の height:100% が <a> から伝わるよう、
   間の <picture> を block + height:100% でパススルーさせる（WebP切替で picture を挟むため）。 */
body.page-home .books-home-hero__book picture {
    display: block;
    height: 100%;
}

body.page-home .books-home-hero__book img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    display: block;
    filter: drop-shadow(0 12px 18px rgba(20, 80, 160, 0.22));
}

/* SP切替：PC FVを隠してsp-titleだけ表示。
   ※ この上書きは __pc の grid 定義より後ろに置かないと同詳細度で負ける。 */
@media (max-width: 767px) {
    body.page-home .books-home-hero__sp-title { display: block; }
    body.page-home .books-home-hero__pc { display: none; }
}

/* =========================================
   セクション見出し共通
   ========================================= */

body.page-home .books-home-featured__heading,
body.page-home .books-home-lineup__heading,
body.page-home .books-home-about__heading {
    font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", "YuGothic", sans-serif;
    font-weight: 800;
    color: var(--hb-blue-dark);
    margin: 0 0 12px;
    text-align: center;
    font-size: clamp(19px, 2.0vw, 24px);
    letter-spacing: 0.04em;
    position: relative;
}

/* 見出し下のアクセントライン */
body.page-home .books-home-featured__heading::after,
body.page-home .books-home-lineup__heading::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin: 6px auto 0;
    background: var(--hb-blue);
    border-radius: 999px;
}

/* =========================================
   注目作品セクション
   ========================================= */

body.page-home .books-home-featured__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

@media (max-width: 767px) {
    body.page-home .books-home-featured__list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

body.page-home .work-card {
    display: block;
    background: #fff;
    border: 1px solid var(--hb-blue-line);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-card-shadow);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

body.page-home .work-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hb-card-shadow-hover);
}

/* PC：注目作品カード（縦積み・上画像／下テキスト）。SPは @media で横並びに上書き。 */
body.page-home .work-card--featured {
    display: flex;
    flex-direction: column;
    height: 100%;
}

body.page-home .work-card--featured .work-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f7fc;
}

body.page-home .work-card--featured .work-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* slug 別微調整は common.css の `--hb-cover-position` 上書きに集約 */
    object-position: var(--hb-cover-position, center);
    display: block;
}

body.page-home .work-card--featured .work-card__body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

body.page-home .work-card__title {
    font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", "YuGothic", sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.4;
    color: var(--hb-blue-dark);
    margin: 0;
}

/* slug別タイトル色（assets/css/common.css の他LPスライダーと同じ色値）。
   featured カードはタイトル中の __title-text に着色（NEWバッジは色を独自に持つ）、
   lineup カードはタイトル要素そのものに着色する。
   anthology / other_originals は色指定なし（--hb-blue-dark のまま）。 */
body.page-home .work--minecraft_adventure .work-card__title-text,
body.page-home .work--minecraft_adventure.work-card--lineup .work-card__title { color: #5ba93a; }
body.page-home .work--kamieshi_note .work-card__title-text,
body.page-home .work--kamieshi_note.work-card--lineup .work-card__title { color: #1f73d8; }
body.page-home .work--zetsuoni .work-card__title-text,
body.page-home .work--zetsuoni.work-card--lineup .work-card__title { color: #c81818; }
body.page-home .work--battlecats .work-card__title-text,
body.page-home .work--battlecats.work-card--lineup .work-card__title { color: #ee8c2c; }
body.page-home .work--novel-irumakun .work-card__title-text,
body.page-home .work--novel-irumakun.work-card--lineup .work-card__title { color: #7e3fab; }

body.page-home .work-card__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #4a5970;
}

body.page-home .work-card__tags {
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.page-home .work-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--hb-blue-bg);
    color: var(--hb-blue);
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid var(--hb-blue-line);
    line-height: 1.6;
}

/* NEW バッジ：タイトル右横に inline 配置（書影には重ねない） */
body.page-home .work-card__title {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

body.page-home .work-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    line-height: 1.5;
    white-space: nowrap;
    vertical-align: middle;
}

body.page-home .work-badge--new {
    background: #ff4d4f;
}

/* PCでは矢印は出さない（縦積みカードでは不要） */
body.page-home .work-card--featured .work-card__arrow {
    display: none;
}

/* SP：注目作品カードを横並びに切り替え（左画像／右テキスト／右端矢印）。
   画像は正方形・中央フォーカス・角丸。 */
@media (max-width: 767px) {
    body.page-home .work-card--featured {
        flex-direction: row;
        align-items: stretch;
        gap: 12px;
        padding: 8px;
        min-height: 0;
    }

    body.page-home .work-card--featured .work-card__image {
        flex: 0 0 110px;
        aspect-ratio: 1 / 1;
        width: 110px;
        height: 110px;
        border-radius: 10px;
        overflow: hidden;
    }

    body.page-home .work-card--featured .work-card__body {
        padding: 0 24px 0 0;
        gap: 3px;
        justify-content: center;
    }

    body.page-home .work-card--featured .work-card__title {
        font-size: 17px;
    }

    body.page-home .work-card--featured .work-card__desc {
        font-size: 12.5px;
        line-height: 1.55;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    body.page-home .work-card--featured .work-tag {
        font-size: 10.5px;
        padding: 1px 8px;
    }

    body.page-home .work-card--featured .work-card__arrow {
        display: block;
        position: absolute;
        right: 10px;
        top: 50%;
        width: 8px;
        height: 8px;
        border-top: 2px solid var(--hb-blue);
        border-right: 2px solid var(--hb-blue);
        transform: translateY(-50%) rotate(45deg);
    }
}

/* =========================================
   作品ラインナップ／ほかの作品
   ========================================= */

body.page-home .books-home-lineup__heading-pc { display: inline; }
body.page-home .books-home-lineup__heading-sp { display: none; }

@media (max-width: 767px) {
    body.page-home .books-home-lineup__heading-pc { display: none; }
    body.page-home .books-home-lineup__heading-sp { display: inline; }
}

body.page-home .books-home-lineup__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 767px) {
    body.page-home .books-home-lineup__list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

body.page-home .work-card--lineup {
    padding: 8px 10px 8px;
    text-align: center;
}

/* 書影を縦長で全部見せると高さが出すぎるので、横長＋中央フォーカスで切り取る。
   書影の中央付近の絵柄が出る形になる。 */
body.page-home .work-card--lineup .work-card__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: #f3f7fc;
    margin: 0 auto 6px;
}

body.page-home .work-card--lineup .work-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* slug 別微調整は common.css の `--hb-cover-position` 上書きに集約 */
    object-position: var(--hb-cover-position, center);
    display: block;
}

body.page-home .work-card--lineup .work-card__title {
    font-size: 15px;
    line-height: 1.35;
    text-align: center;
}

@media (max-width: 767px) {
    body.page-home .work-card--lineup {
        padding: 6px 8px 6px;
    }
    body.page-home .work-card--lineup .work-card__title {
        font-size: 14px;
    }
}

/* =========================================
   針とらについてカード
   ========================================= */

body.page-home .books-home-about__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    background: #fff;
    border: 1px solid var(--hb-blue-line);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-card-shadow);
    padding: 18px 28px;
}

body.page-home .books-home-about__icon {
    flex-shrink: 0;
}

body.page-home .books-home-about__icon img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--hb-blue-bg);
    display: block;
    object-fit: cover;
}

body.page-home .books-home-about__copy {
    min-width: 0;
}

body.page-home .books-home-about__heading {
    text-align: left;
    margin: 0 0 6px;
    font-size: 23px;
}

body.page-home .books-home-about__heading::after {
    display: none;
}

body.page-home .books-home-about__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.75;
    color: #2a3b5a;
}

body.page-home .books-home-about__button {
    display: inline-block;
    padding: 13px 26px;
    background: var(--hb-blue);
    color: #fff;
    text-decoration: none;
    /* M PLUS Rounded 1c の 800 だとボタン文字がジャギーになる（特にWindows ClearType）。
       Zen Maru Gothic 700 のほうがエッジが滑らかに描画される。 */
    font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", "YuGothic", sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(31, 115, 232, 0.32);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

body.page-home .books-home-about__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(31, 115, 232, 0.42);
}

/* SPプロフィールカード：左にアイコン・右にテキスト＋ボタンを縦積み。
   2列gridで、アイコンは2行ぶんまたいで縦中央に。 */
@media (max-width: 767px) {
    body.page-home .books-home-about__inner {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 6px 14px;
        padding: 12px 14px;
        text-align: left;
        align-items: start;
    }
    body.page-home .books-home-about__icon {
        margin: 0;
        grid-row: 1 / 3;
        align-self: center;
    }
    body.page-home .books-home-about__icon img {
        width: 56px;
        height: 56px;
    }
    body.page-home .books-home-about__copy {
        grid-column: 2;
        grid-row: 1;
    }
    body.page-home .books-home-about__heading {
        text-align: left;
        font-size: 15.5px;
        margin: 0 0 2px;
    }
    body.page-home .books-home-about__text {
        font-size: 12.5px;
        line-height: 1.6;
        text-align: left;
    }
    body.page-home .books-home-about__cta {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
    }
    body.page-home .books-home-about__button {
        padding: 8px 18px;
        font-size: 12.5px;
    }
}
