/* =========================================
   らくパス 共通デザイン（孫ページ・全幅最適化版）
   ========================================= */

/* --- ① 全体設定：外側の無駄な余白を徹底排除 --- */
body {
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    line-height: 1.5;
}

.mago-container {
    /* 🚀 左右の余白を最小限（8px）にして、カードの横幅を最大化 */
    padding: 10px 8px; 
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* --- ② ヘッダー --- */
.mago-header {
    background: #fff;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ddd;
    position: sticky; top: 0;
    z-index: 100;
}

.back-arrow {
    font-size: 2.2rem;
    text-decoration: none;
    color: #f10ae6;
    margin-right: 12px;
    line-height: 1;
}

.mago-title {
    font-size: 1rem;
    font-weight: 800;
}

/* --- ③ 🛡️ 武器セクション（ピンク枠 & ボリューム感維持） --- */
.section-buki {
    background: #fff;
    border-radius: 15px;
    padding: 18px 15px;      /* 左右を少しだけ絞って、文字幅を確保 */
    margin-bottom: 25px;
    border: 2px solid #f10ae6; 
    box-shadow: 0 4px 12px rgba(241, 10, 230, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.buki-toggle-trigger {
    padding: 5px 0;
    cursor: pointer;
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.buki-content {
    display: none;
    margin-top: 20px;
}

.section-buki:not(.buki-closed) .buki-content {
    display: block;
}

.buki-title {
    display: inline-block;
    font-size: 1.05rem;
    color: #000;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.4;
}

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

.buki-list li {
    position: relative;
    padding-left: 1.2em;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.buki-list li::before {
    content: "●";
    position: absolute; left: 0;
    color: #f10ae6; font-size: 0.8em;
    top: 0.1em;
}

/* --- 💡 免責事項：画面幅に合わせて自動リサイズ（絶対に1行） --- */
.disclaimer {
    /* 🚀 画面幅（vw）に合わせてサイズを変える設定 */
    /* 最小10px、最大11pxの間で、画面幅(3vw)に応じて動く */
    font-size: clamp(10px, 3vw, 11px) !important;
    
    color: #94a3b8 !important;
    text-align: center;
    margin: 5px 0 20px 0 !important;
    padding: 0 5px;
    line-height: 1.4;
    font-weight: normal !important;

    /* 🚀 1行表示を死守する設定 */
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: -0.03em; /* 念のため少し詰める */
}

/* --- ④ 📝 問題カード：極限・全幅表示版 --- */
.q-card {
    background: #fff;
    border-radius: 15px;
    /* 🚀 左右パディングをさらに半分（4px）へ。ほぼ端っこです */
    padding: 20px 4px; 
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
    box-sizing: border-box;
}

.q-text { 
    font-weight: bold; 
    font-size: 16px !important; 
    margin-bottom: 15px; 
    line-height: 1.6;
    /* 🚀 左右の余白を完全にゼロに */
    padding: 0; 
    margin-left: 4px;
    margin-right: 4px;
}

.q-options {
    margin: 15px 4px 25px 4px; /* 🚀 左右に最低限の4pxだけ確保 */
    padding: 0;
    line-height: 1.8;
    color: #444;
    font-size: 15px !important; 
}

/* --- ⑤ ボタン & 解答エリア：黄色いボックスも限界まで広げる --- */
.q-answer-box {
    margin-top: 15px; 
    /* 🚀 内部の余白をさらに詰め、端まで文字を寄せる */
    padding: 12px 4px;
    background-color: #fffdf2;
    border-left: 3px solid #ffcc00; /* 線をさらに細くしてスペース確保 */
    border-radius: 8px;
    margin-left: 2px;
    margin-right: 2px;
}

.ans-exp {
    font-size: 16px !important;
    line-height: 1.7;
    padding: 0; /* 🚀 解説の左右余白もゼロ */
}

/* --- ⑦ 🏁 フッター --- */
.mago-footer-nav {
    margin-top: 50px;
    padding: 40px 15px;
    background-color: #fff;
    border-top: 1px solid #ddd;
    text-align: center;
}

.footer-links {
    margin-bottom: 15px;
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    white-space: nowrap;
}

/* --- ⑩ ブロックタイトル（漆黒・突き出し版） --- */
.block-title {
    display: inline-flex;
    align-items: center;
    font-size: 1rem !important;
    color: #fff !important;
    background: #333; 
    padding: 8px 20px 8px 15px;
    margin: 40px 0 20px -8px; /* 🚀 コンテナのpaddingに合わせて左に突き出す */
    font-weight: 800;
}

.block-title::before {
    content: "BLOCK ";
    font-size: 0.85rem;
    margin-right: 5px;
}

/* --- ⑧ 📢 広告エリア（中央寄せ確定版） --- */
.ad-container {
    margin: 10px 0 25px 0;
    text-align: center;      /* 子要素を中央寄せ */
    display: flex;
    flex-direction: column;
    align-items: center;     /* Flexboxでも中央に配置 */
    width: 100%;             /* 横幅いっぱい確保 */
}

.ad-label {
    font-size: 0.65rem;
    color: #999;
    margin-bottom: 4px;
    display: block;          /* 確実に一行占有 */
}

.ad-unit {
    width: 100%;
    max-width: 728px;        /* 🚀 広がりすぎ防止 */
    min-height: 100px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 0 auto;          /* 🚀 これで中央寄せを確実に */
}

/* =========================================
   6. 上付き・下付き文字の調整
   ========================================= */
/* 行間を崩さないための魔法の設定 */
sup, sub {
    font-size: 0.7em;      /* 少し小さくする */
    line-height: 0;        /* 行の高さに影響を与えない */
    position: relative;
    vertical-align: baseline;
}

/* 上付き（核種や指数）の位置調整 */
sup {
    top: -0.4em;           /* 上に持ち上げる */
    margin-left: 0.1em;    /* 文字との間隔を少し空ける */
}

/* 下付き（化学式など）の位置調整 */
sub {
    bottom: -0.2em;        /* 下に下げる */
    margin-left: 0.1em;    /* 文字との間隔を少し空ける */
}

/* 検索結果などの強調テキスト内でタグが目立ちすぎないように調整 */
.q-text sup, .q-options sup {
    font-weight: bold;     /* 指数もしっかり見えるように */
    color: inherit;        /* 親要素の色を引き継ぐ */
}

/* =========================================
   全ページ共通：フッター統一デザイン
   ========================================= */
.mago-footer-nav {
    margin-top: 50px;
    padding: 60px 15px 40px; /* 上部余白を多めにとり、コンテンツと分離 */
    background-color: #fff;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

/* 📢 広告エリア：ad-gen.js が中身を流し込む場所 */
.footer-ad-space {
    width: 100%;
    max-width: 728px;
    margin: 0 auto 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 内部の広告ユニットデザイン */
.ad-container {
    width: 100%;
    text-align: center;
}

.ad-label {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-bottom: 5px;
    display: block;
    letter-spacing: 0.1em;
}

.ad-unit {
    width: 100%;
    min-height: 100px;
    background: #f8fafc; /* 背景を少しだけグレーにして「枠」を意識 */
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* 🔗 法的リンク集（免責事項など） */
.footer-links {
    margin: 25px 0 15px;
    font-size: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.footer-links a {
    color: #64748b; /* 視認性の良いグレー */
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #f10ae6; /* ホバー時はブランドカラーのピンク */
}

.footer-separator {
    color: #e2e8f0;
    margin: 0; /* flexのgapを使うためセパレーター自体は非表示または幅0を推奨 */
}

/* © コピーライト */
.copyright {
    color: #cbd5e1;
    font-size: 0.7rem;
    margin-top: 15px;
    display: block;
    letter-spacing: 0.05em;
}