/*
Theme Name: August
Theme URI: https://clearmoon.stars.ne.jp/
Author: clearmoon
Author URI: https://clearmoon.stars.ne.jp/
Description: YouTube動画の自動投稿・まとめサイト専用に最適化されたWordPressテーマ。SEO自動最適化、レスポンシブ対応、直感的な広告設置機能を搭載。
Version: 1.1.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: august
Tags: 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: #2563EB;
  --color-primary-hover: #1D4ED8;
  --color-primary-light: #EFF6FF;
  
  --color-accent: #EF4444;
  --color-accent-hover: #DC2626;
  --color-accent-light: #FEF2F2;
  
  --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(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 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: #0F172A;
  --color-surface: #1E293B;
  --color-surface-hover: #334155;
  
  --color-text-main: #F8FAFC;
  --color-text-sub: #CBD5E1;
  --color-text-muted: #64748B;
  
  --color-border: #334155;
  --color-border-light: #1E293B;
  
  --color-primary-light: #1E3A8A;
}

/* ==========================================================================
   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, #1E40AF 0%, #2563EB 50%, #3B82F6 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%, #3B82F6 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; }

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

/* ① リード文 */
.article-lead-section {
  margin: 0 0 1.75rem;
  padding: 0;
  background: linear-gradient(120deg, #EFF6FF 0%, #F0F9FF 100%);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.article-lead-section::before {
  content: '📌 この記事について';
  display: block;
  background: linear-gradient(90deg, #1D4ED8 0%, #3B82F6 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);
  }
}




