/*
 * 日本の中小型株「隠れた宝石」サイト - スタイルシート
 * プロフェッショナルで洗練されたデザイン
 * ブルー系とグレー系の配色
 */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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";
}

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

/* ========================================
   ヘッダー
   ======================================== */
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 {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav 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 {
    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;
}

.page-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

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

/* ========================================
   見出し
   ======================================== */
h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #2563eb;
}

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;
}

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

h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #4b5563;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* ========================================
   段落・テキスト
   ======================================== */
p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

strong, b {
    font-weight: 700;
    color: #1e3a8a;
}

/* ========================================
   リスト
   ======================================== */
ul, ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.75rem;
}

/* ========================================
   テーブル
   ======================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

th {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
    padding: 1rem;
    text-align: left;
    font-weight: 700;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

tr:hover {
    background-color: #f9fafb;
}

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

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

/* ========================================
   サイドナビゲーション
   ======================================== */
.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;
}

/* 目次 */
.toc ul {
    list-style: none;
    padding-left: 0;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    color: #4b5563;
    font-size: 0.95rem;
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.toc a:hover {
    background-color: #eff6ff;
    color: #2563eb;
    text-decoration: none;
}

/* 関連リンク */
.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;
}

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

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

/* Amazon バナー */
.amazon-banner {
    background: linear-gradient(135deg, #ff9900 0%, #ffb84d 100%);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    margin: 1.5rem 0;
    transition: transform 0.3s ease;
}

.amazon-banner:hover {
    transform: translateY(-2px);
}

.amazon-banner a {
    color: #fff;
    text-decoration: none;
}

/* ========================================
   ニュースセクション
   ======================================== */
.news-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

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

.news-item {
    padding: 1.25rem;
    border-left: 4px solid #2563eb;
    background: #f9fafb;
    margin-bottom: 1.25rem;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.news-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.news-meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.news-excerpt {
    color: #4b5563;
    line-height: 1.6;
}

/* ========================================
   イントロセクション
   ======================================== */
.intro-section {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 2.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 6px solid #2563eb;
}

.intro-section h2 {
    margin-top: 0;
    border-left: none;
    padding-left: 0;
}

/* ========================================
   ボックス・カード
   ======================================== */
.info-box {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.warning-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.success-box {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

/* ========================================
   フッター
   ======================================== */
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;
    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;
}

/* ========================================
   画像
   ======================================== */
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

figure {
    margin: 2rem 0;
}

figcaption {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0.5rem;
    text-align: center;
}

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

    .sidebar {
        order: 2;
    }

    .content-area {
        order: 1;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.4rem;
    }
}

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

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

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

    nav {
        width: 100%;
    }

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

    nav ul.active {
        display: flex;
    }

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

    nav a {
        display: block;
        padding: 1rem;
    }

    .content-area {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

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

/* ========================================
   ユーティリティクラス
   ======================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none;
}

/* ========================================
   アニメーション
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ========================================
   ページトップボタン
   ======================================== */
.page-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2563eb;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.page-top.visible {
    opacity: 1;
    visibility: visible;
}

.page-top:hover {
    background: #1e40af;
    transform: translateY(-5px);
}

.page-top::before {
    content: "↑";
    font-size: 1.5rem;
    font-weight: bold;
}

/* ========================================
   チェックリスト
   ======================================== */
.checklist {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    padding-left: 2rem;
    position: relative;
    margin-bottom: 0.75rem;
}

.checklist li:before {
    content: "□";
    position: absolute;
    left: 0;
    color: #2563eb;
    font-weight: bold;
    font-size: 1.2rem;
}



/* === Mobile fix v3 (auto-injected) === */
html, body { overflow-x: hidden; }
img, video, iframe, table { max-width: 100%; }

@media (max-width: 768px) {
  /* ヒーローテキストがviewportからはみ出さないようにする */
  h1, h2, h3 {
    font-size: clamp(1.3rem, 5vw, 2.5rem) !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  p, li, td, th, span, a {
    overflow-wrap: break-word;
    word-break: break-word;
  }
  /* 全要素の幅を100vw以内に */
  .container, main, section, article, header, footer, nav,
  [class*="container"], [class*="wrapper"], [class*="content"] {
    max-width: 100vw;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}
/* === End Mobile fix v3 === */
