/**
 * でんけんマッスル 過去問一覧ページ専用CSS
 * 全科目共通（理論・機械・電力・法規）
 */

/* ==================== */
/* ページヘッダー */
/* ==================== */
.exam-hero {
    text-align: center;
    padding: 32px 20px 24px;
    margin-bottom: 32px;
    background: linear-gradient(135deg, var(--subject-color, #3498db), var(--subject-light, #5dade2));
    border-radius: 16px;
    color: #fff;
}

.exam-hero h1 {
    font-size: 1.5em;
    margin: 0 0 8px;
    color: #fff;
}

.exam-hero .exam-hero-sub {
    font-size: 0.9em;
    opacity: 0.9;
    margin: 0;
}

/* ==================== */
/* カテゴリ目次（グリッド） */
/* ==================== */
.exam-toc {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}

.exam-toc-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.25s ease;
    text-align: center;
}

.exam-toc-card:hover {
    border-color: var(--subject-color, #3498db);
    background: var(--subject-bg, #f0f8ff);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    text-decoration: none;
}

.exam-toc-icon {
    font-size: 1.6em;
    line-height: 1;
}

.exam-toc-label,
.exam-toc-name {
    font-weight: 700;
    font-size: 0.88em;
    color: #2c3e50;
    line-height: 1.3;
}

.exam-toc-count {
    font-size: 0.75em;
    color: #fff;
    background: var(--subject-color, #3498db);
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
}

/* ==================== */
/* カテゴリセクション */
/* ==================== */
.exam-category {
    margin-bottom: 40px;
    scroll-margin-top: 80px;
    background: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    position: static;
}

.exam-category::before {
    display: none;
}

.exam-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 16px 20px;
    background: var(--subject-color, #3498db);
    border-radius: 12px 12px 0 0;
    color: #fff;
    font-size: 1.15em;
    font-weight: 700;
}

.exam-category-title::before {
    display: none;
}

.exam-category-icon {
    font-size: 1.1em;
}

/* exam-category-header も対応 */
.exam-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--subject-color, #3498db);
    border-radius: 12px 12px 0 0;
    color: #fff;
}

.exam-category-header h2 {
    margin: 0;
    font-size: 1.15em;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exam-category-header h2::before {
    display: none;
}

.exam-count-badge {
    background: rgba(255,255,255,0.25);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

/* ==================== */
/* 問題リスト */
/* ==================== */
.exam-category-list,
.exam-item-list,
.exam-items {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.exam-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

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

.exam-item:hover {
    background: var(--subject-bg, #f0f8ff);
    text-decoration: none;
}

.exam-year {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 4px 10px;
    background: #f0f2f5;
    border-radius: 6px;
    font-size: 0.78em;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
}

.exam-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 4px 8px;
    background: var(--subject-color, #3498db);
    color: #fff;
    border-radius: 6px;
    font-size: 0.78em;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.exam-title {
    flex: 1;
    font-size: 0.9em;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.4;
    min-width: 0;
}

.exam-type {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.type-ronsetsu {
    background: #e8f5e9;
    color: #2e7d32;
}

.type-keisan {
    background: #e3f2fd;
    color: #1565c0;
}

.type-anaume {
    background: #fff3e0;
    color: #e65100;
}

/* ==================== */
/* 科目別テーマカラー */
/* ==================== */
.subject-theory {
    --subject-color: #2980b9;
    --subject-light: #5dade2;
    --subject-bg: #eaf4fc;
}

.subject-machine {
    --subject-color: #27ae60;
    --subject-light: #52c77e;
    --subject-bg: #eafaf1;
}

.subject-power {
    --subject-color: #c0392b;
    --subject-light: #e74c3c;
    --subject-bg: #fdecea;
}

.subject-law {
    --subject-color: #7d3c98;
    --subject-light: #a569bd;
    --subject-bg: #f4ecf7;
}

/* ==================== */
/* common.cssとの競合解消 */
/* ==================== */
.exam-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exam-category li {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    position: static;
    overflow: visible;
}

.exam-category li::before {
    display: none;
}

/* ==================== */
/* レスポンシブ */
/* ==================== */
@media (max-width: 600px) {
    .exam-hero h1 {
        font-size: 1.2em;
    }

    .exam-toc {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .exam-toc-card {
        padding: 12px 8px;
    }

    .exam-toc-label,
    .exam-toc-name {
        font-size: 0.8em;
    }

    .exam-item {
        flex-wrap: wrap;
        gap: 6px;
        padding: 12px 14px;
    }

    .exam-year {
        min-width: auto;
        font-size: 0.72em;
    }

    .exam-title {
        width: 100%;
        font-size: 0.85em;
    }

    .exam-category-title {
        font-size: 1em;
    }

    .exam-category-header h2 {
        font-size: 1em;
    }
}
