/* ==========================================================================
   関東学生鉄道研究会連盟 — 共通スタイルシート
   全ページ（index / overview / charter / journals / federations / activity /
   404）で読み込まれる唯一のスタイルシート。ページ固有の差分は body の
   クラス（.page-home / .page-overview / .page-charter / .page-error など）
   でスコープしている。ページ固有のコンポーネント（.fed-*, .article* など）
   はクラス名自体が他ページと衝突しないので、スコープなしでそのまま置いている。
   ========================================================================== */

:root {
    --railway-blue: #161D61;
    --railway-blue-text: #232E9B;
    --railway-blue-text-bright: #3546E9;
    --railway-light: #F4F7FC;
    --text-main: #2C3E50;
    --text-sub: #5D6D7E;
    --border-color: #E2E8F0;
}

@font-face {
    font-family: 'Kosugi Maru JP';
    font-style: normal;
    font-weight: 400;
    font-display: optional;
    src: url(fonts/kosugi-maru-jp-400.woff2) format('woff2');
    unicode-range: U+3000-303F, U+3040-309F, U+30A0-30FF, U+31F0-31FF, U+3220-3247, U+3280-32B0, U+FF00-FFEF, U+4E00-9FFF, U+FFFD;
}

@font-face {
    font-family: 'Quicksand';
    font-style: normal;
    font-weight: 400;
    font-display: optional;
    size-adjust: 110%;
    src: url(fonts/quicksand-latin-400.woff2) format('woff2');
}

@font-face {
    font-family: 'Quicksand';
    font-style: normal;
    font-weight: 500;
    font-display: optional;
    size-adjust: 110%;
    src: url(fonts/quicksand-latin-500.woff2) format('woff2');
}

@font-face {
    font-family: 'Quicksand';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    size-adjust: 110%;
    src: url(fonts/quicksand-latin-600.woff2) format('woff2');
}

@font-face {
    font-family: 'Quicksand';
    font-style: normal;
    font-weight: 700;
    font-display: optional;
    size-adjust: 110%;
    src: url(fonts/quicksand-latin-700.woff2) format('woff2');
}

/* --------------------------------------------------------------------------
   基本レイアウト（全ページ共通のベース。ページ固有の差分は下の
   body クラススコープで上書き）
   -------------------------------------------------------------------------- */

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: var(--railway-light);
    color: var(--text-main);
    line-height: 1.8;
}

a {
    font-family: 'Kosugi Maru JP', 'Quicksand', sans-serif;
}

/* 幅1067pxは在来線の軌間1067mm（狭軌）にちなむ。padding込みの外形を
   1067pxちょうどにしたいので box-sizing: border-box を明示している
   （content-box のままだと padding 分だけ外形が広がってしまう）。 */
.container {
    box-sizing: border-box;
    max-width: 1067px;
    margin: 60px auto;
    padding: 3.5rem 3rem;
    background: white;
    border-radius: 12px;
    border-top: 6px solid var(--railway-blue);
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2.5rem;
}

.site-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 1.2rem;
    border-radius: 8px;
}

h1 {
    font-family: 'Kosugi Maru JP', 'Quicksand', sans-serif;
    font-size: 1.9rem;
    margin: 0 0 0.5rem 0;
    color: var(--railway-blue-text);
    letter-spacing: 0.02em;
    font-weight: 900;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-sub);
    margin: 0;
    letter-spacing: 0.08em;
}

.back-link {
    display: inline-block;
    margin-top: 1.2rem;
    font-size: 0.85rem;
    color: var(--railway-blue-text);
    text-decoration: none;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.back-link:hover {
    background-color: var(--railway-light);
    border-color: var(--railway-blue);
}

p {
    margin: 0 0 1.5rem 0;
    text-align: justify;
}

/* --------------------------------------------------------------------------
   ページ固有の上書き（body class スコープ）
   -------------------------------------------------------------------------- */

/* トップページ（index.html） */
.page-home header {
    margin-bottom: 3.5rem;
}

.page-home .site-logo {
    width: 120px;
    height: 120px;
}

.page-home header {
    border-bottom: none;
    padding-bottom: 0;
}

.page-home h1 {
    font-size: 2.4rem;
    font-weight: 800;
}

.page-home .subtitle {
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* 連盟概要ページ（overview.html） */
.page-overview .site-logo {
    /* サブページ共通のデフォルト（100px）のまま */
}

/* 憲章ページ（charter.html） */
.page-charter {
    line-height: 1.85;
}

.page-charter p {
    margin: 0 0 1.2rem 0;
}

/* 404ページ */
body.page-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* 404だけは中央の小さなカード。.container が border-box になったので、
   従来と同じ見た目（560px + padding 96px）になる値を外形で指定する。 */
.page-error .container {
    max-width: 656px;
    margin: 0;
    text-align: center;
}

.page-error .site-logo {
    width: 90px;
    height: 90px;
    margin-bottom: 1.5rem;
}

.page-error h1 {
    font-size: 1.3rem;
    color: var(--text-main);
    margin: 0 0 0.8rem 0;
    letter-spacing: normal;
}

.page-error p {
    color: #4A5568;
    margin: 0 0 2rem 0;
    text-align: left;
}

/* --------------------------------------------------------------------------
   リンク・共通コンポーネント
   -------------------------------------------------------------------------- */

.doc-link {
    color: var(--railway-blue-text-bright);
    font-weight: 600;
    text-decoration: none;
}

.doc-link:hover {
    text-decoration: underline;
}

.doc-link:visited {
    color: #7C4A9E;
}

.legacy-link {
    color: var(--text-sub);
    text-decoration: none;
    margin: 0 10px;
}

/* 線路モチーフ */
.track-line {
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--border-color), var(--border-color) 15px, transparent 15px, transparent 25px);
    margin: 4rem 0 2rem 0;
}

.page-error .track-line {
    margin: 0 0 2rem 0;
}

.copyright {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-sub);
    margin: 0;
}

/* --------------------------------------------------------------------------
   見出し（h2）— index.html と overview.html は無名クラスの h2 を直接
   使っているため body スコープで分ける。他ページは h2.chapter-title /
   h2.year-title / .fed-heading h2 のようにクラスを持つ独自セレクタなので
   ページ固有セクションの方にまとめている。
   -------------------------------------------------------------------------- */

.page-home h2 {
    font-family: 'Kosugi Maru JP', 'Quicksand', sans-serif;
    font-size: 1.4rem;
    color: var(--railway-blue-text);
    margin-top: 3rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-home h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1.4rem;
    background-color: var(--railway-blue);
    border-radius: 2px;
}

.page-overview h2 {
    font-family: 'Kosugi Maru JP', 'Quicksand', sans-serif;
    font-size: 1.3rem;
    color: var(--railway-blue-text);
    margin-top: 2.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-overview h2:first-of-type {
    margin-top: 0;
}

.page-overview h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1.2rem;
    background-color: var(--railway-blue);
    border-radius: 2px;
}

/* 情報カード（正式名称・設立日など）— index.html と overview.html で共用 */
.meta-info {
    font-size: 0.9rem;
    background: #F8FAFC;
    padding: 1.2rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin: 1.5rem 0 0 0;
}

.meta-info div {
    display: flex;
    margin-bottom: 6px;
}

.meta-info div:last-child {
    margin-bottom: 0;
}

.meta-info span.label {
    width: 100px;
    font-weight: 600;
    color: var(--railway-blue-text);
}

/* ==========================================================================
   連盟概要ページ（overview.html）専用コンポーネント
   ========================================================================== */

/* class-free so plain Markdown tables (which can't carry a class attribute)
   pick this up automatically -- scoped to the two page types that use
   tables at all. First column width is intrinsic (nowrap) rather than a
   fixed rem value, since both "12月" and "2013"/"1958" style labels need
   to fit without wasting space on the other. */
.page-overview table,
.page-history table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.page-overview th,
.page-overview td,
.page-history th,
.page-history td {
    text-align: left;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.page-overview th,
.page-history th {
    color: var(--railway-blue-text);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.page-overview td:first-child,
.page-history td:first-child {
    white-space: nowrap;
    color: var(--text-sub);
    font-weight: 600;
}

.page-overview tbody tr:last-child td,
.page-history tbody tr:last-child td {
    border-bottom: none;
}


/* ==========================================================================
   トップページ（index.html）専用コンポーネント
   ========================================================================== */

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 3rem;
    margin-bottom: 1.2rem;
}

.section-heading h2 {
    margin: 0;
}

.more-link {
    font-size: 1rem;
    font-weight: 700;
    color: var(--railway-blue-text-bright);
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.more-link:hover {
    text-decoration: underline;
}

.more-link:visited {
    color: #7C4A9E;
}

/* トップページ写真ストリップ（過去の活動写真4枚） */
.home-photo-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 1.8rem 0 0 0;
}

.home-photo-link {
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(22, 29, 97, 0.08);
}

.home-photo-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.home-photo-link:hover img {
    transform: scale(1.05);
}

@media (min-width: 880px) {
    .home-photo-strip {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 加盟団体募集セクション */
.recruitment-section {
    background-color: #FFF7F0;
    border: 1px solid #F37512;
    padding: 2rem;
    border-radius: 8px;
    margin: 3rem 0;
}

.recruitment-section h2 {
    color: #9E3B00;
    margin-top: 0;
}

.recruitment-section h2::before {
    background-color: #9E3B00;
}

.recruitment-section ul {
    margin: 0;
    padding-left: 20px;
    color: #5D6D7E;
}

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

/* 連絡先・SNSセクション */
.sns-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.sns-link {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
    color: var(--text-main);
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.sns-link:hover {
    background-color: var(--railway-light);
    border-color: var(--railway-blue);
    color: var(--railway-blue-text);
}

.sns-link svg {
    margin-right: 8px;
    fill: currentColor;
}

/* リスト一覧（可変レイアウト・ダブルリンク対応） */
.member-list {
    display: grid;
    grid-template-columns: 1fr; /* 基本（画面幅924px以下）は1列 */
    gap: 10px;
    font-size: 0.95rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.member-list li {
    padding-left: 15px;
    position: relative;
    color: #4A5568;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.member-list li::before {
    content: "▪";
    color: var(--railway-blue-text);
    position: absolute;
    left: 0;
    font-size: 0.8rem;
    top: 0.35rem;
}

.member-name {
    font-weight: 500;
    line-height: 1.4;
}

.member-links {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.member-links a {
    color: var(--railway-blue-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 2px 8px;
    background-color: #F1F5F9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.member-links a:hover {
    background-color: var(--railway-blue);
    color: white;
    text-decoration: none;
}

/* 機関誌バックナンバー導線（目立たせる用） */
.journal-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--railway-blue);
    color: white;
    padding: 1.4rem 1.8rem;
    border-radius: 6px;
    margin: 1.8rem 0 0.5rem 0;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.journal-cta:hover {
    background-color: #0D113A;
}

.journal-cta-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex-grow: 1;
}

.journal-cta-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.journal-cta-arrow {
    font-size: 1.4rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ==========================================================================
   全国学生鉄道連盟一覧ページ（federations.html）専用コンポーネント
   ========================================================================== */

.fed-section {
    margin-bottom: 2.6rem;
    padding-bottom: 2.2rem;
    border-bottom: 1px dashed var(--border-color);
}

.fed-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.fed-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.fed-heading h2 {
    font-family: 'Kosugi Maru JP', 'Quicksand', sans-serif;
    font-size: 1.25rem;
    color: var(--railway-blue-text);
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fed-heading h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1.2rem;
    background-color: var(--railway-blue);
    border-radius: 2px;
}

.fed-group {
    margin-bottom: 0.9rem;
}

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

.fed-group-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 0.5rem;
}

.uni-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.uni-chips li {
    font-size: 0.88rem;
    color: var(--text-main);
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.35rem 0.9rem;
}

.fed-note {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-top: 0.6rem;
    margin-bottom: 0;
}

/* ==========================================================================
   連盟誌バックナンバーページ（journals.html）専用コンポーネント
   ========================================================================== */

h2.year-title {
    font-family: 'Kosugi Maru JP', 'Quicksand', sans-serif;
    font-size: 1.4rem;
    color: var(--railway-blue-text);
    margin-top: 3rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

h2.year-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1.4rem;
    background-color: var(--railway-blue);
    border-radius: 2px;
}

.year-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-sub);
    margin-left: 4px;
}

/* PDF一覧 */
.journal-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    font-size: 0.95rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.journal-list li {
    padding-left: 15px;
    position: relative;
    color: #4A5568;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.journal-list li::before {
    content: "▪";
    color: var(--railway-blue-text);
    position: absolute;
    left: 0;
    font-size: 0.8rem;
    top: 0.35rem;
}

.journal-title {
    font-weight: 500;
    line-height: 1.4;
}

.journal-links {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.journal-links a {
    color: var(--railway-blue-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 2px 8px;
    background-color: #F1F5F9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.journal-links a:hover {
    background-color: var(--railway-blue);
    color: white;
    text-decoration: none;
}

/* ==========================================================================
   連盟憲章ページ（charter.html）専用コンポーネント
   ========================================================================== */

h2.chapter-title {
    font-family: 'Kosugi Maru JP', 'Quicksand', sans-serif;
    font-size: 1.4rem;
    color: var(--railway-blue-text);
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    scroll-margin-top: 20px;
}

h2.chapter-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1.4rem;
    background-color: var(--railway-blue);
    border-radius: 2px;
}

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

.toc-title {
    font-weight: 700;
    color: var(--railway-blue-text);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.toc ol {
    margin: 0;
    padding-left: 1.3rem;
    font-size: 0.9rem;
}

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

.toc a {
    color: var(--text-main);
    text-decoration: none;
}

.toc a:hover {
    color: var(--railway-blue-text);
    text-decoration: underline;
}

/* 前文 */
.preamble {
    border-left: 3px solid var(--railway-blue);
    padding: 0.2rem 0 0.2rem 1.5rem;
    margin: 1.5rem 0 2rem 0;
    color: #3D4F61;
}

.preamble p {
    margin-bottom: 1.2rem;
}

.signature-box {
    font-size: 0.95rem;
    background: #F8FAFC;
    padding: 1.3rem 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin: 0 0 2.5rem 0;
}

.signature-date {
    font-weight: 700;
    color: var(--railway-blue-text);
    margin-bottom: 0.8rem;
}

.founding-orgs-label {
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text-main);
}

.founding-orgs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px 24px;
    list-style: none;
    padding: 0;
    margin: 0 0 0.6rem 0;
    font-size: 0.92rem;
}

.founding-orgs li {
    padding-left: 14px;
    position: relative;
    color: #4A5568;
}

.founding-orgs li::before {
    content: "▪";
    color: var(--railway-blue-text);
    position: absolute;
    left: 0;
    font-size: 0.75rem;
    top: 0.3rem;
}

.founding-orgs-total {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-sub);
    margin: 0;
}

/* 条文 */
.article {
    margin-bottom: 2.2rem;
    scroll-margin-top: 20px;
}

.article-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed var(--border-color);
}

.article-title .article-num {
    color: var(--railway-blue-text);
}

.sub-list {
    margin: 0 0 1.2rem 0;
    padding-left: 1.6rem;
}

.sub-list li {
    margin-bottom: 0.5rem;
    text-align: justify;
    padding-left: 0.2rem;
}

.sub-list li::marker {
    color: var(--railway-blue-text);
    font-weight: 700;
}

.clause {
    display: flex;
    gap: 0.6rem;
    margin: 0 0 1.2rem 0;
}

.clause-num {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: var(--railway-blue);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.15rem;
}

.clause p {
    margin: 0;
    text-align: justify;
}

/* ==========================================================================
   活動報告ページ（activity.html）専用コンポーネント
   ========================================================================== */

.year-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--railway-blue-text);
    letter-spacing: 0.04em;
    margin: 2.5rem 0 1.2rem 0;
}

.year-heading:first-of-type {
    margin-top: 0;
}

.news-item {
    padding-bottom: 2.2rem;
    margin-bottom: 2.2rem;
    border-bottom: 1px dashed var(--border-color);
}

.news-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.news-date {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--railway-blue-text);
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.news-text {
    margin: 0 0 0.9rem 0;
    font-size: 0.9rem;
    text-align: left;
}

.news-image-link {
    display: block;
    cursor: zoom-in;
}

.news-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 480px;
    margin: 0 auto 1rem auto;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(22, 29, 97, 0.06), inset 0 2px 6px rgba(22, 29, 97, 0.08);
}

.source-note {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin: 0.6rem 0 0 0;
}

/* ==========================================================================
   404ページ専用コンポーネント
   ========================================================================== */

.error-code {
    font-family: 'Quicksand', sans-serif;
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--railway-blue-text);
    margin: 0;
    letter-spacing: 0.02em;
    line-height: 1;
}

.error-sub {
    font-size: 0.85rem;
    color: var(--text-sub);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0.6rem 0 2rem 0;
}

.home-button {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--railway-blue);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.home-button:hover {
    background-color: #0D113A;
}

.sub-link {
    display: block;
    margin-top: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-sub);
    text-decoration: none;
}

.sub-link:hover {
    color: var(--railway-blue-text);
    text-decoration: underline;
}

/* ==========================================================================
   年度別記録ページ（history/2013.html〜history/2026.html）専用コンポーネント
   ========================================================================== */

.page-history h2 {
    font-family: 'Kosugi Maru JP', 'Quicksand', sans-serif;
    font-size: 1.1rem;
    color: var(--railway-blue-text);
    margin-top: 2.2rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-history h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1rem;
    background-color: var(--railway-blue);
    border-radius: 2px;
}

.page-history h3 {
    font-family: 'Kosugi Maru JP', 'Quicksand', sans-serif;
    font-size: 1rem;
    color: var(--text-main);
    margin-top: 1.8rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed var(--border-color);
    scroll-margin-top: 1.5rem;
}

/* higher specificity than the global .doc-link rule, so table links keep
   this underlined look even though the Markdown link render hook now
   stamps class="doc-link" onto every link, including these. */
.page-history table a {
    color: var(--railway-blue-text);
    text-decoration: underline;
    text-decoration-color: var(--border-color);
    text-underline-offset: 2px;
}

.page-history table a:hover {
    color: var(--railway-blue-text-bright);
    text-decoration-color: var(--railway-blue-text-bright);
}

.year-nav {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0 0 0;
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   幅が変わったら2列にするブレークポイント（ページごとに閾値が異なる）
   -------------------------------------------------------------------------- */

/* トップページの加盟団体一覧: 横幅が924pxを超えたら2列 */
@media (min-width: 924px) {
    .member-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 28px;
    }
}

/* ヘッダー: 横幅が720pxを超えたらロゴをタイトルの左に並べ、
   ロゴ+タイトルのまとまりをページ中央に配置する（トップページを除く） */
@media (min-width: 720px) {
    body:not(.page-home) header {
        display: grid;
        grid-template-columns: max-content max-content;
        justify-content: center;
        align-items: center;
        column-gap: 1.2rem;
    }

    body:not(.page-home) header > a:first-child {
        grid-column: 1;
        grid-row: 1 / 3;
    }

    body:not(.page-home) header > a:first-child .site-logo {
        margin-bottom: 0;
    }

    body:not(.page-home) header > h1 {
        grid-column: 2;
        grid-row: 1;
        text-align: left;
        margin: 0;
    }

    body:not(.page-home) header > .subtitle {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
        margin-top: 0.3rem;
    }

    body:not(.page-home) header > *:not(a):not(h1):not(.subtitle),
    body:not(.page-home) header > a:not(:first-child) {
        grid-column: 1 / -1;
    }
}

/* 連盟誌バックナンバーの一覧: 横幅が840pxを超えたら2列 */
@media (min-width: 840px) {
    .journal-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px 28px;
    }
}

/* 憲章ページの原加盟団体一覧: 横幅が600pxを超えたら2列 */
@media (min-width: 600px) {
    .founding-orgs {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   モバイル表示（〜600px）
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
    .container {
        margin: 20px auto;
        padding: 2rem 1.5rem;
    }
    h1 { font-size: 1.5rem; }
    .site-logo { width: 80px; height: 80px; }

    .journal-cta {
        padding: 1.1rem 1.3rem;
    }
    .journal-cta-title { font-size: 0.95rem; }
}

.page-home {
    /* トップページはモバイルでも少し大きめのロゴ・見出しを保つ */
}

@media (max-width: 600px) {
    .page-home h1 { font-size: 1.6rem; }
    .page-home .site-logo { width: 100px; height: 100px; }

    .page-error .container {
        margin: 0;
        padding: 2.5rem 1.8rem;
    }
    .page-error .error-code { font-size: 3.5rem; }
}

/* --------------------------------------------------------------------------
   印刷時: 装飾を取り除き、本文を読みやすくする（全ページ共通）
   -------------------------------------------------------------------------- */

@media print {
    body {
        background: none;
    }
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
        border-top: none;
    }
    .back-link {
        display: none;
    }
    .article, h2.chapter-title {
        break-inside: avoid;
    }
}

/* ==========================================================================
   サイト内検索（search.js）
   ヘッダーの検索欄と、その下に出る候補リストのスタイル。
   ========================================================================== */
.search-box {
    position: relative;
    max-width: 440px;
    margin: 20px auto 0;
    text-align: left;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--text-sub);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

#site-search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px 10px 36px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}

#site-search:focus {
    border-color: var(--railway-blue-text);
    box-shadow: 0 0 0 3px rgba(53, 70, 233, .12);
}

#site-search::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-results {
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 60vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(22, 29, 97, .13);
}

.search-result {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

.search-result:last-child { border-bottom: none; }
.search-result:hover,
.search-result.is-active { background: var(--railway-light); }

.search-result-page {
    display: block;
    font-size: 0.72rem;
    color: var(--text-sub);
}

.search-result-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--railway-blue-text);
    margin-top: 1px;
}

.search-result-snippet {
    display: block;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-sub);
    margin-top: 3px;
}

.search-result-snippet mark {
    background: rgba(53, 70, 233, .14);
    color: var(--railway-blue-text);
    padding: 0 1px;
    border-radius: 2px;
}

.search-empty {
    padding: 14px;
    font-size: 0.88rem;
    color: var(--text-sub);
    text-align: center;
}

@media (max-width: 600px) {
    /* 16px 未満だと iOS Safari がフォーカス時にページを拡大してしまう */
    #site-search { font-size: 16px; }
}

@media print {
    .search-box { display: none; }
}
