/* ==================================================
   Reset & Basic Styles
================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.7;
    color: #665;
    /* 少し柔らかいブラウン系 */
    background-color: #fffaf4;
    /* クリーム色 */
    font-size: 16px;
}

a {
    color: #ff80ab;
    /* アクセントのピンク */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #f06292;
    /* 少し濃いピンク */
}

/* キーボード操作時のフォーカススタイル */
a:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible {
    outline: 2px solid #ff80ab;
    outline-offset: 2px;
    border-radius: 2px;
    /* フォーカスリングにも少し丸み */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-style: none;
}

ul {
    list-style: none;
}

h1,
h2,
h3 {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 700;
    color: #5d4037;
    /* ブラウン系 */
    margin-bottom: 0.8em;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.6rem;
}

h3 {
    font-size: 1.3rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* .container-narrow はこのファイルでは未使用のため削除 */

/* ==================================================
   Header
================================================== */
.site-header {
    background-color: #fff;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#headernav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    max-height: 40px;
}

#headernav nav ul {
    display: flex;
}

#headernav nav li {
    margin-left: 25px;
}

#headernav nav a {
    color: #555;
    font-weight: 500;
    padding: 10px 0;
    position: relative;
    font-size: 0.95rem;
}

#headernav nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ff80ab;
    /* ピンク */
    transition: width 0.3s ease;
}

#headernav nav a:hover::after,
#headernav nav a.active::after {
    /* .active クラスはJSで付与想定 */
    width: 100%;
}

/* ハンバーガーメニューアイコン (JSで生成・制御) */
#menu-icon {
    display: none;
    /* PCでは非表示 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    /* ナビゲーションより手前に */
}

/* ハンバーガーメニューのバー (JSで生成されるspan要素) */
#menu-icon span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* ハンバーガーメニューが開いた時のスタイル (JSで .active クラスを付与) */
#menu-icon.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

#menu-icon.active span:nth-child(2) {
    opacity: 0;
}

#menu-icon.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ==================================================
   Page Header
================================================== */
.page-header {
    background: linear-gradient(135deg, #e6ffcc, #ccf2ff);
    /* ミントグリーンからライトブルーへ */
    padding: 50px 0;
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 3px dashed #d9ead3;
    /* グリーンの点線 */
}

.page-header h1 {
    color: #689f38;
    /* グリーン系 */
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
}

.page-header h1 .icon-mint {
    /* Font Awesome アイコン用 */
    color: #81c784;
    /* ミントグリーン */
    margin-right: 15px;
    font-size: 1em;
}

.page-header p {
    font-size: 1.1rem;
    color: #556b2f;
    /* ダークオリーブグリーン */
    margin-bottom: 0;
    font-weight: 500;
}

/* ==================================================
   Main Content
================================================== */
.main-content {
    padding: 20px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.8rem;
    color: #8d6e63;
    /* ブラウン系 */
    position: relative;
    padding-bottom: 15px;
}

/* リボン風の下線 */
.section-title::before,
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    height: 10px;
    width: 10px;
    background-color: #a5d6a7;
    /* ライトグリーン */
    border-radius: 50%;
}

.section-title::before {
    left: 50%;
    transform: translateX(-35px);
}

.section-title::after {
    left: 50%;
    transform: translateX(25px);
}

.section-title::first-letter {
    font-size: 1.2em;
    color: #689f38;
    /* グリーン系 */
}

/* ==================================================
   Book Preview Section
================================================== */
.book-preview-section {
    margin-bottom: 50px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.book-card {
    background-color: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.book-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    /* アスペクト比を維持 */
    height: auto;
    position: relative;
    background-color: #f8f8f8;
    /* 画像読み込み中の背景 */
    display: flex;
    /* CSS表現用 */
    justify-content: center;
    /* CSS表現用 */
    align-items: center;
    /* CSS表現用 */
}

.book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* 画像全体を表示 */
    padding: 10px;
    /* 内側に少し余白 */
}

/* --- 小王子用 CSS表現 --- */
.book-cover.book-cover-le-petit-prince {
    background-color: #34495e;
    /* 濃い紺色ベース */
    background-image:
        /* 星々 */
        radial-gradient(circle, white 1px, transparent 1px),
        radial-gradient(circle, white 1px, transparent 1px),
        radial-gradient(circle, white 2px, transparent 2px),
        radial-gradient(circle, white 1px, transparent 1px),
        radial-gradient(circle, white 1px, transparent 1px),
        radial-gradient(circle, white 1px, transparent 1px),
        radial-gradient(circle, white 2px, transparent 2px),
        radial-gradient(circle, white 1px, transparent 1px),
        /* ベースのグラデーション */
        linear-gradient(160deg, #2c3e50, #4a69bd, #8e44ad);
    background-size:
        /* 星々 */
        1px 1px, 1px 1px, 2px 2px, 1px 1px, 1px 1px, 1px 1px, 2px 2px, 1px 1px,
        /* ベース */
        auto;
    background-position:
        /* 星々 */
        10% 20%, 30% 80%, 50% 40%, 70% 15%, 85% 70%, 40% 10%, 65% 90%, 90% 30%,
        /* ベース */
        0 0;
    background-repeat: no-repeat;
    /* 星は繰り返さない */
    animation: twinkle-stars 5s infinite alternate;
    /* 星の瞬きアニメーション */
}

@keyframes twinkle-stars {
    0% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* 中央の大きな星 (Font Awesome) */
.book-cover.book-cover-le-petit-prince::before {
    content: '\f005';
    /* fa-star */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 4rem;
    color: #f1c40f;
    /* 黄色 */
    opacity: 0.9;
    text-shadow: 0 0 15px rgba(241, 196, 15, 0.6);
    /* 少し光らせる */
    z-index: 1;
    /* 星より手前 */
}

/* --- 小王子用 CSS表現 ここまで --- */

.book-info {
    padding: 20px;
    flex-grow: 1;
    /* 残りの高さを埋める */
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.25rem;
    color: #795548;
    /* ブラウン */
    margin-bottom: 8px;
    line-height: 1.4;
}

/* .book-title small はHTML構造に依存するため削除 */

.book-author {
    font-size: 0.9rem;
    color: #887;
    margin-bottom: 15px;
}

.book-description {
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
    /* 説明文エリアを伸ばす */
}

.book-description small {
    /* 引用元表示用 */
    display: block;
    margin-top: 8px;
    font-size: 0.85em;
    color: #aaa;
}

.external-links {
    margin-top: auto;
    /* ボタンをカード下部に配置 */
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    /* 折り返し */
    gap: 10px;
    /* ボタン間の隙間 */
    justify-content: center;
    /* 中央揃え */
}

/* 外部リンクボタン */
.external-links .link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    /* 少し小さめ */
    border: none;
    border-radius: 18px;
    /* 丸み */
    font-weight: 500;
    /* 少し細め */
    font-size: 0.9rem;
    /* 少し小さめ */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    color: #fff;
    /* デフォルトの文字色 */
    flex-grow: 1;
    /* ボタン幅を均等に */
    min-width: 120px;
    /* 最小幅 */
}

.external-links .link-button:hover {
    transform: translateY(-2px);
    text-decoration: none;
    /* ホバー時の下線削除 */
}

.external-links .link-button i {
    /* Font Awesome アイコン用 */
    margin-right: 6px;
}

/* 各ボタンの色 */
.external-links .link-button.amazon-link {
    background-color: #ff9900;
    /* Amazonオレンジ */
}

.external-links .link-button.amazon-link:hover {
    background-color: #e68a00;
}

.external-links .link-button.rakuten-link {
    background-color: #bf0000;
    /* 楽天レッド */
}

.external-links .link-button.rakuten-link:hover {
    background-color: #a60000;
}

.external-links .link-button.external-link {
    /* books.com.tw, eslite.com など */
    background-color: #8d6e63;
    /* ブラウン系 */
}

.external-links .link-button.external-link:hover {
    background-color: #795548;
}

.external-links .link-button.detail-link {
    /* 詳細を見るボタン */
    background-color: #e0f2f7;
    /* 薄い水色 */
    color: #0077cc;
    /* 青系 */
    border: 1px solid #b3d9e6;
    /* 枠線 */
}

.external-links .link-button.detail-link:hover {
    background-color: #cceeff;
    color: #0055aa;
}

/* ==================================================
   Footer Navigation Area
================================================== */
#footer_navi {
    background-color: #f0fff0;
    /* ハニーデュー（薄い緑） */
    padding: 40px 0;
    border-top: 1px solid #eee;
}

.daisosha_service h3 {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: #556b2f;
    /* ダークオリーブグリーン */
}

.service-button-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.service-button-list li {
    flex-basis: calc(33.333% - 15px);
    /* 3列ベース */
    min-width: 220px;
    /* 最小幅 */
}

.cta-button-service {
    display: block;
    padding: 12px 20px;
    background-color: #fff;
    color: #776;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid #eee;
}

.cta-button-service:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
    color: #689f38;
    /* グリーン系 */
    border-color: #d9ead3;
    /* 薄いグリーン */
}

.cta-button-service .button-icon {
    /* 絵文字アイコン用 */
    margin-right: 8px;
}

.cta-button-service .arrow {
    /* Font Awesome アイコン用 */
    margin-left: 8px;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.cta-button-service:hover .arrow {
    transform: translateX(4px);
}

/* ==================================================
   Footer
================================================== */
#footer_wrapper {
    background-color: #8d6e63;
    /* ブラウン系 */
    color: #eee;
    padding: 30px 0;
}

#footer ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

#footer li {
    margin: 5px 15px;
}

#footer a {
    color: #fff;
    font-size: 0.9rem;
}

#footer a:hover {
    color: #dcedc8;
    /* ライトグリーン */
}

.copyright {
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 15px;
    color: #ddd;
}

.copyright a {
    color: #eee;
    font-weight: bold;
}

.copyright a:hover {
    color: #dcedc8;
}

#footer img[alt="正当なCSSです!"] {
    /* W3C バリデーション画像 */
    opacity: 0.7;
    margin-top: 10px;
    vertical-align: middle;
    /* 他の要素と高さを揃える */
}

/* ==================================================
   Page Top Button
================================================== */
.page-top {
    display: none;
    /* 初期非表示 (JSで制御) */
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #81c784;
    /* ミントグリーン */
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    /* アイコン中央揃え */
    align-items: center;
    justify-content: center;
}

.page-top:hover {
    background-color: #689f38;
    /* グリーン系 */
    transform: scale(1.1);
}

/* ==================================================
   Responsive Styles
================================================== */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    #headernav {
        position: relative;
    }

    #menu-icon {
        display: block;
    }

    #headernav nav {
        display: none;
        /* JSで .active を付与して表示 */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        z-index: 1000;
    }

    #headernav nav.active {
        display: block;
    }

    #headernav nav ul {
        flex-direction: column;
        align-items: center;
    }

    #headernav nav li {
        margin: 10px 0;
        margin-left: 0;
        width: 90%;
        text-align: center;
    }

    #headernav nav a {
        display: block;
        padding: 10px;
    }

    /* スマホメニューのリンクスタイル調整 */

    .book-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .service-button-list li {
        flex-basis: calc(50% - 10px);
    }

    /* 2列 */
    #footer ul {
        flex-direction: column;
    }

    #footer li {
        margin: 8px 0;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .book-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* 1列 */
    .book-title {
        font-size: 1.15rem;
    }

    .book-description {
        font-size: 0.9rem;
    }

    .external-links .link-button {
        font-size: 0.85rem;
        padding: 6px 15px;
        min-width: 100px;
    }

    /* ボタンサイズ調整 */
    .service-button-list li {
        flex-basis: 100%;
    }

    /* 1列 */
}