/* =====================================================
   Cocoon Child Collectors File - UI カスタム
   Author: collectors-file
   デザイン方向：C（企業サイト風・控えめの角丸・整った余白）
===================================================== */

/* ------------------------------
   基本レイアウト・タイポグラフィ
------------------------------ */
body {
    font-family: "Noto Sans JP", sans-serif;
    line-height: 1.8;
    color: #333;
}

/* セクションの余白統一 */
.section,
.wrap {
    padding-top: 24px;
    padding-bottom: 24px;
}

/* ------------------------------
   カードUI（一覧・検索結果など）
------------------------------ */
.cocoon-card,
.entry-card,
.article {
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    padding: 18px;
    margin-bottom: 28px;
    overflow: hidden;
}
/* ------------------------------
   ボタン非活性
------------------------------ */
.cf-btn-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* カード内タイトル */
.cocoon-card .entry-title,
.entry-card .entry-title,
.article .entry-title {
    font-size: 18px;
    margin-bottom: 5px;
    font-weight: 600;
}

/* カード内の画像 */
.entry-card-thumb,
.cocoon-card .entry-thumb,
.article .entry-thumb img {
    border-radius: 6px;
    overflow: hidden;
}

/* ホバー時の軽い浮き上がり */
.cocoon-card:hover,
.entry-card:hover,
.article:hover {
    transform: translateY(-2px);
    transition: 0.2s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* ------------------------------
   ボタンデザイン
------------------------------ */
.btn,
.more-link,
a.button,
a.btn,
input[type="submit"],
input[type="button"],
button {
    background: #2563eb; /* 青系アクセント */
    color: #fff !important;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
    font-weight: 600;
}

.btn:hover,
.more-link:hover,
a.button:hover,
a.btn:hover,
input[type="submit"]:hover,
button:hover {
    background: #1e4ecf;
    transform: translateY(-1px);
}

/* ------------------------------
   フォームUI（ログイン/投稿/検索）
------------------------------ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #bbb;
    margin-bottom: 16px;
    box-sizing: border-box;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* エラーメッセージ */
.form-error,
.login-error,
.validation-error {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    padding: 10px 14px;
    border-radius: 6px;
    color: #b91c1c;
    margin-bottom: 16px;
}

/* ------------------------------
   ヘッダー、ナビゲーション
------------------------------ */
.header-container,
#header-container {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.header-container a,
#header-container a {
    font-weight: 600;
    font-size: 16px;
}

/* ------------------------------
   単一記事ページの最適化
------------------------------ */
.entry-content h2 {
    font-size: 24px;
    margin: 32px 0 16px;
    border-left: 5px solid #2563eb;
    padding-left: 12px;
}

.entry-content h3 {
    font-size: 20px;
    margin: 28px 0 12px;
    border-left: 4px solid #2563eb;
    padding-left: 10px;
}

.entry-content p {
    margin-bottom: 18px;
}

/* ------------------------------
   画像
------------------------------ */
.entry-content img {
    border-radius: 6px;
}

/* ------------------------------
   フッター
------------------------------ */
#footer {
    padding-top: 20px;
    padding-bottom: 20px;
    background: #fafafa;
    color: #000;
}

/* ------------------------------
   スマホ（レスポンシブ最適化）
------------------------------ */
@media screen and (max-width: 768px) {
    .cocoon-card,
    .entry-card,
    .article {
        padding: 14px;
        margin-bottom: 20px;
    }

    .entry-content h2 {
        font-size: 20px;
    }

    .entry-content h3 {
        font-size: 18px;
    }

    button,
    .btn,
    a.button {
        width: 100%;
        padding: 14px;
        font-size: 17px;
    }
}
/* ヒーローヘッダー（Cover）の調整 */
.wp-block-cover {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 48px;
}
.wp-block-cover__inner-container h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.wp-block-cover__inner-container p {
    font-size: 17px;
    line-height: 1.7;
}

/* コラム（使い方ガイド） */
.cf-guide-grid h3 {
    font-size: 20px;
    margin-bottom: 8px;
}
/* ===========================================
   カテゴリーラベル（アイキャッチ左上）
=========================================== */
.cf-thumb-wrap {
    position: relative;
}

.cf-cat-label {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    backdrop-filter: blur(3px);
}
/* ===========================================================
   アイキャッチ画像：横幅揃え（3:2比率）＋縦長は縮小表示
   Author: collectors-file
=========================================================== */

.cf-thumb-wrap {
    width: 100%;
    aspect-ratio: 3 / 2;   /* ← 3:2 比率（黄金比・推奨） */
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    background: #f8fafc;
}

/* 画像を縮小して収める */
.cf-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;  /* ← 縦長でも全体を縮小表示 */
    padding: 4px;         /* 画像と枠に余白 */
    border-radius: 10px;
}
/* ===========================================
   カード全体リンク
=========================================== */
.cf-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.cf-click-card {
    cursor: pointer;
    transition: all .25s ease;
}

.cf-click-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.12);
}

/* ===========================================================
   説明文（折り返し 50 文字）＋ 「続きを読む」（右寄せ）
   Author: collectors-file
=========================================================== */

.cf-excerpt {
    font-size: 13px;
    color: #555;
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.6;
    min-height: 3.2em; /* 2行ぶん高さ固定で揃う */
    position: relative;
    padding-right: 60px; /* 「続きを読む」スペース */
    overflow: hidden;
}

/* 「続きを読む」 */
.cf-more {
    position: absolute;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, transparent, #fff 40%);
    padding-left: 6px;
    font-weight: 600;
    color: #1565c0;
    cursor: pointer;
    white-space: nowrap;
}
.cf-search-form label {
    display:block;
    margin-bottom:4px;
}

.cf-search-select,
.cf-search-input {
    width:100%;
    padding:8px 10px;
    border:1px solid #ccc;
    border-radius:6px;
    margin-bottom:12px;
}

.cf-search-btn {
    display:block;
    width:100%;
    padding:10px;
    border-radius:6px;
    font-weight:bold;
    background:#1976d2;
    color:#fff;
    cursor:pointer;
    transition:0.2s;
}

.cf-search-btn:hover {
    background:#125a9c;
}
/*=================================== メニュー制御 */
/* ログイン状態で「未ログイン用メニュー」を隠す */
body.logged-in .cf-guest-only {
  display: none !important;
}

/* 未ログイン状態で「ログイン時用メニュー」を隠す */
body:not(.logged-in) .cf-logged-in-only {
  display: none !important;
}
/*=================================== 共通系 */
/* すべてのカスタムボタンに共通適用 */
.cf_btn_blue,
.cf_btn_red,
.cf_btn_grey {
    display: inline-block;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;  /* 太さを統一 */
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    line-height: 1.4;
    border: none;
    transition: opacity 0.2s ease;
}

/* aタグ・buttonタグ・input[type=submit] 全てに統一 */
.cf_btn_blue,
.cf_btn_red,
.cf_btn_grey,
button.cf_btn_blue,
button.cf_btn_red,
button.cf_btn_grey,
input[type="submit"].cf_btn_blue,
input[type="submit"].cf_btn_red,
input[type="submit"].cf_btn_grey {
    border: none;
    outline: none;
    box-sizing: border-box;
}
/* 青ボタン */
.cf_btn_blue {
    background-color: #007bff;
    color: #ffffff;
}

/* 赤ボタン */
.cf_btn_red {
    background-color: #dc3545;
    color: #ffffff;
}

/* グレーボタン */
.cf_btn_grey {
    background-color: #6c757d;
    color: #ffffff;
}

/*=================================== マイページ用 */
.cf_btn_red:hover,
.cf_btn_blue:hover,
.cf_btn_grey:hover {
    opacity:0.8;
}
.cf-post-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #ffffff;
    margin-bottom: 14px;
}

.cf-post-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.cf-post-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.cf-post-title:hover {
    text-decoration: underline;
}

.cf-post-actions {
    display: flex;
    gap: 8px;
}
/*=================================== 新規投稿・編集用 */
.cf_post_form_wrap {
    max-width: 720px;
    margin: 30px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 10px;
}

.cf_post_preview {
    width: 100%;
    max-width: 360px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

.cf-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 14px;
    border-radius: 6px;
}

/*======================================= レスポンシブ制御 */
/* 横スクロール防止（安全版） */
html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* ▼ スマホ時にCocoon標準の2カラムを強制解除する */
@media (max-width: 1023px) {

    /* メイン＋サイドバーの親コンテナ */
    #content-in {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 16px !important; /* 見やすい余白 */
        box-sizing: border-box !important;
    }

    /* メインコンテンツ */
    #main {
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* サイドバー */
    #sidebar {
        width: 100% !important;
        float: none !important;
        margin: 20px 0 0 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* wrap クラスを強制リセット */
    .wrap {
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ▼ ナビゲーションが横幅を超えないように */
#navi,
#navi-in,
.menu-header,
.menu-pc {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}
/* ▼ サイドバーが消える問題の修正（スマホ） */
@media (max-width: 1023px) {

    /* Cocoon 特有のメイン・サイドバー分割制御を解除 */
    #main,
    #sidebar {
        float: none !important;
        display: block !important;
        clear: both !important;
    }

    /* sidebar が高さゼロで潰れないようにする */
    #sidebar {
        width: 100% !important;
        margin-top: 24px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* 親側の不具合対策 */
    #content-in {
        overflow: visible !important;
    }

    /* wrapの幅強制リセット（再掲だが重要） */
    .wrap {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
}
/* ------------ 人気コレクション ------------- */
/* li と ul の点と余白を消す */
.cf-popular-collections,
.cf-popular-collections li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* リンクのレイアウト調整 */
.cf-popular-item a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important; /* 画像とタイトルの間を一定 */
    text-decoration: none;
}

/* 枠調整 */
.cf-popular-item {
    padding: 6px 0 !important;
}

/* ---------- 画像の固定枠（全ページ統一） --------- */
.cf-popular-collections .cf-thumb {
    width: 96px !important;      /* 好きな大きさに変更可 */
    height: 96px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
	padding-left: 2px !important;  /* 画像の左側に少しだけ余白 */
}

/* ---------- width/height調整 ----------- */
.cf-popular-collections .cf-thumb img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;

    /* Cocoon の image-responsive を強制上書き */
    height: auto !important;
    min-height: 100% !important;
    min-width: 100% !important;

    /* width/height 属性を無効化 */
    aspect-ratio: auto !important;
}
/* スマホの検索アイコンを非表示（Cocoon） */
#navi .fa-search,
#header .fa-search,
#header-container .fa-search,
.mobile-menu-buttons .search-menu-button {
    display: none !important;
}
/* Cocoon フッター背景色を強制的に変更 */
#footer,
#footer .footer-container,
.site-footer,
footer {
    background-color: #9e6822 !important;  /* ← 好きな色に変更 */
}
/* ========================== */
/* アフィリエイトブロック全体 */
/* ========================== */
.cf-affiliate-block {
    margin: 30px 0;
    padding: 16px;
    border-radius: 8px;
    background: #f7f7fb;
}

/* タイトル */
.cf-affiliate-title {
    font-size: 1.1rem;
    margin: 0 0 12px;
    border-left: 4px solid #2c7be5;
    padding-left: 8px;
}
/* アフィリエイト レクタングル 2枠の並び制御 */
.cf-affiliate-carousel {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px auto;
    flex-wrap: wrap;
}

.cf-affiliate-item {
    width: 300px;
    max-width: 100%;
    text-align: center;
}

/* スマホでは1列表示 */
@media (max-width: 768px) {
    .cf-affiliate-carousel {
        flex-direction: column;
        align-items: center;
    }
}
/* Cocoon のロゴサイズを確実に上書きする */
.site-logo-image,
.site-logo-image img,
.logo-header .site-logo-link img {
    max-width: 280px !important; /* ← 好きなサイズに変更 */
    height: auto !important;
}