@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
*/

/************************************
** 子テーマ用のスタイルを書く
************************************/
/*必要ならばここにコードを書く*/

/************************************
** レスポンシブデザイン用のメディアクエリ
************************************/
/*1023px以下*/
@media screen and (max-width: 1023px){
  /*必要ならばここにコードを書く*/
}

/*834px以下*/
@media screen and (max-width: 834px){
  /*必要ならばここにコードを書く*/
}

/*480px以下*/
@media screen and (max-width: 480px){
  /*必要ならばここにコードを書く*/
}

/*================================================
  トップページ
  ================================================*/
/*-------------------------------------
  カテゴリー選択部分
  -----------------------------------*/
/* 全体のコンテナ */
.sora-container {
    padding: 60px 10px;
    padding-bottom: 20px ;
    background: #ffffff;
}

/* グリッドレイアウト */
.sora-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 横3列 */
    grid-template-rows: repeat(2, 280px); /* 縦2列、高さ280px */
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

/* カードの共通デザイン */
.sora-card {
    color: #ffffff !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 45px; /* 角丸を深めに設定 */
    transition: all 0.3s ease;
    text-align: center;
    padding: 25px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* ホバー時の演出 */
.sora-card:hover {
    filter: brightness(1.15);
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* 個別色指定（1枚目〜6枚目） */
.sora-card:nth-child(1) { background-color: #e53935; } /* 赤 */
.sora-card:nth-child(2) { background-color: #fb8c00; } /* 橙 */
.sora-card:nth-child(3) { background-color: #1e88e5; } /* 青 */
.sora-card:nth-child(4) { background-color: #2d5a7a; } /* 紺 */
.sora-card:nth-child(5) { background-color: #43a047; } /* 緑 */
.sora-card:nth-child(6) { background-color: #fdd835; color: #333 !important; } /* 黄 */

/* スマホ対応の調整 */
@media (max-width: 768px) {
    .sora-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 横3列 */
    grid-template-rows: repeat(2, 120px); /* 縦2列、高さ120px */
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    }
    .sora-card {
        height: 120px;
        border-radius: 25px;
        font-size: 18px;
    }
}
/*-------------------------------------
  広告画像部分
  -----------------------------------*/
/* ブロック2のスタイル調整 */
.sora-image-block {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}
.sora-image-wrapper {
    display: flex;
    gap: 20px;
}
.sora-img-item {
    flex: 1;
    width: 100%;
    /* ★ 比率の指定（横 / 縦） */
    aspect-ratio: 1.91 / 1; 
    overflow: hidden;
    border-radius: 12px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: block; /* リンク全体をブロック要素にする */
    text-decoration: none;
}
.sora-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.9; /* 少し薄くなる */
}

/* スマホ表示（縦並び） */
@media (max-width: 767px) {
    .sora-image-wrapper {
        flex-direction: column;
    }
}

/* アンカーリンクのジャンプ位置調整 */
#section1, #section2, #section3 {
    scroll-margin-top: 100px;
}

/*-------------------------------------
  カテゴリーの具体例部分
  -----------------------------------*/
/* 各カテゴリーの色付きの見出しを大きくする */
.guide-item h3 {
    display: inline-block;
    color: #ffffff;
    padding: 6px 20px; /* 余白を少し広げてどっしりさせる */
    margin-bottom: 15px;
    font-size: 1.3rem;  /* 1.1から1.3へ拡大 */
    font-weight: bold;
    border-radius: 5px; /* 少し角を丸くすると画像に近くなります */
}

/*（）内の文字を小さくする設定 */
.guide-item p .small-text {
    font-size: 0.8em; /* 親の文字に対して80%の大きさ */
    color: #555;      /* 少しだけ色を薄くして視覚的に差をつける */
}

/* 共通設定 */
.category-guide {
    padding: 60px 20px;
    padding-top: 0 ;
    background: #ffffff;
}
.guide-inner {
    max-width: 1000px;
    margin: 0 auto;
}
.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 30px;
}
.item-red h3 { background-color: #e53935; }
.item-orange h3 { background-color: #fb8c00; }
.item-blue h3 { background-color: #1e88e5; }
.item-navy h3 { background-color: #2d5a7a; }
.item-green h3 { background-color: #43a047; }
.item-yellow h3 { background-color: #fdd835; color: #333; }
.guide-item p { font-size: 0.95rem; line-height: 1.6; }
.guide-note { font-size: 0.8rem !important; color: #777; margin-top: 5px; }

@media (max-width: 768px) {
    .guide-grid { grid-template-columns: 1fr; }
}

/* =========================================
   全ページ共通カスタムヘッダー
   ========================================= */
/*共通設定*/
.custom-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
    position: sticky; /* 画面上部に固定 */
    top: 0;
    z-index: 999; /* 他の要素より手前に */
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between; /* 両端揃え */
    padding: 0 20px;
    height: 70px; /* 少し高さを確保 */
    position: relative;
    background: #fff;
    z-index: 1000; /* ドロワーより手前に */
}

/* 左側：ロゴエリア */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.logo-img {
    height: 40px; /* ロゴの高さ制限 */
    width: auto;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 900;
    color: #000000;
    letter-spacing: 0.05em;
    line-height: 1;
}

/* 中央（PC）：ナビゲーション */
.header-center-pc {
    display: flex;
    gap: 30px;
}
.header-center-pc a {
    text-decoration: none !important;
    color: #333333 !important;
    font-weight: bold;
    font-size: 1rem;
    transition: color 0.3s;
}
.header-center-pc a:hover {
    color: #2d5a7a !important;
}

/* 右側（PC）/ 中央（スマホ）：ボタンエリア */
.header-auth-area {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ボタンデザイン */
.nav-btn {
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none !important;
    white-space: nowrap; /* 折り返し禁止 */
    transition: all 0.3s ease;
}
.nav-btn:not(.signup):not(.logout) {
    border: 2px solid #2d5a7a;
    color: #2d5a7a !important;
    background: #fff;
}
.nav-btn:not(.signup):not(.logout):hover {
    background: #f0f8ff;
}
.nav-btn.signup {
    background: #2d5a7a;
    color: #ffffff !important;
    border: 2px solid #2d5a7a;
}
.nav-btn.signup:hover {
    background: #1e4560;
    border-color: #1e4560;
}

/* --- 4. ハンバーガーボタン（PCでは非表示） --- */
.hamburger-btn {
    display: none; /* デフォルト非表示 */
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    padding: 0;
    z-index: 1001;
}
.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    position: absolute;
    left: 0;
    transition: all 0.3s;
}
.hamburger-btn span:nth-child(1) { top: 0; }
.hamburger-btn span:nth-child(2) { top: 11px; }
.hamburger-btn span:nth-child(3) { bottom: 0; }

/* ハンバーガーが開いた時の変形 */
.hamburger-btn.is-active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}
.hamburger-btn.is-active span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.is-active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* --- 5. スマホ用メニュー（ドロワー） --- */
.mobile-drawer {
    position: absolute;
    top: 70px; /* ヘッダーの高さ分下げる */
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #eee;
    transform: translateY(-150%); /* 上に隠しておく */
    transition: transform 0.3s ease;
    z-index: 900;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.mobile-drawer.is-active {
    transform: translateY(0); /* 出現 */
}
.mobile-drawer a {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    text-align: center;
}

/*レスポンシブ対応（スマホレイアウト） */
@media (max-width: 768px) {
    /* 中央のPC用ナビを消す */
    .header-center-pc {
        display: none;
    }

    /* ハンバーガーを表示 */
    .hamburger-btn {
        display: block;
        margin-left: 10px;
    }

    /* ロゴの調整 */
    .logo-img { height: 30px; }
    .logo-text { font-size: 1.2rem; }
    
    /* ボタンのサイズ調整（スマホで横並びにするため小さく） */
    .nav-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    .header-auth-area {
        gap: 6px;
        margin-left: auto; /* 左のロゴから離し、右寄せの挙動を作る */
        margin-right: 5px; /* ハンバーガーとの隙間 */
    }
    .header-inner {
        padding: 0 10px; /* 左右の余白を狭く */
        height: 60px;
    }
    
    .mobile-drawer {
        top: 60px; /* ヘッダー高さ変更に追従 */
    }
}

/*==========================================
 その他の設定
 ==========================================*/
/* 既存Cocoon要素の非表示設定 */
.page .header, 
.page .post-date, 
.page .post-update, 
.home.page .entry-title, 
.home.page .sns-share, 
.home.page .sns-follow, 
.archive.category .header,
.home .toc,
.single .header, 
.single .entry-header,
.single .eye-catch,
.single .date-tags,
.single .author-info, /* Cocoon標準のプロフィールボックス */
.single .sns-share,
.author .header-container-in,
.author .site-name-text,
.author .tagline,
.author .header {
    display: none !important;
}

.home.page .main { 
    width: 100% !important; padding: 0 !important; 
}

/* サイト全体の背景と記事エリアの背景を白に固定 */
.body, #content, .main, .article, .entry-content {
    background-color: #fff !important;
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
}

/* UMの必須項目アスタリスクを赤くする */
.um .um-field-label span.um-req {
    color: #e53935 !important; /* 明るい赤色 */
    margin-left: 4px;
    font-size: 1.2em;
    vertical-align: middle;
}

/* Content Block（規約リンク）の下側の余白を消す */
.um-field-content_block {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* チェックボックス（同意）の上側の余白を消す */
.um-field-confirm_terms_ver1 {
    padding-top: 5px !important; /* 少しだけ隙間を開ける */
    margin-top: 0 !important;
}

/* 「同意する」のラベルとチェックボックスの縦位置を微調整 */
.um-field-confirm_terms_ver1 .um-field-area {
    margin-top: 0 !important;
}

/* =========================================
   投稿フォーム関連
   ========================================= */
/*--------------------------------------
  投稿フォーム本体
  --------------------------------------*/
/* フォントを MS Pゴシックに固定 */
.note-editor-wrapper, 
.note-editor-wrapper input, 
.note-editor-wrapper select,
.note-editor-wrapper button,
.note-editor-wrapper .mce-content-body {
    font-family: "MS PGothic", "ＭＳ Ｐゴシック", "MS CP932", sans-serif !important;
}

/* エディター全体コンテナ */
.note-editor-wrapper {
    position: relative;
    max-width: 1100px;
    margin: 40px auto;
    padding-top: 80px; /* 右上ボタンとコンテンツの間の縦幅を拡大 */
}

/* 15. ボタンエリア（右上に配置） */
.editor-local-actions {
    position: absolute;
    top: 0;
    right: 0;
    /* z-index: 100; */
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 変更履歴、下書き保存ボタン */
.btn-text {
    background: none;
    border: none;
    color: #666;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}
.btn-text:hover { color: #333; }

/* 公開ボタン（緑） */
.btn-primary {
    background: #2cb696;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-primary:hover { background: #23947a; }

/* 削除ボタン */
.btn-delete {
    background: none;
    border: none;
    color: #e53935;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
}
.btn-delete:hover { opacity: 0.7; text-decoration: underline; }

/* レイアウト（サイドバー + メイン） */
.editor-container {
    display: flex;
    gap: 30px;
    margin-top: 10px;
}

.editor-sidebar-left {
    width: 180px;
    padding-top: 10px;
}

/* スマホ・タブレット（1024px以下）で非表示にする */
@media (max-width: 1024px) {
    .editor-sidebar-left {
        display: none;
    }
}

.toc-sticky {
    position: sticky;
    top: 100px;
    border-left: 1px solid #eee;
    padding-left: 15px;
}

.toc-title { font-size: 0.8rem; color: #999; margin-bottom: 10px; }
.toc-list { font-size: 0.9rem; color: #666; line-height: 1.8; }
.toc-item:hover { color: #2cb696; cursor: pointer; text-decoration: underline; }

/* 執筆メインエリア */
.editor-main {
    flex: 1;
    max-width: 720px;
}

/* カテゴリー選択：エラーの出ないシンプル枠線デザイン */
.note-category-selector {
    margin-bottom: 30px; 
}

.note-category-selector select {
    border: 1px solid #2cb696;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #2cb696;
    background: #ffffff;
    padding: 8px 15px;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: auto;
    transition: all 0.2s;
}

.note-category-selector select:hover {
    background-color: #f0fffb;
}

.note-title-input {
    width: 100%;
    border: none !important;
    font-size: 36px !important;
    font-weight: bold;
    margin-bottom: 20px;
    outline: none;
    padding: 0;
}

/* ツールバーアイコン */
.mce-i-custom_media_btn, .mce-i-image {
    color: #2cb696 !important;
}

/* ファイルリンク */
.file-link {
    display: block;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    margin: 10px 0;
}

/* エディタ右上の「ビジュアル/テキスト」タブを完全に消し、余白を整える */
.wp-editor-tabs {
    display: none !important;
}

/* ツールバーの枠を少しきれいに整える */
.wp-editor-container {
    border: 1px solid #eee !important;
    border-radius: 4px;
}

/* 保存完了通知のスタイル */
.save-notice {
    background: #e6f7f3;
    color: #2cb696;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #b2e5d9;
    animation: fadeIn 0.5s ease-out;
}

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

/* プレビューボタンのホバー演出など */
#btn-preview:hover {
    color: #2cb696;
    text-decoration: underline;
}

/* プレビューウィンドウ内で画像などがはみ出さないための調整 */
.entry-content img {
    max-width: 100%;
    height: auto;
}

/* 独自のバリデーションエラーメッセージ */
.custom-error-msg { 
    color: #ffb340; 
    font-size: 14px; 
    font-weight: bold; 
    margin-top: 5px; 
}

@keyframes fadeInError {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* エラー時の入力欄の枠線 */
.note-title-input[style*="border-color"], 
select[style*="border-color"] {
    border-width: 2px !important;
    background-color: #fff9f0 !important;
}

/* 履歴ビュー全体の重なり順を一番上にする（カスタムヘッダー対策） */
#history-fullscreen-view {
    z-index: 99999 !important; 
}

/* プレビューエリア内のスクロールをスムーズに */
#history-preview-area {
    scroll-behavior: smooth;
}

/* 戻るボタンのホバー効果 */
#btn-history-back:hover {
    color: #2cb696 !important;
}

/* 履歴リスト内の日付ラベル */
.history-date-group {
    padding: 10px 20px;
    background: #f0f0f0;
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

/* 履歴ビュー全体の重なり順を一番上にする（カスタムヘッダー対策） */
#history-fullscreen-view {
    z-index: 99999 !important; 
}

/* プレビューエリア内のスクロールをスムーズに */
#history-preview-area {
    scroll-behavior: smooth;
}

/* 戻るボタンのホバー効果 */
#btn-history-back:hover {
    color: #2cb696 !important;
}

/* 履歴リスト内の日付ラベル */
.history-date-group {
    padding: 10px 20px;
    background: #f0f0f0;
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

/* サイドバー内のアイテムをより見やすく */
.history-sidebar-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.history-sidebar-item.active {
    background: #fff !important;
    border-left: 4px solid #2cb696;
}

/* 復元ボタンのホバー */
#btn-restore-final:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.history-modal { max-width: 500px; text-align: left; padding: 20px; }
.history-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 15px; }
.history-item { padding: 15px; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: 0.2s; }
.history-item:hover { background: #f9f9f9; }
.history-item.active { background: #e8f5f2; border-left: 4px solid #2cb696; }
.history-date { font-size: 12px; color: #888; margin-bottom: 5px; }
.history-meta { display: flex; gap: 15px; font-weight: bold; }
.history-close { margin-top: 15px; background: none; border: none; color: #888; cursor: pointer; display: block; width: 100%; }
.history-sidebar-item { padding: 20px; border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s; position: relative; }
.history-sidebar-item:hover { background: #f0f0f0; }
.history-sidebar-item.active { background: #e8f5f2; }
.history-sidebar-item.active::after { content: '✔'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: #2cb696; font-weight: bold; }
.history-sidebar-meta { display: flex; gap: 10px; font-weight: bold; margin-bottom: 8px; }
.history-sidebar-title { font-size: 13px; color: #666; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }


 /* アイキャッチ用追加スタイル */
.note-eyecatch-wrapper { margin-bottom: 20px; }
.eyecatch-preview-box { width: 100%; height: 200px; background: #f9f9f9; border: 2px dashed #ddd; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; background-size: cover; background-position: center; transition: all 0.3s ease; }
.btn-eyecatch-upload { background: rgba(255,255,255,0.9); border: 1px solid #ccc; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: bold; color: #666; display: flex; align-items: center; gap: 5px; }
.placeholder-text { color: #999; margin-bottom: 10px; font-size: 14px; }

/* 既存モーダル用スタイル */
.custom-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.custom-modal-content { background: #fff; padding: 30px; border-radius: 8px; max-width: 400px; width: 90%; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.modal-buttons { margin-top: 25px; display: flex; justify-content: center; gap: 10px; }
.btn-secondary { background: #eee; border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; }
.btn-danger { background: #eb5757; color: #fff; border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; font-weight: bold; }

/* カテゴリーヒント */
.category-hint { 
    margin: -15px 0 15px 5px; 
    font-size: 12px; color: #666; 
}
.category-hint a { 
    color: #2cb696; 
    text-decoration: none; 
}
.category-hint .dashicons { 
    font-size: 14px; 
    width: 14px; 
    height: 14px; 
    vertical-align: text-bottom; 
}

/* 1. 外側のオーバーレイ：スクロール可能な土台 */
#cropper-modal-overlay.custom-modal-overlay {
    display: none; 
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 999999; 
    overflow-y: auto;
}

/* 2. クロップ容器：以前のプロフィール用をベースに、数字で位置を指定 */
.eyecatch-cropper-container-wrapper { 
    position: relative;
    margin: 100px auto 50px; /* ★ここの 100px で上からの距離を調整 */
    width: 95%; 
    max-width: 800px; 
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-sizing: border-box;
    text-align: center;
}

/* 3. ★ズレを防止する専用コンテナ（ここが重要） */
.eyecatch-cropper-canvas-area {
    width: 100%;
    /* 高さが可変だとJSが計算をミスるため、少し余裕を持たせた最小高さを設定 */
    min-height: 400px; 
    max-height: 70vh;
    background: #f0f0f0; /* 読み込み前の土台を明るく */
    position: relative;
    overflow: hidden;
}

/* Cropper.jsが生成する要素がズレないように強制 */
.cropper-container {
    top: 0 !important;
    left: 0 !important;
}

#cropper-image { 
    display: block; 
    max-width: 100%; 
}

/* 切り抜きガイド：今回は四角形（1280x670）なので円形設定を排除 */
.cropper-view-box, .cropper-face { border-radius: 0; }

.eyecatch-crop-btn-area { 
    margin-top: 15px; 
    display: flex; 
    gap: 10px; 
    justify-content: flex-end; 
}

/* ボタンの共通スタイル */
.eyecatch-small-btn { 
    padding: 8px 20px; 
    font-size: 14px; 
    font-weight: bold;
    border-radius: 4px; 
    cursor: pointer; 
    border: none; 
}
.eyecatch-save-btn { background: #2cb696; color: #fff; }
.eyecatch-save-btn:hover { background: #25a083; }
.eyecatch-cancel-link { background: #eee; color: #666; }
.eyecatch-cancel-link:hover { background: #e0e0e0; }



/* ==========================================================
   マイページ
   =========================================================*/
/*-----------------------------------------
  共通設定
  ---------------------------------------*/
/* マイページ全体コンテナ */
.mypage-wrapper {
    max-width: 900px;
    margin: 40px auto;
    font-family: "MS PGothic", sans-serif;
}

/* 上部タブバー*/
.mypage-tabs {
    display: flex;
    border: 2px solid #000;
    margin-bottom: 30px;
}

.tab-item {
    flex: 1;
    padding: 15px;
    text-align: center;
    border-right: 2px solid #000;
    cursor: pointer;
    font-weight: bold;
    background: #fff;
    transition: background 0.2s;
}
.tab-item:last-child { border-right: none; }
.tab-item.active { background: #d9e9f2; } /* ラフスケッチの水色 */

/* コンテンツ表示切り替え */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* 3タブ共通カテゴリーマーク */
.post-cat-soft {
    display: inline-block;
    font-size: 11px;
    padding: 3px 12px;
    color: #fff;
    border-radius: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}

/* ページネーション */
.custom-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}
.custom-pagination .page-numbers {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 31px; /* 枠線分を考慮 */
    text-align: center;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    text-decoration: none;
    font-weight: bold;
}
.custom-pagination .current {
    background: #d9e9f2; /* 選択中の水色 */
}

/* カテゴリー色対応（トップページの設定と連動） */
.cat-4 { background-color: #e53935; } /* 赤 */
.cat-5 { background-color: #fb8c00; } /* 橙 */
.cat-6 { background-color: #1e88e5; } /* 青 */
.cat-7 { background-color: #2d5a7a; } /* 紺 */
.cat-8 { background-color: #43a047; } /* 緑 */
.cat-9 { background-color: #fdd835; color: #333 !important; } /* 黄 */

/* ----------------------------------------------------
マイページの「プロフィール」タブ
 -----------------------------------------------------*/
.profile-main-row {
    display: flex;
    align-items: center;
    gap: 30px;
    position: relative;
    margin-bottom: 20px;
    width: 100%; /* 親の幅をいっぱいに使う */
}

/* 画像のコンテナまたは画像自体に「縮まない」設定を追加 */
.profile-avatar {
    flex-shrink: 0; /* これが重要：画像が押しつぶされるのを防ぎます */
}

.profile-avatar img {
    border-radius: 50%;
    border: 2px solid #000;
    width: 100px;
    height: 100px;
    object-fit: cover;
    display: block; /* 隙間防止 */
}

.profile-name {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    flex-grow: 1;
    min-width: 0; /* フレックスアイテムの最小幅バグを防ぐためのおまじない */
    word-break: break-all; /* 「あああ...」のような長い連続文字でも端で改行させる */
    overflow-wrap: break-word; /* 適切な位置で改行させる */
    background-color: #ffffff !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    line-height: 1.2;
}

/* 歯車メニュー */
.profile-settings { 
    position: relative; 
}
.gear-btn {
    background: none;
    border: none;
    font-size: 48px !important; /* 元の24pxから48px（2倍）へ */
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;  /* クリック領域も確保 */
    height: 60px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* クリック時の回転演出 */
.gear-btn:hover {
    transform: rotate(45deg);
}

.gear-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    width: 180px;
    background: #fff;
    border: 2px solid #000;
    z-index: 100;
}
.gear-menu.active { display: block; }
.gear-menu a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
}
.gear-menu a:hover { background: #f5f5f5; }


/* プロフィール詳細全体のコンテナ */
.profile-details-container {
    margin-top: 10px;
    padding: 0;
    text-align: left;
    display: block; /* 念のため追加：確実に縦並びにする */
    clear: both;    /* 念のため追加：回り込みを解除する */
}

/* 各項目の行設定：中身を縦に並べることを保証 */
.profile-item-row {
    margin-bottom: 25px;
    display: flex;          /* 一旦 flex に設定 */
    flex-direction: column; /* 要素を縦に並べる（これで必ず見出しの下に本文が来る） */
    align-items: flex-start;/* 中身をすべて強制的に左端に寄せる */
}

/* ラベル（見出し部分） */
.profile-item-label {
    font-size: 1.1rem;
    font-weight: bold;
    color: #000;
    display: inline-block;
    padding-bottom: 2px;
    border-bottom: 2px solid #000;
    margin-bottom: 8px; 
    line-height: 1.2;
    text-align: left;
}

/* 内容（本文部分） */
.profile-item-content {
    width: 100%;       /* 横幅いっぱいに広げる */
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    text-align: left;  /* 文字を左詰めにする */
    padding-left: 0 !important;
}

/* URLリンク */
.profile-url-box a {
    color: #0066c0; /* 一般的なリンク色 */
    text-decoration: none;
}

.profile-url-box a:hover {
    text-decoration: underline;
}

/* スマホ表示の調整 */
@media (max-width: 768px) {
    .profile-item-row {
        margin-bottom: 25px;
    }
    .profile-item-label {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
}

/* ---------------------------------------------
マイページの「公開済み投稿」タブ
 ----------------------------------------------*/
/* 
※上部のプロフィール欄は「プロフィール」タブと共通
 */

/* 公開済み投稿用の横スクロールコンテナ */
.published-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* 公開済み投稿用のテーブル設定 */
.published-force-table {
    width: 100% !important;
    min-width: 750px; /* モバイルでの横スクロール幅 */
    border-collapse: separate !important; 
    border-spacing: 0;
    background: #fff;
    table-layout: fixed !important;
}

.published-force-table th, .published-force-table td {
    padding: 15px 10px !important;
    border-bottom: 1px solid #eee !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.published-force-table thead th {
    background: #fcfcfc;
    border-bottom: 2px solid #333 !important;
}

/* 行のホバーアニメーション */
.published-force-table tbody tr {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.published-force-table tbody tr:hover {
    background-color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    z-index: 10;
}

/* -----------------------------
マイページの「投稿を管理」タブ 
-------------------------------*/
.manage-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.manage-force-table {
    width: 100% !important;
    min-width: 800px;
    border-collapse: separate !important; 
    border-spacing: 0;
    background: #fff;
    table-layout: fixed !important;
}

.manage-force-table th, .manage-force-table td {
    padding: 15px 10px !important;
    border-bottom: 1px solid #eee !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.manage-force-table thead th {
    background: #fcfcfc;
    border-bottom: 2px solid #333 !important;
}

/* ホバー時の浮き上がりは「公開済み（row-status-publish）」のみ適用 */
.manage-force-table tbody tr.row-status-publish {
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.manage-force-table tbody tr.row-status-publish:hover {
    background-color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    z-index: 10;
}

/* タイトルセルのリセット：縦書き化を防ぐ */
.manage-title-cell {
    text-align: center !important;
    padding: 15px !important;
    writing-mode: horizontal-tb !important; /* 強制的に横書き */
}

/* 既存の干渉しそうなスタイルを無効化 */
.manage-left-content {
    display: inline-block !important;
    width: auto !important;
    text-align: center !important;
}

/* 操作ボタンの配置 */
.manage-actions-column {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.btn-manage-action {
    display: inline-block;
    padding: 6px 12px;
    width: 100px;
    font-size: 15px;
    text-decoration: none !important;
    border-radius: 20px;
    white-space: nowrap;
    color: #333;
}

.btn-edit-custom { background: #a8e4a0; }
.btn-analyze-custom { background: #b3e5fc; }
.btn-delete-draft { background: #FFE4E1; }

/* ドロップダウン */
.status-dropdown-wrapper { position: relative; display: inline-block; cursor: pointer; }
.status-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    min-width: 110px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100;
    border: 1px solid #eee;
    border-radius: 4px;
}
.status-dropdown-content a {
    color: #333;
    padding: 10px 12px;
    text-decoration: none;
    display: block;
    font-size: 13px;
}
.col-actions {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 0 10px;
}


/* 編集警告用モーダル */
.sorashirushi-edit-alert-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); /* 少し暗めにして没入感を出す */
    z-index: 9999; /* 確実に最前面に表示 */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px); /* 背景をぼかすとお洒落になります */
}

/* モーダルがアクティブな時 */
.sorashirushi-edit-alert-overlay.is-active {
    display: flex;
}

.sorashirushi-edit-alert-box {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.sorashirushi-edit-alert-text {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 30px;
    font-weight: bold;
}

.sorashirushi-edit-alert-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ボタン共通設定 */
.sorashirushi-edit-btn {
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, opacity 0.2s;
    min-width: 120px;
}

.sorashirushi-edit-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* 「はい」ボタン：警告なので少し目立たせる */
.sorashirushi-edit-btn-confirm {
    background-color: #000; /* 黒ベースで引き締める */
    color: #fff;
}

/* 「キャンセル」ボタン */
.sorashirushi-edit-btn-cancel {
    background-color: #f0f0f0;
    color: #666;
}

/*分析画面*/
.analysis-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #f8f9fa;
    z-index: 10000;
    overflow-y: auto; /* 条件35: スクロール可能 */
}
.analysis-overlay.is-active { display: block; }

.analysis-header {
    padding: 20px 40px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    position: sticky; top: 0; z-index: 10;
}
.back-btn {
    background: none; border: none; font-size: 18px; cursor: pointer; color: #333;
}

.analysis-body {
    max-width: 1200px; margin: 40px auto; padding: 0 20px;
}
.analysis-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}

.analysis-card {
    background: #fff; border-radius: 12px; padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.chart-container { position: relative; height: 300px; width: 100%; }
.analysis-footer-space { height: 200px; } /* 条件35用余白 */

/* --- モバイル対応：スマホではグラフを縦に並べる --- */
@media (max-width: 768px) {
    .analysis-grid {
        grid-template-columns: 1fr; /* 2段組から1段組へ */
        gap: 20px;
    }
    .analysis-body {
        margin: 20px auto; /* 上下の余白を少し詰める */
    }
}

/* エラーメッセージのスタイル */
.chart-container {
    position: relative; /* メッセージの配置基準 */
}

.chart-error {
    color: #888;
    font-size: 14px;
    background: rgba(240, 240, 240, 0.5);
    padding: 20px;
    border-radius: 8px;
    border: 1px dashed #ccc;
    pointer-events: none; /* 下の要素の邪魔をしない */
}

/* グラフ表示時のフェードインを滑らかにする（任意） */
#viewsChart, #likesChart {
    transition: opacity 0.3s ease;
}

/*----------------------------------------
マイページの「保存した投稿」タブ
----------------------------------------*/
/* 横スクロール用のコンテナ */
.bm-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* iOSでのスクロールを滑らかに */
    margin-bottom: 20px;
}

.bm-force-table {
    width: 100% !important;
    min-width: 800px; /* モバイルでもこの幅を維持して横スクロールさせる */
    border-collapse: separate !important; /* 浮き上がり効果のためにseparateに変更 */
    border-spacing: 0;
    background: #fff;
    table-layout: fixed !important;
}

.bm-force-table th, .bm-force-table td {
    padding: 15px 10px !important;
    border-bottom: 1px solid #eee !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.bm-force-table thead th {
    background: #fcfcfc;
    border-bottom: 2px solid #333 !important;
}

/* 行のホバーアニメーション */
.bm-force-table tbody tr {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.bm-force-table tbody tr:hover {
    background-color: #fff !important;
    transform: translateY(-2px); /* 上に浮かせる */
    box-shadow: 0 8px 20px rgba(0,0,0,0.1); /* 影をつける */
    z-index: 10; /* 隣の行の影に隠れないようにする */
}



/* ================================================
 　記事本文自作レイアウト
 　================================================ */
/*----------------------------------------------
   全体の配置
   --------------------------------------------*/
.article-flex-container {
    display: flex;
    justify-content: center; /* 中央寄せ */
    align-items: flex-start;
    gap: 20px;               /* 記事と広告の間の隙間 */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-content .site-main {
    flex: 1;                       /* 残りの幅をすべて記事エリアに使う */
    min-width: 0;  
    max-width: 800px;
}

.sidebar-custom {
    flex: 0 0 300px;         
    position: static;
    top: 20px;
}

/* モバイル対応：画面が狭いときは縦並び */
@media (max-width: 950px) {
    .article-flex-container {
        flex-direction: column;
        align-items: center;
        padding: 0;
    }
    .site-main {
        width: 100%;
        max-width: 100%; /* ★制限を完全に解除 */
    }
    .sidebar-custom {
        width: 100%;
        position: static;
        margin-top: 40px;
    }
}

/*---------------------------------------------
  カテゴリー、アイキャッチ、タイトル、投稿者情報
  ------------------------------------------*/
/* カテゴリータグ */
.cat-tag-container {
    margin-bottom: 12px; /* 画像との間隔 */
    display: flex;
    justify-content: flex-start; /* 左寄せ */
}

/* アイキャッチ */
.custom-eyecatch {
    line-height: 0;
    margin-bottom: 25px;
}

.custom-eyecatch img {
    width: 100%;
    border-radius: 0;
    margin-bottom: 30px;
}

/* タイトル */
.custom-title {
    text-align: center !important;
    font-size: 24px;
    font-weight: bold;
    margin: 15px 0;
    border: none !important;
    background: transparent !important;
    color: #333 !important;
    line-height: 1.4; 
}

/* 投稿者情報エリア */
.custom-meta .author-box {
    display: flex !important; /* 強制的に表示 */
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    border: none !important;      /* 枠線を消す */
    background: transparent !important; /* 背景を透明に */
    padding: 0 !important;
}

.custom-meta img {
    border-radius: 50% !important;
    border: none ;
}

.custom-author-info {
    display: flex !important;
    flex-direction: column !important; /* 上下に並べる */
    justify-content: center;
    background: transparent !important;
    border: none !important;
}

/* 上段：ユーザー名（太字で少し大きく） */
.custom-author-name {
    display: block !important;
    font-weight: 600 !important; /* noteに近い太さ */
    color: #333 !important;
    font-size: 1rem !important;
    line-height: 1.4;
    margin-bottom: 2px; /* 日時との隙間 */
}

/* 下段：投稿日時（小さく、色を薄く） */
.custom-author-date {
    display: block !important;
    font-size: 0.8rem !important;
    color: #666 !important; /* 少し薄いグレー */
    line-height: 1.2;
}

/* ついでにプロフィール画像との位置バランスを微調整 */
.custom-meta .author-box {
    display: flex !important;
    align-items: center; /* 画像の高さ中央にテキストを合わせる */
    gap: 12px;
}

/* ---------------------------------------------
   記事本文内の見出し（大見出し・小見出し）
   --------------------------------------------- */
.custom-entry-content h2 {
    font-size: 1.6rem !important;  /* ★大見出しのサイズ（例：1.6rem） */
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-top: 2em !important;
    margin-bottom: 1em !important;
    color: #333 !important;
}

.custom-entry-content h3 {
    font-size: 1.3rem !important;  /* ★小見出しのサイズ（例：1.3rem） */
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-top: 1.5em !important;
    margin-bottom: 1em !important;
    color: #333 !important;
}

/* スマホ（768px以下）での見出しサイズ設定 */
@media screen and (max-width: 768px) {
    .custom-entry-content h2 { font-size: 1.4rem !important; }
    .custom-entry-content h3 { font-size: 1.2rem !important; }
}

/* 見出しの装飾（縦線や下線）を消す */
.custom-entry-content h2::before, .custom-entry-content h2::after,
.custom-entry-content h3::before, .custom-entry-content h3::after {
    display: none !important;
}

/*------------------------------------------------------
  いいね・ブックマーク
  ----------------------------------------------------*/
.custom-actions {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    margin-top: 30px; 
    margin-bottom: 30px;
}

.act-btn {
    background: #f5f5f5;
    border: none; 
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex ; 
    align-items: center ;
    justify-content: center !important;
    font-size: 20px;
    padding: 0 ;
    margin: 0 !important;
    line-height: 1 !important;
    position: relative;
}

.act-btn:hover { background: #e6e6e6; }
.like-btn { color: #888; }
.like-btn.liked { background: #ffebee ; color: #e0245e; }
.like-btn.liked .icon { animation: heart-burst 0.3s; }
@keyframes heart-burst {
            0% { transform: scale(1); }
            50% { transform: scale(1.3); }
            100% { transform: scale(1); }
        }
.like-btn .count { font-size: 14px; font-weight: bold; }
.like-btn .count:empty { display: none; }
.bookmark-btn.is-active { color: #fff; background: #007bff; }



/* =========================================
   カテゴリーページ
========================================= */
/*-----------------------------------------
  全体レイアウト
  ----------------------------------------*/
.category-flex-container {
    display: flex;
    justify-content: center; /* 中央寄せ */
    align-items: flex-start;
    gap: 20px;               /* 記事と広告の間の隙間 */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.category-dashboard .site-main {
    flex: 1;                       /* 残りの幅をすべて記事エリアに使う */
    min-width: 0;  
}

/* ランキングはまだ */
.no-ranking-msg {
    width: 100%; 
    padding: 30px; 
    text-align: center; 
    color: #888; 
    background: #f9f9f9; 
    border-radius: 8px;
}

@media (max-width: 950px) {
    .category-flex-container {
        flex-direction: column;
        align-items: center;
        padding: 0;
    }
    .site-main {
        width: 100%;
        max-width: 100%; /* ★制限を完全に解除 */
    }
    .sidebar-custom {
        width: 100%;
        position: static;
        margin-top: 40px;
    }
}

/* -----------------------------------------------
   カテゴリーラベル 
   ----------------------------------------------*/
.cat-label-container { 
    margin: 10px 0 30px; 
}

.cat-pill-label {
    display: inline-block;
    padding: 8px 30px;
    border-radius: 50px;
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
}

.cat-pill-label.cat-id-4 {background: #e53935;}
.cat-pill-label.cat-id-5 {background: #fb8c00;}
.cat-pill-label.cat-id-6 {background: #1e88e5;}
.cat-pill-label.cat-id-7 {background: #2d5a7a;}
.cat-pill-label.cat-id-8 {background: #43a047;}
.cat-pill-label.cat-id-9 {background: #fdd835; color: #333 !important;}

/*-----------------------------------------------
  横スクロールエリア
  ---------------------------------------------*/
.dashboard-section { margin-bottom: 60px; }
.section-title { 
    font-size: 20px; 
    font-weight: bold; 
    margin-bottom: 15px; 
    padding-left: 10px; 
    border-left: 4px solid #333; 
}

.scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px; /* スクロールバーのスペース */
}
.horizontal-scroll-container {
    display: flex;
    gap: 16px;
    padding: 0 5px; /* 端の余白 */
}


/* ----------------------------------------------
  スクロールカード全体設定 
  --------------------------------------------- */
.scroll-card {
    flex: 0 0 280px;      /* カードの幅 */
    background: #fff;
    border-radius: 8px;   /* カード全体の角丸（不要なら0に） */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    margin-right: 4px;   /* 横並び時の余白 */
    border: 1px solid #f0f0f0; /* 薄い枠線 */
    transition: transform 0.2s;
}
.scroll-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.12); 
}
.scroll-card a { 
    text-decoration: none; 
    color: inherit; 
    display: block; 
    height: 100%; 
}

.more-link-card {
    background: #f9f9f9;
    border: 2px dashed #ddd;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-btn-inner {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: #666; font-weight: bold;
}
.more-btn-inner .arrow { font-size: 24px; margin-top: 5px; }

/* --------------------------------------------
  リンクエリア（アイキャッチとタイトル）
  ---------------------------------------------*/
.card-link-area {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* アイキャッチ画像*/
.card-thumb {
    width: 100%;
    aspect-ratio: 1.91 / 1; /* 1.91:1の比率を固定 */
    overflow: hidden;
    background: #eee;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* タイトル（3行制限・...表示）*/
.card-body { 
    padding: 8px; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3 !important;
    height: auto; 
}

/* -----------------------------------------------
  フッターエリア（投稿情報）
   ---------------------------------------------- */
.card-footer {
    width: 100%;
    padding: 2px 8px 16px; /* 下部に少し広めの余白 */
    margin-top: auto;        /* タイトルが短くてもフッターを下に寄せる */
}

/* ユーザー情報と日付の行 */
.card-meta-row {
    width: 100%;
    line-height: 24px;
    display: flex;
    justify-content: space-between; /* 両端揃え（左に名前、右に日付） */
    align-items: center;
    margin-bottom: 12px; /* ボタンとの間隔 */
    font-size: 13px;
    color: #666;
}
.card-author {
    position: relative;
    width: 100%;
    display: block;
    align-items: center;
    white-space: nowrap;
    gap: 6px;
    text-decoration: none;
    color: #333;
}
.card-avatar {
    width: 24px; /* 画像に合わせて少し大きめに */
    height: 24px;
    vertical-align: middle;
    border-radius: 50%;
    object-fit: cover;
    background: #ccc;
}

.card-author-name {
    /* ★計算式: 全体(100%) - 日付(30px) - アバター(24px) - 余白(6px) */
    /* 少し余裕を持たせて -65px 程度に設定するのが安全です */
    max-width: calc(100% - 65px);
    display: inline-block;
    vertical-align: middle;
    line-height: 24px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;  
}

.card-date {
    position: absolute;
    right: 0;
    top: 0;
    vertical-align: middle;
    display: inline-block;
    width: 30px;            /* 日付の幅を固定 */
    text-align: right;
    font-size: 11px;
    color: #999;
}

/* -----------------------------------------------
  フッターエリア（いいね、ブックマーク）
   ---------------------------------------------- */
.card-actions-row {
    display: flex;
    gap: 10px; /* ボタン同士の間隔 */
}
.card-btn {
    border: none !important;      /* 枠線を完全に消去 */
    outline: none !important;     /* クリック時の青や黒の枠も消去 */
    box-shadow: none !important;  /* もし影がついていたら消去 */
    width: 40px;  /* 正円のサイズ */
    height: 40px;
    border-radius: 50%; /* 丸くする */
    background: #f5f5f5; /* 背景：薄いグレー */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888; /* アイコンの色 */
    transition: all 0.2s;
    font-size: 16px;
    padding: 0;
    position: relative;
}

/* ホバー時 */
.card-btn:hover {
    background: #e0e0e0;
}

/* 数字（いいね数）の調整 */
.card-like-btn .count {
    font-size: 12px;
    font-weight: bold;
    margin-left: 4px; /* アイコンの横に少し隙間 */
    display: inline-block;
}
.card-like-btn .count:empty {
    display: none;
}
/* 数字がある場合は丸ではなく少し横長にするか、
   画像通り「丸の中に数字は入れず横に出す」場合はwidthをautoにします。
   ★今回は画像のデザイン（丸いボタン）を優先し、
   数字が出てもボタンが崩れないよう調整します */
.card-like-btn {
    width: auto;       /* 数字が入るため幅を自動に */
    min-width: 40px;   /* 最低幅を正円サイズに */
    padding: 0 10px;   /* 数字が入った時の左右余白 */
    border-radius: 20px; /* カプセル型に変化 */
}
/* 数字がない時は正円に戻す */
.card-like-btn:has(.count:empty) {
    width: 40px;
    padding: 0;
    border-radius: 50%;
}

/* --- アクティブ（いいね/保存済み）状態 --- */
/* 投稿本文のCSSに合わせて色を設定 */
.card-like-btn.liked {
    background: #ffebee; /* 薄い赤背景 */
    color: #e0245e;      /* 赤文字 */
}
.card-bookmark-btn.is-active {background: #007bff; }

/* =========================================
   記事一覧ページ
========================================= */
/* 5列グリッドのレイアウト */
.category-list-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 1行に5記事 */
    gap: 20px;
    margin-bottom: 50px;
}

/* 既存の横スクロール用カードの幅指定をグリッド用にリセット */
.category-list-grid .scroll-card {
    flex: none; 
    width: 100%;
}

.eyecatch-cat-tag {
    background: #f78e04;
    color: #fff !important;
    padding: 5px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 13px;
    text-decoration: none !important;
    transition: all 0.3s ease; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-block;
}
.eyecatch-cat-tag.cat-id-4 {background: #e53935;}
.eyecatch-cat-tag.cat-id-5 {background: #fb8c00;}
.eyecatch-cat-tag.cat-id-6 {background: #1e88e5;}
.eyecatch-cat-tag.cat-id-7 {background: #2d5a7a;}
.eyecatch-cat-tag.cat-id-8 {background: #43a047;}
.eyecatch-cat-tag.cat-id-9 {background: #fdd835; color: #333 !important;}

.eyecatch-cat-tag:hover {
        transform: translateY(-2px); /* 上に4px移動 */
        box-shadow: 0 6px 15px rgba(0,0,0,0.15); /* 影を強くして浮遊感を出す */
        opacity: 0.9;
        color: #fff !important;
}

/* ページネーション */
.list-page-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}
.list-page-pagination .page-numbers {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 31px; /* 枠線分を考慮 */
    text-align: center;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    text-decoration: none;
    font-weight: bold;
}
.list-page-pagination .current {
    background: #d9e9f2; /* 選択中の水色 */
}

.card-title {
    /* 1. ブロックとして表示し、高さを固定する */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; /* 3行に制限 */
    overflow: hidden;      /* 4行目以降を隠す */
    
    /* 2. 見た目を整える設定 */
    line-height: 1.5;      /* 行間の設定（お好みで） */
    max-height: 4.5em;     /* 1.5(行間) × 3(行数) = 4.5em */
    text-overflow: ellipsis;
    
    /* 3. 余白調整（以前のコードに合わせる） */
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 10px;
}

/* レスポンシブ対応（画面サイズに合わせて列数を減らす） */
@media (max-width: 1200px) {
    .category-list-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 992px) {
    .category-list-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .category-list-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}
@media (max-width: 480px) {
    .category-list-grid { grid-template-columns: 1fr; }
}

/*================================================
 プロフィール編集画面・アカウント情報編集画面
 ===============================================*/
.edit-profile-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.edit-section {
    margin-bottom: 25px;
}

.edit-section label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.edit-section textarea, 
.edit-section input[type="url"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.save-btn {
    background-color: #3b82f6;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.cancel-link {
    margin-left: 15px;
    color: #666;
    text-decoration: none;
}

.mailchange-link {
    white-space: nowrap;
    font-size: 13px;
    color: #0066cc;
    text-decoration: underline;
}

.field-error {
    color: #e0245e;
    font-size: 12px;
    margin-top: 5px;
    display: block; /* 改行させて入力欄の真下へ */
}

/* エラーがある入力欄の枠線を赤くする場合（オプション） */
.field-group input:has(+ .field-error) {
    border-color: #e0245e;
    background-color: #fff1f4;
}

/* =========================================
   お問い合わせフォーム
========================================= */
.contact-form-wrapper {
    max-width: 700px;
    margin: 40px auto;
    font-family: sans-serif;
}

.form-row {
    display: flex;
    margin-bottom: 25px;
    align-items: flex-start;
}

.form-row label {
    width: 200px;
    font-size: 1.1rem;
    font-weight: normal;
    padding-top: 10px; /* 入力欄と高さを合わせる */
}

.form-input {
    flex: 1;
}

/* 入力フィールド共通 */
.form-input input[type="text"],
.form-input input[type="email"],
.form-input select,
.form-input textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #000; /* 画像に合わせて太めの黒枠 */
    border-radius: 0;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-input select {
    background: #fff;
    height: 45px;
}

.form-input textarea {
    resize: vertical;
}

/* お問い合わせのプライバシーポリシー欄 */
.privacy-box {
    background-color: #e2f0d9; /* 薄い緑色 */
    border: 2px solid #000;
    padding: 20px;
    margin-top: 40px;
    margin-bottom: 30px;
}

.privacy-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.privacy-text {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.privacy-check {
    text-align: center;
    font-size: 1.1rem;
}

.privacy-check input[type="checkbox"] {
    transform: scale(1.5);
    margin-right: 10px;
}

/* 送信ボタン */
.form-submit {
    text-align: center;
}

.form-submit button {
    background-color: #9fc5e8; /* 非活性時の薄い青 */
    color: #000;
    font-size: 1.4rem;
    font-weight: bold;
    padding: 10px 60px;
    border: 2px solid #000;
    border-radius: 10px;
    cursor: not-allowed;
    transition: all 0.3s;
}

/* チェックが入った時のボタン活性状態 */
.form-submit button.active {
    background-color: #6fa8dc; /* 少し濃い青 */
    cursor: pointer;
}
.form-submit button.active:hover {
    opacity: 0.8;
}

/* --- レスポンシブ対応 --- */
@media (max-width: 768px) {
    .form-row {
        display: block;
    }
    .form-row label {
        display: block;
        width: 100%;
        margin-bottom: 8px;
    }
}

/* =========================================
   お問い合わせ完了画面
   ========================================= */
.contact-thanks-wrapper {
    max-width: 600px;
    margin: 60px auto;
    text-align: center;
}

.thanks-message {
    font-size: 1.1rem;
    margin-bottom: 40px;
    line-height: 1.8;
}

.receipt-box {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    display: inline-block;
    margin-bottom: 40px;
}

.receipt-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.receipt-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d5a7a;
    letter-spacing: 0.1em;
}

.back-home-btn-area .nav-btn {
    display: inline-block;
    padding: 12px 40px;
    /* ヘッダーボタンのデザインを継承している前提 */
}

/* ====================================================
  ご利用規約
  =================================================== */
.terms-container {
    line-height: 1.8;
    color: #333;
    max-width: 100%;
    margin: 0 auto;
}

/* 条（見出し） */
.terms-container h3 {
    border-left: 4px solid #333;
    padding: 10px 15px;
    background: #f4f4f4;
    font-size: 1.25em;
    margin-top: 40px;
    margin-bottom: 20px;
}

/* 項（1. 2. 3.）のリスト設定 */
.terms-ol {
    list-style: none;
    counter-reset: kou-counter; /* 項のカウンターリセット */
    padding-left: 0;
}

.terms-ol > li {
    position: relative;
    padding-left: 2em;
    margin-bottom: 15px;
}

.terms-ol > li::before {
    counter-increment: kou-counter;
    content: counter(kou-counter) " "; /* 番号と半角スペース */
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 号（(1) (2) (3)）のリスト設定 */
.terms-sub-ol {
    list-style: none;
    counter-reset: go-counter; /* 号のカウンターリセット */
    padding-left: 0;
    margin-top: 10px;
}

.terms-sub-ol > li {
    position: relative;
    padding-left: 2.5em;
    margin-bottom: 8px;
}

.terms-sub-ol > li::before {
    counter-increment: go-counter;
    content: "(" counter(go-counter) ") "; /* (数字)と半角スペース */
    position: absolute;
    left: 0.5em;
}

/* レスポンシブ調整 */
@media screen and (max-width: 768px) {
    .terms-container h3 {
        font-size: 1.15em;
        padding: 8px 12px;
    }
    .terms-ol > li {
        padding-left: 1.8em;
    }
}

/* ===================================================
   宙しるしの使い方
   =================================================== */
.how-to-use-container {
    max-width: 800px;
    margin: 0 auto;
    color: #333;
    line-height: 1.8;
    font-family: sans-serif;
}

/* Cocoonのデフォルト見出しスタイルをリセット */
.how-to-use-container h1,
.how-to-use-container h2,
.how-to-use-container h3 {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.how-to-title {
    text-align: center;
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 30px;
}

.how-to-intro p {
    margin-bottom: 20px;
}

/* 中央のリンクブロック（記す・知る） */
.how-to-nav-blocks {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 50px 0;
}

.nav-block {
    text-decoration: none;
    color: #333;
    border-radius: 20px;
    padding: 40px 20px;
    width: 45%;
    text-align: center;
    transition: transform 0.2s, opacity 0.2s;
    display: block;
}

.nav-block:hover {
    opacity: 0.85;
    transform: translateY(-3px);
}

.nav-block h2 {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 15px;
}

.nav-block p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
}

.block-shirusu {
    background-color: #f0f7f0; /* 薄緑 */
}

.block-shiru {
    background-color: #f0f8fc; /* 薄青 */
}

/* 各セクション */
.how-to-section {
    margin-top: 60px;
    scroll-margin-top: 80px; /* スクロール時のヘッダー被り防止 */
}

.how-to-section .section-main-title {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 30px;
}

.how-to-section h3 {
    font-size: 1.4em;
    font-weight: bold;
    margin: 40px 0 15px 0;
}

/* Step背景ボックス */
.step-box {
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.step-box.bg-green {
    background-color: #f0f7f0;
}

.step-box.bg-blue {
    background-color: #f0f8fc;
}

.step-box p {
    margin-bottom: 5px;
}

.step-box p:last-child {
    margin-bottom: 0;
}

.step-note {
    font-size: 0.85em;
    color: #666;
    margin-left: 1em;
    display: block;
}

.note-text {
    font-size: 0.95em;
    margin-bottom: 20px;
}

/* レスポンシブ（スマホ・タブレット向け） */
@media screen and (max-width: 600px) {
    .how-to-nav-blocks {
        /* flex-direction: column; を削除、または row に変更 */
        flex-direction: row; 
        align-items: stretch; /* 高さを揃える */
        gap: 10px; /* スマホ用に隙間を少し狭く調整 */
    }
    
    .nav-block {
        width: 50%; /* 90% から 50%（または横並びになるサイズ）に変更 */
        padding: 20px 10px; /* スマホ用に余白を少し縮小 */
    }

    /* 文字がはみ出すのを防ぐための調整 */
    .nav-block h2 {
        font-size: 1.5em; 
    }
    .nav-block p {
        font-size: 0.85em;
    }
    
    .how-to-section h3 {
        font-size: 1.2em;
    }
    
    .step-box {
        padding: 15px;
        font-size: 0.95em;
    }
}