/*
 * ニュース記事専用CSS - 日本の中小型株「隠れた宝石」
 * ヘッダー・フッター・ニュース記事専用スタイルを含む
 */

/* ========================================
   リセット・基本設定
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
}

body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    line-height: 1.8;
    color: #333;
    background-color: #f5f7fa;
    font-feature-settings: "palt";
    writing-mode: horizontal-tb;
    text-orientation: mixed;
}

/* ========================================
   レイアウト
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   ヘッダー（両パターン対応）
   ======================================== */
header, .header, .site-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
    padding: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.site-title a {
    color: #fff;
    text-decoration: none;
}

/* ========================================
   ナビゲーション
   ======================================== */
nav ul, .nav-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a, .nav-menu a, .nav-item a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

nav a:hover, .nav-menu a:hover, .nav-item a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ハンバーガーメニュー（モバイル用） */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ========================================
   メインコンテンツ
   ======================================== */
main {
    margin: 2rem 0;
}

/* ========================================
   ニュースコンテナ（2カラムレイアウト）
   ======================================== */
.news-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   メインコンテンツエリア
   ======================================== */
.main-content {
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ========================================
   記事ヘッダー
   ======================================== */
.article-header {
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.article-meta time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ========================================
   記事画像
   ======================================== */
.featured-image {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* ========================================
   記事本文
   ======================================== */
.article-content {
    line-height: 1.9;
}

.article-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    padding-left: 1rem;
    border-left: 4px solid #2563eb;
}

.article-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #374151;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.article-content ul, .article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.75rem;
}

/* ========================================
   ニュースソースセクション
   ======================================== */
.news-source-section {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2.5rem;
    border-left: 4px solid #2563eb;
}

.news-source-list {
    display: grid;
    gap: 1rem;
}

.news-source-list dt {
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 0.25rem;
}

.news-source-list dd {
    margin-left: 0;
    padding-left: 1rem;
}

.news-source-list a {
    color: #2563eb;
    text-decoration: none;
}

.news-source-list a:hover {
    text-decoration: underline;
}

/* ========================================
   シェアボタン
   ======================================== */
.share-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-button.twitter {
    background: #1da1f2;
    color: #fff;
}

.share-button.facebook {
    background: #1877f2;
    color: #fff;
}

/* ========================================
   サイドバー
   ======================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

/* 広告エリア */
.ad-space {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.ad-space img {
    max-width: 100%;
    height: auto;
}

/* 関連リンク */
.related-links ul {
    list-style: none;
    padding-left: 0;
}

.related-links li {
    margin-bottom: 0.75rem;
}

.related-links a {
    color: #2563eb;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.related-links a:before {
    content: "→";
    margin-right: 0.5rem;
    font-weight: bold;
}

.related-links a:hover {
    background-color: #eff6ff;
    text-decoration: none;
}

/* ========================================
   ニュース一覧ページ専用スタイル
   ======================================== */
.news-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
}

.news-list-header {
    text-align: center;
    margin-bottom: 3rem;
}

.news-list-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 1rem;
}

.news-list-header p {
    color: #6b7280;
    font-size: 1.1rem;
}

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

.news-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

.news-card-content {
    padding: 1.5rem;
}

.news-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.news-card-title a {
    color: #1e3a8a;
    text-decoration: none;
}

.news-card-title a:hover {
    color: #2563eb;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.news-card-excerpt {
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination a, .pagination span {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination a {
    background: #fff;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.pagination a:hover {
    background: #2563eb;
    color: #fff;
}

.pagination .current {
    background: #2563eb;
    color: #fff;
    border: 2px solid #2563eb;
}

/* ========================================
   フッター（両パターン対応）
   ======================================== */
footer, .footer, .site-footer {
    background: #1f2937;
    color: #d1d5db;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding-left: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ========================================
   リンク
   ======================================== */
a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #1e40af;
    text-decoration: underline;
}

/* ========================================
   レスポンシブデザイン - タブレット
   ======================================== */
@media (max-width: 991px) {
    .news-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .main-content {
        order: 1;
    }

    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* ========================================
   レスポンシブデザイン - モバイル
   ======================================== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    body {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 1.5rem;
    }

    nav {
        width: 100%;
    }

    nav ul, .nav-menu {
        flex-direction: column;
        gap: 0;
        display: none;
    }

    nav ul.active, .nav-menu.active {
        display: flex;
    }

    nav li, .nav-item {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav a, .nav-menu a, .nav-item a {
        display: block;
        padding: 1rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-content h2 {
        font-size: 1.25rem;
    }

    .article-content h3 {
        font-size: 1.1rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .share-buttons {
        flex-direction: column;
    }
}

/* ========================================
   印刷用スタイル
   ======================================== */
@media print {
    header, .header, .site-header,
    footer, .footer, .site-footer,
    .sidebar,
    .share-buttons {
        display: none;
    }

    .news-container {
        grid-template-columns: 1fr;
    }

    .main-content {
        box-shadow: none;
        padding: 0;
    }
}
