/* 湘南タイムズ - プロフェッショナルデザイン */
:root {
    --primary-color: #0066cc;
    --text-dark: #222;
    --text-medium: #666;
    --text-light: #999;
    --border-color: #e0e0e0;
    --bg-light: #fafafa;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8;
    color: var(--text-dark);
    background: #fff;
    font-size: 16px;
}

/* ヘッダー */
.site-header {
    background: #fff;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.site-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.site-header h1 a {
    color: var(--primary-color);
    text-decoration: none;
}

.site-header p {
    font-size: 0.95rem;
    color: var(--text-medium);
    font-weight: 400;
}

/* メインコンテンツ */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* フィルタセクション */
.filter-section {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2.5rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 0.8rem;
}

.filter-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filter-button {
    padding: 0.6rem 1.2rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.filter-result {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-medium);
}

.filter-result #result-count {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* 記事グリッド */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

/* 記事カード（画像の上にタイトル重ねる） */
.news-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.news-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

/* カード画像コンテナ */
.news-card > img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

/* 画像上のグラデーションオーバーレイ */
.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 280px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* バッジを画像左上に配置 */
.card-meta {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 3;
}

/* カードコンテンツ（タイトル・日時は下部） */
.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.8rem;
    z-index: 2;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 180px; /* 4行タイトル分の高さ確保 */
}

/* タイトルを白文字に（リンク色も白・4行まで表示） */
.card-content h2 {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    font-size: 1.25rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
    flex-grow: 1;
    
    /* 長いタイトルを省略（4行まで） */
    display: -webkit-box;
    -webkit-line-clamp: 4; /* 4行まで表示 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* リンク色を白に統一 */
.card-content h2 a {
    color: inherit;
    text-decoration: none;
}

/* 説明文を削除（画像重ねるスタイルでは不要） */
.card-content p {
    display: none;
}

/* カードメタ情報（画像上部・白背景） */
.card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* カテゴリバッジ（画像上では半透明白背景） */
.category-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 市区町村タグ（画像上では半透明白背景） */
.city-tag {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}



/* 日時（画像上では白文字・小さめ・下部固定） */
.news-card time {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    margin-top: auto; /* 下部に固定 */
}

/* フッター */
.site-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
    text-align: center;
    margin-top: 5rem;
}

.site-footer p {
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* 記事詳細ページ */
.article-detail {
    max-width: 800px;
    margin: 3rem auto;
    padding: 3rem 2rem;
    background: #fff;
}

.article-detail header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.article-detail h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.article-detail time {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* 記事詳細の画像 */
.article-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}

.article-body {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #444;
}

.article-body p {
    margin-bottom: 1.8rem;
}

.article-body h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 2.5rem 0 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--border-color);
}

/* MV画像 */
.article-mv {
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.article-mv img {
    width: 100%;
    height: auto;
    display: block;
}

/* 目次 */
.article-toc {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.article-toc h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.article-toc ol {
    list-style: decimal;
    padding-left: 1.5rem;
    margin: 0;
}

.article-toc li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

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

.article-toc a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* Googleマップ */
.google-map {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.google-map h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.google-map iframe {
    width: 100%;
    height: 350px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.map-link {
    margin-top: 1rem;
    text-align: center;
}

.map-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.map-link a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .site-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .site-header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 2rem 1rem;
    }
    
    .filter-section {
        padding: 1.5rem;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .article-detail {
        padding: 2rem 1rem;
    }
    
    .article-detail h1 {
        font-size: 1.6rem;
    }
    
    .article-mv {
        margin: 1.5rem 0;
        border-radius: 8px;
    }
    
    .article-toc {
        padding: 1rem;
    }
    
    .article-toc h3 {
        font-size: 1rem;
    }
    
    .google-map {
        padding: 1.5rem 1rem;
    }
    
    .google-map iframe {
        height: 300px;
    }
}

/* 読み込みアニメーション */
@media (prefers-reduced-motion: no-preference) {
    .news-card {
        animation: slideUp 0.5s ease-out backwards;
    }
    
    .news-card:nth-child(1) { animation-delay: 0.1s; }
    .news-card:nth-child(2) { animation-delay: 0.15s; }
    .news-card:nth-child(3) { animation-delay: 0.2s; }
    .news-card:nth-child(4) { animation-delay: 0.25s; }
    .news-card:nth-child(5) { animation-delay: 0.3s; }
    .news-card:nth-child(6) { animation-delay: 0.35s; }
}

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

/* 参照元情報 */
.article-source {
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.article-source h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 0.8rem;
}

.article-source p {
    margin: 0;
}

.article-source a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    word-break: break-all;
    transition: color 0.3s ease;
}

.article-source a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* レスポンシブ（参照元） */
@media (max-width: 768px) {
    .article-source {
        padding: 1rem;
    }
    
    .article-source a {
        font-size: 0.85rem;
    }
}

/* MVタイトルオーバーレイ */
.article-mv {
    position: relative;
    margin: 0 0 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.mv-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4), transparent);
    padding: 3rem 2rem 2rem;
}

.mv-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* レスポンシブ（MVオーバーレイ） */
@media (max-width: 768px) {
    .mv-overlay {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .mv-title {
        font-size: 1.6rem;
    }
}

/* モバイル対応スライダーフィルタ */
@media (max-width: 768px) {
    .filter-section {
        padding: 1.5rem 1rem;
    }
    
    .filter-group {
        margin-bottom: 1.2rem;
    }
    
    .filter-group label {
        font-size: 0.85rem;
        margin-bottom: 0.6rem;
    }
    
    /* スライダーコンテナ */
    .filter-slider {
        display: flex;
        gap: 0.6rem;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 0.5rem;
        margin-right: -1rem;
        padding-right: 1rem;
    }
    
    /* スクロールバーを非表示（見た目重視） */
    .filter-slider::-webkit-scrollbar {
        height: 4px;
    }
    
    .filter-slider::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .filter-slider::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 2px;
    }
    
    /* ボタンのサイズ調整 */
    .filter-slider .filter-button {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
        scroll-snap-align: start;
    }
    
    /* 件数表示を小さく */
    .filter-result {
        margin-top: 1rem;
        padding-top: 1rem;
        font-size: 0.85rem;
    }
    
    .filter-result #result-count {
        font-size: 1rem;
    }
}

/* デスクトップではflexwrap（従来通り） */
@media (min-width: 769px) {
    .filter-slider {
        display: flex;
        gap: 0.8rem;
        flex-wrap: wrap;
    }
}
