/*
Theme Name:     Lightning-child
Description:    Lightning子テーマ
Author:         mirai
Template:       lightning

(optional values you can add: Theme URI, Author URI, Version, License, License URI, Tags, Text Domain)
*/



/* ------------------------- 
*  全体
---------------------------- */

/* 記事全体 */
.blog-post {
    max-width: 800px;
    margin: 0 auto;
    font-family: "Yu Gothic", "Hiragino Kaku Gothic Pro", sans-serif;
    line-height: 1.8;
    color: #333;
    padding: 20px;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* 投稿・固定ページタイトルの装飾 */
.entry-title {
    font-size: 1.3em;                           /* タイトルサイズ */
    font-weight: bold;                           /* 太字 */
    color: #222;                                 /* 文字色：ダークグレー */
    text-align: left;                            /* 左揃え */
    background-color: #f5f5f5;                  /* 背景色：薄いグレー */
    padding: 12px 16px;                          /* 上下左右の余白 */
    border-left: 5px solid #337ab7;             /* 左側アクセントライン */
    border-radius: 5px;                          /* 角丸 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);     /* 軽い影 */
    display: block;                              /* 幅を画面いっぱいに */
    word-break: break-word;                      /* 長い文字も折り返す */
    line-height: 1.4;                            /* 行間調整 */
    margin-bottom: 20px;                         /* 下の余白 */
}

/* ホバーで少し色が変わる演出 */
.entry-title:hover {
    background-color: #f0f8ff;                  /* 薄いブルーに変更 */
    border-left-color: #005fa3;                 /* アクセントラインも濃く */
}

/* モバイル対応 */
@media (max-width: 768px) {
    .entry-title {
    	font-size: 1.1em;   
        padding: 8px 12px;                      /* 余白調整 */
        border-left-width: 3px;                 /* 左ラインを細く */
    }
}

/* 見出し */
.blog-post h1 {
    font-size: 1.75em;       
    margin-bottom: 1.25em;   
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 0.625em; 
}
.blog-post h2 {
    font-size: 1.375em;      
    margin-top: 1.875em;     
    margin-bottom: 0.9375em; 
    color: #4CAF50;
}
.blog-post h3 {
    font-size: 1.125em;      
    margin-top: 1.25em;      
    margin-bottom: 0.625em;  
    color: #333;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .blog-post h1 {
        font-size: 1.2em;       
        margin-bottom: 1em;     
        padding-bottom: 0.5em;  
    }
    .blog-post h2 {
        font-size: 1.2em;     
        margin-top: 1.5em;      
        margin-bottom: 0.75em;  
    }
    .blog-post h3 {
        font-size: 1.2em;         
        margin-top: 1em;         
        margin-bottom: 0.5em;   
    }
}
/* コードブロック */
pre {
    background: #f5f5f5;
    padding: 12px;
    overflow: auto;      /* 横スクロール＆縦スクロール両方対応 */
    max-height: 800px;   /* 高さ制限、長いコードでも途中でスクロール可能 */
    border-radius: 5px;
    margin-bottom: 20px;
    position: relative;  /* コピー用ボタン・上へボタン配置用 */
}

/* code内のスタイル */
pre code {
/*
    display: block;
    background: #f7f7f7;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
    overflow-x: auto;
    white-space: pre;
*/
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 14px;
    display: block;
    white-space: pre;    /* 折り返さず横に広げる */
}





/* -----------------------------
	チェック幅
----------------------------- */
.wpcf7-list-item-label{
	margin:0 20px 0 0;
	line-height:2em;
}

span.wpcf7-list-item {
	display: block!important;
}

/* -----------------------------
　　　フォーム
----------------------------- */

input[type="text"], 
input[type="password"],
input[type="email"],
input[type="url"],
input[type="phone"],
input[type="tel"],
input[type="datetime"],
input[type="date"],
input[type="month"],
input[type="color"],
input[type="time"],
input[type="search"],
input[type="datetime-local"] {
	font-size: 0.95em;
    border:1px solid #ccc;
	box-shadow: none;
	padding: 0.3em 0.35em;
	line-height: 1.65em;
	border-radius: 0;
	outline: none;
	background: #ffc;
}

input[type="number"]{
	text-align:center;
	font-size: 0.95em;
    border:1px solid #ccc;
	box-shadow: none;
	padding: 0.3em 0.35em;
	width:50px;
	line-height: 1.65em;
	border-radius: 0;
	outline: none;
	background: #ffc;
}

.wpcf7-checkbox input[type=checkbox] {
	margin-right:10px;
	width:			18px;
	height:			18px;
	-moz-transform:		scale(1.4);
	-webkit-transform:	scale(1.4);
	transform:		scale(1.4);
}

.wpcf7-calculated{
	text-align:right;
	font-size: 0.95em;
    border:1px solid #ccc;
	box-shadow: none;
	padding: 0.3em 0.35em;
	width:100px;
	line-height: 1.65em;
	border-radius: 0;
	outline: none;
	background: #ffc;
}

.wpcf7-calculator{
	text-align:right;
	font-size: 0.95em;
    border:1px solid #ccc;
	box-shadow: none;
	padding: 0.3em 0.35em;
	width:100px;
	line-height: 1.65em;
	border-radius: 0;
	outline: none;
	background: #ffc;
}

.cf7-calculation{
	text-align:right;
	font-size: 0.95em;
    border:1px solid #ccc;
	box-shadow: none;
	padding: 0.3em 0.35em;
	width:100px;
	line-height: 1.65em;
	border-radius: 0;
	outline: none;
	background: #ffc;
}

/*合計ボタン*/
.cf7-calculate_button{
	width:100px;
	height:30px;
	font-size:18px;
}

.wpcf7-textarea{
    border:1px solid #ccc !important;
	width:100%;
	font-size: 0.95em;
	box-shadow: none;
	padding: 0.3em 0.35em;
	line-height: 1.65em;
	border-radius: 0;
	outline: none;
	background: #ffc;
}

.wpcf7-select{
	padding:3px;
	border: 1px solid #ddd;
	font-size:0.9em !important;
	background: #ffc;
}


/* -----------------------------
　　　ラジオボタン radio
----------------------------- */

input[type="radio"] {
  position: relative;
  width: 20px;
  height: 20px;
  border: 1px solid #000;
  border-radius: 50%;
  vertical-align: -2px;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

input[type="radio"]:checked:before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #000;
  content: '';
}


/* -----------------------------
　　　textbox
----------------------------- */

/*送信ボタン*/
#main .wpcf7-form input[type=submit]{ 
	padding:20px;
	width:280px;
	height:60px;
	color:#fff;
	text-align:center;
	background-color:#028cd4 !important;
    border:0;
	border-radius:5px;
	-moz-border-radius:5px;
	-webkit-border-radius:5px;
}

.form-width  { 
    max-width: 80%;
}





/* ------------------------- 
*  コピー用ボタン設置
---------------------------- */

/* コピー用ボタン */
.copy-code-button {
position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    background-color: #0073aa; /* WordPressブルー */
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    z-index: 10;
}

.copy-code-button:hover {
    background-color: #005177;
}

/* 上へボタン */
.scroll-top-button {
    position: absolute;
    bottom: 5px;       /* pre の下端に配置 */
    right: 5px;        /* 右端に配置 */
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 3px;
    z-index: 10;
}
.scroll-top-button:hover {
    background-color: #388E3C;
}

/* 上スクロールバー用（必要なら残す） */
.pre-scroll-top {
    height: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 4px;
}
.pre-scroll-top div {
    height: 1px; /* 見えない要素 */
}

/* 注意・補足ボックス */
.notice-box {
    background: #fff8c5;
    border-left: 5px solid #f0c000;
    padding: 10px 15px;
    margin: 20px 0;
    border-radius: 4px;
}

/* リスト */
.blog-post ul {
    margin: 10px 0 20px 20px;
    padding: 0;
}
.blog-post li {
    margin-bottom: 8px;
}

/* 投稿日、更新日、投稿者名を非表示にする */
.entry-meta-item-date, .entry-meta-item-updated, .entry-meta .author {
    display: none;
}

/* サイドバーの投稿日を消す */
.vk_post_date {
    display: none;
}

/*子テーマのディレクトリ構造*/
.tree ul {
	list-style-type: none;
	padding-left: 20px;
	font-family: monospace;
	line-height: 1.5;
}

.tree li::before {
	content: "├─ ";
}

.tree li:last-child::before { 
	content: "└─ ";
}

/* 「制御方法」列を広くする */
.rest-api-table th:first-child,
.rest-api-table td:first-child {
    width: 190px; /* お好みで調整可能 */
    min-width: 180px;
}

/* テーブル全体を横スクロール可能に */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

/* テーブルデザイン */
.rest-api-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 14px;
    min-width: 700px; /* 横スクロール発生の目安 */
	table-layout: fixed; /* 列幅を制御 */
}

/* ヘッダー */
.rest-api-table thead th {
    background-color: #6c5ce7; /* 薄めの紫 */
    color: #fff;
    padding: 10px;
    text-align: left;
    position: sticky; /* スクロール時にヘッダー固定 */
    top: 0;
    z-index: 2;
}

/* ボディのセル */
.rest-api-table tbody td {
    border: 1px solid #ddd;
    padding: 10px;
    vertical-align: top;
}

/* 行のホバー効果 */
.rest-api-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* リストのスタイル調整 */
.rest-api-table ul {
    margin: 0;
    padding-left: 20px;
}

.rest-api-table ul li {
    list-style-type: disc;
}

/* コードブロックのスタイル */
.rest-api-table pre {
    background-color: #f0f0f0;
    padding: 8px;
    overflow-x: auto;
    border-radius: 4px;
}

/* レスポンシブ対応（狭い画面用） */
@media (max-width: 600px) {
    .rest-api-table {
        font-size: 13px;
    }
}





/* ------------------------- 
*  本文の最後に関連記事リンクを自動追加（タグ優先 → カテゴリ）
---------------------------- */

/*Lightning 本文の最後に関連記事リンクを自動追加*/
.related-links {
    margin: 40px 0;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
}
.related-links h3 {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    border-left: 5px solid #0073aa; /* Lightningブルー */
    padding-left: 10px;
}
.related-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.related-links li {
    margin: 8px 0;
}
.related-links li a {
    text-decoration: none;
    color: #0073aa;
}
.related-links li a:hover {
    text-decoration: underline;
}





/* ------------------------- 
*  サイドバーに最近の投稿（サムネ付き）を表示する
---------------------------- */

.recent-posts-widget {
  display: flex;
  flex-direction: column; /* 投稿ごとに縦積み */
  gap: 10px;              
}

.recent-post-item {
    display: flex;
    align-items: flex-start;      /* タイトルを画像の上部と同じ高さに*/
    /* align-items: center;      　　タイトルを画像のcenterと同じ高さに*/
    gap: 10px;
    flex-wrap: wrap; /* 画像幅で自動改行 */
}

.recent-post-thumb-img {
	border-radius: 4px;
}

.recent-post-thumb-img.large {
    flex-basis: 100%;      /* 幅を100%に */
    display: block;         /* ブロック表示に */
}

.recent-post-item.large {
    flex-direction: column; /* 画像下にタイトル */
    align-items: flex-start;
}

/* 画像が150px以上ならタイトルを上に */
.recent-post-thumb-img.large + .recent-post-title {
    flex-basis: 100%;  /* タイトルを上に */
    margin-top: 5px;   /* 画像との間隔 */
}

.recent-post-title {
  font-size: 14px;
  color: #333;
  text-decoration: none;
  flex: 1;
　font-weight:normal !important;
}

.recent-post-title:hover {
  text-decoration: underline;
}
  





/* ------------------------- 
*  ページネーション対応サイトマップショートコード
---------------------------- */

.sitemap-list ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

.sitemap-list li {
    margin-bottom: 8px;
}

.sitemap-list li a {
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 500;
}

.sitemap-list li a:hover {
    text-decoration: underline;
}

/* ページネーション */
.sitemap-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.sitemap-pagination a, .sitemap-pagination span {
    padding: 6px 12px;
    background-color: #f0f0f0;
    border-radius: 4px;
    color: #6c5ce7;
    text-decoration: none;
}

.sitemap-pagination a:hover {
    background-color: #6c5ce7;
    color: #fff;
}

.sitemap-pagination .current {
    background-color: #6c5ce7;
    color: #fff;
    font-weight: bold;
}



.sitemap-list h3 {
    font-size: 16px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 6px;
    margin-top: 24px;
}





/* ------------------------- 
*  スクロール追従するトップへ戻るボタン
---------------------------- */

/*スクロール追従するトップへ戻るボタン*/
#scrollTopBtn {
    position: fixed;       /* 画面のスクロールに関係なく、常に同じ位置に表示される */
    right: 20px;           /* 画面右端から20px内側に配置 */
    bottom: 20px;          /* 画面下端から20px上に配置 */
    background: #337ab7;      /* ボタンの背景色を濃いグレー (#333) に設定 */
    color: #fff;           /* ボタン内の文字色を白に設定 */
    border: none;          /* ボタンの枠線をなくす */
    padding: 12px 16px;    /* 上下12px、左右16pxの内側余白を設定 */
    border-radius: 50%;    /* 角丸を50%にして丸いボタンにする */
    font-size: 18px;       /* 文字サイズを18pxに設定 */
    cursor: pointer;       /* ホバー時にマウスカーソルが手の形になる */
    z-index: 9999;         /* 他の要素より前面に表示されるように設定 */
    display: none;         /* 初期状態では非表示にする（スクロール時にJavaScriptで表示切替） */
}

#scrollTopBtn:hover {
    opacity: 0.8;          /* ホバー時に少し透明にして押せる感を演出 */
}





/* ------------------------- 
*  いいねボタン（グッドボタン）ショートコード
---------------------------- */

/*いいねボタン*/
.like-button-container{
    text-align:center;
    margin:20px 0;
}

.like-button{
    padding:10px 20px;
    border:none;
    border-radius:30px;
    background:#3399ff; /* 薄い青系 */
    color:#fff;
    font-weight:bold;
    font-size:16px;
    cursor:pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.like-button:hover{
    transform: scale(1.1);
    background:#1a75d2; /* 濃いめの黄色 */
    box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

.like-button:active{
    transform: scale(0.95);
}

.like-button.liked{
    animation: pop 0.5s ease;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.like-count{
    margin-left:8px;
    font-weight:bold;
}
  





/* ------------------------- 
*  カテゴリーページでソート処理を追加
---------------------------- */

.sort-buttons {
  margin: 20px 0;
  text-align: center;
}
.sort-button {
  display: inline-block;
  padding: 8px 15px;
  margin: 5px;
  border: 1px solid #0073aa;
  border-radius: 5px;
  background: #f7f7f7;
  color: #0073aa;
  cursor: pointer;
  transition: 0.3s;
}
.sort-button:hover {
  background: #0073aa;
  color: #fff;
}


/* Lightningボタン調整 */
.sort-button {
  font-size: 14px;
  font-weight: bold;
}





/* ------------------------- 
*  サイト全体の閲覧数を1件更新（IPごと1回カウント）
---------------------------- */

.site-total-views {
    display: inline-block;
    padding: 2px 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 0.9em;
    color: #333;
}





/* ------------------------- 
*  投稿の閲覧数を取得・更新する関数（IP制限付き）
---------------------------- */

/*ショートコードで投稿ページごとに閲覧数（カウンター）を表示*/
.post-views {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.9em;
    color: #333;
}





/* ------------------------- 
*  おすすめ記事リスト　おススメ
---------------------------- */
.recommend-posts {
    list-style: none;
    margin: 0 0 0 -20px;
    padding: 0;
}

.recommend-posts li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.recommend-posts li img {
    margin-right: 8px;
    width: 60px;   /* サムネイルの横幅 */
    height: 60px;  /* サムネイルの高さ */
    object-fit: cover;
    border-radius: 4px;
}




/* -----------------------------
*   人気記事リスト
----------------------------- */
.popular-posts {
    list-style: none;  /* デフォルトの数字を消す */
    counter-reset: popular-counter; /* カウンター初期化 */
    padding-left: 0;
    margin: 0 0 20px 0;
	font-size:14px;
}

.popular-posts li {
    counter-increment: popular-counter; /* 順位を増やす */
    position: relative;
    margin-bottom: 12px;
    line-height: 1.4;
    padding-left: 2em; /* 数字の分だけ余白 */
}

/* 数字をタイトル左に表示（色は黒） */
.popular-posts li::before {
    content: counter(popular-counter) "."; /* 1., 2., 3. ... */
    position: absolute;
    left: 0;
    top: 0; /* 常に上に固定 */
    font-weight: bold;
    color: #000; /* 黒に変更 */
}

/* タイトルリンクに下線 */
.popular-posts li a {
    text-decoration: none;
    color: #0073aa;
    display: inline-block;           
    border-bottom: 1px dotted #666; 
    padding-bottom: 2px;
}

.popular-posts li a:hover {
    border-bottom-style: solid;     
    color: #005177;
}

/* 閲覧・コメントは非表示 */
.popular-posts li .views-comments {
    display: none;
}





/* -----------------------------
*    Lightning用 サイドバーのカテゴリーに件数を表示
----------------------------- */

/* ul全体を左端に揃える */
.my-category-count {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: -30px; /* テーマ余白打ち消し */
}

/* liの下線と上下余白 */
.my-category-count li {
    margin: 0;
    border-bottom: 1px dotted #999; /* 灰色の点線下線 */
}

/* aをブロック化して行全体ホバー可能に */
.my-category-count li a {
    display: block;      
    padding: 8px 10px;   
    text-decoration: none;
    color: #333;
    background-color: #ffffff; /* 白背景に変更 */
}

/* 階層ごとのインデント */
.my-category-count li.cat-level-0 a { padding-left: 10px; }  
.my-category-count li.cat-level-1 a { padding-left: 25px; }  
.my-category-count li.cat-level-2 a { padding-left: 40px; }  
.my-category-count li.cat-level-3 a { padding-left: 55px; }  
.my-category-count li.cat-level-4 a { padding-left: 70px; }  

/* ホバー時に行全体に薄い灰色背景 */
.my-category-count li a:hover {
    background-color: #e0e0e0; /* 濃い目の灰色はそのまま残す */
}





/* -----------------------------
*    ランダム関連記事をサイドバーに表示する
----------------------------- */

/* サイドバー関連記事（画像とタイトル回り込み） */
.sidebar-related-posts {
    list-style: none;
    padding-left: 0;
    margin: 0 0 0 -20px;
}

.sidebar-related-item {
    margin-bottom: 10px;
    overflow: hidden; /* floatを使った回り込みを確実に */
}

.sidebar-related-item img {
    float: left;         /* 左に回り込み */
    width: 60px;         /* サムネイルサイズ */
    height: 60px;
    object-fit: cover;
    margin-right: 8px;   /* 画像とタイトルの間隔 */
    border-radius: 4px;
}

.sidebar-related-item .sidebar-related-title {
    display: block;
    font-size: 14px;
    line-height: 1.2;
    color: #0073aa;
}

.sidebar-related-item a:hover .sidebar-related-title {
    text-decoration: underline;
}





/* -----------------------------
*    ランダム記事リストを固定ページにショートコードで表示する方法
----------------------------- */

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

.random-post-item {
    border: 1px solid #ddd;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.random-post-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    margin-bottom: 10px;
}

.random-post-item .post-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.random-post-item .post-excerpt {
    font-size: 0.9em;
    color: #555;
}

/* スマホ用に1列にする */
@media screen and (max-width: 768px) {
    .random-posts {
        grid-template-columns: 1fr !important;
    }
}