/* =========================================
   Neoteros Official Theme - The Masterpiece
   Optimization: High Readability & Stylish Modern
========================================= */

:root {
    --bg-base: #ffffff;        
    --bg-menu: #111111;        
    --accent-gold: #c5a059;    
    --text-main: #111111;      
    --text-sub: #555555;       
    --border-light: #eeeeee;
    --sidebar-border: #e0e0e0; 
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    /* フォントに丸みを持たせる指定を追加 */
    font-family: 'Quicksand', 'Nunito', 'Hiragino Maru Gothic ProN', 'Montserrat', 'Noto Sans JP', sans-serif !important;
    font-weight: 400;
    line-height: 1.85; 
    letter-spacing: 0.05em; 
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

/* 記事本文の読みやすさ調整 */
.entry-content p {
    margin-bottom: 1.7em !important;
    color: var(--text-main) !important;
}

.entry-content,
.entry-content li,
.entry-content div {
    color: var(--text-main) !important;
}

/* --- 👑 ブログタイトル --- */
#blog-title {
    text-align: center;
    padding: 50px 0 30px !important;
    width: 100%;
}
#title a {
    font-family: 'Quicksand', 'Montserrat', sans-serif !important;
    font-weight: 700 !important;
    font-size: 2.8rem !important;
    letter-spacing: 0.3em !important;
    color: var(--text-main) !important;
    text-decoration: none !important;
    text-transform: uppercase;
}
#title a:hover {
    color: var(--accent-gold) !important;
}

/* --- 1. グローバルメニュー --- */
#global-menu { 
    max-width: 1200px; 
    margin: 0 auto 60px; 
    padding: 0 15px; 
    box-sizing: border-box; 
}
#global-menu ul { 
    display: flex; 
    width: 100%; 
    background: var(--bg-menu); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    border-radius: 8px; 
}
#global-menu li { flex: 1; position: relative; }

/* メニュー間のアクセント境界線 */
#global-menu li:not(:last-child):not(.menu-search-li)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(197, 160, 89, 0.4); 
}

#global-menu a { display: flex; justify-content: center; align-items: center; height: 100%; color: #ffffff !important; text-decoration: none !important; font-weight: 700; font-size: 0.85em; padding: 22px 5px; transition: all 0.3s ease; letter-spacing: 0.05em; text-align: center; box-sizing: border-box; }
#global-menu a:hover { color: var(--accent-gold) !important; background: rgba(255,255,255,0.05); }

/* --- 1.5. メニュー内検索ボックス（白ベースに変更） --- */
#global-menu li.menu-search-li {
    flex: none;
    margin-left: auto;
    display: flex;
    align-items: center;
    padding: 0 15px;
}
.menu-search-form {
    display: flex;
    align-items: center;
    background: #ffffff; /* 白背景 */
    border: 1px solid #dddddd; /* 薄いグレー枠 */
    border-radius: 50px;
    height: 36px;
    padding: 0 5px 0 15px;
    transition: all 0.3s ease;
}
.menu-search-form:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 0 8px rgba(197, 160, 89, 0.2);
}
.menu-search-form input {
    background: transparent;
    border: none;
    color: #111111; /* 入力文字は黒 */
    width: 140px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}
.menu-search-form input::placeholder { color: #aaaaaa; }
.menu-search-form button {
    background: transparent;
    border: none;
    color: #888888; /* アイコンはグレー */
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.menu-search-form button:hover { color: var(--accent-gold); }

/* --- 2. レイアウト構成 --- */
#content { max-width: 1200px; margin: 0 auto; }
#content-inner { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 0 15px; }
#wrapper { width: 100%; }
#box2 { width: 100%; margin-top: 50px; }
@media screen and (min-width: 992px) { #wrapper { width: 68%; } #box2 { width: 28%; margin-top: 0; } }

/* --- 3. 記事一覧・記事ページ --- */
.archive-entry { 
    display: flex; 
    flex-direction: column; 
    padding: 40px; 
    margin-bottom: 60px; 
    background: #ffffff;
    border: 1px solid #dcdcdc; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.04); 
    transition: all 0.3s ease;
}
.archive-entry:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); border-color: #cccccc; }
.entry-thumb-link { display: block !important; width: 100% !important; aspect-ratio: 16 / 9 !important; overflow: hidden; border-radius: 4px; margin-bottom: 35px; }
.entry-thumb { width: 100% !important; height: 100% !important; object-fit: cover !important; }

/* 🚨 記事タイトル */
.page-entry .entry-title a,
.archive-entry .entry-title a,
.entry-title a {
    color: var(--text-main) !important;
    text-decoration: none !important;
}
.page-entry .entry-title a:hover,
.archive-entry .entry-title a:hover,
.entry-title a:hover {
    color: var(--accent-gold) !important;
}

/* 🚨 日付 */
.entry-date,
.archive-entry .entry-date {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
}
.entry-date::before,
.archive-entry .entry-date::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 3px;
    height: 14px;
    background: var(--accent-gold);
    border-radius: 2px;
}
.entry-date a,
.entry-date time,
.archive-entry .entry-date a,
.archive-entry time,
.archive-entry time a {
    color: #888888 !important;
    font-size: 0.85em !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    letter-spacing: 0.05em;
}

/* 🚨 カテゴリー */
.entry-categories,
.archive-entry .entry-categories,
.categories-tags {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}
.entry-categories a,
.archive-entry .entry-categories a,
.categories-tags a,
.archive-entry .entry-category-link,
.archive-entry a[href*="/archive/category"] {
    display: inline-block !important;
    border: 1.5px solid var(--accent-gold) !important;
    color: var(--accent-gold) !important;
    background: transparent !important;
    border-radius: 50px !important;
    padding: 3px 14px !important;
    font-size: 0.78em !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    letter-spacing: 0.06em;
    transition: background 0.2s ease, color 0.2s ease;
}
.entry-categories a:hover,
.archive-entry .entry-categories a:hover {
    background: var(--accent-gold) !important;
    color: #ffffff !important;
}

/* --- スタイリッシュ見出し（H3） --- */
.page-entry .entry-title,
.entry-content h3, h3 {
    border: none !important;
    border-left: 6px solid var(--accent-gold) !important; 
    border-bottom: 1px solid var(--border-light) !important; 
    padding: 12px 15px 12px 20px !important;
    border-radius: 0 !important;
    background: transparent !important;
    display: block !important;
    text-align: left !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    margin: 2.5em 0 1.5em !important;
    letter-spacing: 0.05em !important;
}

/* --- 4. 目次（線で囲うスタイルへ刷新） --- */
.entry-content ul.table-of-contents,
ul.table-of-contents { 
    border: 2px solid var(--sidebar-border) !important; /* 全体の枠線 */
    border-top: 5px solid var(--accent-gold) !important; /* 上部のアクセント */
    padding: 20px 25px 25px !important;
    border-radius: 4px; 
    background: #ffffff;
    margin: 2.5em 0 !important;
}
.table-of-contents::before { 
    content: "目次"; 
    display: block; 
    font-size: 1.2em; 
    font-weight: 700; 
    color: var(--text-main); 
    margin: 0 0 15px 0; 
    text-align: left; 
    border-bottom: 1px dashed var(--sidebar-border); 
    padding-bottom: 10px;
    width: 100%;
}

/* 🚨 目次リンクの青文字修正 */
ul.table-of-contents a,
.entry-content ul.table-of-contents a {
    color: var(--text-sub) !important; /* 落ち着いたダークグレー */
    text-decoration: none !important;
    font-weight: 500;
    transition: color 0.2s ease;
}
ul.table-of-contents a:visited,
.entry-content ul.table-of-contents a:visited {
    color: var(--text-sub) !important;
}
ul.table-of-contents a:hover,
.entry-content ul.table-of-contents a:hover {
    color: var(--accent-gold) !important;
}

/* --- 5. サイドバー・パンくず --- */
.hatena-module-title,
.entry-footer-module-title {
    border: 2px solid var(--accent-gold) !important;
    padding: 12px 15px !important;
    border-radius: 6px;
    text-align: center;
    background: #ffffff;
    margin-bottom: 25px;
    font-weight: 700;
    color: var(--text-main) !important;
}

.breadcrumb { display: flex !important; justify-content: center !important; flex-wrap: wrap; width: 100%; margin-bottom: 25px; font-weight: 600; }

/* --- 6. サイドバー検索モジュール --- */
.hatena-module-search-box .search-form {
    display: flex; align-items: center; background: #ffffff; border: 1px solid #cccccc; border-radius: 50px; padding: 3px 5px;
}
.hatena-module-search-box .search-module-input {
    flex: 1; background: transparent; border: none; color: #111111; padding: 12px 20px; font-size: 14px; outline: none;
}
.hatena-module-search-box .search-module-input::placeholder { color: #aaaaaa; }
.hatena-module-search-box .search-module-button {
    background: var(--accent-gold); border: none; color: #ffffff; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center;
}

/* --- 7. ページャー --- */
.pager { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 60px 0; list-style: none; clear: both; }
.pager a {
    display: inline-flex; justify-content: center; align-items: center; min-width: 140px; padding: 14px 24px; background-color: #111111; color: #ffffff !important; font-weight: 700; text-decoration: none !important; border-radius: 50px; transition: all 0.3s ease;
}
.pager a:hover { background-color: var(--accent-gold); color: #111111 !important; transform: translateY(-3px); }

/* --- 8. ASP規約遵守 (1px画像対策) --- */
img[width="1"], a img[width="0"], img[src*="0.gif"] {
    position: absolute !important; width: 1px !important; height: 1px !important; pointer-events: none !important; opacity: 0 !important;
}

/* --- 9. 画像のレイアウトシフト(CLS)対策 --- */
.entry-content img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

/* --- 10. モバイル向けボタン最適化（タップ領域確保） --- */
.entry-content a.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 44px;
    min-height: 44px; /* タップ領域の確保 */
    padding: 12px 24px;
    background-color: var(--bg-menu); /* ブランドカラー: 黒 */
    color: var(--accent-gold); /* ブランドカラー: 金 */
    border: 2px solid var(--bg-menu);
    border-left: 6px solid var(--accent-gold); /* 左側の太いボーダー線でブランド感を強調 */
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.entry-content a.btn:hover {
    background-color: var(--accent-gold);
    color: #ffffff;
    border-color: var(--accent-gold);
}

/* --- リッチな箇条書きボックス等のスタイル --- */
.ff14-check-box {
    background: #fdfdfd;
    border: 2px solid #5d99d1;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
}

.ff14-check-box::before {
    content: "CHECK LIST";
    position: absolute;
    top: -12px;
    left: 15px;
    background: #5d99d1;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    padding: 0 10px;
    border-radius: 4px;
}

.ff14-check-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ff14-check-box ul li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.ff14-check-box ul li::before {
    content: "✔";
    position: absolute;
    left: 0;
    color: #5d99d1;
    font-weight: bold;
    font-size: 18px;
}

/* コマンド表示用スタイル */
.cmd-box {
    background: #f5f5f5;
    color: #111111;
    padding: 15px;
    border-left: 4px solid #c5a059;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    margin: 15px 0;
    overflow-x: auto;
    border-top: 1px solid #ddd;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

/* 注意喚起ボックス */
.warning-box {
    background: #fff9e6;
    border-left: 5px solid #ffcc00;
    padding: 15px;
    margin: 20px 0;
}

/* --- 📱 モバイル表示の徹底最適化 --- */
@media screen and (max-width: 768px) {
    /* A. スマホ用：横スワイプメニュー (改修ポイント) */
    #global-menu { 
        display: block !important; 
        margin: 0 0 30px 0; 
        padding: 0; 
    }
    #global-menu ul { 
        display: flex; 
        flex-wrap: nowrap !important; /* 折り返し禁止 */
        overflow-x: auto;  /* 横スクロール許可 */
        -webkit-overflow-scrolling: touch;
        border-radius: 0; 
        background: var(--bg-menu);
    }
    #global-menu li { 
        flex: 0 0 auto !important; /* 縮小禁止 */
        border: none !important;
    }
    #global-menu a { 
        padding: 15px 20px !important; 
        font-size: 14px !important; 
        white-space: nowrap !important; /* 文字改行禁止 */
    }
    /* スマホでは検索ボックスを隠してスッキリ */
    #global-menu li.menu-search-li { display: none !important; }

    /* 1. ブログタイトルのサイズ調整 */
    #title a {
        font-size: 1.8rem !important;
        letter-spacing: 0.15em !important;
    }

    /* 2. 記事タイトル (h1相当) の調整 */
    .entry-title a,
    .entry-header h1 a {
        font-size: 1.4rem !important;
        line-height: 1.4 !important;
    }

    /* 3. 見出し (h3/h4) のサイズ最適化 */
    .entry-content h3, h3 {
        font-size: 1.15em !important;
        padding: 10px 12px !important;
        margin: 1.5em 0 1em !important;
    }
    .entry-content h4, h4 {
        font-size: 1.05em !important;
        margin: 1.2em 0 0.8em !important;
    }

    /* 4. 表（テーブル）のレスポンシブ化 */
    .entry-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border-radius: 4px;
    }

    /* 5. 本文の読みやすさ */
    .entry-content {
        font-size: 16px !important;
        line-height: 1.7 !important;
        padding: 0 5px;
    }

    /* 6. ボタンを押しやすく */
    .entry-content a.btn {
        width: 100%;
        display: flex;
        padding: 15px 10px !important;
        box-sizing: border-box;
        font-size: 1rem;
    }

    /* 7. アーカイブ一覧の調整 */
    .archive-entry {
        padding: 20px 15px !important;
        margin-bottom: 30px !important;
    }
    .entry-thumb-link {
        margin-bottom: 20px !important;
    }

    /* 8. 箇条書きの余白調整 */
    .entry-content ul {
        padding: 1.2em 1.2em 1.2em 2em !important;
    }

    /* 9. 画像の上下余白 */
    .uw-image {
        aspect-ratio: 16 / 9;
        margin: 15px 0 !important;
    }
}