/*
Theme Name: AIツールラボ用
Author: 自作
Description: オリジナルテーマ。
Version: 2.7
*/

/* スライド自体の背景や枠線をなくし、中のカードにデザインを委ねる */
.swiper-slide {
    height: auto; /* 高さを自動調整 */
    background-color: transparent;
    border: none;
    box-shadow: none;
    display: flex; /* カードの天地を揃えるため */
    align-items: stretch;
}

/* サンプル画像風のカードデザイン */
.category-ranking-card {
    width: 100%;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    display: flex;
    flex-direction: column;
}

.category-ranking-title {
    font-size: 1.25rem; /* 20px */
    font-weight: 800; /* extra-bold */
    margin-bottom: 1.25rem; /* 20px */
}

/* ランキングリスト */
.category-ranking-list {
    list-style-type: none;
    padding-left: 0;
    counter-reset: ranking-counter;
    margin-bottom: 1rem;
    flex-grow: 1; /* この要素が伸びて高さを揃える */
}

.category-ranking-list li {
    counter-increment: ranking-counter;
    margin-bottom: 0.875rem; /* 14px */
    display: flex;
    align-items: flex-start;
    font-size: 1rem; /* 16px */
    line-height: 1.5;
}

/* ランキングの数字 */
.category-ranking-list li::before {
    content: counter(ranking-counter);
    font-weight: 800;
    margin-right: 0.75rem;
    font-size: 0.875rem; /* 14px */
    min-width: 1.25rem; /* 幅を固定 */
}

/* 1,2,3位の色 */
.category-ranking-list li:nth-child(1)::before { color: #8b5cf6; } /* purple-500 */
.category-ranking-list li:nth-child(2)::before { color: #60a5fa; } /* blue-400 */
.category-ranking-list li:nth-child(3)::before { color: #a78bfa; } /* violet-400 */


.category-ranking-list li a {
    text-decoration: none;
    color: #1f2937; /* gray-800 */
}

.category-ranking-list li a:hover {
    text-decoration: underline;
    color: #4f46e5; /* indigo-600 */
}

/* 「もっと見る」リンク */
.category-ranking-more {
    margin-top: auto; /* カードの一番下に配置 */
    text-align: right;
    font-weight: bold;
    color: #4f46e5; /* indigo-600 */
    text-decoration: none;
    font-size: 0.875rem; /* 14px */
}

.category-ranking-more:hover {
    text-decoration: underline;
}

/* ========== 投稿本文のスタイル ========== */
.post-content p { margin: 0.75rem 0 1.5rem 0; line-height: 1.9; }
.post-content a { color: #4f46e5; text-decoration: underline; }
.post-content a:hover { color: #3730a3; }
.post-content blockquote { border-left: 4px solid #d1d5db; padding-left: 1rem; margin: 1.5rem 0; font-style: italic; color: #4b5563; }

/* ========== コードブロックコピーボタン========== */
.code-block-wrapper {
	position: relative;
	margin-bottom: 1.5em;
}

.code-block-wrapper:hover .copy-button {
	opacity: 1;
}

.post-content .code-block-wrapper pre {
	background-color: #1f2937;
	color: #e5e7eb; 
	padding: 1rem 1rem 1rem 3.5rem;
	border-radius: 0.5rem;
	overflow-x: auto;
	margin-bottom: 0 !important;
	position: relative;
}


/* [3] 各パーツ (コピーボタン・行番号) */
.copy-button {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	background-color: #4b5563;
	color: white;
	border: none;
	padding: 0.25rem 0.75rem;
	font-size: 0.875rem;
	border-radius: 0.375rem;
	cursor: pointer;
	opacity: 0; 
	transition: opacity 0.2s ease-in-out;
	z-index: 10;
}

.line-numbers {
	position: absolute;
	top: 0;
	left: 0;
	width: 2.5rem;
	padding: 1rem 0;
	text-align: right;
	color: #6b7280; 
	user-select: none;
	border-right: 1px solid #374151;
}

.line-numbers span {
	display: block;
	padding-right: 0.5rem;
}


/* --- [4] 折りたたみ機能のスタイル --- */

/* 折りたたまれた状態 */
.code-block-wrapper.is-collapsible.is-collapsed {
	max-height: 250px;
	overflow: hidden;
	border-radius: 0.5rem;
}


.code-block-wrapper.is-collapsible.is-collapsed::after {
	content: '';
	position: absolute;
	bottom: 40px;
	left: 0;
	right: 0;
	height: 50px;
	background: linear-gradient(to bottom, transparent, #1f2937);
	pointer-events: none;
}

.toggle-collapse-button {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	padding: 8px;
	background-color: #374151;
	color: #d1d5db;
	border: none;
	border-top: 1px solid #4b5563; 
	text-align: center;
	cursor: pointer;
	font-weight: bold;
	z-index: 2;
}

.toggle-collapse-button:hover {
	background-color: #4b5563;
}

/* 展開された状態では、ボタンをブロックの下部に配置 */
.code-block-wrapper.is-collapsible:not(.is-collapsed) .toggle-collapse-button {
	position: relative;
	border-radius: 0 0 0.5rem 0.5rem;
}

/* 見出しデザイン */
.post-content h1 {
  font-size: 2.25rem; /* 36px */
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 2rem;
  line-height: 2.75rem;
}

.post-content h2 {
  font-size: 1.875rem; /* 30px */
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  line-height: 2.25rem;
}

.post-content h3 {
  font-size: 1.5rem; /* 24px */
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  position: relative;
  padding-left: 1.5rem;
  line-height: 2rem;
}

.post-content h3::before {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #4f46e5, #a855f7);
  border-radius: 2px;
}

.post-content h4 {
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  line-height: 1.5rem;
}
/*
.post-content h4::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234f46e5'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'%3E%3C/path%3E%3C/svg%3E");
}
 */
.post-content h5 {
  display: flex;
  align-items: center;
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: #4b5563;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.25rem;
}

.post-content h5::before,
.post-content h5::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: #d1d5db;
}

.post-content h5::before {
  margin-right: 1rem;
}

.post-content h5::after {
  margin-left: 1rem;
}

.post-content h6 {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: #4b5563;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.25rem;
}

.post-content h6::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 20' fill='none'%3E%3Cpath d='M0 0L10 20' stroke='%234b5563' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  margin-right: 1rem;
}

.post-content h6::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 20' fill='none'%3E%3Cpath d='M10 0L0 20' stroke='%234b5563' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  margin-left: 1rem;
}


/* ----------------------------------------------
  スマートフォン向けのスタイル（画面幅768px以下）
---------------------------------------------- */
@media screen and (max-width: 768px) {
  .post-content h1 {
    font-size: 1.5rem; /* 24px (元30px) */
    line-height: 2rem;
    margin-top: 2rem;
    margin-bottom: 1.25rem;
  }

  .post-content h2 {
    font-size: 1.25rem; /* 20px (元24px) */
    line-height: 1.75rem;
    margin-top: 1.75rem;
    margin-bottom: 1rem;
  }

  .post-content h3 {
    font-size: 1.125rem; /* 18px (維持 or 微調整) */
    line-height: 1.75rem;
    padding-left: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
  }

  .post-content h4 {
    font-size: 1rem; /* 16px (元18px) */
    line-height: 1.5rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
  }
  
  .post-content h4::before {
    width: 16px; /* フォントサイズに合わせて縮小 */
    height: 16px;
  }

  .post-content h5 {
    font-size: 0.9375rem; /* 15px (元16px) */
    line-height: 1.5rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
  }

  .post-content h6 {
    font-size: 0.875rem; /* 14px (元16px) */
    line-height: 1.4rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
  }


}



/* 目次ハイライト */
#toc a.active {
    background-color: #eef2ff; color: #4338ca; font-weight: 600;
    border-left: 3px solid #4f46e5; padding-left: 0.75rem; margin-left: -0.75rem;
}
#toc a { display: block; transition: all 0.2s ease-in-out; }

/* レスポンシブテーブル */
.responsive-table-wrapper { overflow-x: auto; margin-bottom: 1.5rem; }
.post-content table { width: 100%; border-collapse: collapse; min-width: 600px; }
.post-content th, .post-content td { border: 1px solid #d1d5db; padding: 0.75rem 1rem; text-align: left; }
.post-content th { background-color: #f3f4f6; }


/* ===== ページネーションのスタイル ===== */
.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.pagination .page-numbers.current {
    background-color: #4f46e5; /* bg-indigo-600 */
    color: #ffffff; /* text-white */
}

.pagination a.page-numbers {
    color: #4b5563; /* text-gray-600 */
}

.pagination a.page-numbers:hover {
    background-color: #e5e7eb; /* hover:bg-gray-200 */
}

.pagination .dots {
    color: #6b7280; /* text-gray-500 */
    padding: 0.5rem 0.25rem;
}

/* カテゴリーウィジェット */
.widget_categories ul {
    margin-top: 1rem;
    space-y: 0.5rem; /* space-y-2 */
}
.widget_categories a {
    color: #374151; /* text-gray-700 */
    text-decoration: none;
    transition: color 0.2s;
}
.widget_categories a:hover {
    color: #4f46e5; /* text-indigo-600 */
}

/* タグウィジェット */
.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* gap-2 */
    margin-top: 1rem;
}
.tag-cloud-link {
    background-color: #ffffff; /* bg-white */
    color: #374151; /* text-gray-700 */
    font-size: 0.875rem !important; /* text-sm */
    font-weight: 500; /* medium */
    padding: 0.25rem 0.75rem; /* px-3 py-1 */
    border-radius: 9999px; /* rounded-full */
    border: 1px solid #d1d5db; /* border */
    text-decoration: none;
    transition: all 0.2s;
}
.tag-cloud-link:hover {
    background-color: #f3f4f6; /* hover:bg-gray-100 */
}

/* 診断テスト関連 */
.filter-btn.active {
    background-color: rgb(79 70 229 / var(--tw-bg-opacity, 1));
    color: white;
}

