/* =========================================
   基本設定 & リセット
   ========================================= */
:root {
    --bg-color: #f9f9f9;
    --text-main: #111;
    --text-sub: #444;
    --font-base: 'Zen Old Mincho', serif;
    --border-color: #ddd;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: opacity 0.2s; }
a:hover { opacity: 0.7; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; vertical-align: bottom; }
* { box-sizing: border-box; }

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   ヘッダー
   ========================================= */
.site-header {
    text-align: center;
    padding: 50px 0 40px;
}

.site-header h1 {
    font-weight: 900;
    font-size: 2.8rem;
    margin: 0;
    letter-spacing: 0.05em;
    color: #000;
}

/* =========================================
   トップページ (リスト部分)
   ========================================= */
.era-section { margin-bottom: 40px; }

.era-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-left: 0;
    color: #000;
    line-height: 1.2;
}

.case-link { display: block; margin-bottom: 25px; }

.case-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.case-thumb { flex: 0 0 160px; width: 160px; }
.case-thumb img {
    width: 100%; height: 100px; object-fit: cover;
    border-radius: 2px;
    filter: sepia(10%) grayscale(30%) contrast(1.1);
}
.no-image {
    width: 100%; height: 100px; background: #e0e0e0;
    display: flex; align-items: center; justify-content: center;
    color: #888; font-size: 0.7rem; font-weight: bold;
}

.case-info { flex: 1; display: flex; flex-direction: column; }

.case-title {
    font-size: 1.25rem; font-weight: 800;
    margin: 0 0 5px 0; line-height: 1.3; color: #000;
}
.case-meta {
    font-size: 0.9rem; color: var(--text-main);
    margin-bottom: 5px; font-weight: 500;
}
.case-desc {
    font-size: 0.9rem; color: #333; margin: 0;
    line-height: 1.6; text-align: justify; font-weight: 500;
}
.no-data { font-size: 0.9rem; color: #777; padding: 10px 0; }


/* =========================================
   詳細ページ (ここを追加・強化)
   ========================================= */
.detail-wrapper {
    margin-top: 20px;
    /* background: #fff; */
    padding: 40px;
    /* box-shadow: 0 2px 10px rgba(0,0,0,0.03); */
}

.crime-detail {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
    align-items: flex-start;
    border-bottom: 1px solid #eee;
    padding-bottom: 40px;
}

.detail-main { flex: 1; }

/* タイトルを画像のように巨大に */
.detail-title {
    font-size: 2.8rem; 
    font-weight: 900;
    margin: 0 0 10px 0;
    line-height: 1.1;
    color: #000;
    letter-spacing: -0.02em;
}

.detail-date {
    font-size: 1.0rem;
    margin: 0 0 25px 0;
    color: #333;
    font-weight: 600;
}

.detail-body {
    font-size: 1.05rem;
    line-height: 1.9;
    text-align: justify;
    color: #111;
}

/* 右側の写真 */
.detail-visual {
    flex: 0 0 280px;
}
.detail-visual img {
    width: 100%;
    height: auto;
    /* filter: grayscale(100%) contrast(1.1); */
    display: block;
}

/* === 掲示板 (スレッド) エリア === */
.bbs-heading {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #000;
}

.post-list {
    border-top: 1px solid var(--border-color);
}

.post-row {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 10px;
    background-color: #fafafa;
}
/* 偶数番目を少し色変える（ストライプ）場合は以下を有効化 */
/* .post-row:nth-child(even) { background-color: #fff; } */

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.95rem;
    color: #000;
    margin-bottom: 8px;
    font-family: sans-serif;
}

.post-left {
    display: flex;
    gap: 15px;
    align-items: baseline;
}

.post-num { font-weight: bold; font-size: 1.1rem; }
.post-name { font-weight: bold; }
.post-time { color: #555; font-size: 0.9rem; }

.post-right {
    font-size: 0.9rem;
    color: #333;
}

.post-content {
    padding-left: 25px;
    font-size: 1.0rem;
    line-height: 1.6;
    color: #111;
    font-weight: 500;
}






.post-actions {
    margin-top: 10px;
    display: flex;
    gap: 15px;
    padding-left: 25px;
}

.btn-like,
.btn-report {
    border: 1px solid #ccc;
    background: #fff;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.2s;
}

/* ホバー */
.btn-like:hover {
    background: #ffe9e9;
    border-color: #ff8f8f;
}

.btn-report:hover {
    background: #fff4d6;
    border-color: #ffbb55;
}





/* === 投稿フォーム === */
.post-form-area {
    margin-top: 50px;
    background: #f0f0f0;
    padding: 30px;
}
.post-form-area h3 {
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 20px;
}
.form-row { margin-bottom: 15px; }

/* DjangoフォームのウィジェットをCSSで強制整形 */
.post-form-area input[type="text"],
.post-form-area textarea {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    font-family: var(--font-base);
}
.post-form-area textarea { height: 100px; resize: vertical; }

.btn-submit {
    background: #000;
    color: #fff;
    border: none;
    padding: 10px 30px;
    font-size: 1rem;
    cursor: pointer;
    font-family: var(--font-base);
}
.btn-submit:hover { background: #333; }


/* =========================================
   フッター
   ========================================= */
.site-footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid #eaeaea;
    /* background-color: #fff; */
}
.site-footer p {
    margin: 0;
    /* color: #999; */
    font-size: 1rem;
    font-weight: 400;
}

/* =========================================
   レスポンシブ
   ========================================= */
@media (max-width: 768px) {
    .site-header h1 { font-size: 2.0rem; }
    .container { width: 100%; padding: 0 15px; }
    
    /* 詳細ページのスマホ対応 */
    .detail-wrapper { padding: 20px; }
    .crime-detail { flex-direction: column-reverse; gap: 20px; }
    .detail-visual { width: 100%; }
    .detail-title { font-size: 2.0rem; }
    
    /* 掲示板スマホ対応 */
    .post-header { flex-direction: column; gap: 5px; }
    .post-content { padding-left: 0; }
}










/* コメント数　閲覧数 */
.case-stats {
    font-size: 0.85rem;
    color: #444;
    margin-top: 5px;
    display: flex;
    gap: 12px;
}

.case-views, .case-comments {
    display: inline-block;
}

.detail-stats {
    margin: 10px 0 20px 0;
    font-size: 0.95rem;
    color: #333;
    display: flex;
    gap: 20px;
}







/* 論点 */
.discussion-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 40px 0 15px 0;
    color: #000;
}

.discussion-body {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #111;
    /* margin-bottom: 40px; */
    text-align: justify;
}







/* アンケート */
.poll-box {
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    margin: 30px 0;
}

.poll-question {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.poll-choices button {
    margin-right: 10px;
    padding: 6px 14px;
    border: 1px solid #666;
    background: #fff;
    cursor: pointer;
}

.poll-choices button:hover {
    background: #eee;
}

.poll-result-row {
    margin-top: 8px;
    font-size: 0.95rem;
}











/* 関連事件 */
.related-section {
    margin: 40px 0;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #ddd;
}

.related-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.related-list {
    list-style: none;
    padding-left: 0;
}

.related-list li {
    margin-bottom: 8px;
}

.related-list a:hover {
    opacity: 0.7;
}







/* タイトル・日付・PV・コメントを1列でバランスよく表示 */
.case-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;             /* ← 適度な間隔 */
    margin-bottom: 12px;
    line-height: 1.5;
}

/* タイトルの右余白を少しだけにする */
.case-line .case-title {
    font-weight: 800;
    font-size: 1.15rem;
    margin-right: 12px;    /* ← auto をやめて適度な余白に */
    white-space: nowrap;   /* ← タイトルが折れにくくなる（任意） */
}

/* 各項目 */
.case-line span {
    font-size: 0.95rem;
    color: #333;
}









/* ===== ランキング ===== */
.ranking-section {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 40px;
}

.ranking-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.ranking-list {
    list-style: none;
    padding: 0;
}

.ranking-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item a {
    display: flex;
    align-items: center;
    gap: 20px;
}

.rank-number {
    font-weight: 700;
    width: 40px;
}

.rank-title {
    flex: 1;
    font-weight: 600;
}

.rank-views, .rank-comments {
    font-size: 0.9rem;
    color: #444;
}









.sort-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.sort-buttons a {
    padding: 6px 14px;
    border: 1px solid #888;
    border-radius: 4px;
    background: #f8f8f8;
    font-size: 0.9rem;
}

.sort-buttons a.active {
    background: #333;
    color: #fff;
    border-color: #333;
}





/* 各元号ごとのソートボタン */
.era-sort {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.era-sort-btn {
    padding: 4px 10px;
    border: 1px solid #999;
    background: #f8f8f8;
    border-radius: 3px;
    cursor: pointer;
}

.era-sort-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}










/* 事件名の下の PV / コメント */
.detail-sub-stats {
    margin-top: 8px;
    font-size: 1.05rem;
    color: #333;
    display: flex;
    gap: 18px;
    font-weight: 600;
}

/* 発生日 */
.detail-date-line {
    margin: 8px 0 20px 0;
    font-size: 1.05rem;
    color: #333;
    font-weight: 600;
}












/* ===== アンケートの2択を大きく均等に配置 ===== */
.poll-choices-grid {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 15px;
}

.poll-choice-wrapper {
    flex: 1;
    text-align: center;
}

/* 大きなボタン */
.poll-choice-btn {
    width: 100%;
    padding: 18px 10px;
    font-size: 1.1rem;
    background: #fff;
    border: 2px solid #666;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 700;
}

.poll-choice-btn:hover {
    background: #eee;
}

/* 票数表示（ボタンの下） */
.poll-count-display {
    margin-top: 8px;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

@media (max-width: 600px) {
    .poll-choices-grid {
        flex-direction: column;
        gap: 15px;
    }
}
