/*
Theme Name: HEALIO
Theme URI: https://clearmoon.stars.ne.jp/
Author: clearmoon
Author URI: https://clearmoon.stars.ne.jp/
Description: 健康・フィットネス・ウェルネス・栄養・睡眠動画の自動投稿・まとめサイト専用に最適化されたWordPressテーマ。SEO自動最適化、レスポンシブ対応、直感的な広告設置機能を搭載。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: healio
Tags: health, wellness, fitness, youtube, video, auto-post, light-theme, responsive-layout, grid-layout, ad-ready, custom-colors, custom-menu, featured-images, custom-logo, seo-friendly
*/

/* ==========================================================================
   1. デザインシステム / CSS変数 (ライト系 / ダーク系)
   ========================================================================== */
:root {
  --color-primary: #0D9488;
  --color-primary-hover: #0F766E;
  --color-primary-light: #F0FDF4;
  
  --color-accent: #F59E0B;
  --color-accent-hover: #D97706;
  --color-accent-light: #FFFBEB;
  
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-surface-hover: #F1F5F9;
  
  --color-text-main: #0F172A;
  --color-text-sub: #475569;
  --color-text-muted: #94A3B8;
  
  --color-border: #E2E8F0;
  --color-border-light: #F1F5F9;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 25px -5px rgba(13, 148, 136, 0.12), 0 10px 10px -5px rgba(13, 148, 136, 0.04);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-base: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --container-max-width: 1200px;
}

/* 機能2: ダークモード変数定義 */
html[data-theme="dark"] {
  --color-bg: #0B131E;
  --color-surface: #132235;
  --color-surface-hover: #1E344D;
  
  --color-text-main: #F8FAFC;
  --color-text-sub: #CBD5E1;
  --color-text-muted: #64748B;
  
  --color-border: #223B56;
  --color-border-light: #162B44;
  
  --color-primary-light: #064E3B;
}

/* ==========================================================================
   2. リセット & 基本スタイル
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

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

/* 共通コンテナ */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-content {
  flex: 1;
  padding: 2rem 0;
}

.content-wrapper {
  display: flex;
  gap: 2rem;
}

.main-area {
  flex: 1;
  min-width: 0;
}

.sidebar-area {
  width: 320px;
  flex-shrink: 0;
}

/* ==========================================================================
   3. ヘッダー ＆ ヘッダーアクション
   ========================================================================== */
.site-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0.5rem 0;
  gap: 0.75rem;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.site-title {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text-main);
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.site-title a {
  color: var(--color-text-main);
  display: inline;
  text-decoration: none;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.site-title a:hover {
  color: var(--color-primary);
}

.site-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background-color: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  vertical-align: middle;
  margin-right: 0.35rem;
}

.site-description {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ヘッダーナビゲーション */
.primary-navigation ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.primary-navigation a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text-sub);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

/* ヘッダーアクション (検索・ダークモード・あとで見る) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-icon-btn {
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.header-icon-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.badge-count {
  background: var(--color-accent);
  color: #ffffff;
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 99px;
}

/* ダークモード表示トグルアイコン切替 */
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: inline; }
html[data-theme="dark"] .theme-toggle-btn .icon-sun { display: inline; }
html[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }

/* 検索バー (ヘッダー) */
.header-search {
  position: relative;
}

.search-form {
  display: flex;
  align-items: center;
}

.search-form input[type="search"] {
  padding: 0.5rem 1rem;
  padding-right: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition-fast);
  width: 180px;
}

.search-form input[type="search"]:focus {
  border-color: var(--color-primary);
  background-color: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  width: 230px;
}

.search-form button[type="submit"] {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
}

.search-form button[type="submit"]:hover {
  color: var(--color-primary);
}

/* モバイルメニューボタン */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-main);
  cursor: pointer;
  padding: 0.5rem;
}

/* ==========================================================================
   4. ヒーローセクション / トップバナー
   ========================================================================== */
.hero-banner {
  background: linear-gradient(135deg, #042F2E 0%, #0D9488 50%, #14B8A6 100%);
  color: #FFFFFF;
  padding: 3rem 0;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.hero-inner {
  max-width: 700px;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.hero-description {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.5;
}

/* ==========================================================================
   5. 動画カードグリッド (.video-grid, .video-card)
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.video-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-border);
}

.video-thumbnail-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #000;
  overflow: hidden;
}

.video-thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.video-card:hover .video-thumbnail-wrapper img {
  transform: scale(1.05);
}

.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background-color: rgba(239, 68, 68, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
}

.video-card:hover .play-badge {
  background-color: var(--color-accent);
  transform: translate(-50%, -50%) scale(1.1);
}

/* 機能3: カード上 あとで見る ボタン */
.card-bookmark-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  backdrop-filter: blur(4px);
  transition: var(--transition-fast);
  z-index: 2;
}

.card-bookmark-btn:hover,
.card-bookmark-btn.bookmarked {
  background: var(--color-accent);
  color: #ffffff;
  transform: scale(1.1);
}

.video-card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.video-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.video-card-title a {
  color: var(--color-text-main);
  text-decoration: none;
}

.video-card-title a:hover {
  color: var(--color-primary);
}

.video-card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding-top: 0.75rem;
  border-top: 1px dashed var(--color-border);
}

.channel-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text-sub);
  font-weight: 500;
}

.post-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* カテゴリ・タグバッジ */
.badge-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   6. YouTube 埋め込み (16:9 レスポンシブ)
   ========================================================================== */
.youtube-embed-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: #000;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.youtube-embed-container iframe,
.youtube-embed-container object,
.youtube-embed-container embed,
.youtube-embed-container .youtube-lite-embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.youtube-lite-embed {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.youtube-lite-embed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.youtube-lite-play-btn {
  position: absolute;
  width: 68px;
  height: 48px;
  background-color: rgba(33, 33, 33, 0.8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.youtube-lite-embed:hover .youtube-lite-play-btn {
  background-color: #FF0000;
}

/* ==========================================================================
   7. 広告コンテナ
   ========================================================================== */
.ad-container {
  margin: 1.5rem auto;
  text-align: center;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.ad-label {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.ad-wrapper {
  display: inline-block;
  max-width: 100%;
  background-color: var(--color-surface);
  border: 1px dashed var(--color-border);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  overflow: hidden;
}

.ad-placeholder {
  background: repeating-linear-gradient(
    45deg,
    var(--color-bg),
    var(--color-bg) 10px,
    var(--color-surface) 10px,
    var(--color-surface) 20px
  );
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 0.75rem;
  min-height: 80px;
  border-radius: var(--radius-sm);
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   8. サイドバー & ウィジェット & 人気ランキング (機能1)
   ========================================================================== */
/* ─── サイドバー ウィジェット ─── */
.widget {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 0;
  margin-bottom: 1.75rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden;
}

/* ウィジェットタイトル帯 */
.widget-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin: 0;
  padding: 0.7rem 1.1rem;
  background: linear-gradient(90deg, var(--color-primary) 0%, #14B8A6 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background-color: rgba(255,255,255,.7);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ウィジェット本体のパディング */
.widget > *:not(.widget-title) {
  padding: 0 1.1rem;
}
.widget > ul,
.widget > div,
.widget > p,
.widget > form {
  padding: 0.9rem 1.1rem;
}

.widget ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1.1rem 0.5rem !important;
}

.widget ul li {
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--color-border-light);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.widget ul li::before {
  content: '›';
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.widget ul li:last-child {
  border-bottom: none;
}

.widget ul li a {
  color: var(--color-text);
  transition: color .15s;
  line-height: 1.5;
}

.widget ul li a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ミニ動画リスト & ランキングスタイリング (機能1) */
.mini-video-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mini-video-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  position: relative;
}

.rank-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #F59E0B, #D97706); }
.rank-2 { background: linear-gradient(135deg, #94A3B8, #64748B); }
.rank-3 { background: linear-gradient(135deg, #B45309, #78350F); }
.rank-other { background: var(--color-text-muted); }

.ranking-views-count {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.mini-video-thumb {
  width: 85px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.mini-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-video-info {
  flex: 1;
  min-width: 0;
}

.mini-video-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-video-title a {
  color: var(--color-text-main);
}

/* ==========================================================================
   9. ページネーション & パンくず
   ========================================================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.breadcrumbs a {
  color: var(--color-text-sub);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs .separator {
  color: var(--color-text-muted);
}

.breadcrumbs .current {
  word-break: break-word;
  overflow-wrap: anywhere;
  color: var(--color-text-main);
}

/* ==========================================================================
   10. フッター
   ========================================================================== */
.site-footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
  padding: 3rem 0 1.5rem 0;
  color: var(--color-text-sub);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand .footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.75rem;
}

.footer-description {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.footer-widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 1rem;
}

.footer-nav ul {
  list-style: none;
}

.footer-nav ul li {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer-copyright a {
  color: var(--color-text-sub);
  font-weight: 500;
}

.footer-copyright a:hover {
  color: var(--color-primary);
}

/* トップに戻るボタン */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background-color: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  z-index: 99;
  border: none;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
}

/* ==========================================================================
   11. 収益化 ＆ SNS ＆ モーダル機能 (機能3)
   ========================================================================== */

.single-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.btn-bookmark-action {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-bookmark-action.bookmarked {
  background: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

/* お気に入りモーダル構造 (機能3) */
.bookmark-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.bookmark-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bookmark-modal-content {
  background: var(--color-surface);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bookmark-modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bookmark-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.bookmark-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bookmark-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
}

.bookmark-item img {
  width: 80px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.bookmark-item-info {
  flex: 1;
  min-width: 0;
}

.bookmark-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-remove-btn {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
}

/* SNSシェアボタン */
.social-share-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}

.share-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-sub);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff !important;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.share-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.share-x { background-color: #000000; }
.share-line { background-color: #06C755; }
.share-fb { background-color: #1877F2; }

/* アフィリエイトボタン */
.affiliate-search-buttons {
  margin: 2rem 0;
  padding: 1.25rem;
  background-color: var(--color-primary-light);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
}

.affiliate-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.affiliate-btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-affiliate {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
  color: #ffffff !important;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.btn-affiliate:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-amazon { background-color: #FF9900; }
.btn-rakuten { background-color: #BF0000; }
.btn-yahoo { background-color: #0074E4; }

/* ─── 楽天＆Amazon 商品リンクカード (リッチデザイン & 複数表示対応) ─── */
.healio-affiliate-products-wrap,
.smart-affiliate-section {
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.affiliate-section-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

.affiliate-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.affiliate-section-lead {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.healio-affiliate-products-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.healio-product-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.healio-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.product-card-badge {
  background: linear-gradient(90deg, #1e40af 0%, #3b82f6 100%);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.product-card-badge .badge-num {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.product-card-inner {
  display: flex;
  padding: 1.25rem;
  gap: 1.5rem;
  align-items: center;
}

.product-image-box {
  flex-shrink: 0;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #f1f5f9;
}

.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-image-box a:hover .product-thumb-img {
  transform: scale(1.05);
}

.product-no-image {
  color: #94a3b8;
  font-size: 0.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.product-info-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
}

.product-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.15s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-title a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.product-meta-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.product-price {
  color: #e11d48;
  font-size: 1.15rem;
  font-weight: 800;
}

.product-price .price-val {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.product-price .tax-label {
  font-size: 0.75rem;
  font-weight: normal;
  color: #64748b;
  margin-left: 0.2rem;
}

.product-shop {
  font-size: 0.8rem;
  color: #64748b;
}

.product-rating-row {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rating-stars {
  color: #f59e0b;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.rating-score {
  font-weight: 700;
  color: #0f172a;
}

.rating-count {
  color: #64748b;
  font-size: 0.8rem;
}

.product-button-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.btn-mall-affiliate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff !important;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  flex: 1 1 130px;
  max-width: 200px;
  text-align: center;
}

.btn-mall-affiliate:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  opacity: 0.95;
}

.btn-mall-amazon {
  background: linear-gradient(135deg, #FF9900 0%, #E68A00 100%);
  color: #ffffff !important;
}

.btn-mall-rakuten {
  background: linear-gradient(135deg, #BF0000 0%, #990000 100%);
  color: #ffffff !important;
}

/* 公式ブランドアイコン（Amazon / 楽天） */
.mall-brand-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  filter: brightness(0) invert(1); /* ボタン背景が色付きなので白く表示 */
  object-fit: contain;
}

/* ─── スマート複数アフィリエイト検索グリッド (フォールバック & ジャンル別) ─── */
.smart-affiliate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.smart-aff-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.smart-aff-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: #94a3b8;
}

.smart-aff-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #0f172a;
}

.smart-aff-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.smart-aff-kw {
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.smart-aff-btn-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.smart-aff-btn-group .btn-mall-affiliate {
  flex: 1 1 70px;
  max-width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .product-card-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .product-image-box {
    width: 160px;
    height: 160px;
  }

  .product-meta-row {
    justify-content: center;
  }

  .product-rating-row {
    justify-content: center;
  }

  .product-button-group {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-mall-affiliate {
    max-width: 100%;
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
  }

  .smart-aff-btn-group {
    flex-direction: column;
  }
}

/* ─── オリジナルまとめ記事テンプレート ─── */

/* ① リード文 */
.article-lead-section {
  margin: 0 0 1.75rem;
  padding: 0;
  background: linear-gradient(120deg, #F0FDF4 0%, #ECFDF5 100%);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.article-lead-section::before {
  content: '📌 この記事について';
  display: block;
  background: linear-gradient(90deg, #0F766E 0%, #0D9488 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 0.45rem 1rem;
}
.article-lead-text {
  font-size: 0.97rem;
  line-height: 1.85;
  color: var(--color-text);
  margin: 0;
  padding: 1rem 1.25rem;
}

/* ② 動画情報カード */
.video-info-card {
  margin: 0 0 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden;
}
.video-info-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: .06em;
  margin: 0;
  padding: 0.5rem 1rem;
  background: linear-gradient(90deg, #475569 0%, #64748B 100%);
  color: #ffffff;
  border-bottom: none;
}
.video-meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.video-meta-table th,
.video-meta-table td {
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}
.video-meta-table th {
  width: 7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: #F8FAFC;
  white-space: nowrap;
  border-right: 2px solid var(--color-border-light);
}
.video-meta-table tr:last-child th,
.video-meta-table tr:last-child td {
  border-bottom: none;
}
.video-meta-table tr:nth-child(even) td {
  background: #FAFBFC;
}

/* ③ ポイントリスト */
.article-points-section {
  margin: 0 0 1.75rem;
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.article-points-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: .06em;
  margin: 0;
  padding: 0.5rem 1rem;
  background: linear-gradient(90deg, #15803D 0%, #22C55E 100%);
  color: #ffffff;
}
.article-points-list {
  margin: 0;
  padding: 0.75rem 1rem 0.75rem 1rem;
  list-style: none;
}
.article-points-list li {
  padding: 0.5rem 0 0.5rem 1.75rem;
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--color-text);
  border-bottom: 1px dashed #BBF7D0;
  position: relative;
}
.article-points-list li:last-child {
  border-bottom: none;
}
.article-points-list li::before {
  content: '✅';
  position: absolute;
  left: 0;
  top: 0.5rem;
  font-size: 0.85rem;
}

/* ④ YouTube CTA ボタン */
.article-cta-section {
  margin: 0 0 1.75rem;
  background: #FFF7ED;
  border: 1px solid #FDBA74;
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
}
.article-cta-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: .06em;
  margin: 0;
  padding: 0.5rem 1rem;
  background: linear-gradient(90deg, #C2410C 0%, #F97316 100%);
  color: #ffffff;
  text-align: left;
}
.article-cta-section p {
  color: var(--color-text-muted);
  margin: 0.75rem 0 0.75rem;
  font-size: 0.875rem;
}
.btn-youtube-watch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  margin: 0 0 1.25rem;
  background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(239,68,68,.35);
  transition: transform .15s, box-shadow .15s;
}
.btn-youtube-watch:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(239,68,68,.45);
}

/* ⑤ まとめセクション */
.article-summary-section {
  margin: 0 0 1.75rem;
  background: linear-gradient(120deg, #FFFBEB 0%, #FFF7ED 100%);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.article-summary-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: .06em;
  margin: 0;
  padding: 0.5rem 1rem;
  background: linear-gradient(90deg, #B45309 0%, #D97706 100%);
  color: #ffffff;
}
.article-summary-section p {
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--color-text);
  margin: 0;
  padding: 1rem 1.25rem;
}

/* 動画概要ボックス（旧・後方互換）*/
.video-intro-box {
  background-color: var(--color-surface-hover);
  border-left: 4px solid var(--color-primary);
  padding: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* ─── 関連動画セクション ─── */
.related-videos-section {
  margin-top: 3rem;
  margin-bottom: 3.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--color-border);
}

.related-videos-section .section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.related-videos-section .section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.video-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.775rem;
  color: var(--color-text-muted);
}

.related-cat-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-size: 0.725rem;
}

/* コメントエリア */
.comments-wrap {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--color-border);
}

.comments-area {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.comment-list {
  list-style: none;
  margin-bottom: 2rem;
}

.comment-list li {
  padding: 1rem;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid var(--color-border-light);
}

.btn-submit-comment {
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-submit-comment:hover {
  background-color: var(--color-primary-hover);
}

/* ==========================================================================
   固定ページ (page.php) 本文スタイル
   ========================================================================== */

/* ページ見出し */
.page-header {
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}

.page-header__title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1.4;
  margin: 0 0 0.5rem;
}

.page-header__updated {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ページアイキャッチ画像 */
.page-thumbnail {
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.page-thumbnail__img {
  width: 100%;
  height: auto;
  display: block;
}

/* ページ本文エリア：読みやすい行間・フォントサイズ */
.page-content {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-text-main);
}

.page-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  border-left: 4px solid var(--color-primary);
  padding-left: 0.75rem;
  margin: 2rem 0 0.75rem;
}

.page-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--color-border);
}

.page-content p {
  margin-bottom: 1.2rem;
}

.page-content ul,
.page-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.page-content li {
  margin-bottom: 0.4rem;
}

.page-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.page-content a:hover {
  color: var(--color-primary-hover);
}

/* ページ全体カード */
.page-article {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border-light);
}

/* ==========================================================================
   ヒーローバナー : カスタムヘッダー画像対応
   ========================================================================== */
.hero-banner[style] {
  /* 画像が設定された場合の文字色を白にして読みやすく */
  color: #ffffff;
}

.hero-banner[style] .hero-title,
.hero-banner[style] .hero-description {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   フッター 3カラム対応 (サイト情報コラム追加)
   ========================================================================== */
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  padding: 2.5rem 0;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ==========================================================================
   カスタムヘッダーバナー画像の見切れ防止 ＆ レスポンシブ最適化
   ========================================================================== */
.custom-header-banner {
  width: 100%;
  margin-bottom: 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-surface);
  line-height: 0;
}

.custom-header-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain; /* 画像を一切切らずに完璧なアスペクト比で表示 */
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   サイドバー ウィジェット検索フォームのサイズ適正化 (さらにコンパクトなスリムサイズ)
   ========================================================================== */
.widget_search,
.widget .search-form,
.sidebar-area .search-form {
  width: 100%;
  max-width: 100%;
}

.widget .search-form,
.sidebar-area .search-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px 4px 2px 10px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
  height: 32px; /* 縦幅をスリムな32pxに固定 */
}

.widget .search-form:focus-within,
.sidebar-area .search-form:focus-within {
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.widget .search-field,
.sidebar-area .search-field {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 0.8rem !important;
  color: var(--color-text-main) !important;
  outline: none !important;
  height: 28px !important;
  line-height: 28px !important;
}

.widget .search-submit,
.sidebar-area .search-submit {
  flex-shrink: 0;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  background: var(--color-primary) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: var(--transition-fast) !important;
}

.widget .search-submit svg,
.sidebar-area .search-submit svg {
  width: 13px !important;
  height: 13px !important;
}

.widget .search-submit:hover,
.sidebar-area .search-submit:hover {
  background: var(--color-primary-hover) !important;
  transform: scale(1.05);
}

/* ==========================================================================
   個別記事 ＆ 固定ページタイトルの見切れ・あふれ防止
   ========================================================================== */
.single-video-post {
  max-width: 100%;
  overflow-x: hidden;
}

.entry-title,
.page-header__title {
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  line-height: 1.4;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.video-meta-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.btn-youtube-watch {
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  white-space: normal;
  text-align: center;
  justify-content: center;
}

.btn-affiliate {
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  white-space: normal;
}

.social-share-bar {
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 78px !important;
    right: 16px !important;
    z-index: 1600 !important;
  }

  .single-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .entry-title {
    font-size: 1.2rem;
    line-height: 1.45;
    width: 100%;
  }

  .page-header__title {
    font-size: 1.25rem;
  }

  .btn-bookmark-action {
    align-self: flex-start;
  }

  .article-lead-text,
  .article-summary-section p {
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
  }

  .article-points-list {
    padding: 0.5rem 0.85rem;
  }

  .article-cta-section {
    padding: 1rem 0.75rem;
  }

  .btn-youtube-watch {
    padding: 0.7rem 1.25rem;
    font-size: 0.875rem;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .video-meta-table tr {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--color-border-light);
  }

  .video-meta-table tr:last-child {
    border-bottom: none;
  }

  .video-meta-table th,
  .video-meta-table td {
    display: block;
    width: 100% !important;
    padding: 0.2rem 0.85rem;
    border: none !important;
  }

  .video-meta-table th {
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    padding-top: 0.4rem;
  }

  .video-meta-table td {
    font-weight: 600;
    color: var(--color-text-main);
  }
}

/* ==========================================================================
   Contact Form 7 (お問い合わせフォーム) 専用デザインスタイル
   ========================================================================== */
.wpcf7 {
  margin: 1.5rem 0;
  padding: 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.wpcf7 form p {
  margin: 0 0 1.25rem;
}

.wpcf7 label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.35rem;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="url"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 select,
.wpcf7 textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--color-bg);
  color: var(--color-text-main);
  box-sizing: border-box;
  transition: var(--transition-fast);
  outline: none;
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
  border-color: var(--color-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.wpcf7 textarea {
  min-height: 140px;
  resize: vertical;
}

.wpcf7 input[type="submit"],
.wpcf7-submit {
  width: 100%;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, #0F766E 100%);
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.wpcf7-not-valid-tip {
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.wpcf7-response-output {
  margin: 1.25rem 0 0 !important;
  padding: 1rem 1.25rem !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
}

.wpcf7 form.sent .wpcf7-response-output {
  background: #f0fdf4 !important;
  border: 1px solid #86efac !important;
  color: #166534 !important;
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.invalid .wpcf7-response-output {
  background: #fef2f2 !important;
  border: 1px solid #fca5a5 !important;
  color: #991b1b !important;
}

/* ==========================================================================
   人気アクセスランキング — トップページ全幅バー (PC)
   ========================================================================== */
.top-ranking-bar {
  margin: 1.5rem 0 2rem;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.top-ranking-bar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  gap: 1rem;
}

.top-ranking-bar__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.top-ranking-bar__icon {
  font-size: 1.15rem;
}

.top-ranking-bar__more-btn {
  flex-shrink: 0;
  padding: 0.45rem 1rem;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}

.top-ranking-bar__more-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

.top-ranking-bar__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--color-border-light, #f1f5f9);
}

.top-ranking-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid var(--color-border-light, #e2e8f0);
  transition: background 0.15s;
  position: relative;
  background: #ffffff;
}

.top-ranking-card:last-child {
  border-right: none;
}

.top-ranking-card:hover {
  background: #f8fafc;
}

.top-ranking-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e2e8f0;
}

.top-ranking-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.top-ranking-card:hover .top-ranking-card__thumb img {
  transform: scale(1.04);
}

.top-ranking-card__medal {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* ★ タイトル背景エリア（上位3つ）★ */
.top-ranking-card__info {
  padding: 0.85rem 1rem;
  flex: 1;
  background: #ffffff; /* 明確な背景色 */
  border-top: 2px solid #e2e8f0; /* サムネイルとの区切り線 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.top-ranking-card__title {
  margin: 0 0 0.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a; /* 濃い文字色で背景と同化させない */
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ★ PV数表示（同化防止の目立つグリーンバッジ調） ★ */
.top-ranking-card__views {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0D9488; /* 視認性の高いプライマリグリーン */
  background: #F0FDF4;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #A7F3D0;
  width: fit-content;
}

.top-ranking-bar__empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.9rem;
}

/* モバイルでは非表示（ボトムナビのランキングボタンで代替） */
@media (max-width: 768px) {
  .top-ranking-bar {
    display: none;
  }
}

/* ==========================================================================
   モーダル全共通オーバーレイ (PC ＆ モバイル 全対応グローバルCSS)
   ========================================================================== */
.app-modal-overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.7) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999999 !important;
  align-items: center;
  justify-content: center;
}

.app-modal-overlay.is-active,
.app-modal-overlay.active {
  display: flex !important;
}

.app-modal-content {
  background: var(--color-surface, #ffffff);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1000000;
}

.app-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light, #f1f5f9);
  background: var(--color-surface, #ffffff);
}

.app-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-main, #0f172a);
}

.modal-close-btn {
  background: var(--color-surface-hover, #f1f5f9);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--color-text-sub, #475569);
  cursor: pointer;
  transition: background 0.15s;
}

.modal-close-btn:hover {
  background: #e2e8f0;
}

.app-modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  max-height: 70vh;
}

/* ==========================================================================
   モーダル表示時の背景スクロール防止 (Body Scroll Lock)
   ========================================================================== */
body.modal-open {
  overflow: hidden !important;
  height: 100vh !important;
  touch-action: none;
}

/* モバイルでは下からスライドアップ ＆ ボトムナビ（100px高）の上に浮かせて表示 */
@media (max-width: 768px) {
  #ranking-modal {
    align-items: flex-end;
    padding-bottom: 108px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  #ranking-modal .app-modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 16px !important;
    max-height: calc(85vh - 110px);
  }
  .ranking-modal-body,
  #ranking-modal .app-modal-body {
    max-height: 350px !important; /* スマホ画面で5件全表示＋6件目の頭が見切れて見える高さ */
  }
  .ranking-modal-item {
    padding: 0.6rem 0.85rem !important;
    gap: 0.6rem !important;
  }
  .ranking-modal-thumb {
    width: 64px !important;
    height: 42px !important;
  }
  .ranking-modal-title {
    font-size: 0.8rem !important;
    line-height: 1.35 !important;
  }
  .ranking-modal-badge {
    font-size: 1.2rem !important;
    width: 1.6rem !important;
  }
}

/* ==========================================================================
   人気アクセスランキング — サイドバーウィジェット (PC)
   ========================================================================== */
.sidebar-ranking-widget {
  margin-bottom: 1.5rem;
}


.sidebar-ranking-more-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.sidebar-ranking-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(245, 158, 11, 0.5);
}

/* ==========================================================================
   人気アクセスランキング — モーダル専用スタイル ＆ スクロールバー
   ========================================================================== */
.ranking-modal-content {
  max-width: 560px !important;
  max-height: 85vh;
  overflow: hidden;
}

.ranking-modal-body,
#ranking-modal .app-modal-body {
  padding: 0 !important;
  max-height: 415px !important; /* 5件全表示＋6件目の頭が見切れて見える高さ */
  overflow-y: scroll !important; /* スクロール可能であることを明確に示すスクロールバー */
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

/* カスタムスリムスクロールバー (Chrome / Safari / Edge) */
.ranking-modal-body::-webkit-scrollbar,
#ranking-modal .app-modal-body::-webkit-scrollbar {
  width: 8px;
}

.ranking-modal-body::-webkit-scrollbar-track,
#ranking-modal .app-modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.ranking-modal-body::-webkit-scrollbar-thumb,
#ranking-modal .app-modal-body::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

.ranking-modal-body::-webkit-scrollbar-thumb:hover,
#ranking-modal .app-modal-body::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

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

.ranking-modal-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light, #f1f5f9);
  transition: background 0.15s;
  text-decoration: none;
}

.ranking-modal-item:last-child {
  border-bottom: none;
}

.ranking-modal-item:hover {
  background: var(--color-bg, #f8fafc);
}

.ranking-modal-badge {
  flex-shrink: 0;
  font-size: 1.4rem;
  width: 2rem;
  text-align: center;
  line-height: 1;
}

.ranking-modal-badge .rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--color-border, #e2e8f0);
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--color-text-sub, #475569);
}

.ranking-modal-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 48px;
  overflow: hidden;
  border-radius: 6px;
  background: #e2e8f0;
}

.ranking-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ranking-modal-info {
  flex: 1;
  min-width: 0;
}

.ranking-modal-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-main, #0f172a);
  line-height: 1.4;
  text-decoration: none;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ranking-modal-title:hover {
  color: var(--color-primary, #0D9488);
}

.ranking-modal-views {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted, #94a3b8);
  margin-top: 0.25rem;
}

/* ==========================================================================
   モバイルボトムナビゲーション — 2段構成スタイル (PC非表示)
   ========================================================================== */
@media (min-width: 769px) {
  /* PC表示時はボトムナビを完全非表示 */
  .mobile-bottom-nav {
    display: none !important;
  }

  /* ランキングモーダルはPC表示に切り替え（中央寄せ） */
  #ranking-modal.is-active {
    align-items: center !important;
  }

  #ranking-modal.is-active .ranking-modal-content {
    border-radius: var(--radius-md, 12px) !important;
    margin-bottom: 0 !important;
  }
}





