/* ============================================================
   基本リセット
============================================================ */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}



#cardContainer{
    margin-top: 90px;
    box-sizing:border-box;
    
}



/* ============================================================
   PC フィルタタブ
============================================================ */
.filter-tab {
    position: fixed;
    left: 20px;
    width: 22%;
    padding: 6px 0;
    background: #dce7f5;
    text-align: center;
    font-weight: bold;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px 8px 14px 14px;

    z-index: 1101;
}

/* ============================================================
   PC カテゴリブロック
============================================================ */
.cat-block {
    display: grid;
    grid-template-columns: 70px 90px 1fr;
    align-items: center;

    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fafafa;

    padding: 6px 10px;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
}

.cat-label {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.cat-value {
    font-size: 20px;
    font-weight: 700;
    color: #0066ff;
    text-align: left;
}

.cat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ============================================================
   PC ボタン（メタリック）
============================================================ */
.cat-buttons button:not(.party-btn),
.filter-clear-btn,
.color-btn {
    flex: 0 0 85px;
    max-width: 85px;
    min-width: 85px;
    padding: 4px 0;
    border-radius: 8px;

    background: linear-gradient(145deg, #f0f0f0, #d6d6d6);
    border: 1px solid #888;
    box-shadow:
        inset 1px 1px 2px rgba(255,255,255,0.7),
        inset -1px -1px 2px rgba(0,0,0,0.15);

    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
    cursor: pointer;
}

/* ============================================================
   政党ボタン色
============================================================ */
.cat-buttons .party-btn[data-party="自民"]  { background-color: #ffe0e0 !important; }
.cat-buttons .party-btn[data-party="維新"]  { background-color: #e0ffe0 !important; }
.cat-buttons .party-btn[data-party="中道"]  { background-color: #e0f0ff !important; }
.cat-buttons .party-btn[data-party="国民"]  { background-color: #fff0e0 !important; }
.cat-buttons .party-btn[data-party="参政"]  { background-color: #f0e0ff !important; }
.cat-buttons .party-btn[data-party="みらい"]{ background-color: #e0ffff !important; }
.cat-buttons .party-btn[data-party="共産"]  { background-color: #f23f3f !important; }
.cat-buttons .party-btn[data-party="無"]    { background-color: #f5f5f5 !important; }

/* ============================================================
   active 状態
============================================================ */
button.active {
    background: linear-gradient(145deg, #d0d0d0, #f8f8f8);
    box-shadow:
        inset -1px -1px 2px rgba(255,255,255,0.8),
        inset 2px 2px 3px rgba(0,0,0,0.25);
    transform: translateY(1px);
    border-color: #444;
    color: #000;
    font-weight: 800;

    border-width: 3px !important;
    border-left-width: 6px !important;
    border-left-color: #0077ff !important;
    padding-left: 4px !important;
}

/* ============================================================
   色 ON/OFF（カード側）
============================================================ */
body.color-on .pt-jimin  { background-color: #ffe0e0 !important; }
body.color-on .pt-ishin  { background-color: #e0ffe0 !important; }
body.color-on .pt-chudo  { background-color: #e0f0ff !important; }
body.color-on .pt-kokumin{ background-color: #fff0e0 !important; }
body.color-on .pt-sansei { background-color: #f0e0ff !important; }
body.color-on .pt-mirai  { background-color: #e0ffff !important; }
body.color-on .pt-kyousan  { background-color: #f1370d !important; }
body.color-on .pt-mu     { background-color: #f5f5f5 !important; }

body:not(.color-on) .container {
    background: #fff !important;
}

/* ============================================================
   カード本体（PC）
============================================================ */
.container {
    border: 1px solid #000;
    padding: 4px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-width: 0;
}

/* ============================================================
   画像ブロック
============================================================ */
.ssss {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin: 1px auto;
}

.src {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* ============================================================
   ruby 行
============================================================ */
.ruby-inner-row {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.left-block {
    min-width: 0;
}

.right-block {
    min-width: 0;
}

.tx1,
.tx2,
.right-line {
    white-space: nowrap;
    min-width: 0;
}

/* ============================================================
   ruby-bottom
============================================================ */
.ruby-bottom {
    width: 100%;
    margin-top: 6px;
}

.bt-job,
.tx-call {
    text-align: center;
    color: #0055ff;
    font-size: 18px;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: break-word;
}
.tx-call-row {
    display:flex;
    justify-content:center;
    align-items:baseline;
    gap:0.8em;
}
.bt-concurrent-roles {
    font-size: 12px;
    opacity: 0.9;
    white-space: normal;
    overflow-wrap: break-word;
    text-align: center;
    white-space: pre-line;
}

/* ============================================================
   PC 列レイアウト
============================================================ */
:root {
    --gap: 2px;
}

#cardContainer {
    display: grid;
    gap: var(--gap);
    padding: 0 var(--gap);
    box-sizing: border-box;
}

/* PC 最小幅（700〜1000px）→ 3 列 */
@media (min-width: 701px) and (max-width: 1000px) {
    #cardContainer {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* PC 中間幅 → 4 列 */
@media (min-width: 1002px) and (max-width: 1400px) {
    #cardContainer {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* PC 大画面 → 8 列 */
@media (min-width: 1401px) {
    #cardContainer {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* ============================================================
   📱 スマホ（700px 以下）→ 3 列固定
============================================================ */
@media (max-width: 700px) {
    #cardContainer {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2px !important;
        padding: 2px !important;
    }

    .tx2 { font-size: clamp(8px, 2.2vw, 13px); line-height: 1.05; }
    .tx1 { font-size: clamp(6px, 1.8vw, 10px); line-height: 1.05; }
    .right-line { font-size: clamp(6px, 1.8vw, 10px); line-height: 1.05; }
    .bt-job,
    .tx-call { font-size: clamp(8px, 2.2vw, 12px); }
    .bt-concurrent-roles { font-size: clamp(6px, 1.6vw, 10px); }
    ruby { font-size: clamp(6px, 1.6vw, 10px); line-height: 1.05; }
}

/* ============================================================
   📱 スマホ横 → 8 列
============================================================ */
@media (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
    #cardContainer {
        grid-template-columns: repeat(8, 1fr) !important;
    }
}

#retryFailedImagesBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
