/* News Article Styles */

/* スキップリンク */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1410;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: top 0.3s;
}

.skip-link:focus {
    top: 80px;
}

/* 画像の基本スタイル */
img {
    max-width: 100%;
    height: auto;
}

/* 記事コンテナ */
.news-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px;
    width: 100%;
    box-sizing: border-box;
}

/* メイン記事エリア（2カラムレイアウト） */
.news-main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 968px) {
    .news-main {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

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

    .news-article {
        order: 0;
    }
}

/* 記事本文エリア */
.news-article {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* 記事ヘッダー */
.news-header {
    margin-bottom: 30px;
}

.news-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

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

.news-category {
    display: inline-block;
    background: #22c55e;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.news-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
    margin-bottom: 20px;
}

/* メイン画像 */
.news-hero-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 30px;
    display: block;
}

/* 記事本文 */
.news-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.news-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #22c55e;
    color: #1a1a1a;
}

.news-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 30px 0 15px;
    color: #1a1a1a;
}

.news-content p {
    margin-bottom: 20px;
}

.news-content pre {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
}

.news-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.news-content pre code {
    background: none;
    padding: 0;
}

/* サイドバー */
.news-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.news-sidebar-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.news-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.news-toc {
    list-style: none;
    padding: 0;
}

.news-toc li {
    margin-bottom: 10px;
}

.news-toc a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.news-toc a:hover {
    color: #22c55e;
}

/* ニュース一覧ページ */
.news-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

.news-list-header {
    text-align: center;
    margin-bottom: 60px;
}

.news-list-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.news-list-description {
    font-size: 18px;
    color: #666;
}

/* ニュースカードグリッド */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* ニュースカード */
.news-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.news-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.news-card-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.news-card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
    flex: 1;
}

.news-card-link {
    color: #22c55e;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-card-link:hover {
    text-decoration: underline;
}

/* モバイル対応の画像制約 */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .news-container,
    .news-list-container {
        padding: 80px 15px 40px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .news-article {
        padding: 20px;
        overflow-x: hidden;
    }

    .news-title {
        font-size: 24px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    img {
        max-width: 100% !important;
        height: auto !important;
    }

    .news-hero-image {
        max-width: 100%;
        width: 100%;
        height: auto;
    }

    .news-card-image {
        max-width: 100%;
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: cover;
    }

    .news-content img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    pre {
        overflow-x: auto;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .news-container,
    .news-list-container {
        padding: 70px 10px 30px;
    }

    .news-article {
        padding: 15px;
    }

    .news-title {
        font-size: 20px;
    }

    .news-list-title {
        font-size: 28px;
    }
}
