/* --- Reset & Base Styles --- */
:root {
    --primary-color: #4c6cb3; /* サイトのメインカラー */
    --secondary-color: #f0f4f8; /* 背景色など */
    --font-color: #333; /* 基本の文字色 */
    --border-color: #e0e0e0; /* 境界線 */
    --card-bg: #ffffff; /* カードの背景色 */
    --card-shadow: 0 4px 8px rgba(0,0,0,0.05);
    --card-hover-shadow: 0 8px 16px rgba(0,0,0,0.1);
    --font-family: 'Noto Sans JP', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    color: var(--font-color);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #334a7a;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Header --- */
.site-header {
    background-color: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding a {
    text-decoration: none;
    color: var(--font-color);
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.site-description {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.site-navigation {
    display: flex;
    gap: 15px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
}
.nav-link:hover {
    background-color: var(--secondary-color);
}

/* --- Main Content --- */
.site-main {
    padding: 2rem 0;
}

.ad-space {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px; /* 広告が表示されない場合でも高さを確保 */
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.page-title {
    font-size: 1.8rem;
}

.update-time {
    font-size: 0.9rem;
    color: #555;
}

/* --- Article Grid --- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* for link to fill the card */
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.card-link {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    width: 100%; /* Ensure link fills the card */
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    flex-grow: 1; /* Title takes up available space */
}

.card-meta {
    font-size: 0.85rem;
    color: #666;
    margin-top: auto; /* Push meta to the bottom */
}

/* Special card styles */
.article-card.featured {
    grid-column: 1 / -1; /* Span full width */
    background: linear-gradient(45deg, #e8f0fe, #d6e4fd);
}
.article-card.featured .card-title {
    color: #2c3e50;
}
.article-card.extra {
    border-left: 5px solid var(--primary-color);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 10px;
}

.pagination-link {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    font-weight: 700;
    white-space: nowrap; /* Prevent text wrapping */
}

.pagination-link:hover {
    background-color: var(--secondary-color);
    border-color: #ccc;
}

.pagination-link.current {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    cursor: default;
}

.pagination-link.disabled {
    color: #aaa;
    background-color: #f5f5f5;
    cursor: not-allowed;
    pointer-events: none;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

/* --- Footer --- */
.site-footer {
    background-color: #333;
    color: #eee;
    padding: 2rem 0;
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
}

.site-footer .container p {
    margin: 0;
}


/* --- Responsive Design --- */
@media (max-width: 768px) {
    .site-title {
        font-size: 1.5rem;
    }
    .site-description {
        display: none; /* Hide on mobile */
    }
    .nav-text {
        display: none; /* Hide nav text, show only icons */
    }
    .nav-link {
        padding: 8px;
        font-size: 1.2rem;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .pagination {
        justify-content: space-between;
    }
    .page-numbers {
        display: none; /* Hide page numbers on mobile */
    }
}

@media (max-width: 480px) {
    .article-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
    .card-title {
        font-size: 1rem;
    }
}