:root {
    --bg-color: #0f0f0f;
    --card-bg: #1a1a1a;
    --accent-red: #d32f2f;
    --text-main: #e0e0e0;
    --text-sub: #999;
}

body {
    margin: 0; background: var(--bg-color); color: var(--text-main);
    font-family: sans-serif; line-height: 1.7;
}

header {
    background: #000; border-bottom: 4px solid var(--accent-red);
    padding: 30px; text-align: center;
}

.container {
    max-width: 1100px; margin: 30px auto; padding: 0 20px;
    display: flex; gap: 40px;
}

main { 
    flex: 3; 
    min-width: 0; 
    width: 100%;       /* 画面幅に強制的に合わせる */
    overflow: hidden;  /* 枠からはみ出るのを絶対に許さない */
}

.sidebar { flex: 1; }

/* 記事カード（一覧用共通設定） */
.post-item {
    background: var(--card-bg); padding: 20px; margin-bottom: 20px;
    border-radius: 4px; border-left: 4px solid var(--accent-red);
}

/* サムネイル画像がある場合だけ横並びにするレイアウト */
.post-item.has-thumb {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* サムネイル画像枠の調整 */
.post-thumbnail {
    flex: 0 0 150px; /* 画像の横幅を150pxに固定 */
    max-width: 150px;
    aspect-ratio: 16 / 9; /* 常に16:9を維持 */
    overflow: hidden;
    border-radius: 4px;
    background: #000;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 枠線に合わせて綺麗にトリミング */
    transition: transform 0.3s ease;
}

.post-thumbnail img:hover {
    transform: scale(1.05); /* ホバーした時に少し拡大するアニメーション */
}

/* テキスト部分の幅調整 */
.post-text {
    flex: 1;
    min-width: 0;
}

.post-item h2 { margin: 0 0 10px; font-size: 1.4rem; }
.post-item a { color: #fff; text-decoration: none; }
.post-item a:hover { color: var(--accent-red); }
.date-tag { font-size: 0.8rem; color: var(--text-sub); margin-bottom: 5px; }

/* 記事本文ページ */
.article-full h1 { font-size: 2.2rem; border-bottom: 1px solid #333; padding-bottom: 10px; }
.article-body { margin-top: 20px; font-size: 1.1rem; }
.article-body p { margin-bottom: 1.5em; }

.article-body h2 {
    position: relative;
    padding: 0.5rem 0 0.5rem 1rem;
    margin: 2.5rem 0 1.5rem;
    font-size: 1.6rem;
    border-left: 5px solid var(--accent-red); /* 前回の青から赤に戻し統一 */
    border-bottom: 1px solid #333; 
    color: #fff;
}

.article-body img {
    max-width: 100%;  /* 画面の幅を超えそうになったら自動縮小する */
    height: auto;     /* 縦横比を絶対に崩さない */
    display: block;
}

/* サイドバー */
.sidebar h3 { font-size: 1rem; color: var(--accent-red); border-bottom: 1px solid #333; margin-bottom: 10px; }
.sidebar ul { list-style: none; padding: 0; margin-bottom: 30px; }
.sidebar li { padding: 5px 0; border-bottom: 1px solid #222; font-size: 0.9rem; }
.sidebar a { color: var(--text-main); text-decoration: none; }
.sidebar a:hover { color: var(--accent-red); }

/* レスポンシブ */
@media (max-width: 800px) {
    .container { flex-direction: column; }
    .sidebar { order: 2; }
    
    /* スマホ画面ではサムネイルを上、タイトルを下にする（縦並び） */
    .post-item.has-thumb {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .post-thumbnail {
        width: 100%;
        max-width: 100%;
        flex: none;
    }

}

/* サイドバーのサブカテゴリ用スタイル */
.sub-menu {
    list-style: none;
    padding-left: 15px; 
    margin-top: 5px;
    font-size: 0.85rem;
}
.sub-menu li {
    border-bottom: none; 
    padding: 2px 0;
}
.sub-menu a {
    color: var(--text-sub); 
}
.sub-menu a:hover {
    color: var(--accent-red);
}

/* ==========================================
   追加：年齢確認ゲート（18禁対策）用のスタイル
   ========================================== */
#adult-gate {
    display: none; /* 初期状態は非表示 */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000000; /* コンテンツを見せないように完全な真っ黒背景 */
    z-index: 99999;     /* 最前面に配置 */
}

.gate-box {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 8px;
    border: 2px solid var(--accent-red); /* モチーフである赤枠をアクセントに */
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    box-sizing: border-box;
}

.gate-box h2 {
    color: #fff;
    margin-top: 0;
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.gate-box p {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.gate-box .gate-question {
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 30px 0 20px;
}

.gate-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.gate-buttons button {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    width: 100%;
    max-width: 160px;
}

/* YESボタン（警告色の赤） */
#gate-yes-btn {
    background: var(--accent-red);
    color: #fff;
}
#gate-yes-btn:hover {
    background: #b71c1c;
    transform: scale(1.03);
}

/* NOボタン（落ち着いたグレー） */
#gate-no-btn {
    background: #444;
    color: #fff;
}
#gate-no-btn:hover {
    background: #555;
    transform: scale(1.03);
}

/* スマホ用の微調整 */
@media (max-width: 480px) {
    .gate-box { padding: 30px 20px; }
    .gate-buttons { flex-direction: column; gap: 10px; align-items: center; }
    .gate-buttons button { max-width: 100%; }
}