@charset "utf-8";

/* =============================================
    Base Styles
   ============================================= */
body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

/* 共通コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================
    Header (Plan B: Dark Intelligence)
   ============================================= */
.site-header {
    background-color: #1a202c; /* 知的な紺色 */
    color: #ffffff;
    border-bottom: 4px solid #007bff; /* 既存サイトのアクセントカラー */
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 80px; /* シニアの方にも見やすいゆったりした高さ */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #f0f4f8; /* わずかに青みのある白 */
    gap: 15px;
    transition: opacity 0.2s;
}

.site-logo:hover {
    opacity: 0.9;
}

.logo-svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* =============================================
    Layout
   ============================================= */
.main-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px; /* ヘッダーとの間に余白 */
    margin-bottom: 40px;
}

main {
    flex: 1;
    min-width: 0; /* flexbox内での崩れ防止 */
    
    /* ▼ ここからカード型UIのスタイルを追加 ▼ */
    background-color: #ffffff;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* スマホ閲覧時はカードの余白を少し狭める */
@media (max-width: 768px) {
    main {
        padding: 20px;
    }
}

/* スマホ対応 */
@media (max-width: 768px) {
    .header-inner {
        height: 64px;
    }
    .logo-text {
        font-size: 1.3rem;
    }
    .logo-svg {
        width: 32px;
        height: 32px;
    }
    .main-layout {
        flex-direction: column;
        margin-top: 10px;
    	margin-bottom: 20px;
    }
}

/* ==========================================
    ■ 記事タイトル (h1)
   ========================================== */
.post-detail h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #1a202c;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.post-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 30px;
}

/* ==========================================
    ■ 記事内の見出し装飾 (h2 - h4)
    ※ .post-content 内に限定して適用
   ========================================== */

/* 中見出し：グラデーション背景 */
.post-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a202c;
    padding: 0.6rem 0 0.6rem 1.2rem;
    margin: 3.5rem 0 1.5rem;
    background: linear-gradient(to right, #fcfcfc, transparent); 
    border-left: 6px solid #007bff;
    border-bottom: 1px solid #eee;
    scroll-margin-top: 100px;
}

/* 小見出し：下線の青がより長く残るように調整 */
.post-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a202c;
    margin: 2.5rem 0 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #eee;
    position: relative;
    scroll-margin-top: 100px;
}

.post-content h3::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 200px; 
    height: 3px;
    background: linear-gradient(to right, #007bff 10%, transparent);
}

/* 最小見出し：シャープなひし形アイコン */
.post-content h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a202c;
    margin: 2.2rem 0 1rem;
    display: flex;
    align-items: center;
}

.post-content h4::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #007bff;
    margin-right: 12px;
    transform: rotate(45deg);
}

/* ==========================================
    ■ 長文記事の目次 (Table of Contents) 
   ========================================== */
.toc-container {
    background: #fcfcfc;
    border: 1px solid #eee;
    padding: 24px;
    margin: 30px auto; /* 中央寄せ */
    border-radius: 8px;
    max-width: 480px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

@media (max-width: 768px) {
    .toc-container {
        max-width: 100%; 
    }
}

.toc-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-align: center;
    display: block;
    color: #1a202c;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item-h2 { 
    margin-top: 10px; 
    font-weight: bold; 
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
}
.toc-item-h3 { 
    margin-left: 1.5em; 
    margin-top: 6px; 
    font-size: 0.95em; 
    color: #555;
}

.toc-list a {
    text-decoration: none;
    color: #007bff;
    transition: color 0.2s;
}
.toc-list a:hover { 
    color: #0056b3;
    text-decoration: underline; 
}

/* ==========================================
    ■ 記事表示・装飾
   ========================================== */
.post-item { margin-bottom: 30px; border-bottom: 1px solid #eee; padding-bottom: 20px; }
.post-content { margin-top: 30px; }

/* 記事内画像 */
.post-content img { max-width: 100%; height: auto; display: block; margin: 20px auto; border-radius: 4px; }
.post-content img.post-img-large  { width: 100%; }
.post-content img.post-img-medium { width: 70%; }
.post-content img.post-img-small  { width: 40%; }
.post-content .sudoku-tech-figure { margin: 20px 0; }
.post-content .sudoku-tech-figure img { width: 70%; }

@media (max-width: 600px) {
    .post-content img.post-img-medium { width: 90%; }
    .post-content img.post-img-small  { width: 80%; }
    .post-content .sudoku-tech-figure img { width: 90%; }
}

.post-content img.align-left { margin-left: 0; margin-right: auto; }

/* AdSense snippets / local placeholders */
.pb-promo-block {
    margin: 28px 0;
    text-align: center;
}

.pb-promo-block hr {
    margin: 0 0 10px;
    border: 0;
    border-top: 1px solid #cbd5e1;
}

.pb-promo-block hr:last-child {
    margin: 10px 0 0;
}

.pb-promo-label {
    margin: 0 0 8px;
    color: #475569;
    font-size: 0.9rem;
    text-align: left;
}

.pb-promo-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: min(100%, 336px);
    min-height: 280px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
    background: repeating-linear-gradient(
        -45deg,
        #f8fafc,
        #f8fafc 10px,
        #eef2f7 10px,
        #eef2f7 20px
    );
    border: 1px dashed #94a3b8;
    color: #334155;
    font-size: 0.9rem;
}

.pb-promo-slot strong {
    color: #1f2937;
    font-size: 1rem;
}

.pb-promo-slot span {
    color: #64748b;
}

.pb-promo-slot-sidebar-pc {
    width: min(100%, 160px);
    min-height: 600px;
}

.pb-promo-game-bottom {
    margin-top: 100px;
    margin-bottom: 36px;
}

/* アイキャッチ画像 */
.post-featured-image { margin: 20px 0; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.post-featured-image img { width: 100%; height: auto; display: block; }
.post-featured-image.is-placeholder { max-height: 200px; background-color: #f4f7f9; }
.post-featured-image.is-placeholder img { height: 200px; object-fit: cover; opacity: 0.8; }

@media (max-width: 600px) {
    .post-featured-image.is-placeholder { height: 120px; }
}

/* ==========================================
    ■ ページネーション
   ========================================== */
.pagination { margin-top: 40px; display: flex; gap: 10px; align-items: center; justify-content: center; }
.pagination a, .pagination .page-number { padding: 8px 15px; border: 1px solid #ddd; text-decoration: none; color: #333; }
.pagination .active { background: #333; color: #fff; border-color: #333; cursor: default; }
.pagination a:hover:not(.active) { background-color: #eee; }

/* 記事詳細内分割ページ用 */
.post-pagination { margin-top: 30px; display: flex; gap: 10px; justify-content: center; }
.post-pagination a { padding: 5px 12px; border: 1px solid #333; text-decoration: none; color: #333; }
.post-pagination a.active { background: #333; color: #fff; }

/* 記事詳細内分割ページ用案内 */
.page-indicator {
    background: #f8f9fa;
    border-top: 2px solid #333;
    padding: 10px 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.current-page-label {
    font-weight: bold;
    color: #333;
}

.post-pagination-top a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}
.post-pagination-top a:hover {
    text-decoration: underline;
}

/* ==========================================
    ■ サイドバー・ウィジェット共通 (カード型統合)
   ========================================== */
.widget { 
    margin-bottom: 30px;
    /* ウィジェット自体も白いカードにする */
    background-color: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.widget h3, .widget .widget-title { 
    font-size: 1.1rem; 
    margin-top: 0; 
    margin-bottom: 15px;
    padding-left: 0;
    border-left: none; /* 古い左線を消す */
    border-bottom: 2px solid #007bff; /* サイトカラーの青い下線 */
    padding-bottom: 10px;
    position: relative;
    color: #333;
}

/* タイトルの下にオレンジのアクセントラインを重ねる */
.widget h3::after, .widget .widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 40px;
    height: 2px;
    background-color: #ff9800; 
}

/* サイドバー内のリンクにマウスを乗せた時の共通アクション（少し右へ動く） */
.widget a {
    transition: transform 0.2s ease, color 0.2s ease;
}
.widget a:hover {
    color: #007bff;
    transform: translateX(5px);
    display: inline-block; /* transformを効かせるため */
}

/* ==========================================
   ■ サイドバーのリンクリスト装飾（カード型対応）
   ========================================== */
.widget .post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 各項目の間に薄い点線を引く */
.widget .post-list li {
    border-bottom: 1px dashed #e0e0e0;
    padding: 4px 0; /* 上下に少し余白を持たせる */
}

/* 一番下の線は消す */
.widget .post-list li:last-child {
    border-bottom: none;
}

/* リンクテキストの装飾 */
.widget .post-list a {
    position: relative;
    padding: 2px 5px 2px 20px; /* 左側にアイコン用の余白20pxをあける */
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* リンクの左に小さな矢印アイコン（>）を付ける */
.widget .post-list a::before {
    content: '\203A'; /* 右向きの山括弧 */
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    color: #007bff; /* サイトカラーの青 */
    font-weight: bold;
    font-size: 1.2rem;
}

/* マウスを乗せた時の動き */
.widget .post-list a:hover {
    color: #007bff;
    padding-left: 25px; /* 右へ5pxスライドする */
}

/* カテゴリー一覧 */
.category-header { margin-bottom: 40px; padding-bottom: 20px; border-bottom: 3px solid #333; }
.category-header h2 { margin: 0; font-size: 1.5rem; }
.category-meta { color: #666; font-size: 0.9rem; margin-top: 5px; }
.category-list, .widget-category-list ul { list-style: none; padding: 0; }
.category-list li, .widget-category-list li { border-bottom: 1px dotted #ccc; padding: 0; }
.category-list li a, .widget-category-list li a { display: inline-flex; gap: 8px; padding: 8px 0; }
.category-list li a:hover, .widget-category-list li a:hover { color: #666; padding-left: 5px; transition: all 0.2s; }

/* ==========================================
    ■ コメント機能
   ========================================== */
#comment-area { margin-top: 50px; }
.widget-comment-list .no-comments { color: #888; font-style: italic; }
.comment-item { border-bottom: 1px solid #eee; padding: 15px 0; margin-bottom: 5px; }
.comment-item:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.comment-author { font-weight: bold; color: #333; }
.comment-date { color: #888; font-size: 0.85rem; }
.comment-body { white-space: pre-wrap; font-size: 0.95rem; line-height: 1.6; color: #444; }
.widget-comment-form { margin-top: 40px; border-top: 1px solid #eee; padding-top: 30px; }
.widget-comment-form .field { margin-bottom: 15px; }
.widget-comment-form label { display: block; margin-bottom: 5px; font-weight: bold; }
.widget-comment-form input[type="text"], 
.widget-comment-form textarea { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    box-sizing: border-box; 
    font-family: inherit;
}
.btn-submit { background: #333; color: #fff; padding: 12px 30px; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; transition: background 0.2s; }
.btn-submit:hover { background: #555; }
.alert-success { background: #e2f3e5; color: #155724; padding: 10px; margin: 20px 0; border-radius: 4px; border: 1px solid #c3e6cb; }
.hp-field { display: none; }

/* ==========================================
    ■ ウィジェット：メイン記事一覧（画像付き）
   ========================================== */
.widget-article-list-main { margin-bottom: 40px; }
.article-item { display: flex; gap: 20px; margin-bottom: 25px; padding-bottom: 25px; border-bottom: 1px solid #eee; align-items: flex-start; }
.article-thumb { width: 120px; height: 120px; flex-shrink: 0; overflow: hidden; border-radius: 6px; background: #f0f0f0; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-content { flex: 1; }
.article-date { font-size: 0.85rem; color: #888; }
.article-title { margin: 5px 0 0; font-size: 1.2rem; }
.article-title a { text-decoration: none; color: #333; font-weight: bold; }
.article-summary { font-size: 0.95em; color: #555; margin: 12px 0; line-height: 1.7; }
.article-more { text-align: right; }
.btn-read-more-small { display: inline-block; padding: 6px 18px; background: #fff; color: #444 !important; border: 1px solid #666; border-radius: 4px; font-size: 0.85em; text-decoration: none; transition: all 0.3s ease; }
.btn-read-more-small:hover { background: #666; color: #fff !important; border-color: #666; }

@media (max-width: 600px) {
    .article-item { flex-direction: column; gap: 15px; }
    .article-thumb { width: 100%; height: 180px; }
    .article-title { font-size: 1.1rem; }
    .article-more { text-align: left; }
}

/* ==========================================
    ■ ウィジェット：固定記事 (PinnedPost)
   ========================================== */
.widget-pinned-post { margin-bottom: 50px; }
.pinned-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #eee; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.pinned-image { position: relative; width: 100%; height: 250px; overflow: hidden; }
.pinned-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.pinned-card:hover .pinned-image img { transform: scale(1.05); }
.pinned-badge { position: absolute; top: 15px; left: 15px; background: #ff5252; color: #fff; padding: 4px 12px; font-size: 0.75rem; font-weight: bold; border-radius: 4px; z-index: 1; }
.pinned-body { padding: 25px; }
.pinned-title { font-size: 1.6rem; margin: 10px 0; }
.pinned-title a { text-decoration: none; color: #333; }
.pinned-summary { color: #666; font-size: 0.95rem; line-height: 1.7; margin-bottom: 20px; }
.btn-read-more { display: inline-block; padding: 10px 25px; background: #333; color: #fff; text-decoration: none; border-radius: 25px; font-size: 0.9rem; transition: background 0.3s; }
.btn-read-more:hover { background: #555; }

@media (min-width: 768px) {
    .pinned-card { flex-direction: row; align-items: center; }
    .pinned-image { width: 50%; height: 350px; }
    .pinned-body { width: 50%; padding: 40px; }
}

/* ==========================================
    ■ ウィジェット：固定記事のナビメニュー
   ========================================== */
.widget-page-navigation {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.widget-page-navigation .widget-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff; 
    color: #333;
    border-left: none;
    padding-left: 0;
}

.page-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-nav-list li {
    border-bottom: 1px solid #f0f0f0;
}

.page-nav-list li:last-child {
    border-bottom: none;
}

.page-nav-list li a {
    display: block;
    padding: 10px 5px;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    position: relative;
}

.page-nav-list li a:hover {
    color: #007bff;
    background-color: #f8f9fa;
    padding-left: 15px; 
}

.page-nav-list li a:hover::before {
    content: '>';
    position: absolute;
    left: 0;
    font-weight: bold;
}


/* =============================================
    ■ ウィジェット：フォームメール（ContactForm）
   ============================================= */
.contact-container {
    background: #fff;
    border: 1px solid #ddd;
    border-top: 5px solid #333; 
    border-radius: 4px;
    margin-top: 20px;
    overflow: hidden;
}

.contact-lead-text {
    padding: 25px 30px 10px;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #444;
}

.widget-contact-form {
    padding: 10px 30px 30px;
}

.contact-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.contact-table th, .contact-table td {
    padding: 15px;
    border: 1px solid #ddd;
}

.contact-table th {
    width: 30%;
    background: #f9f9f9;
    text-align: left;
    font-size: 0.9rem;
    color: #333;
}

.required {
    color: #d93025;
    font-size: 0.8rem;
    font-weight: normal;
}

.contact-table input[type="text"],
.contact-table input[type="email"],
.contact-table input[type="tel"],
.contact-table textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}

.contact-errors {
    color: #d93025;
    background: #fff5f5;
    padding: 15px;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    margin-bottom: 20px;
}

.form-submit {
    text-align: center;
    margin-top: 20px;
}

.btn-send {
    background: #007bff;
    color: #fff;
    padding: 15px 80px;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-send:hover {
    background: #0056b3;
}

.contact-success-msg {
    padding: 60px 20px;
    text-align: center;
    background-color: #fcfcfc;
}

.contact-success-msg p {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
}

.contact-success-msg::before {
    content: '✔';
    display: block;
    font-size: 3rem;
    color: #28a745;
    margin-bottom: 10px;
}

.btn-back-home {
    display: inline-block;
    background: #444;
    color: #fff;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-back-home:hover {
    background: #000;
}

.form-divider-space {
    display: none !important;
    visibility: hidden;
    height: 0;
    width: 0;
    overflow: hidden;
    position: absolute;
    left: -9999px;
}

@media (max-width: 600px) {
    .contact-table th, .contact-table td {
        display: block;
        width: 100%;
    }
    .contact-table th {
        border-bottom: none;
        padding-bottom: 5px;
    }
}

/* ==========================================
   ■ サイドバーのレイアウト保護
   ========================================== */
.sidebar {
    width: 300px;    /* PCでのサイドバーの幅を固定 */
    flex-shrink: 0;  /* メイン領域に押し潰されないようにする */
}

/* スマホ表示では横幅100%に戻す */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }
}

/* ==========================================
   ■ ウィジェット：記事リスト系のテキスト省略（Ellipsis）の完全版
   ========================================== */
/* リスト自体を横並び（Flexbox）にする */
.widget-category-posts .post-list li,
.widget-latest-posts ul li,
.widget-access-ranking .ranking-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px; /* テキストと日付の間の余白 */
}

/* リンク（タイトル）部分だけを省略させる */
.widget-category-posts .post-list li a,
.widget-latest-posts ul li a,
.widget-access-ranking .ranking-list li a {
    flex: 1;      /* 余ったスペースを最大限使う */
    min-width: 0; /* ★重要：Flexアイテム内でellipsisを効かせるための必須指定 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 日付やPV数などの付加情報は縮ませず、そのまま表示する */
.widget-latest-posts .date,
.widget-access-ranking .view-count {
    flex-shrink: 0; /* ここが縮むのを防ぐ */
    font-size: 0.85em;
    color: #888;
}
   
/* ==========================================
    ■ フッター
   ========================================== */
footer { background: #333; color: #fff; padding: 40px 0; margin-top: 60px; text-align: center; }
footer p { margin: 0; font-size: 0.9rem; }

/* ==========================================
    ■ チャット風吹き出し
   ========================================== */
.balloon-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin: 20px 0;
}

.balloon-left { flex-direction: row; }
.balloon-right { flex-direction: row-reverse; }

.balloon-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}
.balloon-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #eee;
}

.balloon-text {
    position: relative;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 10px;
    max-width: 70%;
    font-size: 0.95rem;
}

.balloon-left .balloon-text::before {
    content: "";
    position: absolute;
    top: 20px;
    left: -10px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 10px solid #f0f0f0;
}

.balloon-right .balloon-text::before {
    content: "";
    position: absolute;
    top: 20px;
    right: -10px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 10px solid #f0f0f0;
}

.balloon-color-blue .balloon-text { background-color: #e1f5fe; color: #01579b; }
.balloon-left.balloon-color-blue .balloon-text::before { border-right-color: #e1f5fe; }
.balloon-right.balloon-color-blue .balloon-text::before { border-left-color: #e1f5fe; }

.balloon-color-orange .balloon-text { background-color: #fff3e0; color: #e65100; }
.balloon-left.balloon-color-orange .balloon-text::before { border-right-color: #fff3e0; }
.balloon-right.balloon-color-orange .balloon-text::before { border-left-color: #fff3e0; }

.balloon-color-pink .balloon-text { background-color: #fce4ec; color: #880e4f; }
.balloon-left.balloon-color-pink .balloon-text::before { border-right-color: #fce4ec; }
.balloon-right.balloon-color-pink .balloon-text::before { border-left-color: #fce4ec; }

.balloon-color-green .balloon-text { background-color: #95ec69; color: #000; }
.balloon-left.balloon-color-green .balloon-text::before { border-right-color: #95ec69; }
.balloon-right.balloon-color-green .balloon-text::before { border-left-color: #95ec69; }

/* ==========================================
    ■ 蛍光ペン（マーカー）
   ========================================== */
.marker-yellow { background: linear-gradient(transparent 60%, #fff352 60%); }
.marker-pink { background: linear-gradient(transparent 60%, #ffc0cb 60%); }
.marker-green { background: linear-gradient(transparent 60%, #95ec69 60%); }

/* ==========================================
    ■ ボタン（カスタム作成したボタン）
   ========================================== */
.custom-btn-wrapper {
    text-align: center;
    margin: 25px 0;
}

.custom-btn {
    display: inline-block;
    padding: 15px 35px;
    background-color: #007bff; 
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 50px; 
    font-weight: bold;
    box-shadow: 0 4px 0 #0056b3; 
    transition: all 0.2s;
}

.custom-btn:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0056b3;
}

.btn-align-left   { text-align: left; }
.btn-align-center { text-align: center; }
.btn-align-right  { text-align: right; }

.custom-btn.btn-red    { background-color: #e53935; box-shadow: 0 4px 0 #b71c1c; }
.custom-btn.btn-green  { background-color: #43a047; box-shadow: 0 4px 0 #1b5e20; }
.custom-btn.btn-orange { background-color: #fb8c00; box-shadow: 0 4px 0 #e65100; }

/* ==========================================
    ■ その他
   ========================================== */
.post-content h2, .post-content h3 {
    scroll-margin-top: 100px; 
}

/* ==========================================
   問題一覧のグリッド表示（カード型UI）
   ========================================== */
.puzzle-grid {
    display: grid;
    /* PCでは横に2列（または3列）、スマホでは自動的に1列になる魔法の指定 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.puzzle-card {
    display: block;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.puzzle-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
    border-color: #007bff;
}

.puzzle-card-header {
    background: #444; /* 現行サイトの黒いヘッダーを踏襲 */
    color: #ffffff;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 1.1rem;
}

.puzzle-card-body {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.avg-time {
    font-size: 0.9rem;
    color: #666;
}

.btn-play-small {
    color: #007bff;
    font-weight: bold;
    font-size: 0.95rem;
}
.puzzle-card:hover .btn-play-small {
    text-decoration: underline;
}

/* ==========================================
    ■ フロントエンド：タグバッジ
   ========================================== */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.tag-badge-front {
    display: inline-block;
    padding: 5px 12px;
    background: #e2e8f0; /* 薄いグレーブルー */
    color: #475569;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tag-badge-front:hover {
    background: var(--accent-color, #007bff);
    color: #fff;
    transform: translateY(-1px);
}

/* ==========================================
   トップページ
   ========================================== */
.top-layout {
    display: block;
}

.top-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: stretch;
    padding: 32px;
    margin-bottom: 28px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(0, 123, 255, 0.18), transparent 36%),
        linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border: 1px solid #dcecff;
}

.top-hero-copy,
.top-hero-panel {
    min-width: 0;
}

.top-kicker {
    margin: 0 0 8px;
    color: #007bff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.top-hero h1 {
    margin: 0 0 16px;
    color: #102033;
    font-size: clamp(1.9rem, 3.4vw, 2.8rem);
    line-height: 1.2;
}

.top-hero-copy p:not(.top-kicker) {
    margin: 0;
    max-width: 680px;
    color: #475569;
    font-size: 1.05rem;
}

.top-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    min-width: 0;
}

.top-primary-button,
.top-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    box-sizing: border-box;
}

.top-primary-button {
    background: #007bff;
    color: #fff;
    box-shadow: 0 4px 0 #0056b3;
}

.top-secondary-button {
    background: #fff;
    color: #007bff;
    border: 1px solid #b8d8ff;
}

.top-hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    border-radius: 16px;
    background: #1a202c;
    color: #fff;
    box-shadow: 0 10px 28px rgba(26, 32, 44, 0.18);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

.top-hero-panel:hover {
    transform: translateY(-3px);
    border-color: #60a5fa;
    box-shadow: 0 14px 34px rgba(0, 123, 255, 0.22);
}

.top-hero-panel strong {
    font-size: 1.35rem;
}

.top-hero-date,
.top-hero-panel > span:not(.top-hero-panel-cta) {
    color: #cbd5e1;
    font-size: 0.95rem;
}

.top-hero-panel-cta {
    display: inline-flex;
    width: fit-content;
    margin-top: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff !important;
    font-size: 0.82rem;
    font-weight: 800;
}

.top-notice {
    padding: 20px 24px;
    margin-bottom: 30px;
    border-radius: 14px;
    background: #fff8e1;
    border-left: 6px solid #ff9800;
}

.top-notice h2,
.top-notice p {
    margin: 0;
}

.top-notice h2 {
    margin-bottom: 8px;
    color: #7c4a00;
    font-size: 1.2rem;
}

.top-section {
    margin-top: 40px;
}

.top-section-heading {
    margin-bottom: 18px;
}

.top-section-heading h2 {
    margin: 0 0 8px;
    color: #102033;
    font-size: 1.7rem;
}

.top-section-heading p:last-child {
    margin: 0;
    color: #64748b;
}

.top-daily-grid,
.top-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.top-daily-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 150px;
    padding: 18px;
    border-radius: 16px;
    text-decoration: none;
    color: #1a202c;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.top-daily-card:hover {
    transform: translateY(-3px);
    border-color: #007bff;
    box-shadow: 0 12px 24px rgba(0, 123, 255, 0.12);
}

.top-daily-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.top-daily-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff, #eef6ff);
    box-shadow: inset 0 0 0 1px rgba(0, 123, 255, 0.15);
    font-size: 1.45rem;
}

.top-daily-level {
    display: inline-flex;
    width: fit-content;
    padding: 3px 9px;
    border-radius: 999px;
    background: #e3f2fd;
    color: #0d47a1;
    font-size: 0.75rem;
    font-weight: 800;
}

.top-daily-card strong {
    font-size: 1.25rem;
}

.top-daily-meta {
    min-height: 40px;
    color: #64748b;
    font-size: 0.9rem;
}

.top-card-cta {
    margin-top: auto;
    color: #007bff;
    font-weight: 800;
}

.top-history-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.top-history-box {
    min-width: 0;
    padding: 18px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.top-history-box h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: #102033;
}

.top-history-icon {
    line-height: 1;
}

#top-bookmark-list > div,
#top-save-list > div {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)) !important;
    padding: 0 !important;
}

#top-bookmark-list .history-card,
#top-save-list .history-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#top-bookmark-list .history-card > div,
#top-save-list .history-card > div {
    min-width: 0;
}

.top-feature-grid article {
    padding: 22px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.top-feature-grid h3 {
    margin: 0 0 10px;
    color: #102033;
}

.top-feature-grid p {
    margin: 0;
    color: #475569;
}

.top-about-card {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid #dbeafe;
}

.top-about-image {
    margin: 0;
}

.top-about-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #dbeafe;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.top-about-text p {
    margin: 0 0 12px;
    color: #475569;
}

.top-about-text p:last-of-type {
    margin-bottom: 18px;
}

.top-text-link {
    display: inline-flex;
    align-items: center;
    color: #007bff;
    font-weight: 800;
    text-decoration: none;
}

.top-text-link:hover {
    text-decoration: underline;
}

.top-level-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.top-level-links a {
    display: block;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1a202c;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
}

.top-level-links a:hover {
    color: #007bff;
    border-color: #007bff;
    background: #fff;
}

@media (max-width: 900px) {
    .top-hero,
    .top-history-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-hero {
        padding: 22px;
    }

    .top-hero-actions {
        flex-direction: column;
    }

    .top-primary-button,
    .top-secondary-button {
        width: 100%;
        max-width: 100%;
    }

    .top-history-box {
        padding: 14px;
    }

    #top-bookmark-list > div,
    #top-save-list > div {
        grid-template-columns: 1fr !important;
    }

    #top-bookmark-list .history-card,
    #top-save-list .history-card {
        padding: 14px !important;
    }

    .top-about-card {
        grid-template-columns: 1fr;
    }

    .top-about-image {
        max-width: 180px;
    }
}
