/*
  Skin Name: 素材
  Description: 
  Skin URI: https://yusukegoto.com/
  Author: Yusuke Goto
  Author URI: https://yusukegoto.com/
  Screenshot URI: https://im-cocoon.net/wp-content/uploads/skin-template.png
  Version: 1.0.4
  Priority: 1
*/

/* ==================================================
   基本設定 & 変数定義
   ================================================== */
:root {
  --primary-color: #3b82f6; /* メインのテックブルー */
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%); /* AIっぽいグラデ */
  --bg-color: #f3f4f6; /* 背景の薄いグレー */
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-sub: #6b7280;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  letter-spacing: 0.03em;
}

/* リンクの基本設定 */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

/* ==================================================
   ヘッダー：SaaS風デザイン
   ================================================== */
.header-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px); /* すりガラス効果 */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  top: 0;
  z-index: 1000;
}

/* サイトタイトル（ロゴ） */
.site-name-text {
  font-weight: 800;
  font-size: 26px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; /* 文字をグラデーションに */
  display: inline-block;
}

/* キャッチフレーズ */
.tagline {
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
}

/* ==================================================
   メインエリア：ギャラリー化
   ================================================== */
/* 余白調整 */
.content-in {
  padding-top: 40px;
  margin-top: 0;
}

/* Cocoonの白い背景枠をリセットして透過させる */
.main, .article {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* 不要な要素を非表示（日付、更新日、TOPというタイトル） */
.home .entry-title,
.home .date-tags,
.home .author-info {
  display: none;
}

/* --- 動画グリッドシステム --- */

/* コンテナのFlex設定をGrid風に再構築 */
.material-latest-wrap {
  display: grid !important;
  /* 画面幅に合わせて自動で列数を調整（最小220px） */
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px !important;
  justify-content: center;
}

/* 個々のカードアイテム */
.material-latest-item {
  display: block;
  width: 100% !important; /* HTMLのインラインスタイルを強制上書き */
  background: var(--card-bg);
  border-radius: 16px;
  padding: 12px;
  box-sizing: border-box;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  border: 1px solid rgba(255,255,255,0.5);
  position: relative;
  overflow: hidden;
}

/* ホバー時のアクション */
.material-latest-item:hover {
  transform: translateY(-8px); /* 浮き上がる */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 10;
}

/* 動画（サムネイル） */
.material-latest-item video {
  border-radius: 10px;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background-color: #000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* タイトルテキスト */
.material-latest-item p {
  margin: 12px 0 4px 0 !important;
  font-size: 14px !important;
  font-weight: 700;
  color: var(--text-main) !important;
  line-height: 1.4;
  /* 長いタイトルを...で省略 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-align: left;
}

/* ==================================================
   サイドバー：モダンなウィジェット
   ================================================== */
#sidebar {
  padding-top: 10px;
}

.widget-sidebar {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* サイドバー見出し */
.widget-sidebar h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  background: none;
  padding: 0 0 10px 0;
  margin-bottom: 20px;
  border: none;
  border-bottom: 2px solid #e5e7eb;
  position: relative;
}

/* 見出しの下線アクセント */
.widget-sidebar h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--accent-gradient);
}

/* 検索ボックスのカスタマイズ */
.wp-block-search__input {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  transition: 0.3s;
}

.wp-block-search__input:focus {
  background-color: #fff;
  border-color: var(--primary-color);
  outline: none;
}

.wp-block-search__button {
  background: var(--accent-gradient);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  padding: 8px 16px;
  margin-left: 8px;
}

/* リストアイテム */
.widget_block li a {
  display: block;
  padding: 8px 0;
  border-bottom: 1px dashed #e5e7eb;
  color: var(--text-sub);
}

.widget_block li a:hover {
  color: var(--primary-color);
  padding-left: 5px; /* 右に動くアニメーション */
}

/* ==================================================
   モバイル対応
   ================================================== */
@media screen and (max-width: 768px) {
  /* スマホではグリッドを2列にする */
  .material-latest-wrap {
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px !important;
  }
  
  .content-in {
    padding-top: 20px;
  }
  
  /* カード内の文字サイズ調整 */
  .material-latest-item p {
    font-size: 12px !important;
  }
}

/* ==================================================
   個別記事ページ（動画ダウンロードページ）専用スタイル
   ================================================== */

/* メインコンテンツ（記事）全体をカード化 */
.post .article {
  background: var(--card-bg) !important;
  border-radius: 16px;
  padding: 30px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

/* 記事タイトル */
.entry-header .entry-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.3;
}

/* 日付・カテゴリ情報 */
.date-tags {
  color: var(--text-sub);
  font-size: 14px;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e5e7eb;
}

/* カテゴリタグをモダンに */
.cat-link {
  font-size: 12px;
  background-color: #f3f4f6;
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  margin-right: 10px;
  border: 1px solid #e5e7eb;
  display: inline-flex;
  align-items: center;
}
.cat-link:hover {
    background-color: #e5e7eb;
    color: var(--primary-color);
}
.cat-link .cat-icon {
    margin-right: 5px;
}

/* 記事コンテンツエリア（動画プレイヤーとボタンの親要素） */
.entry-content {
  margin-top: 0;
  padding-top: 0;
}

/* --- 動画プレイヤーのスタイル --- */
.entry-content video {
  display: block;
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 0 auto 30px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  background: #000;
}

/* --- ダウンロードボタンのスタイル --- */

/* ダウンロードボタンの親要素のPタグを中央揃え */
.entry-content p:has(> .button) {
    text-align: center;
    margin: 30px 0 20px;
}

/* 動画をダウンロード ボタン (クラス名が "button" の場合) */
.entry-content a.button {
  display: inline-block;
  background: var(--accent-gradient); /* グラデーションを使用 */
  color: white;
  font-weight: 700;
  font-size: 18px;
  padding: 12px 30px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  text-decoration: none;
}

.entry-content a.button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* テキストリンクによるダウンロード表示を非表示にする（ボタンがあれば不要なため） */
.entry-content br+a[href*="download_file"] {
    display: none;
}


/* --- 関連素材エリアのスタイル --- */
#custom_html-8 {
  margin-top: 40px;
}

.widget-single-content-bottom-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  border-left: 5px solid var(--primary-color);
  padding-left: 10px;
  margin-bottom: 20px;
}

/* 関連素材グリッドのレイアウト調整 */
.material-related-wrap {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px !important;
  padding: 10px;
  background: #fcfcfc;
  border-radius: 12px;
  border: 1px solid #eee;
}

/* 関連素材のカードはホームと共通のスタイルを適用するため、専用の調整のみ */
.material-related-item {
    width: 100% !important; /* インラインスタイル上書き */
    /* 関連素材のカードは少しシンプルに */
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.material-related-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.material-related-item video {
    border-radius: 8px;
}

/* パンくずリスト */
#breadcrumb {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-sub);
}
#breadcrumb a {
    color: var(--text-sub);
}
#breadcrumb a:hover {
    color: var(--primary-color);
}


/* --- モバイルでの調整 --- */
@media screen and (max-width: 768px) {
  .post .article {
    padding: 20px !important;
  }
  
  .entry-header .entry-title {
    font-size: 22px;
  }
  
  .entry-content a.button {
    font-size: 16px;
    padding: 10px 20px;
  }
  
  .widget-single-content-bottom-title {
    font-size: 18px;
  }
  
  /* 関連素材をスマホでは2列にする */
  .material-related-wrap {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px !important;
  }
}

video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

video::-webkit-media-controls-picture-in-picture-button {
    display: none !important;
}

/* =========================================
   Section Headings (見出しの刷新)
   ========================================= */
.entry-content h2.wp-block-heading {
    margin-top: 60px;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 800;
    color: #1a202c;
    position: relative;
    padding-left: 0;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 見出しの左にテックっぽい装飾を追加 */
.entry-content h2.wp-block-heading::before {
    content: '';
    display: block;
    width: 6px;
    height: 32px;
    background: linear-gradient(to bottom, #2575fc, #6a11cb);
    border-radius: 4px;
    transform: skewX(-15deg); /* 斜めにしてスピード感を出す */
}

.entry-content h3.wp-block-heading {
    margin-top: 50px;
    font-size: 1.4rem;
    color: #4a5568;
    border-bottom: 2px dashed #e2e8f0;
    padding-bottom: 10px;
}

/* =========================================
   Categories (グリッドパネル化)
   ========================================= */
ul.wp-block-categories-list {
    list-style: none !important;
    padding: 0;
    margin: 0 0 50px 0;
    
    /* グリッドレイアウトでタイル状に配置 */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

ul.wp-block-categories-list li {
    margin: 0;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    
    /* 中身の配置 */
    display: flex;
    align-items: center;
    justify-content: space-between; /* 文字と件数を左右に配置 */
    padding: 16px 20px;
}

/* ホバー時の劇的な変化 */
ul.wp-block-categories-list li:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(37, 117, 252, 0.15);
    border-color: #2575fc;
}

/* 背景にうっすら装飾を入れる */
ul.wp-block-categories-list li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 117, 252, 0.05));
    transform: skewX(-20deg) translateX(40px);
    transition: transform 0.4s;
}

ul.wp-block-categories-list li:hover::after {
    transform: skewX(-20deg) translateX(0px);
}

/* カテゴリーリンク（文字部分） */
ul.wp-block-categories-list li a {
    color: #2d3748;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    z-index: 2; /* 装飾より上に */
    flex-grow: 1; /* クリック領域を広げる努力 */
}

ul.wp-block-categories-list li a:hover {
    color: #2575fc;
}

/* 件数の部分 (HTMLの構造上、aタグの外にあるテキスト) */
ul.wp-block-categories-list li {
    color: #a0aec0; /* 件数の色 */
    font-size: 0.9rem;
    font-family: 'Roboto', sans-serif; /* 数字をかっこよく */
}

/* =========================================
   Tag Cloud (ミニマルで洗練されたチップ)
   ========================================= */
.wp-block-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* 隙間を調整 */
    margin-top: 20px;
}

.wp-block-tag-cloud a.tag-cloud-link {
    /* サイズを統一し、少し大きめに */
    font-size: 0.9rem !important;
    font-weight: 500;
    
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    
    background-color: #fff;
    color: #555;
    text-decoration: none;
    
    border: 1px solid #cbd5e0;
    border-radius: 6px; /* 丸すぎない、テック感のある角丸 */
    transition: all 0.2s ease-in-out;
}

/* タグの左にアクセントのドットをつける */
.wp-block-tag-cloud a.tag-cloud-link::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #cbd5e0;
    border-radius: 50%;
    margin-right: 8px;
    transition: background-color 0.2s;
}

/* ホバー時のエフェクト */
.wp-block-tag-cloud a.tag-cloud-link:hover {
    background-color: #2d3748; /* ダークモード風に反転 */
    color: #fff;
    border-color: #2d3748;
    transform: scale(1.05); /* 少し拡大 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.wp-block-tag-cloud a.tag-cloud-link:hover::before {
    background-color: #4fd1c5; /* ドットが光る */
    box-shadow: 0 0 8px #4fd1c5;
}

/* 件数表示をスタイリッシュに */
.wp-block-tag-cloud .tag-link-count {
    font-size: 0.75em;
    margin-left: 6px;
    opacity: 0.6;
}

.wp-block-tag-cloud a.tag-cloud-link:hover .tag-link-count {
    color: rgba(255,255,255,0.7);
}

.video-quality-wrap {
  margin: 8px 0;
  font-size: 14px;
}

.video-quality-value {
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
  background: #111;
  color: #fff;
}

.video-quality-8k { background: #8b0000; }
.video-quality-4k { background: #00008b; }
.video-quality-2k { background: #005f5f; }
.video-quality-fullhd { background: #006400; }
.video-quality-hd { background: #444; }
