/**
 * 小浜島日記アーカイブ (Issue #153 PR4)
 *
 * - カード/バッジ/ページネーションは kk- コンポーネント（components.css）
 * - 旧ミントパレット（#5fd4cd / #8eeee7 直書き）と #2c3e50 見出しを撲滅
 * - 色はすべてトークン＝ライト/ダーク自動追従（旧ダークブロックは削除）
 */

.diary-page-container {
    padding-top: var(--space-2);
    padding-bottom: var(--space-4);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================
   リード文と統計
   ================================ */

.diary-page-container .page-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin: calc(-1 * var(--space-3)) 0 var(--space-2);
}

.diary-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.stat-divider {
    color: var(--border-strong);
    font-size: 1.3rem;
}

/* ================================
   年代別アーカイブ
   ================================ */

.diary-archive-sidebar {
    margin-bottom: var(--space-3);
}

.diary-yearly-archives h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 10px;
}

.diary-yearly-archives .year-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.diary-yearly-archives .year-item a {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 5px 14px;
    background: var(--bg-inset);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-pill);
    color: var(--accent-strong);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.diary-yearly-archives .year-item a:hover {
    background: var(--bg-inset-strong);
    border-color: var(--accent);
}

.diary-yearly-archives .year-item .count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================================
   日記グリッド
   ================================ */

.diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-3);
}

.diary-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.diary-grid .kk-card {
    height: 100%;
    animation: cardFadeIn 0.5s ease-out both;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.diary-grid .kk-card__image {
    position: relative;
}

.diary-grid .kk-card__image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder {
    width: 72px;
    height: 72px;
    color: var(--accent);
    opacity: 0.5;
}

/* 「第◯回」バッジは画像左上にオーバーレイ */
.diary-number-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* タイトルは2行でクランプ */
.diary-grid .kk-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 続きを読む（global の .read-more ボタン化を避けた別名） */
.diary-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-strong);
    font-weight: 600;
    font-size: 0.92rem;
    transition: gap 0.3s ease;
}

.diary-grid .kk-card:hover .diary-read-more {
    gap: 12px;
}

.diary-read-more .arrow {
    transition: transform 0.3s ease;
}

.diary-grid .kk-card:hover .diary-read-more .arrow {
    transform: translateX(4px);
}

/* ================================
   空状態
   ================================ */

.no-posts {
    text-align: center;
    padding: var(--space-5) var(--space-3);
    color: var(--text-muted);
}

.no-posts-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto var(--space-2);
    color: var(--accent);
    opacity: 0.35;
}

.no-posts h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--heading);
    margin-bottom: 10px;
}

/* ================================
   レスポンシブ
   ================================ */

@media (max-width: 768px) {
    .diary-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .diary-stats {
        gap: var(--space-1);
    }

    .stat-number {
        font-size: 1.4rem;
    }
}

/* ================================
   アクセシビリティ
   ================================ */

@media (prefers-reduced-motion: reduce) {
    .diary-page-container,
    .diary-grid .kk-card {
        animation: none;
    }
}
