* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    margin-top: 0;
}

/* カテゴリセクション */
.categories {
    margin-bottom: 40px;
}

.categories h2 {
    font-size: 18px;
    color: #555;
    margin-bottom: 15px;
    border-bottom: 2px solid #FF6F00;
    padding-bottom: 10px;
}

.category-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.category-btn {
    padding: 15px 20px;
    background-color: #FF6F00;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.category-btn:hover {
    background-color: #E65100;
}

.category-btn.active {
    background-color: #ff9800;
}

/* 年度セクション */
.years {
    margin-top: 40px;
    margin-bottom: 40px;
}

.years h2 {
    font-size: 18px;
    color: #555;
    margin-bottom: 15px;
    border-bottom: 2px solid #2196F3;
    padding-bottom: 10px;
}

.year-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.year-btn {
    padding: 12px 18px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.year-btn:hover {
    background-color: #0d47a1;
}

.year-btn.active {
    background-color: #ff9800;
}

/* 月セクション */
.months {
    margin-top: 40px;
    margin-bottom: 40px;
}

.months h2 {
    font-size: 18px;
    color: #555;
    margin-bottom: 15px;
    border-bottom: 2px solid #9C27B0;
    padding-bottom: 10px;
}

.month-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.month-btn {
    padding: 12px 15px;
    background-color: #9C27B0;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.month-btn:hover {
    background-color: #4a148c;
}

.month-btn.active {
    background-color: #ff9800;
}

.month-btn.all-months {
    background-color: #673AB7;
}

.month-btn.all-months:hover {
    background-color: #311b92;
}

.month-btn.all-months.active {
    background-color: #ff9800;
}

/* 記事セクション */
.articles {
    margin-top: 50px;
    margin-bottom: 40px;
}

.articles h2 {
    font-size: 18px;
    color: #555;
    margin-bottom: 15px;
    border-bottom: 2px solid #FF6F00;
    padding-bottom: 10px;
}

#articles-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.article-card {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background-color: #f5f5f5;
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.article-date {
    font-weight: bold;
    color: #1976D2;
    font-size: 14px;
}

.article-category {
    display: inline-block;
    background-color: #FF6F00;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.article-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.article-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 14px;
}

.article-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.article-image-placeholder {
    background-color: #e0e0e0;
    border-radius: 5px;
    padding: 30px;
    text-align: center;
    color: #999;
    font-size: 12px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-articles {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

/* ============================================
   ページネーション
   ============================================ */

.pagination {
    margin-top: 40px;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination-btn {
    padding: 10px 16px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #0d47a1;
}

.pagination-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.pagination-btn.active {
    background-color: #ff9800;
}

.pagination-info {
    font-size: 14px;
    color: #555;
    margin: 0 10px;
}

/* ============================================
   モーダルスタイル
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    margin-bottom: 30px;
}

.detail-date {
    font-weight: bold;
    color: #1976D2;
    font-size: 16px;
    margin-bottom: 10px;
}

.detail-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.detail-category {
    display: inline-block;
    background-color: #FF6F00;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 20px;
}

.detail-description {
    color: #555;
    line-height: 1.8;
    font-size: 15px;
    margin-bottom: 30px;
    text-align: justify;
}

.detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-image-placeholder {
    background-color: #e0e0e0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 14px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.back-btn {
    padding: 12px 24px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background-color: #0d47a1;
}

/* モーダルが開いているときはメイン要素をスクロール不可に */
body.modal-open {
    overflow: hidden;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .pagination-info {
        font-size: 12px;
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }
}
