/*
Theme Name: hd-modern
Theme URI: https://www.hyperdouraku.com/
Author: YAS
Author URI: https://www.hyperdouraku.com/
Description: HyperDouraku Modern Theme (Custom)
Version: 1.1.0
License: GNU General Public License v2 or later
Text Domain: hd-modern
*/

/* ======================================
   1. 全体背景（メインサイトとの親和性）
====================================== */
html, body {
    margin: 0;
    padding: 0;
    /* 背景画像を左上起点で固定表示 */
    background-image: url("assets/images/background.png");
    background-repeat: repeat;
    background-attachment: fixed;
    background-position: left top; /* ここを center から left に変更 */

    color: #cbc5b9;
    font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    line-height: 1.7;
}

/* ======================================
   2. レイアウト構造（1070px固定・中央配置）
====================================== */

/* ヘッダー・ナビ・コンテンツは固定幅 */
#site-header,
#g-nav,
#content {
    width: 1070px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: none;
}

/* フッターだけフルワイド */
#site-footer {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-shadow: none;
}

/* 各エリアの背景色設定 */
#site-header { 
    background: #000;
    text-align: center;
}
    
.header-image img {
    display: block;
    margin: 0 auto;
    vertical-align: bottom;
    line-height: 0;
}

#content { 
    background: #2b2b2b; 
    padding: 30px 0; 
    overflow: hidden; 
}

/* フッター */
#site-footer { 
    background: #000; 
    color: #aaa; 
    padding: 25px 0; 
    text-align: center; 
}

/* =================================================
   Top Bar（ヘッダー上部バー）
================================================= */

#top-bar {
  width: 100%;
  height: 46px;

  background: #000;
  color: #aaa;

  display: flex;
  align-items: center;
}

/* 中央1070px枠 */

.top-bar-inner {
  width: 1070px;
  max-width: 100%;

  margin: 0 auto;
  padding: 0 10px;

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

/* 左テキスト */

.top-bar-text {
  font-size: 13px;
  letter-spacing: 0.03em;
}

/* SNS */

.top-bar-sns {
  display: flex;
  gap: 16px;
}

.top-bar-sns img {
  height: 25px;
  width: auto;

  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.top-bar-sns img:hover {
  opacity: 1;
}

.top-bar-sns img:last-child {
  margin-right: 15px;
}

/* =================================================
   Footer Style（HYPER DOURAKU Blog）
================================================= */

/* フッター全体 */

#site-footer {
  background: #000;
  color: #aaa;
  text-align: center;

  padding: 32px 10px 28px;
  border-top: 1px solid #222;
}


/* =========================
   SNS（YouTube / X）
========================= */

.footer-sns {
  display: flex;
  justify-content: center;
  gap: 28px;

  margin-bottom: 14px;
}

.footer-sns img {
  height: 25px;
  width: auto;

  opacity: 0.75;       /* 少し控えめ表示 */
  transition: opacity 0.2s ease;
}

.footer-sns img:hover {
  opacity: 1;
}


/* =========================
   Links（お問い合わせなど）
========================= */

.footer-links {
  font-size: 13px;
  line-height: 1.8;

  margin-bottom: 10px;
}

.footer-links a {
  color: #aaa;
  text-decoration: none;

  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-links span {
  margin: 0 6px;
  color: #555;
}


/* =========================
   Copyright
========================= */

.copyright {
  font-size: 12px;
  color: #666;

  letter-spacing: 0.03em;
}


/* =========================
   Responsive（スマホ）
========================= */

@media (max-width: 768px) {

  #site-footer {
    padding: 26px 12px 22px;
  }

  .footer-sns {
    gap: 22px;
  }

  .footer-sns img {
    height: 18px;   /* スマホは少し小さく */
  }

  .footer-links {
    font-size: 12px;
  }

  .copyright {
    font-size: 11px;
  }

}


/* ======================================
   3. Gナビ（センター合わせ・リピートなし）
====================================== */
#g-nav {
    background-image: url("assets/images/menu_bg.jpg");

    /* 横方向に繰り返す */
    background-repeat: repeat-x;

    /* サイズ固定をやめる */
    background-size: auto;

    background-position: center top;

    background-color: #000;

    height: 50px;
    clear: both;

    box-shadow: none; /* 念のため影も消す */
}

.menu-list {
    display: flex;
    justify-content: center; /* 文字を中央寄せ */
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-list li a {
    display: block;
    line-height: 50px;
    padding: 0 26px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    text-shadow: 1px 1px 2px #000;
}

.menu-list li a:hover {
    color: #d09c15;
    background: rgba(255,255,255,0.1);
}

/* ======================================
   メイン(670px) & サイドバー(330px)
====================================== */
#main {
    float: left;
    width: 670px; /* 内部で630px画像を扱うための枠 */
    padding: 0 20px;
}

#sidebar {
    float: right;
    width: 330px; /* 300pxバナーが余裕を持って入る枠 */
    padding: 0;
}

/* 記事内の画像（リサイズ済みのものをそのまま表示） */
.entry-content img,
.post-content img {
    max-width: 100%;   /* はみ出し防止 */
    height: auto;
    display: block;

    margin: 20px 0;    /* ← auto を消す（左揃え） */
}

/* 記事ページ：タイトル色 */
.post-title {
  color: #d09c15;
}

/* 一覧ページ：記事タイトル */
.post-title,
.entry-title {
  color: #d09c15;
}


/* ==================================================
   サイドバー：300px幅 ＆ 配色 徹底固定（左寄せ設定）
   ================================================== */

/* 1. 器の設定：300px幅に固定し、左寄せ（margin-right: auto）にする */
#sidebar aside, 
#sidebar .widget, 
#sidebar [class*="widget_"],
#sidebar section.widget {
    width: 300px !important;
    max-width: 300px !important;
    margin-left: 0 !important;      /* 左寄せ */
    margin-right: auto !important;  /* 右側に30pxの空きを作る */
    margin-bottom: 35px !important;
    padding: 0 !important;          /* 内部余白を完全に消して線を端まで引く */
    box-sizing: border-box !important;
    overflow: hidden;
}

/* 2. ウィジェットタイトル */
#sidebar .widget-title, 
#sidebar h2.widget-title,
.side-title {
    font-size: 20px !important;
    font-weight: bold !important;
    color: #d09c15 !important;
    font-family: "Georgia", "游明朝体", "YuMincho", serif !important;
    margin-bottom: 12px !important;
    padding: 0 !important;
    display: block;
}

/* 3. 基本文字色（ベージュ） */
#sidebar, #sidebar p, #sidebar li {
    color: #cbc5b9 !important;
    font-size: 14px;
}

/* 4. リンク色：通常ベージュ / ホバー金 */
#sidebar a {
    color: #cbc5b9 !important;
    text-decoration: none !important;
    transition: color 0.2s;
}

#sidebar a:hover {
    color: #d09c15 !important;
}

/* 5. リストと区切り線：300pxいっぱいに線を引く */
#sidebar ul,
.hd-category-list {
    width: 300px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

#sidebar ul li,
.hd-category-list li {
    width: 300px !important;
    border-bottom: 1px solid #928d82 !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    list-style-type: none !important;
}

/* 最後の項目の線だけ消す */
#sidebar ul li:last-child,
.hd-category-list li:last-child {
    border-bottom: none !important;
}

/* 6. 画像・フォーム・セレクトボックスを300px幅に固定 */
#sidebar .widget img,
#sidebar select {
    width: 300px !important;
    max-width: 300px !important;
    height: auto !important;
    box-sizing: border-box;
}

/* ==================================================
   サイドバー検索窓：ラベル崩れ修正版
   ================================================== */

/* フォーム全体の枠 */
#sidebar .widget_search form,
#sidebar .wp-block-search {
    display: block !important; /* 全体をブロックに戻してラベルの縦並びを防ぐ */
    width: 285px !important;
    margin-top: 10px;
}

/* 「ブログ記事検索」ラベル部分 */
#sidebar .wp-block-search__label,
#sidebar .widget_search label {
    display: block !important;
    width: 100% !important;
    margin-bottom: 8px !important;
    color: #cbc5b9;
    font-size: 14px;
    font-weight: bold;
}

/* 入力欄とボタンを包むコンテナ（もしあれば）または配置の調整 */
/* 最近のWPブロック用：入力とボタンのラッパー */
.wp-block-search__inside-wrapper {
    display: flex !important;
    width: 100% !important;
}

/* 従来型の検索窓用：inputとsubmitを横に並べる */
#sidebar .widget_search input[type="search"],
#sidebar .widget_search input[type="text"],
#sidebar .wp-block-search__input {
    display: inline-block !important;
    flex: 1 !important;
    width: 180px !important; /* 柔軟に伸びるが、ベースの幅を確保 */
    height: 36px;
    padding: 8px;
    background-color: #1a1a1a;
    color: #cbc5b9;
    border: 1px solid #928d82;
    box-sizing: border-box;
    font-size: 14px;
    vertical-align: middle;
}

/* 検索ボタン */
#sidebar .widget_search input[type="submit"],
#sidebar .wp-block-search__button {
    display: inline-block !important;
    width: 60px !important;
    height: 36px;
    margin-left: 5px !important;
    background-color: #444;
    color: #fff;
    border: 1px solid #928d82;
    cursor: pointer;
    vertical-align: middle;
    flex-shrink: 0 !important;
}

/* セレクトボックス（その他のカテゴリ）の配色 */
#sidebar select {
    padding: 8px;
    background-color: #1a1a1a; /* 背景色（黒） */
    color: #cbc5b9;            /* 文字色（ベージュ） */
    border: 1px solid #928d82; /* 境界線（グレー） */
    margin-top: 10px;
    font-size: 14px;
}

/* 7. リンクのクリック範囲とインデント解消 */
#sidebar .widget a,
.hd-category-list li a {
    display: block;
    width: 100%;
    padding-left: 0 !important;
}

/* 8. 独自カテゴリー（セレクトボックス）の調整 */
.hd-category-more {
    margin-top: 15px;
    width: 300px !important;
}


/* ======================================
   スマホ対応（PCの1070pxを解除）
====================================== */
@media (max-width: 1070px) {

    #site-header,
    #g-nav,
    #content,
    #site-footer {
        width: 100%;
    }

    #main,
    #sidebar {
        float: none;
        width: 100%;
        padding: 20px;
    }

    /* サイドバー300px固定を解除 */
    #sidebar aside,
    #sidebar .widget,
    #sidebar [class*="widget_"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* サイドバー内画像も可変に */
    #sidebar .widget img,
    #sidebar .widget_media_image img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
}

/* ================================
   スマホ用Gナビ
================================ */

/* トグルボタン */
#nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    padding: 10px 15px;
}

/* スマホ時 */
@media (max-width: 768px) {

  /* ハンバーガー表示 */
  #nav-toggle {
    display: block;
    width: 100%;
    text-align: right;
    font-size: 26px;
    padding: 10px 15px;
    background: #000;
    color: #fff;
    position: relative;
    z-index: 9999;
  }

  /* ナビ高さ解除（保険） */
  #g-nav {
    height: auto !important;
  }

    /* メニューを縦並び */
    #g-nav .menu-list {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #000;
    }

    #g-nav .menu-list.is-open {
        display: flex;
    }

    #g-nav .menu-list li a {
        line-height: 1.5;
        padding: 12px 20px;
        border-top: 1px solid #222;
    }

}

/* ================================
   リンク・テキストの配色設定
================================ */

/* サイト全体のリンクを強制指定 */
body a, 
#content a {
    color: #c9b37e;
    text-decoration: none;
}

/* ホバー時の挙動 */
body a:hover,
#content a:hover {
  color: #f2ead6 !important;
  text-decoration: none !important;
}

/* 訪問済みリンクが紫になるのを防ぐ */
body a:visited {
    color: #c9b37e;
}

/* 検索窓のボタンなど、特定の場所で青が出るのを防ぐ */
input[type="submit"], 
button {
    background-color: #444;
    color: #fff;
}

/* ================================
    記事一覧（カードデザイン：最新版）
================================ */

/* 各記事を包む四角い枠（post-card） */
.post-card {
    background: #1a1a1a;
    border: 1px solid #333;
    margin-bottom: 30px;
    padding: 20px;
    overflow: hidden;
    position: relative; /* 子要素の配置基準 */
}

/* 1. 記事タイトル */
.post-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 10px 0;
    line-height: 1.4;
}
.post-title a {
    color: #d09c15 !important; /* ハイパー道楽カラーの金文字 */
    text-decoration: none;
}

/* 2. 日付とカテゴリの並び */
.post-meta {
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 15px; /* 日付とカテゴリの間隔 */
}
.post-date {
    color: #888;
}

/* カテゴリの座布団（グレー背景） */
.post-category a {
    background: #444; /* グレーの背景 */
    color: #fff !important;
    padding: 3px 10px;
    text-decoration: none;
    font-size: 11px;
    border-radius: 2px; /* わずかに角を丸く（お好みで） */
}

/* 3. サムネと本文を包むエリア */
.post-content-inner {
    display: flex; /* 横並びにする */
    align-items: flex-start;
    gap: 20px; /* サムネと本文の間隔 */
}

/* サムネイル 300x300 正方形 */
.post-thumbnail {
    flex-shrink: 0; /* 幅を固定して縮ませない */
    width: 300px;
    height: 300px;
    overflow: hidden;
}
.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 300x300に綺麗に収める */
}

/* 本文書き出しテキスト */
.post-excerpt {
    font-size: 15px;
    line-height: 1.8;
    color: #cbc5b9;
    flex-grow: 1; /* 残りの幅を埋める */
}

/* 4. 続きを読む（右下配置・画像切り替え） */
/* 続きを読む：右下配置 */
.post-more {
    text-align: right;
    margin-top: 20px;
}

/* ボタン本体 */
.btn-read-more {
    position: relative;
    display: inline-block;

    width: 160px;
    height: 36px;          /* ← 超重要：高さを固定 */

    text-decoration: none;
    cursor: pointer;
}

/* 背景画像（OFF/ON 共通） */
.btn-bg {
    position: absolute;   /* 親基準にする */
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    object-fit: contain;
    display: block;
}

/* ON画像を隠す */
.btn-bg.on {
    opacity: 0;
    transition: opacity .2s;
}

/* hoverでON */
.btn-read-more:hover .btn-bg.on {
    opacity: 1;
}

/* テキスト中央 */
.btn-read-more .read-more-text {
    position: absolute;

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    font-size: 14px;
    font-weight: bold;

    color: #d09c15 !important;

    z-index: 2;
    white-space: nowrap;
    pointer-events: none;
}

/* hover文字色 */
.btn-read-more:hover .read-more-text {
    color: #000 !important;
}



/* ページトップへ戻るボタン */
#page-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
}

/* JSでこのクラスがついたら表示される */
#page-top.is-show {
    opacity: 1;
    visibility: visible;
}

#page-top a {
    display: block;
    /* 幅を40pxに固定。高さはautoでアスペクト比を維持 */
    width: 40px; 
    height: auto;
    transition: transform 0.3s;
}

#page-top img {
    width: 100%;  /* 親要素(40px)いっぱいに広げる */
    height: auto; /* 比率を維持 */
    display: block;
}

#page-top a:hover {
    transform: translateY(-5px); /* ホバー時に少し浮く演出 */
}

/* サムネ付き新着記事 */
.hd-recent-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hd-recent-posts li {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    margin-bottom: 14px;

    padding: 0 10px;      /* ← 追加 */
    box-sizing: border-box; /* ← 念のため */
}

/* サムネ */
.hd-recent-thumb {
    width: 75px;                 /* 75pxに合わせる */
    height: 75px;
    object-fit: cover;
    flex-shrink: 0;
}

/* サムネリンク */
.hd-recent-thumb-link {
    display: block;
    flex-shrink: 0;
}

/* 右側テキストブロック */
.hd-recent-text {
    display: block;
    line-height: 1.4;
}

/* 日付 */
.hd-recent-date {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
}

/* タイトル */
.hd-recent-title {
    display: block;
    font-size: 13px;
    line-height: 1.5;
}

/* タイトルリンク */
.hd-recent-link {
    display: inline-block;
    text-decoration: none;
}

.hd-recent-link:hover .hd-recent-title {
    color: #d09c15;
    text-decoration: underline;
}

.hd-recent-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  padding: 0 10px;
  box-sizing: border-box;
}

/* パンくずリスト */
.hd-breadcrumb {
    display: flex;
    align-items: center; /* 垂直中央揃え */
    flex-wrap: wrap;
    font-size: 12px;
    color: #aaa;
}

/* ホームリンク（アイコン＋文字）のスタイル */
.home-link {
    display: flex;
    align-items: center;
    color: #c9b37e !important;
    text-decoration: none;
}

/* ホームアイコンのサイズと余白を固定 */
.home-icon {
    width: 16px; /* アイコンの大きさに合わせて調整 */
    height: auto;
    margin-right: 6px; /* アイコンと「HOME」の間の距離 */
    display: block;
}

/* セパレーター（ > ）の調整 */
.hd-breadcrumb .sep {
    margin: 0 10px;
    color: #666;
}

/* パンくず用ラッパー（1070px中央寄せ） */
.breadcrumb-wrap {
    width: 1070px;
    margin: 0 auto;
    background: #2b2b2b;   /* contentと合わせる */
    padding: 16px 15px 8px 20px;
    box-sizing: border-box;
}

/* ======================================
   ページネーション：絶対中央・端固定（最適化版）
====================================== */
.pagination {
    width: 670px;
    margin: 40px auto;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    min-height: 40px;
}

/* 中央の数字 */
.pagination .page-numbers:not(.prev):not(.next):not(.dots) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 4px;
    border: 1px solid #928d82;
    color: #d09c15;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

/* カレント */
.pagination .page-numbers.current {
    background-color: #d09c15;
    border-color: #d09c15;
    color: #fff !important;
}

/* 左右 */
.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    text-decoration: none !important;
}

.pagination .page-numbers.prev { left: 0; }
.pagination .page-numbers.next { right: 0; }

/* PREV / NEXT 画像は元サイズを使う */
.pagination .page-numbers.prev img,
.pagination .page-numbers.next img {
    width: auto;
    height: auto;
    max-height: none;
    margin: 0 6px;
    vertical-align: middle;
}

/* =====================================================
   記事 前後ナビ（上下構成・左右固定・ズレ防止完全版）
   ===================================================== */

.post-navigation {
  margin: 30px 0 50px;
}

/* 2カラム固定レイアウト（片側だけでも崩れない） */
.post-navigation .nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;

  background: #2f2f2f;
  padding: 20px;
}

/* 左右カラム */
.post-navigation .nav-left,
.post-navigation .nav-right {
  min-height: 60px; /* 片側なしでも高さ維持 */
  display: flex;
}

/* リンク本体 */
.post-navigation .post-nav {
  display: flex;
  flex-direction: column; /* 縦並び */
  gap: 6px;

  color: #f5c400;
  text-decoration: none;
  font-weight: bold;

  max-width: 100%;
}

/* 上段：アイコン行 */
.post-navigation .nav-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

/* 下段：タイトル */
.post-navigation .nav-title {
  font-size: 14px;
  line-height: 1.4;
  color: #cbc5b9;
  word-break: break-word;
}

/* 右側カラムは右寄せ */
.post-navigation .nav-right {
  justify-content: flex-end;
  text-align: right;
}

.post-navigation .nav-right .post-nav {
  align-items: flex-end;
}

/* 矢印画像 */
.post-navigation img {
    width: auto;
    height: auto;
    max-height: none;
    margin: 0 6px;
    vertical-align: middle;
}

/* ホバー */
.post-navigation .post-nav:hover .nav-title {
  text-decoration: underline;
}

/* =========================
   レスポンシブ
   ========================= */

@media (max-width: 768px) {

  .post-navigation .nav-links {
    grid-template-columns: 1fr;
  }

  .post-navigation .nav-right {
    justify-content: flex-start;
    text-align: left;
  }

  .post-navigation .nav-right .post-nav {
    align-items: flex-start;
  }

}

/* =========================================
   記事内 動画・埋め込み 全幅レスポンシブ
   ========================================= */

/* 共通ラッパー（WP標準） */
.entry-content .wp-embed-aspect-16-9,
.entry-content .wp-embed-aspect-4-3 {
  width: 100%;
  max-width: 100%;
}

/* iframe直指定（YouTubeなど） */
.entry-content iframe,
.entry-content embed,
.entry-content object {
  width: 100% !important;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  margin: 20px auto;
}

/* 念のため video タグも */
.entry-content video {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* 記事内 見出しスタイル（旧ブログ互換＋調整） */

.entry-content h1,
.post-content h1 {
  clear: both;
  font-size: 20px;
  margin: 30px 0 15px;
}

.entry-content h2,
.post-content h2 {
  clear: both;

  font-size: 18px;

  border-bottom: 1px solid #efefef;
  border-left: 5px solid #efefef;

  padding: 0 0 5px 10px;
  margin: 30px 0 15px;
}

.entry-content h3,
.post-content h3 {
  clear: both;

  font-size: 16px;

  border-left: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;

  padding: 0 0 5px 10px;
  margin: 25px 0 12px;
}

.entry-content h4,
.post-content h4 {
  clear: both;
  font-size: 15px;

  margin: 20px 0 10px;
}

/* 日付アイコンの縦位置を文字に合わせる */

.icon-clock {
  vertical-align: middle;

  position: relative;
  top: -1px;   /* ← ここで2px上げる */
}

/* サムネイル画像：ホバー演出 */

.post-thumbnail img,
.hd-recent-thumb,
.widget img {
  transition: filter 0.25s ease, transform 0.25s ease;
}

.post-thumbnail a:hover img,
.hd-recent-thumb-link:hover img,
.widget a:hover img {
  filter: brightness(1.15) contrast(1.05);
}

/* Gナビ：ホバー色を最優先で維持 */

#g-nav .menu-list li a:hover {
  color: #d09c15 !important;
}

/* Gナビ：訪問済みでも色を固定 */

#g-nav .menu-list li a,
#g-nav .menu-list li a:visited {
  color: #c9b37e;
}

/* ======================================
   スマホ統合最適化CSS（2026）
====================================== */
@media (max-width: 768px) {

  /* =====================
     レイアウト基本
  ===================== */

  #main,
  #sidebar {
    padding: 10px 8px;
  }

  .post-card {
    padding: 12px;
    max-width: 100%;
    overflow: hidden;
  }

  /* =====================
     記事カード
  ===================== */

  .post-content-inner {
    flex-direction: column;
    min-width: 0;
  }

  .post-content-inner > * {
    min-width: 0;
  }

  .post-thumbnail {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .post-thumbnail img {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    box-sizing: border-box;
  }

  .post-title {
    font-size: 18px;
  }

  .post-excerpt {
    font-size: 14px;
  }

  .post-more {
    text-align: center;
  }

  /* =====================
     ヘッダー
  ===================== */

  .header-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
  }

  /* =====================
     トップバー
  ===================== */

  #top-bar {
    height: auto;
    padding: 6px 0;
  }

  .top-bar-inner {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .top-bar-text {
    font-size: 12px;
    line-height: 1.4;
  }

  .top-bar-sns {
    justify-content: center;
    gap: 14px;
  }

  .top-bar-sns img {
    height: 18px;
  }

  /* =====================
     パンくず
  ===================== */

  .breadcrumb-wrap {
    width: 100%;
    max-width: 100%;
    padding: 6px 10px;
  }

  .hd-breadcrumb {
    flex-wrap: wrap;
    line-height: 1.5;
  }

  .hd-breadcrumb,
  .hd-breadcrumb a {
    font-size: 11px;
  }

  .hd-breadcrumb .sep {
    margin: 0 6px;
  }

  .hd-breadcrumb span,
  .hd-breadcrumb a {
    word-break: break-all;
  }

  /* =====================
     ページネーション
  ===================== */

  .pagination {
    width: 100%;
    max-width: 100%;
    margin: 30px auto;
    padding: 0 5px;
    box-sizing: border-box;
  }

  .pagination .nav-links {
    position: static;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
  }

  .pagination .page-numbers.prev,
  .pagination .page-numbers.next {
    position: static;
    transform: none;
  }

  .pagination .page-numbers {
    width: 28px;
    height: 28px;
    font-size: 12px;
    margin: 2px;
  }

  .pagination .prev,
  .pagination .next {
    min-width: 44px;
    justify-content: center;
    font-size: 13px;
    padding: 4px 8px;
  }

  /* 画像は非表示 */
  .pagination .prev img,
  .pagination .next img {
    display: none;
  }

}

@media (max-width: 768px) {

  html, body {
    background-attachment: scroll;
  }

}

/* ======================================
   横はみ出し防止：ヘッダー完全封印
====================================== */
@media (max-width: 768px) {

  #site-header,
  #site-header *,
  #top-bar,
  #top-bar *,
  .header-image,
  .header-image img,
  #g-nav,
  #g-nav * {
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .header-image img {
    width: 100% !important;
    height: auto !important;
  }

}

/* ======================================
   背景ズレ対策：スマホではfixed禁止
====================================== */
@media (max-width: 768px) {

  html,
  body {
    background-attachment: scroll !important;
    background-position: left top !important;
  }

}

/* ======================================
   横ズレ完全防止（最終確定版）
====================================== */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

*, *::before, *::after {
  box-sizing: border-box;
}

@media (max-width: 768px) {

  /* 外枠を物理的に縛る */
  #site-header,
  #g-nav,
  #content,
  .site-content,
  .content-inner,
  .breadcrumb-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* paddingで広がらないように */
  #content {
    padding-left: 0;
    padding-right: 0;
  }

  /* fixed要素対策 */
  #page-top {
    right: 10px;
    max-width: 100%;
  }

}

/* ======================================
   サイドバー：スマホ完全最適化
====================================== */
@media (max-width: 768px) {

  /* サイドバー全体 */
  #sidebar {
    padding: 15px 12px;
  }

  /* ウィジェットを100%に */
  #sidebar aside,
  #sidebar .widget,
  #sidebar [class*="widget_"],
  #sidebar section.widget {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 30px 0 !important;
  }

  /* 新着記事リスト */
  .hd-recent-posts,
  .hd-recent-posts li {
    width: 100%;
  }

  /* 内側ラッパーをフル幅に */
  .hd-recent-inner {
    padding: 0;
    width: 100%;
  }

  /* サムネ少し大きく */
  .hd-recent-thumb {
    width: 80px;
    height: 80px;
  }

  /* カテゴリ一覧 */
  #sidebar ul,
  .hd-category-list {
    width: 100% !important;
  }

  #sidebar ul li,
  .hd-category-list li {
    width: 100% !important;
    padding: 12px 0 !important;
  }

}

/* ======================================
   PC表示：メイン幅を元に戻す補正
====================================== */
@media (min-width: 769px) {

  /* メインをpadding込みで670pxに見せる */
  #main {
    box-sizing: content-box;
    width: 670px;
    padding: 0 20px;
  }

  /* サイドバーも合わせる */
  #sidebar {
    box-sizing: content-box;
    width: 330px;
  }

}

/* ======================================
   サイドバー広告：スマホ最適化
====================================== */
@media (max-width: 768px) {

  /* 広告全体を中央寄せ＋余白追加 */
  .sidebar-ad {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 35px; /* ← 下に余裕を作る */
    text-align: center;
  }

  /* 画像も中央固定 */
  .sidebar-ad img {
    margin: 0 auto;
    display: block;
  }

}

/* ======================================
   サイドバー広告枠
====================================== */
.sidebar-ad {
  width: 300px;
  margin: 0 0 30px 0;
  text-align: center;
}

.sidebar-ad img {
  width: 100%;
  height: auto;
  display: block;
}

/* スマホ対応 */
@media (max-width: 768px) {

  .sidebar-ad {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 25px;
  }

}

/* ======================================
   モバイル上部広告
====================================== */

/* PCでは非表示 */
.mobile-top-ad {
  display: none;
}

/* スマホのみ表示 */
@media (max-width: 768px) {

  .mobile-top-ad {
    display: block;
    text-align: center;

    /* 余白を最小化 */
    margin: 0 auto;
    padding: 16px 0 0;

    background: #2b2b2b;
  }
  
  .mobile-top-ad img {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto;
  }

}

/* ======================================
   CATEGORY：左右分離 最終上書き
====================================== */

#sidebar .hd-category-list li a {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;

  padding: 0 15px !important;
  box-sizing: border-box;
}

/* 左：カテゴリ名 */
#sidebar .hd-category-list .cat-name {
  flex: 1 1 auto !important;
  min-width: 0;              /* ← 超重要（省略すると崩れる） */
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右：件数 */
#sidebar .hd-category-list li a::after {
  content: attr(data-count) !important;
  flex: 0 0 auto !important;

  min-width: 36px;
  text-align: left;

  color: #aaa;
  font-size: 12px;
}

/* ======================================
   記事ページ：上余白を一覧と揃える
====================================== */

.single #content .container,
.single #content .layout {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
.single #content {
  padding-top: 15px !important;
}

/* ======================================
   共感＋シェアブロック
====================================== */

.post-share-box {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 16px 18px;
  margin: 30px 0;

  background: #222;
  border: 1px solid #333;
}

.share-message {
  margin: 0;
  font-size: 14px;
  color: #cbc5b9;
}

/* ボタン側 */
.share-buttons {
  flex-shrink: 0;
}

/* スマホ */
@media (max-width: 768px) {

  .post-share-box {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

}

/* ======================================
   記事下 関連記事（RECENT ENTRY型）
====================================== */

.related-posts {
  margin: 40px 0 20px;
}

.related-title {
  font-size: 18px;
  margin-bottom: 15px;
  color: #d09c15;
}

/* 記事内なのでpaddingを消す */
.related-posts .hd-recent-posts li {
  padding: 0;
}

/* ======================================
   楽天アフィリエイトブロック
====================================== */

.rakuten-aff-block {
  margin: 25px 0;
  padding: 10px 0;
  border: none;
  background: transparent;
  box-sizing: border-box;
}

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

.rakuten-item {
  margin-bottom: 10px;
}

.rakuten-item:last-child {
  margin-bottom: 0;
}

.rakuten-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.rakuten-item a:hover {
  background: rgba(0,0,0,0.03);
}

.rakuten-item img {
  width: 75px;
  height: 75px;
  object-fit: contain;   /* はみ出さず収める（おすすめ） */
  background: #fff;      /* 余白対策（任意） */
  border: 1px solid #eee;
}

.rakuten-name {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
}

.rakuten-price {
  font-weight: bold;
  white-space: nowrap;
}

.rakuten-credit {
  margin-top: 10px;
  font-size: 0.75rem;
  text-align: right;
}

.rakuten-more-link {
  text-align: center;
  width: 100%;
}

/* ======================================
   楽天アフィリ：スマホ 横並び維持版
====================================== */
@media (max-width: 768px) {

  /* 横並びは維持 */
  .rakuten-item a {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px 5px;

    /* 折り返し許可 */
    flex-wrap: nowrap;
  }

  /* 画像を少し縮小 */
  .rakuten-item img {
    width: 60px;
    height: 60px;
    flex-shrink: 0; /* 潰さない */
  }

  /* 商品名：折り返しOK */
  .rakuten-name {
    flex: 1;
    min-width: 0;           /* ← 超重要 */
    font-size: 13px;
    line-height: 1.4;

    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* 価格：右固定 */
  .rakuten-price {
    flex-shrink: 0;
    font-size: 13px;
    white-space: nowrap;
  }

}

/* ======================================
   記事本文：画像リンクの誤クリック防止
====================================== */

/* 画像を含むリンクだけ幅を戻す */
.entry-content a:has(img),
.post-content a:has(img) {
  display: inline-block !important;
  width: auto !important;
}

/* 画像自体もinline寄りにする */
.entry-content a img,
.post-content a img {
  display: inline-block;
}

/* === サイドバー広告：上下余白調整 === */

#sidebar .side-widget {
  margin-bottom: 10px;
}

/* ======================================
   サイドバー広告・ウィジェット：スマホ中央寄せ
====================================== */
@media (max-width: 768px) {

  /* サイドバー内の広告ブロック共通 */
  #sidebar .side-widget,
  #sidebar .widget,
  #sidebar aside {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
  }

  /* 中の画像・iframeも中央に */
  #sidebar .side-widget img,
  #sidebar .widget img,
  #sidebar iframe {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
  }

}

/* =================================================
   Header Google Search (Fixed Design)
   ================================================= */

.header-image {
    position: relative;
}

.header-search {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 10;
    width: 300px;
    height: 36px; /* サイドバーと統一 */
    box-sizing: border-box;
}

/* Google全体枠の余白を完全にゼロにする */
.header-search .gsc-control-cse {
    background: transparent !important;
    border: none !important;
    padding: 0 !important; /* 4pxから0に変更して天地を詰める */
    margin: 0 !important;
}

/* 入力欄のコンテナ */
.header-search .gsc-input-box {
    height: 36px !important;
    border: 1px solid #928d82 !important;
    background-color: #fff !important;
    box-sizing: border-box !important;
}

/* 入力テキストエリア */
.header-search input.gsc-input {
    font-size: 14px !important;
    height: 34px !important; /* 枠線分を引いた高さ */
    padding: 4px 8px !important;
    background: none !important;
    box-sizing: border-box !important;
}

/* 検索ボタンを強制表示し、デザインを統一 */
.header-search button.gsc-search-button,
.header-search input.gsc-search-button-v2 {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 36px !important;
    width: 60px !important;
    margin: 0 0 0 5px !important;
    padding: 0 !important;
    background-color: #444 !important; /* ボタン背景色 */
    border: 1px solid #928d82 !important;
    border-radius: 0 !important;
    cursor: pointer;
    box-sizing: border-box !important;
}

/* 虫眼鏡アイコンの色を白に */
.header-search button.gsc-search-button svg {
    fill: #fff !important;
    width: 18px !important;
    height: 18px !important;
}

/* 不要なロゴ等を隠してさらに高さを詰める */
.header-search .gsib_b, 
.header-search .gsst_b {
    display: none !important;
}

/* スマホ非表示 */
@media (max-width: 768px) {
    .header-search {
        display: none !important;
    }
}

/* --- サイドバー検索窓の調整 --- */

/* 検索ブロック全体の幅を抑え、右に余白を作る */
.sidebar .wp-block-search {
    margin-right: 15px; /* 右端に15pxの隙間を作る */
    margin-bottom: 25px; /* 下のウィジェットとの間隔 */
}

/* 「ブログ記事検索」ラベルの調整 */
.sidebar .wp-block-search__label {
    color: #cbc5b9; /* 指定のベージュ */
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

/* 入力ボックスのスタイル */
.sidebar .wp-block-search__input {
    border: 1px solid #928d82; /* 指定のグレー */
    background-color: #fff;
    padding: 8px;
    color: #333;
}

/* 検索ボタンのスタイル */
.sidebar .wp-block-search__button {
    background-color: #555; /* 背景は少し暗めに */
    color: #cbc5b9;         /* 文字はベージュ */
    border: 1px solid #928d82;
    padding: 8px 15px;
    transition: all 0.3s ease;
}

/* 検索ボタン：ホバー時 */
.sidebar .wp-block-search__button:hover {
    background-color: #d09c15; /* 指定のゴールド */
    color: #fff;
    cursor: pointer;
}

/* ヘッダーロゴのクリック範囲設定 */
.header-image {
    position: relative; /* 基準点 */
}

.header-logo-link {
    position: absolute;
    top: 0;
    left: 0;
    
    /* クリック範囲のサイズ調整 */
    /* 画像のロゴの大きさに合わせて数値を微調整してください */
    width: 320px;  
    height: 80px; 
    
    z-index: 5;    /* 検索窓(z-index:10)より下に配置して邪魔しないようにする */
    display: block;
}

/* スマホ時のクリック範囲調整 */
@media (max-width: 768px) {
    .header-logo-link {
        width: 60%;  /* スマホのヘッダー画像に合わせて調整 */
        height: 60px;
    }
}

/* Amazonリンクなどの画像＋テキストの調整 */
.post-content a img + text, 
.post-content a {
    display: inline-flex;    /* 中身をフレキシブルな箱にする */
    align-items: center;    /* 垂直方向の中央で揃える */
    text-decoration: none;  /* 下線を消す（本サイト風） */
    gap: 10px;              /* 画像と文字の間の距離 */
}

/* 画像自体の微調整 */
.post-content a img {
    vertical-align: middle;
    display: inline-block;
}







