﻿/* 記事一覧ページ専用CSS */

* {
    box-sizing: border-box;
}

:root {
    --accent-color-alt: #10b981;
    --button-active-bg: #030303;
    --button-inactive-bg: #f0f0f0;
    --button-hover-bg-alt: #e5e5e5;
}

.posts-index-page {
    position: relative;
    min-height: 100vh;
}

.post-list-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.posts-wrapper {
    width: 100%;
}

.posts-grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 1200px) {
    .posts-grid-3x3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .posts-grid-3x3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .post-list-container {
        padding: 1rem;
    }
}

.post-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.post-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card-link:hover {
    text-decoration: none;
}

.post-card-link:focus {
    outline: none;
    text-decoration: none;
}

.post-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--button-bg);
    position: relative;
}

.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.05);
}

.post-card-content {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100px;
}

.post-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: auto;
}

.post-card-meta time {
    display: flex;
    align-items: center;
}

.post-card-stats {
    display: flex;
    gap: 0.75rem;
}

.post-card-stats span {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.post-card-stats span i.fa-eye {
    color: #10b981;
}

.post-card-stats span i.fa-heart {
    color: #ef4444;
}

.post-card-category {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card-category i {
    font-size: 0.75rem;
    color: #f59e0b;
}

@media (max-width: 768px) {
    .post-card-content {
        padding: 0.75rem 1rem;
        min-height: 80px;
    }
    
    .post-card-title {
        font-size: 1.125rem;
    }
    
    .post-card-meta {
        font-size: 0.75rem;
    }
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination-nav {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.page-item {
    margin: 0;
}

.page-link {
    display: block;
    padding: 10px 16px;
    color: #030303 !important;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: all 0.3s ease;
    background-color: #f0f0f0;
    font-weight: 500;
}

.page-link:hover {
    background: #e5e5e5;
    color: #030303 !important;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-item.active .page-link {
    background: #030303;
    color: white !important;
    border-color: #030303;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.category-navigation {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 0;
    position: sticky;
    top: 90px;
    z-index: 99;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.category-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.category-nav-list li {
    margin: 0;
}

.category-nav-list a {
    display: inline-block;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #030303 !important;
    background-color: #f0f0f0;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
}

.category-count {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 2px;
}

.category-nav-list a:hover {
    background-color: #e5e5e5;
    color: #030303 !important;
    transform: translateY(-1px);
}

.category-nav-list a.active {
    background-color: #030303;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-color: #030303;
}

.category-nav-list a.active:hover {
    background-color: #030303;
    opacity: 0.9;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .category-navigation {
        padding: 8px 0;
        top: 56px;
        position: sticky;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-navigation .container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
    }
    
    .category-nav-list {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px;
        padding: 0 16px;
        min-width: min-content;
    }
    
    .category-nav-list a {
        padding: 6px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .category-navigation {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .category-navigation::-webkit-scrollbar,
    .category-navigation .container::-webkit-scrollbar {
        display: none;
    }
    
    .category-navigation::before,
    .category-navigation::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 20px;
        pointer-events: none;
        z-index: 1;
    }
    
    .category-navigation::before {
        left: 0;
        background: linear-gradient(to right, rgba(255, 255, 255, 0.8), transparent);
    }
    
    .category-navigation::after {
        right: 0;
        background: linear-gradient(to left, rgba(255, 255, 255, 0.8), transparent);
    }
}

.no-posts {
    text-align: center;
    padding: 4rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.no-posts i {
    font-size: 4rem;
    color: var(--text-color);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.no-posts p {
    font-size: 1.25rem;
    color: var(--text-color);
    opacity: 0.7;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.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; }

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sort-container {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.sort-label {
    margin-right: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sort-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.sort-select:hover,
.sort-select:focus {
    border-color: var(--accent-color);
    outline: none;
}

@media (max-width: 768px) {
    .sort-wrapper {
        justify-content: center;
    }
}

.banner-and-links-section {
    background-color: var(--bg-color);
}

.banner-area {
    background-color: var(--bg-secondary, #f8f9fa);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.banner-area .container {
    text-align: center;
}

.banner-image {
    max-width: 100%;
    height: auto;
    max-height: 150px;
    border-radius: 8px;
}

.social-links-area {
    background-color: #e0f2fe;
    padding: 16px 0;
}

.social-links-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.contact-us-label {
    font-size: 16px;
    font-weight: 600;
    color: #0369a1;
    margin-right: 10px;
    letter-spacing: 0.5px;
}

/* デフォルトでモバイル用要素を非表示 */
.mobile-text {
    display: none;
}

.mobile-x-text {
    display: none;
}

/* デスクトップ用表示 */
.desktop-text {
    display: inline;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: white;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.social-link .author-icon-small {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.discord-link:hover {
    background-color: #5865F2;
    color: white;
    border-color: #5865F2;
}

.discord-link i {
    color: #5865F2;
    font-size: 18px;
}

.discord-link:hover i {
    color: white;
}

.twitter-link:hover {
    background-color: #1DA1F2;
    color: white;
    border-color: #1DA1F2;
}

.twitter-link:hover .author-icon-small {
    border-color: white;
}

@media (max-width: 768px) {
    .social-links-area {
        padding: 10px 0;
    }
    
    .social-links-wrapper {
        gap: 10px;
        padding: 0 16px;
    }
    
    .contact-us-label {
        font-size: 14px;
        margin-right: 8px;
    }
    
    .social-link {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* デスクトップ要素を非表示 */
    .desktop-text {
        display: none !important;
    }
    
    /* モバイル要素を表示 */
    .mobile-text {
        display: inline !important;
        font-size: 10px;
        font-weight: 600;
        margin-left: 2px;
    }
    
    /* Discordボタンの調整 */
    .discord-link {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        padding: 6px 10px;
    }
    
    .discord-link i {
        font-size: 16px;
    }
    
    /* Twitter(X)ボタンの調整 */
    .twitter-link {
        padding: 6px 10px;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    
    /* 筆者アイコンは常に表示 */
    .twitter-link .author-icon-small {
        width: 20px;
        height: 20px;
        display: inline-block !important;
    }
    
    /* Xテキストをモバイルで表示 */
    .twitter-link .mobile-x-text {
        display: inline-block !important;
        font-size: 12px;
        font-weight: 700;
        color: #000000;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        line-height: 1;
        margin-left: 3px;
    }
    
    .twitter-link:hover {
        background-color: #000000;
        border-color: #000000;
    }
    
    .twitter-link:hover .mobile-x-text {
        color: white;
    }
}

@media (max-width: 480px) {
    .social-links-wrapper {
        gap: 6px;
    }
    
    .contact-us-label {
        font-size: 12px;
        margin-right: 6px;
    }
    
    /* Discordボタン */
    .discord-link {
        padding: 5px 8px;
        border-radius: 15px;
        width: auto;
        height: auto;
    }
    
    .discord-link .mobile-text {
        font-size: 9px;
    }
    
    /* X(Twitter)ボタン */
    .twitter-link {
        padding: 5px 8px;
        border-radius: 20px;
        width: auto;
        height: auto;
        display: inline-flex;
        align-items: center;
        gap: 3px;
    }
    
    .twitter-link .author-icon-small {
        width: 18px;
        height: 18px;
    }
    
    .twitter-link .mobile-x-text {
        font-size: 12px;
        margin-left: 2px;
        color: #000000;
    }
}

@media print {
    .posts-grid-3x3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .post-card-image {
        height: auto;
    }
}
