/* 長距離鉄道サイト - スタイルシート */

/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本設定 */
:root {
    /* Nostalgic Palette */
    --primary-color: #1a4269;
    /* Retro Navy Blue ("Blue Train" color) */
    --secondary-color: #8B4513;
    /* Saddle Brown / Leather Seat Color */
    --accent-color: #d4a017;
    /* Muted Gold / Brass */
    --text-color: #2c2c2c;
    /* Softer Black (Ink color) */
    --bg-color: #fcfbf7;
    /* Warm Paper White/Cream */
    --white: #ffffff;
    --border-color: #d3cdb8;
    /* Beige Gray */
    --gray-light: #f2efe6;
    /* Warm Light Gray */
    --gray-dark: #595959;
}

body {
    /* Serif font for a literary/travelogue feel */
    font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "HGSMinchoE", "Meiryo", serif;
    line-height: 2.0;
    /* More relaxed reading pace */
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><g fill="%23d3cdb8" fill-opacity="0.05"><path d="M0 0h50v50H0zM50 50h50v50H50z"/></g></svg>');
    /* Subtle texture */
}

/* ヘッダー */
header {
    background: var(--primary-color);
    /* Solid Classic Navy */
    /* Remove gradient for a flatter, more classic look */
    border-bottom: 4px solid var(--accent-color);
    /* Gold strip */
    color: var(--white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.site-tagline {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

/* ナビゲーション */
nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

nav ul li {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav ul li:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
}

/* ハンバーガーメニュー */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
}

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

/* ヒーローセクション */
.hero {
    /* Premium Deep Blue Gradient to simulate night/premium feel if image fails */
    background: linear-gradient(135deg, #002244 0%, #004488 100%);
    border-radius: 12px;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    max-width: 900px;
    height: auto;
    border-radius: 8px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* Nostalgic Filter */
    filter: sepia(0.3) contrast(1.1) brightness(0.9);
}

.hero h1 {
    font-size: 2.5rem;
    color: #FFFFFF;
    /* White Text */
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px #000000;
    /* Black Shadow */
    font-weight: 800;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: #FFFFFF;
    /* White Text */
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px #000000;
    /* Black Shadow */
    font-weight: 600;
}

/* 2カラムレイアウト */
.two-column {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

.main-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar-section h3 {
    font-size: 1.2rem;
    color: var(--white);
    background-color: var(--secondary-color);
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    /* Slight round */
    border-left: 6px solid var(--accent-color);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-family: "Yu Mincho", serif;
    letter-spacing: 0.05em;
    border-bottom: none;
    /* Remove previous style */
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section ul li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.sidebar-section ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.sidebar-section ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar-section ul li a:hover {
    color: var(--primary-color);
}

/* シングルカラム（TOPページ用） */
.single-column {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(--0, 0, 0, 0.08);
}

/* セクション */
section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

section h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

section h4 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

section ul,
section ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

section li {
    margin-bottom: 0.5rem;
}

/* ニュースリスト */
.news-list {
    list-style: none;
    margin-left: 0;
}

.news-list li {
    background: var(--gray-light);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.news-list li:hover {
    background: #EBEBEB;
    transform: translateX(5px);
}

.news-list .news-date {
    color: var(--gray-dark);
    font-size: 0.9rem;
    font-weight: 600;
}

.news-list .news-title {
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}

/* 画像 */
.content-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 8px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

table th {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

table tr:hover {
    background: var(--gray-light);
}

/* キーワードハイライト */
.keyword {
    background: linear-gradient(transparent 60%, rgba(255, 102, 0, 0.3) 60%);
    font-weight: 600;
    padding: 0 0.2rem;
}

/* フッター */
footer {
    background: var(--text-color);
    color: var(--white);
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

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

.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}


/* Sub Page Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.65);
    /* Darken for text readability */
    transition: transform 10s ease;
}

.hero-section:hover .hero-bg {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 90%;
    z-index: 10;
}

.hero-overlay h1 {
    color: #fff;
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9);
    margin: 0;
    line-height: 1.4;
    letter-spacing: 0.05em;
    border-bottom: none;
    /* Override default section h2 style if leak */
}

/* Override existing h1 inside article if needed, but we will remove it */

/* Sidebar Ad */
.sidebar-ad {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: block;
}

.sidebar-ad:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* レスポンシブデザイン */

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
    }

    nav ul.active {
        display: flex;
    }

    nav ul li {
        width: 100%;
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    /* Main content above sidebar on mobile */
    .main-content {
        order: 1;
    }

    .sidebar {
        order: 2;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    section h2 {
        font-size: 1.5rem;
    }

    main {
        padding: 0 1rem;
    }

    .header-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.4rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    section h2 {
        font-size: 1.3rem;
    }
}


/* === 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 === */
