/* =====================
   ギャラリー表示設定（タブ切替対応版）
===================== */

/* 初期状態では非表示（タブ切り替えで表示） */
.jeeko-cat-gallery {
  display: none;
  flex-wrap: wrap;
  justify-content: flex-start; /* ← 左揃えに変更 */
  gap: 10px;
  max-width: 100%;
  margin: 0 auto;
}

/* アクティブなタブのギャラリーだけ表示 */
.jeeko-cat-gallery.active {
  display: flex;
}

/* 各カード（基本デザイン） */
.jeeko-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  overflow: hidden;
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 0 1 calc(12.5% - 6px);   /* ← PC 8列 */
  max-width: calc(12.5% - 6px);
  box-sizing: border-box;
}

/* 各カード内の画像（正方形） */
.jeeko-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}

/* ホバー時 */
.jeeko-card:hover {
  transform: scale(1.05);
}

/* =============================
   タブ切り替えデザイン
============================= */
.jeeko-tabs {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 30px auto 40px;
  flex-wrap: wrap;
  border-bottom: 2px solid #ffd6e0;
  padding-bottom: 10px;
}

.jeeko-tab-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #888;
  cursor: pointer;
  padding: 5px 10px;
  position: relative;
  transition: color 0.3s ease;
}

.jeeko-tab-btn:hover {
  color: var(--pink);
}

.jeeko-tab-btn.active {
  color: var(--pink);
  font-weight: 600;
}

.jeeko-tab-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 3px;
  background-color: var(--pink);
  border-radius: 3px;
}

/* =============================
   サイドバー除去＋全幅化（Cocoon用）
============================= */
body.home #main,
body.home #container,
body.home .content,
body.home #content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box;
}

.sidebar,
#sidebar,
.l-sidebar,
.r-sidebar {
  display: none !important;
}

/* =============================
   ギャラリー全体レイアウト（Flex 左揃え）
============================= */

body.home {
  overflow-x: hidden;
  overflow-y: auto;
  /*background: #fff;*/
  margin: 0 !important;
  padding: 0 !important;
}

body.home #jeeko-gallery-section {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ギャラリー（左揃えで均等表示） */
body.home .jeeko-cat-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;/* ← ここが重要 */
  align-items: flex-start;
  width: 100%;
  max-width: fit-content; /* ← 中央に最大幅を設定して整える */
  margin: 0 auto;
  padding: 0;
  gap: 10px;
  box-sizing: border-box;
}

/* =============================
   レスポンシブ設定
============================= */

/* タブレット（6列） */
@media (max-width: 1024px) {
  .jeeko-card {
    flex: 0 1 calc(16.66% - 6px);
    max-width: calc(16.66% - 6px);
  }
}

/* スマホ（3列） */
@media (max-width: 768px) {
  .jeeko-card {
    flex: 0 1 calc(33.333% - 6px);
    max-width: calc(33.333% - 6px);
  }
}

/* 小さいスマホ（2列） */
@media (max-width: 480px) {
  .jeeko-card {
    flex: 0 1 calc(50% - 4px);
    max-width: calc(50% - 4px);
  }
}

/* 強制 2列（スマホ） */
@media (max-width: 480px) {
  body.home .jeeko-card {
    flex: 0 1 calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
  }

  /* ギャラリーの左右余白を少なくして2列が入りやすいように調整 */
  body.home .jeeko-cat-gallery {
    padding: 0 4px !important;
  }
}

/* =====================================
   スマホ最適化（幅 768px 以下）
===================================== */
@media (max-width: 768px) {

  /* ギャラリー全体の左右余白を少なくする */
  body.home .jeeko-cat-gallery {
    padding: 0 6px !important;       /* ←左右の余白を最小に */
    gap: 6px !important;             /* ←画像間の隙間を縮小 */
    max-width: 100% !important;
    justify-content: center !important;
  }

  /* 画像を大きく見やすく（2列維持） */
  body.home .jeeko-card {
    flex: 0 1 calc(33.333% - 6px) !important;  /* ←2列表示 */
    max-width: calc(33.333% - 6px) !important;
    border-radius: 10px;
  }

  /* 画像自体も丸みを維持して見栄えをよくする */
  body.home .jeeko-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
  }

  /* タブ上の余白を縮める */
  body.home .jeeko-tabs {
    margin: 20px 0 15px !important;
    gap: 18px;
  }

  /* タブ文字サイズを少し大きく見やすく */
  .jeeko-tab-btn {
    font-size: 1rem;
  }
}

html, body {
  background: linear-gradient(to bottom, #fff7fb, #ffe6ef);
  background-image: radial-gradient(
      rgba(255,182,193,0.15) 1px,
      transparent 1px
  );
  background-size: 26px 26px;
  background-attachment: fixed;
}

