html {
    padding-top: 0 !important; /* htmlの上部パディングをゼロに */
    margin-top: 0 !important; /* htmlの上部マージンをゼロに */
}

body {
    padding-top: 0 !important; /* bodyの上部パディングをゼロに */
    margin: 0 !important; /* bodyの全方向マージンをゼロに */
  font-family:
    "ヒラギノ角ゴ ProN W3", /* macOS用 */
    "Hiragino Kaku Gothic ProN",
    "游ゴシック",           /* Windows 8.1以降 */
    "Yu Gothic",
    "メイリオ",             /* Windows Vista以降 */
    Meiryo,
    "ＭＳ Ｐゴシック",      /* 旧 Windows 用 */
    "MS PGothic",
    sans-serif;            /* 最終フォールバック */
}

/* レイアウトによる余白をリセット */
.main .container .content {
    padding: 0 !important;
    margin-top: 0 !important;
}

/* main要素とハンバーガーメニューのデフォルトマージンをリセット */
main, .hamburger-menu {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.top-image-hero {
    width: 100%; /* 親要素の幅に合わせる */
    height: 292px; /* 高さを292pxに固定 */
    overflow: hidden; /* はみ出た部分を非表示にする */
    margin: 0 auto; /* 中央寄せと下マージン */
}

.top-image {
    width: 100%; /* 親要素の幅に合わせる */
    height: 100%; /* 親要素の高さに合わせる */
    object-fit: cover; /* アスペクト比を維持し、要素を覆うように画像をトリミング */
    display: block;
}
.padding-top30 {
    padding-top: 30px;
}

.section-wide-color{
    width: 100%;
    background-color: #fef8f8;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 2rem;
}

.site-logo { /* ロゴ画像 */
    margin-right: 20px; /* タイトルとの間にスペース */
    margin-bottom: 35px; /* 縦並び時のマージンをリセット */
}
.site-title { /* ロゴ画像 */
    margin-bottom: 0; /* 縦並び時のマージンをリセット */
}

.title-with-logo { /* ロゴとタイトルを囲むコンテナ */
    display: flex;
    flex-direction: row; /* PC表示で横に並べる */
    align-items: center; /* 垂直方向中央寄せ */
    justify-content: center; /* 水平方向中央寄せ */
    max-width: 750px; /* コンテンツの幅に合わせて調整 */
    margin: 20px auto 30px auto; /* 上下マージンと中央寄せを調整 */
}

.title-with-logo h2 { /* コンテナ内のh2 */
    margin: 0; /* デフォルトマージンをリセット */
}

.title-text{
    font-size:1.8em; 
    color: #958d8b;
}
.title-text2{
    font-size:2.5em; 
    text-align: center;
    margin-bottom: 30px;
}
.title-description {
    max-width: 600px;
    margin: 0 auto;
    margin-bottom: 30px;
}
.title-description2 {
    max-width: 850px;
    margin: 0 auto;
    margin-bottom: 40px;
}

.description-text {
    display: inline-block;
    text-align: left; /* 改行された文字を左揃えに */
}
.description-text2 {
    display: inline-block;
    line-height: normal; /* デフォルトの行の高さを適用 */
}

.kirokueizo-link-container {
    display: flex;
    align-items: center;
    justify-content: center; /* 中央寄せ */
    flex-wrap: nowrap; /* 折り返しを防止 */
    gap: 10px; /* テキストと画像の間隔 */
    max-width: 850px;
    margin: 0 auto 40px auto; /* 中央寄せと下マージン */
}

.kirokueizo-logo {
    width: 150px; /* 画像の幅 */
    height: auto; /* アスペクト比を維持 */
    vertical-align: middle; /* 垂直方向中央揃え */
}

@media (max-width: 767px) {
    .kirokueizo-link-container {
        flex-direction: column; /* スマホ表示で縦並び */
        text-align: left; /* 左寄せ */
    }
    .kirokueizo-logo {
        margin-top: 10px; /* テキストとの間隔 */
    }
}

/* Search Box */
.search-box {
    padding: 10px 0;
    max-width: 850px; /* 幅を制限 */
    margin: 0 auto 20px auto; /* 中央寄せ */
}
.search-box h2 {
    text-align: left; /* 作品検索のタイトルは左寄せ */
}
.search-form-container {
    display: flex;
    align-items: center;
}
.search-input {
    width: 600px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 3px 0 0 3px;
    flex-basis: 600px; /* 基準となる幅を設定 */
    flex-grow: 0; /* 伸びないようにする */
    background-color: #fff !important;
 }
.search-button {
    width: 40px;
    height: 40px;
/*    border: 1px solid #2b3187;*/
    background-color: #2b3187;
    color: white;
    cursor: pointer;
    border: 0;
    border-radius: 0 3px 3px 0;
    padding: 0; /* パディングをゼロに */
    margin-top: -4px; /* パディングをゼロに */
    line-height: 1; /* 行の高さを1に */
    box-sizing: border-box; /* パディングとボーダーを幅と高さに含める */
    flex-shrink: 0; /* 縮小されないようにする */
    flex-grow: 0; /* 伸びないようにする */
    min-width: 40px; /* 最小幅を40pxに設定 */
    max-width: 40px; /* 最大幅を40pxに設定 */
    display: flex; /* フレックスコンテナとして設定 */
    justify-content: center; /* 水平方向中央寄せ */
    align-items: center; /* 垂直方向中央寄せ */
    overflow: hidden; /* コンテンツがはみ出さないように隠す */
    white-space: nowrap; /* テキストを折り返さない */
    text-overflow: ellipsis; /* はみ出したテキストを省略記号で表示 */
    font-size: 2rem;
}

.search-button .search-icon {
    width: 100%; /* ボタンの幅に合わせる */
    height: 100%; /* ボタンの高さに合わせる */
    object-fit: contain; /* アスペクト比を維持してフィット */
    padding: 3px 5px 5px 5px; /* 上下左右のパディングを調整 (上3px, 右5px, 下7px, 左5px) */
}
.search-caption {
    margin: -1rem 0 0 40px;
    font-size: 0.8em;
    color: #666;
    line-height: 1.5;
}

.genre-list {
    text-align: left; /* 左寄せ */
    margin-top: 20px;
    padding-top: 30px;
    padding-bottom: 20px;
    max-width: 850px; /* 幅を制限 */
    margin: 0 auto 30px auto; /* 中央寄せ */
    display: flex; /* Flexboxコンテナにする */
    flex-wrap: wrap; /* 折り返しを許可 */
    align-items: flex-start; /* 上揃え */
}

.genre-list h4 { /* h2からh4に変更されているため修正 */
    text-align: left; /* ジャンル検索のタイトルは左寄せ */
    margin-bottom: 20px;
    width: 100%; /* 幅を100%にして独立した行にする */
}

.genre-tags-container {
    display: flex;
    max-width: 680px; /* 幅を制限 */
    flex-direction: column; /* 縦に並べる */
    background-color: #fef8f8; /* 背景色 */
    padding: 20px 10px 5px 20px; /* パディング */
    border-radius: 8px; /* 角丸 */
    border: 1px solid #ddd; /* 点線ボーダー */
    flex-grow: 1; /* 伸びるようにする */
}

.genre-row {
    display: flex;
    flex-wrap: wrap; /* 折り返し */
    margin-bottom: 10px; /* 行間のマージン */
}
.genre-section-wrapper{
    display: flex; /* これは維持 */
    align-items: center; /* 垂直方向中央寄せ */
    padding-bottom: 10px;
}
.genre-link {
    display: inline-block;
    margin-right: 15px; /* リンク間のマージン */
    margin-bottom: 5px; /* 下方向のマージン */
    color: #333; /* 文字色 */
    text-decoration: none; /* 下線なし */
    font-size: 1em; /* フォントサイズ */
    white-space: nowrap; /* 折り返しなし */
}

.genre-link:hover {
    text-decoration: underline; /* ホバーで下線 */
}

.memoir-link-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 90px; /* 円の幅 */
    height: 90px; /* 円の高さ */
    border-radius: 50%; /* 円形にする */
    background-color: #fef8f8; /* 背景色 */
    border: 1px dotted #f0e0e0; /* 点線ボーダー */
    box-shadow: 0 0 0 15px #f3e6f0; /* 外側の薄いピンクの影 */
    text-align: center;
    flex-shrink: 0; /* 縮小させない */
    margin-left: 50px; /* ジャンルリストとの間にマージン */
    white-space: nowrap;
    align-self: center; /* 追加: 親Flexコンテナ内で自身を中央揃えにする */
}

.memoir-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #666; /* 文字色 */
}

.memoir-text1 {
    font-size: .9em;
    font-weight: normal;
}
.memoir-text2 {
    font-size: 1em;
    font-weight: bold;
}

.memoir-link:hover {
    text-decoration: underline;
}


.section-wide-white{
    padding: 2rem;
}
.top-section-with-bg {
    position: relative; /* 擬似要素の基準位置 */
    z-index: 1; /* コンテンツが背景画像より手前に来るように */
}

.top-section-with-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/img/my_image/camera_image_400.png');
/*    background-size: 273px 350px;*/ /* オリジナルサイズ */
    background-size: 312px 400px; /* オリジナルサイズ */
/*    background-position: 10% 50%;*/ /* 左右は中心よりちょっと左寄り (20%)、上下はちょっと下寄り (60%) */
    background-position: left 80px top 20px; /* 左右は中心よりちょっと左寄り (20%)、上下はちょっと下寄り (60%) */
    background-repeat: no-repeat;
    opacity: 0.15; /* 透明度15% */
    z-index: -1; /* 背景として表示 */
}


/* 画面右下のCakePHPロゴを非表示にする */
body::after,
footer::after {
    background-image: none !important;
}
@media (max-width: 767px) {
    .container {
        margin: 0 !important;
        padding: 0 !important;
    }
    .top-image {
        margin-bottom: 10px;
    }

    .title-with-logo.image-container { /* home.phpで追加したクラスを使用 */
        flex-direction: column; /* スマホ表示でロゴとタイトルを縦に並べる */
        padding: 0 5px;
        margin-left: 0; /* 上下マージンと中央寄せを調整 */
    }
    .site-logo {
        margin-right: 0; /* スマホ表示では右マージンをリセット */
        margin-bottom: 10px; /* スマホ表示で下にマージンを追加 */
    }
    .search-section {
        padding: 0 5px;
    }
    .search-form-container { /* スマホ表示で検索入力とボタンを縦に並べる */
        flex-wrap: wrap;
    }
    .search-input {
        width: 100%;
        flex-basis: auto; /* 基準となる幅を自動に */
        margin-bottom: 10px; /* ボタンとの間に隙間を追加 */
        border-radius: 3px; /* 角丸を統一 */
    }
    .search-button {
        width: 100%;
        min-width: auto; /* 最小幅を自動に */
        max-width: none; /* 最大幅を解除 */
        border-radius: 3px; /* 角丸を統一 */
    }
    .search-caption { /* スマホ表示でキャプションを入力ボックスの下に配置 */
        margin: 10px 0 0 0; /* 上部にマージンを追加し、左右マージンをゼロに */
        width: 100%; /* 幅を100%に */
    }

    .section-wide-color{
        padding: 2rem 1rem;
    }
    .section-wide-white {
        padding: 2rem 1rem;
    }
    .title-description {
        margin-bottom: 20px;
        padding-left: 0;
        text-align: left;
    }
    .genre-list h4 {
        margin-bottom: 0;
    }

.top-section-with-bg::before {
    background-position: left 0 top 40px; /* 左右は中心よりちょっと左寄り (20%)、上下はちょっと下寄り (60%) */
}

}
.main {
    max-width: 1280px;
    margin: 0 auto; /* 中央寄せのため追加 */
}

.container {
    padding: 0 20px;
}

@media (max-width: 767px) {
    .main {
        padding-left: 0;
        padding-right: 0;
    }

    .container {
        padding: 0 10px;
    }

}
/* 書籍版セクション */
.book-section {
    max-width: 850px;
    margin: 10px auto;
    text-align: left;
}

.book-section h4 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: left;
}

.book-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    max-width: 650px;
    margin: 30px auto
}

.book-image {
    flex-shrink: 0;
    height: 250px;
    margin-right: 20px;
}

.book-image img {
    max-height: 250px;
    display: block;
}

.book-text {
    flex-grow: 1;
}

.book-text p {
    margin-bottom: 10px;
}

.book-logo {
    text-align: left; /* 左揃えに変更 */
    margin-top: 20px;
}

.book-logo img {
    width: 200px; /* ロゴのサイズ調整 */
    vertical-align: middle;
}

@media (max-width: 767px) {
    .book-content {
        flex-direction: column;
        align-items: center;
    }

    .book-image {
        margin-right: 0;
        margin-bottom: 20px;
    }

    .book-text {
        text-align: center;
    }

    .book-logo {
        text-align: center;
    }
}
/* お問い合わせセクション */
.contact-section {
    max-width: 850px;
    margin: 30px auto;
    text-align: left;
}

.contact-section h4 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: left;
}

.contact-content {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    max-width: 650px;
    margin: 30px auto;
}

.contact-logo {
    flex-shrink: 0;
    text-align: center;
}

.contact-logo img {
    width: 120px;
    display: block;
    margin-bottom: 10px;
}

.contact-logo p {
    margin: 0;
    font-size: 0.9em;
    color: #333;
}

.contact-text {
    flex-grow: 1;
}

.contact-text p {
    margin-bottom: 10px;
    line-height: 1.6;
}

@media (max-width: 767px) {
    .contact-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .contact-text {
        text-align: left;
    }
}

/* ハンバーガーメニューのスタイル */
.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.8); /* 透明度70%の白 */
    padding: 10px; /* 周囲に余白を追加 */
    border-radius: 5px; /* 角を丸くする */
    display: flex; /* アイコンを中央に配置するため */
    justify-content: center; /* 水平方向中央寄せ */
    align-items: center; /* 垂直方向中央寄せ */
}

.menu-toggle {
    display: none !important; /* チェックボックスを非表示にする */
}

.menu-icon {
    display: block;
    width: 30px; /* ハンバーガーアイコンの幅 */
    height: 24px; /* ハンバーガーアイコンの高さ */
    position: relative;
    cursor: pointer;
    z-index: 1001; /* アイコンをメニューより手前に表示 */
    /* background-color と padding は .hamburger-menu に移動 */
    border-radius: 5px; /* 角を丸くする */
}

.menu-icon .line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
    transform-origin: center center; /* 回転の中心を中央に設定 */
}

.menu-icon .line:nth-child(1) {
    top: 0;
}

.menu-icon .line:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.menu-icon .line:nth-child(3) {
    bottom: 0;
}

/* メニューが開いた時のアイコンのアニメーション */
.menu-toggle:checked + .menu-icon .line:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.menu-toggle:checked + .menu-icon .line:nth-child(2) {
    opacity: 0;
}

.menu-toggle:checked + .menu-icon .line:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

.menu-nav {
    position: fixed;
    top: 0;
    right: -300px; /* 初期状態では画面外に隠す */
    width: 170px;
    height: 50%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    padding-top: 80px; /* アイコンと被らないように */
    box-sizing: border-box;
}

.menu-toggle:checked ~ .menu-nav {
    right: 0; /* チェックされたら表示 */
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-list li {
    border-bottom: 1px solid #eee;
}

.menu-list li:last-child {
    border-bottom: none;
}

.menu-list a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-size: 1.1em;
}

.menu-list a:hover {
    background-color: #f0f0f0;
}

@media (max-width: 900px) {
    .genre-list { /* スマホでは縦に並べる */
        flex-direction: column;
        align-items: center; /* 中央寄せ */
        margin-right: 0; /* マージンをリセット */
        width: 100%; /* 幅を100%に */
        gap: 20px; /* 要素間の隙間を調整 */
    }

    .genre-tags-container {
        margin-right: 0; /* マージンをリセット */
        margin-bottom: 0; /* 下にマージンをリセット */
        width: 100%; /* 幅を100%に */
    }

    .memoir-link-container {
        margin: 20px 0 20px 0; /* 上にマージン */
        margin-left: 0; /* マージンをリセット */
    }
    .genre-section-wrapper{
        /* display: inline-block; を削除 */
        width: 100%; /* スマホでは幅を100%に */
    }
}
