/* ==========================================================================
   全体リセット ＆ ポップモダン基本ルール
   ========================================================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    line-height: 1.5;
    background-color: #f0f4f8; 
    color: #2d3748;
    margin: 0;
    padding: 0;
}

/* --- ヘッダー（1段・モダン） --- */
.site-header {
    background: #0f172a;
    border-bottom: 3px solid #3b82f6;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header-inner {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ブランドロゴ */
.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.brand-logo {
    font-size: 22px;
    line-height: 1;
}
.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.brand-name {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
    line-height: 1;
}
.brand-jp {
    color: #3b82f6;
    font-size: 16px;
}
.brand-sub {
    font-size: 10px;
    color: #64748b;
    letter-spacing: 0.3px;
    line-height: 1;
}

/* ナビゲーション */
.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.site-nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.site-nav-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
}

/* 検索フォーム */
.header-search-form {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    overflow: hidden;
    margin-left: 8px;
    height: 34px;
}
.header-search-input {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 13px;
    padding: 0 12px;
    width: 200px;
    outline: none;
    height: 100%;
}
.header-search-input::placeholder { color: #475569; }
.header-search-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    height: 100%;
    transition: background 0.15s;
    white-space: nowrap;
}
.header-search-btn:hover { background: #2563eb; }

/* ==========================================================================
   3カラム・丸みと優しさのあるグリッド構造
   ========================================================================== */
.portal-wrapper {
    display: flex;
    max-width: 1350px;
    margin: 15px auto;
    padding: 0 15px;
    gap: 15px;
}
.left-sidebar { width: 220px; flex-shrink: 0; }
.main-content { flex: 1; min-width: 500px; background: white; padding: 16px; border: none; box-shadow: 0 4px 12px rgba(0,0,0,0.03); border-radius: 12px; }
.right-sidebar { width: 240px; flex-shrink: 0; min-width: 0; max-width: 240px; position: relative; overflow: hidden; }

.menu-box, .news-box {
    background: white;
    padding: 12px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border-radius: 12px; 
    margin-bottom: 12px;
}
.menu-box h4, .news-box h4 { margin: 0 0 10px 0; font-size: 14.5px; color: #1e3a8a; border-left: 4px solid #3b82f6; padding-left: 8px; font-weight: bold; }
.vertical-menu-list { list-style: none; padding: 0; margin: 0; }
.vertical-link { display: block; padding: 6px 8px; color: #4a5568; text-decoration: none; font-size: 13.5px; font-weight: 600; border-radius: 6px; transition: all 0.2s; }
.vertical-link:hover { background: #eff6ff; color: #3b82f6; }

/* ==========================================================================
   🏛️ 官公庁・政党タグ：シック＆ダークカラーパレット（統合強制上書き版）
   ========================================================================== */

/* 1. 【中央・全般】デフォルトはマイルドで優しい薄型グレー */
.ministry-badge, .status-indicator, .status-tag {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
    display: inline-block;
}

/* 2. 【政党ボタン共通】枠線を消して文字を白抜きに統一 */
.party-link {
    color: #ffffff !important;
    border: none !important;
    font-weight: bold !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    display: inline-block;
    box-shadow: none !important;
}

/* 🏢 組織別の完全上書きシックカラー（中央・左側ペインすべてに一括適用） */

/* 内閣官房・首相官邸・政府全般：深いスレートグレー */
[class*="tag-内閣官房"], [class*="tag-首相官邸"], [data-agency*="内閣"], [data-agency*="官邸"] {
    background-color: #475569 !important;
    color: #ffffff !important;
}

/* デジタル庁：ミッドナイトブルー */
[class*="tag-デジタル庁"], [data-agency*="デジタル"] {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

/* 自民党：深みのあるバーガンディワイン */
[class*="tag-自民"], [class*="tag-自由民主"], [href*="q=自民"], [href*="q=自由民主"] {
    background-color: #9f1239 !important;
    color: #ffffff !important;
}

/* 公明党：深みのあるディープティール（青緑） */
[class*="tag-公明"], [href*="q=公明"] {
    background-color: #115e59 !important;
    color: #ffffff !important;
}

/* 防衛省：渋みのあるダークネイビー */
[class*="tag-防衛省"], [data-agency*="防衛"] {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
}

/* 外務省：落ち着いたクラシックブルー */
[class*="tag-外務省"], [data-agency*="外務"] {
    background-color: #0369a1 !important;
    color: #ffffff !important;
}

/* その他政党（立憲・維新・国民・共産など）：彩度を落としたスレートグレー */
[href*="q=立憲"], [href*="q=維新"], [href*="q=国民"], [href*="q=共産"] {
    background-color: #64748b !important;
    color: #ffffff !important;
}

/* ==========================================================================
   中央ペイン：コンテンツ装飾
   ========================================================================== */
.welcome-banner { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 8px 12px; margin-bottom: 12px; border-radius: 6px; }
.welcome-banner h2 { margin: 0; font-size: 14px; color: #166534; font-weight: bold; }
.search-bar-box { display: none; }
.content-section h3 { font-size: 14px; color: #1e3a8a; margin: 0 0 12px 0; padding-bottom: 6px; border-bottom: 2px solid #3b82f6; }

.project-card-large {
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    border-radius: 12px; 
    background: #ffffff;
    position: relative;
    margin-bottom: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02), 0 1px 3px rgba(0,0,0,0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}
.project-card-large:hover {
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(59,130,246,0.08);
}
.project-card-large h4 { margin: 6px 0 6px 0; font-size: 20px; font-weight: bold; padding-right: 75px; line-height: 1.4; }
.project-card-large h4 a { color: #1e3a8a; text-decoration: none; }
.project-card-large h4 a:hover { color: #3b82f6; text-decoration: underline; }

.status-indicator { position: absolute; top: 14px; right: 16px; }
.project-card-large p { margin: 0 0 10px 0; font-size: 12px; color: #64748b; line-height: 1.5; }

.card-latest-step-box {
    background-color: #f8fafc;
    border-left: 4px solid #3b82f6; 
    padding: 6px 10px;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.step-label { font-weight: bold; color: #64748b; flex-shrink: 0; }
.step-title { color: #334155; font-weight: 600; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }

.card-footer { text-align: right; margin-top: 6px; }
.view-timeline-btn { font-size: 12px; color: #3b82f6; text-decoration: none; font-weight: bold; background: #eff6ff; padding: 4px 10px; border-radius: 20px; display: inline-block; transition: all 0.2s; }
.view-timeline-btn:hover { background: #3b82f6; color: white; }

.compact-news-list li { margin-bottom: 6px; font-size: 12px; padding-bottom: 6px; }

/* ==========================================================================
   💰 広告枠レイアウト
   ========================================================================== */
.ad-container { width: 100%; margin-bottom: 12px; }
.ad-wrapper-300x250-premium {
    width: 100%; 
    background: #ffffff; 
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border-radius: 12px; 
    padding: 6px; 
    box-sizing: border-box;
}
.ad-wrapper-left-sidebar {
    width: 100%; 
    background: #ffffff; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border-radius: 12px; 
    padding: 6px; 
    box-sizing: border-box; 
    margin-top: 12px;
}
.ad-label { display: block; font-size: 9px; color: #94a3b8; text-align: center; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; }

.ad-placeholder-premium, .ad-placeholder-left {
    height: 140px; 
    background-color: #f8fafc; 
    color: #1e3a8a; 
    border: 1px dashed #cbd5e0; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    border-radius: 6px; 
    padding: 10px; 
    box-sizing: border-box;
}
.ad-placeholder-premium h4, .ad-placeholder-left h4 { margin: 0 0 4px 0; font-size: 13.5px; font-weight: bold; color: #1e3a8a; }
.ad-placeholder-premium p, .ad-placeholder-left p { margin: 0 0 8px 0; font-size: 11.5px; color: #64748b; line-height: 1.4; }
.ad-btn-demo { display: inline-block; background: #3b82f6; color: white; padding: 4px 14px; font-size: 11px; font-weight: bold; border-radius: 20px; text-decoration: none; transition: all 0.2s; }
.ad-btn-demo:hover { background: #1d4ed8; }

.portal-footer { padding: 16px; margin-top: 20px; background: white; text-align: center; font-size: 12px; color: #64748b; box-shadow: 0 -2px 8px rgba(0,0,0,0.02); }

/* ==========================================================================
   用語ツールチップ（glossary.js と連動）
   ========================================================================== */
.glossary-term {
    border-bottom: 1px dotted #93c5fd;
    cursor: help;
    position: relative;
    color: inherit;
}
.glossary-term::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
    padding: 8px 12px;
    border-radius: 8px;
    width: 260px;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
/* 吹き出し三角 */
.glossary-term::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 9999;
}
.glossary-term:hover::after,
.glossary-term:hover::before {
    opacity: 1;
}

.status-success {
font-size: 11px;
font-weight: bold;
background-color: #e6fffa;
color: #234e52;
padding: 2px 6px;
border-radius: 4px;
border: 1px solid #b2f5ea;
display: inline-block;
white-space: nowrap;
}

.status-progress {
font-size: 11px;
font-weight: bold;
background-color: #ebf8ff;
color: #2b6cb0;
padding: 2px 6px;
border-radius: 4px;
border: 1px solid #bee3f8;
display: inline-block;
white-space: nowrap;
}

.status-planning {
font-size: 11px;
font-weight: bold;
background-color: #fffaf0;
color: #dd6b20;
padding: 2px 6px;
border-radius: 4px;
border: 1px solid #fbd38d;
display: inline-block;
white-space: nowrap;
}

.status-default {
font-size: 11px;
font-weight: bold;
background-color: #edf2f7;
color: #4a5568;
padding: 2px 6px;
border-radius: 4px;
border: 1px solid #e2e8f0;
display: inline-block;
white-space: nowrap;
}

/* ==========================================================================
   モック広告（公開後はAdSenseに差し替え）
   ========================================================================== */
.mock-ad-wrap {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: block;
}
.mock-ad-wrap * {
    max-width: 100%;
    box-sizing: border-box;
}
.mock-ad-pr-label {
    text-align: right;
    font-size: 9px;
    color: #94a3b8;
    padding: 4px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.mock-ad-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    padding: 16px 16px 14px;
}
.mock-ad-brand {
    font-size: 10px;
    color: #93c5fd;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.mock-ad-headline {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.35;
}
.mock-ad-body {
    padding: 14px 16px;
}
.mock-ad-copy {
    font-size: 12px;
    color: #475569;
    line-height: 1.65;
    margin: 0 0 12px 0;
}
.mock-ad-cta {
    display: block;
    background: #2563eb;
    color: white;
    text-align: center;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: default;
    letter-spacing: 0.3px;
}
.mock-ad-footer {
    text-align: center;
    font-size: 9px;
    color: #cbd5e1;
    padding: 6px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   モバイル対応（レスポンシブ）
   ========================================================================== */

/* タブレット〜中サイズ: 右サイドバーを非表示 */
@media (max-width: 1100px) {
    .right-sidebar { display: none; }
    .main-content { min-width: 0; }
}

/* モバイル: 縦積みレイアウト */
@media (max-width: 768px) {

    /* ── ヘッダー ── */
    .site-header-inner {
        height: auto;
        min-height: 50px;
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .brand-sub      { display: none; }
    .brand-name     { font-size: 17px; }
    .brand-logo     { font-size: 18px; }
    .site-nav-link  { display: none; }
    .header-search-form  { margin-left: 0; flex: 1; min-width: 0; }
    .header-search-input { width: 100%; flex: 1; min-width: 0; }

    /* ── 3カラム → 縦積み ── */
    .portal-wrapper {
        flex-direction: column;
        padding: 0 8px;
        margin: 8px auto;
        gap: 8px;
    }
    .main-content {
        order: 1;
        min-width: 0;
        width: 100%;
        padding: 12px;
        border-radius: 8px;
    }
    .left-sidebar {
        order: 2;
        width: 100%;
    }
    .right-sidebar { display: none; }

    /* 左サイドバーのメニューボックスを横並びに */
    .left-sidebar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .left-sidebar .menu-box,
    .left-sidebar .news-box,
    .left-sidebar .ad-container {
        flex: 1;
        min-width: 140px;
        margin-bottom: 0;
    }

    /* ── 注目法案カード: 1列 ── */
    .featured-grid { grid-template-columns: 1fr !important; }
    .bill-card { height: auto; min-height: 90px; }

    /* ── 立法プロセスバー ── */
    .law-label { font-size: 8px; }
    .law-progress-wrap { padding: 10px 12px 22px; }

    /* ── タイムライン ── */
    .utl-left  { min-width: 70px; }
    .utl-title { font-size: 14px; }

    /* ── 政策詳細見出し ── */
    .project-header-box h2 { font-size: 18px; }

    /* ── フッター ── */
    .portal-footer { font-size: 11px; padding: 12px; }
}

/* 小型スマホ（〜480px）*/
@media (max-width: 480px) {
    .main-content { padding: 10px; }

    /* プロセスバー: ラベル非表示・高さ節約 */
    .law-label       { display: none; }
    .law-progress-wrap { padding: 10px 12px 12px; }
    .law-dot         { width: 10px; height: 10px; }
    .law-step.lp-active .law-dot { width: 14px; height: 14px; }

    /* タイムライン: 左カラムさらに縮小 */
    .utl-left  { min-width: 56px; }
    .utl-date  { font-size: 9px; }
    .utl-badge { font-size: 8px; padding: 1px 4px; }
    .utl-title { font-size: 13px; }

    /* 縦接続線を非表示 */
    .utl-connector { display: none; }

    /* 左サイドバーを縦積みに戻す */
    .left-sidebar { flex-direction: column; }
}
