/*
 * 投稿・アーカイブページ専用CSS
 * ブログ記事、カテゴリーページ、タグページ、検索結果など
 */

/* ==========================================================================
   アーカイブページヘッダー
   ========================================================================== */

.archive-header {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: #fff;
    padding: 60px 0 40px;
    text-align: center;
    margin-bottom: 40px;
}

.archive-title {
    font-size: 2.2rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    animation: fadeInUp 0.8s ease;
}

.archive-description {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* ==========================================================================
   投稿一覧レイアウト
   ========================================================================== */

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

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* ==========================================================================
   投稿カード（アーカイブ用）
   ========================================================================== */

.post-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    height: fit-content;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* カード画像 */
.post-card-image {
    position: relative;
    overflow: hidden;
    height: 220px;
    background-color: #f8f9fa;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.08);
}

/* カードコンテンツ */
.post-card-content {
    padding: 25px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #95a5a6;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-category {
    background-color: #74ACDD;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.post-category:hover {
    background-color: #5a9bd4;
}

.post-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 15px 0;
}

.post-card-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-card-title a:hover {
    color: #74ACDD;
}

.post-card-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f1f2f3;
}

.read-more {
    color: #74ACDD;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover {
    color: #5a9bd4;
    transform: translateX(3px);
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.post-tag {
    background-color: #f8f9fa;
    color: #666;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-tag:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* ==========================================================================
   サイドバー（もしある場合）
   ========================================================================== */

.content-with-sidebar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.sidebar {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    height: fit-content;
    position: sticky;
    top: 120px;
}

.sidebar-widget {
    margin-bottom: 30px;
}

.sidebar-widget:last-child {
    margin-bottom: 0;
}

.sidebar-widget h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #74ACDD;
}

.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-widget li {
    margin-bottom: 8px;
}

.sidebar-widget a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.sidebar-widget a:hover {
    color: #74ACDD;
}

/* ==========================================================================
   検索結果ページ
   ========================================================================== */

.search-header {
    background-color: #f8f9fa;
    padding: 40px 20px;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 40px;
}

.search-title {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.search-query {
    color: #74ACDD;
    font-weight: 600;
}

.search-results-count {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* ==========================================================================
   フィルタリング・ソート
   ========================================================================== */

.posts-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.posts-filter {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-button {
    background-color: #fff;
    border: 2px solid #e1e1e1;
    color: #666;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-button:hover,
.filter-button.active {
    background-color: #74ACDD;
    border-color: #74ACDD;
    color: #fff;
}

.posts-sort select {
    padding: 8px 12px;
    border: 2px solid #e1e1e1;
    border-radius: 5px;
    background-color: #fff;
    color: #666;
}

/* ==========================================================================
   レスポンシブデザイン
   ========================================================================== */

@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .sidebar {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .archive-header {
        padding: 40px 0 30px;
    }

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

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .posts-container {
        padding: 0 15px;
    }

    .post-card-content {
        padding: 20px;
    }

    .posts-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .posts-filter {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .post-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .post-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .post-tags {
        width: 100%;
    }

    .archive-title {
        font-size: 1.6rem;
    }

    .post-card-image {
        height: 180px;
    }
}

/* ==========================================================================
   アニメーション
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 投稿カードの順次表示アニメーション */
.post-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.post-card:nth-child(1) {
    animation-delay: 0.1s;
}

.post-card:nth-child(2) {
    animation-delay: 0.2s;
}

.post-card:nth-child(3) {
    animation-delay: 0.3s;
}

.post-card:nth-child(4) {
    animation-delay: 0.4s;
}

.post-card:nth-child(5) {
    animation-delay: 0.5s;
}

.post-card:nth-child(6) {
    animation-delay: 0.6s;
}

.post-card:nth-child(7) {
    animation-delay: 0.7s;
}

.post-card:nth-child(8) {
    animation-delay: 0.8s;
}

.post-card:nth-child(9) {
    animation-delay: 0.9s;
}

/* ホバー時のマイクロアニメーション */
.post-card-title a {
    position: relative;
    transition: all 0.3s ease;
}

.post-card-title a:hover {
    transform: translateX(2px);
}