/* ==========================================================================
   ベース・リセット
   ========================================================================== */

/* 特記事項:
   - common.css をベースとして使用しているため、重複するリセット・フォント設定は省略
   - バナーダウンロードページ固有の変数や基本設定のみを記述
*/

:root {
  --bdl-sidebar-width: 240px;
  --bdl-gap: 40px;
  --bdl-accent-color: #f7941d;
  --bdl-bg-light: #f9f9f9;
  --bdl-border-color: #e0e0e0;
}

/* ==========================================================================
   汎用レイアウト構造
   ========================================================================== */

.bdl-container {
  position: relative;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--bdl-gap);
  margin: 0 0 40px;
  background: #fff;
}

@media (max-width: 991px) {
  .bdl-container {
    flex-direction: column;
    gap: 30px;
  }
}

.bdl-sidebar {
  position: sticky;
  top: 20px;
  flex-shrink: 0;
  width: var(--bdl-sidebar-width);
}

@media (max-width: 991px) {
  .bdl-sidebar {
    position: static;
    width: 100%;
  }
}

.bdl-contents {
  flex-grow: 1;
  min-width: 0;
}

/* ==========================================================================
   汎用パーツ・コンポーネント
   ========================================================================== */

/* バナーグリッドリスト (4列グリッド) */
.bdl-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.bdl-list>li {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--bdl-border-color);
  border-radius: 8px;
  transition: border-color 0.2s ease;
}

.bdl-list>li:hover {
  border-color: var(--primary-mint);
}

.bdl-list .thumb {
  position: relative;
  width: 100%;
  height: auto;
  margin-bottom: 12px;
  border-radius: 4px;
  overflow: hidden;
}

.bdl-list .thumb img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.bdl-list .thumb:hover img {
  opacity: 0.88;
}

.thumb-zoom {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 26px;
  height: 26px;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bdl-list .thumb:hover .thumb-zoom {
  opacity: 1;
}

/* タグ関連 */
.tag-bdl {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  margin: 10px 0;
  padding: 0 32px 0 0;
  /* 右側にボタン用の余白を確保 */
  list-style: none;
  height: 26px;
  /* 1行分が完全に収まる高さに微増 */
  overflow: hidden;
  position: relative;
  transition: height 0.3s ease-out;
}

/* 下方向へのグラデーション透過（フェードアウト）: タグが溢れている場合のみ表示 */
.tag-bdl.has-more:not(.is-expanded)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.9) 80%, rgba(255, 255, 255, 1) 100%);
  pointer-events: none;
  z-index: 4;
  /* タグより上に表示 */
  transition: opacity 0.3s;
}

.tag-bdl.is-expanded {
  height: auto;
  overflow: visible;
}

.tag-bdl li {
  display: inline-block;
}

.tag-bdl li a {
  display: inline-block;
  padding: 2px 8px;
  background: #f0f0f0;
  border-radius: 4px;
  font-size: 11px;
  color: #666;
  text-decoration: none;
  transition: background 0.2s ease;
}

.tag-bdl li a:hover {
  background: #e0e0e0;
  color: #333;
}

/* タグもっと見るボタン */
.tag-more-wrap {
  display: contents;
  /* ラッパーのレイアウト影響を排除 */
}

.tag-more-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 24px;
  background: transparent;
  border: none;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  z-index: 5;
}

.tag-more-btn span {
  display: none;
}

.tag-more-btn i {
  font-size: 10px;
  transition: transform 0.3s;
}

.tag-bdl.is-expanded .tag-more-btn {
  position: absolute;
  /* 位置を固定のままにする */
  bottom: auto;
}

.tag-bdl.is-expanded .tag-more-btn i {
  transform: rotate(180deg);
}

.tag-more-btn:hover {
  background: #f5f5f5;
  color: #333;
  border-color: #999;
}

.tag-more-btn i {
  font-size: 8px;
  transition: transform 0.3s;
}

.is-expanded+.tag-more-wrap .tag-more-btn i {
  transform: rotate(180deg);
}

/* ダウンロードボタン */
.button-bdl {
  margin-top: auto;
}

.button-bdl a {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary-mint);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.2s ease;
}

.button-bdl a:hover {
  transform: translate(2px, 2px);
  opacity: 0.9;
  color: #fff;
  text-decoration: none;
}

/* クイックリンク */
.quick-links {
  margin-top: 60px;
  padding: 40px;
  background: var(--bdl-bg-light);
  border-radius: 12px;
}

@media (max-width: 767px) {
  .quick-links {
    padding: 20px;
  }
}

.quick-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.quick-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--bdl-border-color);
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
}

.quick-link-card:hover {
  border-color: var(--bdl-accent-color);
  background: #fffaf5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(247, 148, 29, 0.15);
}

.quick-link-card .card-icon {
  margin-bottom: 12px;
  font-size: 24px;
  color: var(--bdl-accent-color);
}

.quick-link-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #333;
}

.quick-link-card p {
  margin: 0;
  font-size: 13px;
  color: #666;
}

/* ==========================================================================
   ページ・機能固有スタイル
   ========================================================================== */

/* プラットフォーム絞り込みUI */
.platform-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  margin-bottom: 25px;
}

.platform-filter-label {
  font-size: 15px;
  font-weight: bold;
  color: #333;
}

.platform-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.platform-filter-buttons li {
  margin-bottom: 0;
}

/* ラジオボタン本体は非表示 */
.platform-filter-buttons li input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}

/* ラベルをボタン風に */
.platform-filter-buttons li label {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 15px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  opacity: 0.3;
  cursor: pointer;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
  background: #aaa;
}

/* チェックアイコン（非アクティブ時は非表示） */
.platform-filter-buttons li label .btn-check-icon {
  display: none;
  font-size: 12px;
}

/* アクティブ状態 */
.platform-filter-buttons li:has(input:checked) label {
  opacity: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.platform-filter-buttons li:has(input:checked) label .btn-check-icon {
  display: inline;
}

@media (hover: hover) {
  .platform-filter-buttons li label:hover {
    opacity: 0.75;
  }
  .platform-filter-buttons li:has(input:checked) label:hover {
    opacity: 1;
  }
}

/* すべてボタン */
.platform-filter-buttons li[data-tag="all"] label {
  background: #555;
}

/* タグ名に応じた色（LINE / Instagram） */
.platform-filter-buttons li[data-tag="LINE"] label,
.platform-filter-buttons li[data-tag="LINE用"] label {
  background: #06c755;
}

.platform-filter-buttons li[data-tag="Instagram"] label,
.platform-filter-buttons li[data-tag="Instagram用"] label {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* カウント非表示（labelの中のspan.nameのみ表示） */
.platform-filter-buttons li label .count {
  display: none;
}

@media (max-width: 767px) {
  .platform-filter {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* フィルターサイドバーのデザイン (ボタン形式) */
.bdl-sidebar h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #555;
  font-size: 17px;
  color: #333;
}

.reset-wrap {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 10px;
}

.bdl-sidebar .reset {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 11px;
  color: #666;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.bdl-sidebar .reset:hover {
  background: #f0f0f0;
  border-color: #999;
  color: #333;
}

.tag-list-wrap {
  margin-bottom: 30px;
}

.tag-list-wrap h4 {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

/* サイドバーのタグリスト（パーツ共通：縦並び） */
.tag-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.tag-list li label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.tag-list li input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* ジャンル・タイプ用：1列配置・ボタン風デザイン */
.tag-list-genre,
.tag-list-type {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.tag-list-genre li,
.tag-list-type li {
  margin-bottom: 0;
}

.tag-list-genre li label,
.tag-list-type li label {
  justify-content: space-between;
  min-height: 38px;
  padding: 5px 12px;
  background: #eee;
  color: #444;
  border-radius: 4px;
  font-size: 12px;
  text-align: left;
}

.tag-list-genre li label:hover,
.tag-list-type li label:hover {
  background: #e0e0e0;
}

.tag-list-genre li input[type="checkbox"],
.tag-list-type li input[type="checkbox"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.tag-list-genre li:has(input:checked) label,
.tag-list-type li:has(input:checked) label {
  background: var(--accent-pink);
  color: #fff;
}

/* カラーフィルター用 */
.tag-list-color {
  display: grid;
  grid-template-columns: repeat(auto-fill, 34px);
  gap: 8px;
}

.tag-list-color li {
  margin-bottom: 0;
}

.color-box {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-box:hover {
  transform: scale(1.1);
  border-color: #999;
}

.color-box input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

/* チェックマーク */
.color-box::after {
  content: "\f00c";
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}

.color-box:has(input:checked)::after {
  display: block;
}

/* 各色の設定 */
.color-black {
  background-color: #000000;
}

.color-white {
  background-color: #ffffff;
}

.color-white::after {
  color: #333;
  text-shadow: none;
}

.color-blue {
  background-color: #007aff;
}

.color-green {
  background-color: #34c759;
}

.color-red {
  background-color: #ff3b30;
}

.color-yellow {
  background-color: #ffcc00;
}

.color-pink {
  background-color: #dc4d79;
}

/* サイトアクセントカラー */
.color-orange {
  background-color: #ff9500;
}

.color-grey {
  background-color: #8e8e93;
}

.color-brown {
  background-color: #a2845e;
}

.color-purple {
  background-color: #a855f7;
}

/* 青と判別しやすい鮮やかな紫 */
.color-gold {
  background: linear-gradient(135deg, #d4af37 0%, #f9f295 45%, #e6b8af 70%, #d4af37 100%);
}

.color-silver {
  background: linear-gradient(135deg, #c0c0c0 0%, #ffffff 45%, #ebebeb 70%, #c0c0c0 100%);
}

/* もっと見る（バナーリスト下部） */
.bdl-more-btn-wrap {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.btn-bdl-more {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 200px;
  padding: 12px 30px;
  background: #fff;
  border: 2px solid var(--primary-mint);
  border-radius: 50px;
  font-weight: bold;
  font-size: 15px;
  color: var(--primary-mint);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-bdl-more:hover {
  background: var(--primary-mint);
  color: #fff;
  transform: translate(2px, 2px);
  opacity: 0.9;
}

/* Remodal (ポップアップ) スタイル */
.remodal-overlay {
  position: fixed;
  z-index: 9999;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  background: rgba(0, 0, 0, 0.7);
}

.remodal-wrapper {
  position: fixed;
  z-index: 10000;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  overflow: auto;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.remodal-wrapper:after {
  display: inline-block;
  height: 100%;
  margin-left: -0.05em;
  content: "";
  vertical-align: middle;
}

.remodal {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  width: 100%;
  max-width: 600px;
  padding: 35px;
  background: #fff;
  border-radius: 8px;
  text-align: left;
  box-sizing: border-box;
  transform: scale(0.95);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.remodal-is-opened .remodal {
  transform: scale(1);
  opacity: 1;
}

.remodal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 30px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s ease;
}

.remodal-close:hover {
  color: #333;
}

.tag-list li .count {
  margin-left: auto;
  font-size: 11px;
  color: #999;
  font-weight: normal;
}

.tag-list-genre li label .count,
.tag-list-type li label .count {
  color: inherit;
  opacity: 0.7;
}

/* チェック時のカウントカラー調整 */
.tag-list-genre li:has(input:checked) label .count,
.tag-list-type li:has(input:checked) label .count {
  color: #fff;
  opacity: 0.9;
}

/* 絞り込みアコーディオン（スマホ用） */
.bdl-sidebar-toggle {
  display: none !important;
}

/* ==========================================================================
   メディアクエリ (レスポンシブ対応)
   ========================================================================== */

/* 1199px 以下 (タブレット・小画面PC) */
@media (max-width: 1199px) {
  .bdl-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
}

/* 767px 以下 (スマホ等) */
@media (max-width: 767px) {
  .bdl-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .button-bdl a {
    padding: 8px 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  /* 絞り込みアコーディオン */
  .bdl-sidebar-toggle {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 1px solid #333;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
  }

  .bdl-sidebar-toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg);
    margin-left: 10px;
    transition: transform 0.3s;
  }

  .bdl-sidebar.is-active .bdl-sidebar-toggle::after {
    transform: rotate(-135deg);
    margin-top: 5px;
  }

  .bdl-sidebar-content {
    display: none;
  }

  .bdl-sidebar.is-active .bdl-sidebar-content {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
  }
}

/* 480px 以下 (スマートフォン) */
@media (max-width: 480px) {
  .bdl-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .button-bdl a {
    padding: 10px 15px;
    font-size: 12px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ページ最上部の間隔調整 */
.bp-section {
  padding-top: 0 !important;
}

.bp-section .container {
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  background: #fff;
  position: relative;
  z-index: 40;
}

/* 装飾パーツの重なり順調整 */
.global-decorations {
  z-index: 1 !important;
}

.decoration-shape {
  z-index: 0 !important;
}

/* iPhone（iOS）をご利用の方へ */
.ios-note {
  display: none;
  align-items: baseline;
  gap: 0;
  margin-top: 24px;
  padding: 10px 14px;
  border: 1px solid #777;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.75;
  color: #777;
}

.ios-note__label {
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: bold;
  color: #555;
  margin-right: 0.3em;
}

.ios-note__label i {
  margin-right: 3px;
}

.ios-note__body {
  flex: 1;
  min-width: 0;
}

@media (max-width: 767px) {
  .ios-note {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
}