@charset "UTF-8";

/*!
Theme Name: Cocoon Child
Description: Cocoon専用の子テーマ
Theme URI: https://wp-cocoon.com
Author: わいひら
Author URI: https://nelog.jp
Template:   cocoon-master
Version:    1.1.3
*/

/************************************
** カテゴリーページ：パターン1（ダークグレー×オレンジ）
************************************/
html body.category .entry-card-wrap.a-wrap,
html body.category a.entry-card-link,
html body.category .entry-card {
    background-color: #1e1e1e !important;
    border: 2px solid #b35c00 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

html body.category .entry-card-title,
html body.category h2.entry-card-title {
    color: #ffa726 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    text-align: left !important;
}
html body.category .entry-card-title a {
    color: #ffa726 !important;
}

/* スニペット（説明文）を非表示 */
html body.category .entry-card-snippet,
html body.category p.entry-card-snippet {
    display: none !important;
}

/************************************
** タグページ：パターン3（アースグリーン）
************************************/
html body.tag .entry-card-wrap.a-wrap,
html body.tag a.entry-card-link,
html body.tag .entry-card {
    background-color: #1a231d !important;
    border: 2px solid #2e7d32 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

html body.tag .entry-card-title,
html body.tag h2.entry-card-title {
    color: #81c784 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    text-align: left !important;
}
html body.tag .entry-card-title a {
    color: #81c784 !important;
}

/* スニペット（説明文）を非表示 */
html body.tag .entry-card-snippet,
html body.tag p.entry-card-snippet {
    display: none !important;
}


/************************************
** グリッドレイアウト（PC3列 / スマホ2列を強制固定）
************************************/
/* 一覧全体の並びを横並びに変更 */
html body.category .list,
html body.tag .list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
}

/* カードを「縦型（画像が上、文字が下）」に固定 */
html body.category .entry-card-wrap.a-wrap,
html body.tag .entry-card-wrap.a-wrap {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
}

/* カード内部を縦いっぱいに広げる */
html body.category .entry-card,
html body.tag .entry-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* 画像エリアを横100%にして上に配置 */
html body.category .entry-card-thumb,
html body.tag .entry-card-thumb {
    width: 100% !important;
    margin: 0 0 10px 0 !important;
    float: none !important;
}

/* 画像自体のサイズをカード幅に合わせる */
html body.category .entry-card-thumb img,
html body.tag .entry-card-thumb img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

/* テキストコンテンツの余白調整 */
html body.category .entry-card-content,
html body.tag .entry-card-content {
    margin: 0 !important;
    padding: 10px !important;
    width: 100% !important;
}

/* 【PC環境】横並び3列・文字サイズを拡大 */
@media screen and (min-width: 769px) {
    html body.category .list,
    html body.tag .list {
        gap: 24px 2% !important; /* 縦の隙間24px、横の隙間2% */
    }
    html body.category .entry-card-wrap.a-wrap,
    html body.tag .entry-card-wrap.a-wrap {
        width: 32% !important; /* 32% × 3列 ＋ 隙間2% × 2箇所 ＝ 100% */
    }
    /* ★PCでのタイトルの文字サイズを少し大きく（16px）設定 */
    html body.category .entry-card-title,
    html body.category h2.entry-card-title,
    html body.tag .entry-card-title,
    html body.tag h2.entry-card-title {
        font-size: 16px !important;
        line-height: 1.5 !important; /* 行間も少しだけ広げて読みやすく */
    }
}

/* 【スマホ・タブレット環境】横並び2列・文字は14pxのまま */
@media screen and (max-width: 768px) {
    html body.category .list,
    html body.tag .list {
        gap: 16px 4% !important; /* 縦の隙間16px、横の隙間4% */
    }
    html body.category .entry-card-wrap.a-wrap,
    html body.tag .entry-card-wrap.a-wrap {
        width: 48% !important; /* 48% × 2列 ＋ 隙間4% × 1箇所 ＝ 100% */
    }
    /* スマホは元の要望通り14pxのまま固定 */
    html body.category .entry-card-title,
    html body.category h2.entry-card-title,
    html body.tag .entry-card-title,
    html body.tag h2.entry-card-title {
        font-size: 14px !important;
    }
}




/************************************
** 記事下のカテゴリー・タグの大きさを変更
************************************/
.entry-categories-tags {
  font-size: 18px !important; 
}

.entry-categories a, 
.entry-tags a {
  padding: 0.4em 0.8em; 
  margin-bottom: 8px;
  background-color: #222222; 
  color: #ffffff !important; 
  border: 1px solid #ffffff; 
  border-radius: 4px; 
  display: inline-block; 
  transition: all 0.3s ease; 
}

.entry-categories a:hover, 
.entry-tags a:hover {
  background-color: #ffffff; 
  color: #000000 !important; 
  opacity: 1;
}

.entry-categories .fa, 
.entry-tags .fa {
  font-size: 1em; 
  color: #ffb700; 
  margin-right: 6px;
}

/* ========================================================
   商品紹介記事下画像CSS
   ======================================================== */
.flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}

.flex-item {
  width: calc((100% - 48px) / 4); 
}

.flex-item a {
  display: block;
}

.flex-item img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background-color: #191919;
  display: block;
}

@media screen and (max-width: 480px) {
  .flex-item {
    width: calc((100% - 16px) / 2);
  }
  .flex-item img {
    height: 140px;
  }
}

/* ========================================================
   Cocoon人気記事ショートコードのカスタムグリッドCSS
   ======================================================== */
.custom-wpp-grid.widget-entry-cards {
    display: grid !important;
    /* スマホで2列横並びにする設定 */
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important; /* スマホ用に隙間を少し狭く（12px）調整 */
    margin: 20px auto !important;
    padding: 0 !important;
    list-style: none !important;
    max-width: 800px !important;
}

.custom-wpp-grid.widget-entry-cards .a-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    margin: 0 !important;
    /* スマホ2列で余白が広すぎると窮屈になるため、16pxから10pxに変更 */
    padding: 10px !important;
    background: #ffffff !important;
    border: 1px solid #dcdcdc !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    text-decoration: none !important;
}

/* Cocoon標準のホバーエフェクトをリセット */
.custom-wpp-grid.widget-entry-cards .a-wrap:hover {
    background: #ffffff !important;
    opacity: 0.9;
}

.custom-wpp-grid.widget-entry-cards .card-thumb {
    display: block !important;
    float: none !important;
    margin: 0 0 10px 0 !important; /* 下の余白を少し調整 */
    width: 100% !important;
    max-width: 800px !important;
    aspect-ratio: 4 / 3 !important;
    overflow: hidden !important;
    border-radius: 6px !important;
}

.custom-wpp-grid.widget-entry-cards .card-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.custom-wpp-grid.widget-entry-cards .card-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.custom-wpp-grid.widget-entry-cards .card-title {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.4 !important;
    font-weight: bold !important;
    /* スマホ2列でも文字が溢れないよう、16pxから14pxへ少し小さく調整 */
    font-size: 14px !important;
    color: #222222 !important;
}

/* 💻 PC・タブレット（画面幅768px以上）の設定 */
@media (min-width: 768px) {
    .custom-wpp-grid.widget-entry-cards {
        /* PCでは予定通り4列にする */
        grid-template-columns: repeat(4, 1fr) !important;
        max-width: 100% !important;
        gap: 16px !important;
    }
    .custom-wpp-grid.widget-entry-cards .a-wrap {
        padding: 16px !important; /* PCでは少し広めの余白に戻す */
    }
    .custom-wpp-grid.widget-entry-cards .card-title {
        font-size: 16px !important; /* PCでは文字サイズを16pxに戻す */
    }
}
