/* 1st-train専用スタイル - クラシックデザイン */

/* ===== リセット & 基本設定 ===== */
* {
    margin: 0;
    padding: 0;
}

body {
    font-family: "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, Osaka, "MS Pゴシック", "MS PGothic", sans-serif;
    background-color: #bbbbbb;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

/* ===== ページ全体のラッパー ===== */
.page-wrapper {
    max-width: 1050px;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
    border-left: 1px solid #999999;
    border-right: 1px solid #999999;
}

/* ===== コンテナ ===== */
.container {
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== ヘッダー ===== */
header {
    background-color: white;
    border-bottom: 2px solid #666666;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 10px 20px 0 20px;
}

header h1 {
    font-size: 24px;
    font-weight: normal;
    color: #000099;
    margin-bottom: 5px;
}

header h1 a {
    text-decoration: none;
    color: #000099;
    display: inline-block;
}

.site-logo {
    height: 40px;
    width: auto;
    vertical-align: middle;
}

/* ハンバーガーメニューボタン */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background-color: #000099;
    transition: all 0.3s ease;
}

.hamburger-menu:hover span {
    background-color: #0000cc;
}

/* オーバーレイ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.overlay-visible {
    display: block;
    opacity: 1;
}

/* 閉じるボタン */
.sidebar-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    z-index: 1001;
}

.sidebar-close:hover {
    color: #000;
}

.archive-notice {
    background-color: #ffdddd;
    color: #cc0000;
    padding: 8px 20px;
    font-size: 13px;
    border-top: 1px solid #ff9999;
    border-bottom: 1px solid #ff9999;
    text-align: center;
}

.notice-icon {
    margin-right: 5px;
}

/* ナビゲーション */
.header-nav {
    background-color: #f5f5f5;
    border-bottom: 1px solid #cccccc;
    padding: 8px 20px;
    font-size: 12px;
    text-align: right;
}

.header-nav a {
    color: #0000cc;
    text-decoration: none;
    margin: 0 10px;
}

.header-nav a:hover {
    text-decoration: underline;
}

/* ===== メインコンテンツ ===== */
main {
    padding: 20px;
}

/* ===== パンくずリスト ===== */
.breadcrumbs {
    font-size: 12px;
    color: #666666;
    padding: 10px 0;
    margin-bottom: 15px;
}

.breadcrumb-link {
    color: #0000cc;
    text-decoration: none;
}

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

.breadcrumb-separator {
    margin: 0 8px;
    color: #999999;
}

.breadcrumb-current {
    color: #333333;
}

/* ===== 記事一覧 ===== */
.topics-list h2 {
    background-color: #000099;
    color: white;
    font-size: 16px;
    font-weight: normal;
    padding: 8px 15px;
    margin-bottom: 20px;
    border: 1px solid #999999;
}

.topics-grid {
    display: block;
}

.topic-card {
    background: white;
    border: 1px solid #999999;
    margin-bottom: 15px;
    overflow: hidden;
}

.topic-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.topic-link:hover {
    background-color: #f9f9f9;
}

.topic-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: #eeeeee;
    border-bottom: 1px solid #cccccc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.no-image-text {
    font-size: 14px;
    color: #767676;
    font-weight: 500;
}

.topic-content {
    padding: 15px;
}

.topic-content h3 {
    font-size: 14px;
    line-height: 1.5;
    color: #000099;
    margin-bottom: 10px;
    font-weight: bold;
}

.topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #666666;
}

.topic-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.meta-label {
    font-weight: 600;
    color: #333;
}

.topic-meta a {
    color: #0000cc;
    text-decoration: none;
}

.topic-meta a:hover {
    text-decoration: underline;
}

/* ===== 記事詳細 ===== */
.article-detail {
    background: white;
}

.article-header {
    border-bottom: 2px solid #666666;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.article-header h1 {
    font-size: 18px;
    color: #000099;
    margin-bottom: 15px;
    line-height: 1.5;
    font-weight: bold;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
    font-size: 12px;
    color: #666666;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.article-photos {
    margin: 20px 0;
}

.photo-item {
    margin-bottom: 25px;
    text-align: center;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.photo-item img {
    width: 100%;
    height: auto;
    border: 1px solid #999999;
}

.photo-item figcaption {
    margin-top: 8px;
    font-size: 13px;
    text-align: center;
}

/* 撮影者情報 */
.photo-info {
    background-color: #f5f5f5;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #cccccc;
    font-size: 12px;
    color: #333;
    line-height: 1.5;
}

.photo-info span {
    display: inline-block;
    margin-right: 15px;
}

.photo-info .photographer {
    font-weight: normal;
}

.photo-info a {
    color: #0000cc;
    text-decoration: none;
}

.photo-info a:hover {
    text-decoration: underline;
}

.article-body {
    line-height: 1.8;
    color: #333;
    margin: 20px auto;
    font-size: 14px;
    /* 2026-10-10 写真（.photo-item、元画像が横480px）と左端を揃えるため 640px → 480px */
    max-width: 480px;
    /* 本文中の長いURLが枠からはみ出さないように */
    overflow-wrap: break-word;
}

.article-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #cccccc;
}

.back-link {
    display: inline-block;
    color: #0000cc;
    text-decoration: none;
    font-size: 13px;
    padding: 5px 10px;
    border: 1px solid #cccccc;
    background-color: #f5f5f5;
}

.back-link:hover {
    background-color: #e5e5e5;
    text-decoration: underline;
}

/* ===== フッター ===== */
footer {
    background-color: white;
    border-top: 1px solid #999999;
    padding: 20px;
    margin-top: 30px;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 5px 0;
    font-size: 12px;
    color: #666666;
}

.copyright {
    font-size: 12px;
}

.current-site a {
    color: #0000cc;
    text-decoration: none;
}

.current-site a:hover {
    text-decoration: underline;
}

/* ===== その他 ===== */
.no-articles {
    text-align: center;
    color: #666666;
    font-size: 14px;
    padding: 40px 20px;
}

.pagination {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    border: 1px solid #cccccc;
    background-color: white;
    color: #000099;
    text-decoration: none;
    font-size: 13px;
}

.pagination a:hover {
    background-color: #f5f5f5;
    border-color: #000099;
}

.pagination .current {
    background-color: #000099;
    color: white;
    border-color: #000099;
    font-weight: bold;
}

.pagination .disabled {
    color: #cccccc;
    cursor: not-allowed;
    pointer-events: none;
}

.prev-link,
.next-link {
    font-weight: 500;
}

/* ===== 2カラムレイアウト ===== */
.two-column-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* ===== サイドバー ===== */
.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.sidebar-section {
    background-color: white;
    border: 1px solid #999999;
    margin-bottom: 15px;
    overflow: hidden;
}

.sidebar-title {
    background-color: #000099;
    color: white;
    font-size: 14px;
    font-weight: normal;
    padding: 8px 12px;
    margin: 0;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    border-bottom: 1px solid #eeeeee;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-list a {
    display: block;
    padding: 8px 12px;
    color: #0000cc;
    text-decoration: none;
    font-size: 12px;
    transition: background-color 0.2s;
}

.sidebar-list a:hover {
    background-color: #f5f5f5;
    text-decoration: underline;
}

.sidebar-list .count {
    color: #999999;
    font-size: 11px;
    margin-left: 5px;
}

/* サイドバー検索フォーム */
.sidebar-search-form {
    padding: 12px;
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
}

.sidebar-search-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid #cccccc;
    font-size: 12px;
    font-family: inherit;
}

.sidebar-search-input:focus {
    outline: 2px solid #000099;
    outline-offset: 2px;
    border-color: #000099;
}

.sidebar-search-button {
    flex-shrink: 0;
    padding: 6px 12px;
    background-color: #000099;
    color: white;
    border: 1px solid #000099;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.sidebar-search-button:hover {
    background-color: #0000cc;
}

/* 検索ページ用のフォームボックス */
.search-form-box {
    background-color: #f5f5f5;
    border: 1px solid #cccccc;
    padding: 20px;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #cccccc;
    font-size: 14px;
    font-family: inherit;
}

.search-input:focus {
    outline: 2px solid #000099;
    outline-offset: 2px;
    border-color: #000099;
}

.search-button {
    padding: 10px 25px;
    background-color: #000099;
    color: white;
    border: 1px solid #000099;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.search-button:hover {
    background-color: #0000cc;
}

.search-button:focus {
    outline: 2px solid #000099;
    outline-offset: 2px;
}

.sidebar-search-button:focus {
    outline: 2px solid #000099;
    outline-offset: 2px;
}

/* 全てのフォーカス可能要素に焦点可視性を確保 */
a:focus,
button:focus {
    outline: 2px solid #000099;
    outline-offset: 2px;
}

.search-result-count {
    color: #666666;
    font-size: 13px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #000099;
}

/* ===== レスポンシブ対応 ===== */
@media (max-width: 768px) {
    .container {
        border-left: none;
        border-right: none;
    }

    header h1 {
        font-size: 20px;
    }

    .topic-image {
        height: 180px;
    }

    .article-detail {
        padding: 15px;
    }

    .article-header h1 {
        font-size: 16px;
    }

    .photo-info span {
        display: block;
        margin-right: 0;
        margin-bottom: 3px;
    }

    /* ハンバーガーメニュー表示 */
    .hamburger-menu {
        display: flex;
    }

    /* 2カラムレイアウトをモバイルでは調整 */
    .two-column-layout {
        flex-direction: row;
    }

    .main-content {
        flex: 1;
        width: 100%;
    }

    /* サイドバーをオフキャンバスに */
    .sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100%;
        background-color: white;
        z-index: 1100;
        overflow-y: auto;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        padding-top: 50px;
    }

    .sidebar.sidebar-open {
        right: 0;
    }

    .sidebar-close {
        display: block;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 18px;
    }

    .topics-list h2 {
        font-size: 14px;
    }

    .topic-content {
        padding: 12px;
    }

    .topic-content h3 {
        font-size: 13px;
    }

    .article-header h1 {
        font-size: 15px;
    }
}

/* =====================================================================
   当時（2007年頃）のデザイン（2026-10-10、設計書 docs/1st-train_cutover_design_2026-10-09.md §4.6）
   手本：web.archive.org の 1st-train.xrea.jp/k-phototopic/314.html（2007-02-08）。広告は出さない。
   当時の値：白い枠752px（左右1px #999999）、ロゴ190×40＋バナー550×50、2px #666666 の線、
   見出し枠のアクセント #00cccc、写真480×320、撮影情報・本文は幅480の1px #999999 の枠、文字は約13px。
   上の既存の指定を、ここでまとめて上書きする。
   ===================================================================== */

.page-wrapper {
    max-width: 752px;
}

/* --- ヘッダー --- */
.classic-header {
    background-color: white;
    border-bottom: none; /* 既存の header の2px線を消す（線は .classic-banner の下の1本だけ） */
}

.classic-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 50px;
    border-bottom: 2px solid #666666;
}

.classic-logo {
    display: block;
    width: 190px;
    height: 40px;
}

.classic-logo img,
.classic-photo {
    display: block;
}

.classic-photo {
    width: 550px;
    height: 50px;
}

.classic-links {
    text-align: right;
    font-size: 12px;
    line-height: 16px;
    padding: 1px 4px 0 0;
}

.classic-links a {
    color: #0000cc;
}

.classic-main {
    padding: 12px 18px 0;
}

.breadcrumbs {
    font-size: 11px;
    margin-bottom: 10px;
}

/* --- 見出しの枠（当時は右半分が広告） --- */
.article-detail {
    padding: 0;
}

.title-box {
    border: 1px solid #999999;
    background-color: white;
    margin-bottom: 18px;
}

.title-box-head {
    display: flex;
    align-items: stretch;
    height: 16px;
    border-bottom: 1px solid #999999;
}

.title-box-accent {
    display: block;
    width: 5px;
    background-color: #00cccc;
    border-right: 1px solid #999999;
    margin-right: 4px;
}

.title-box-head img {
    display: block;
}

.title-box-title {
    font-size: 13px;
    font-weight: normal;
    color: #000000;
    text-align: center;
    line-height: 1.5;
    margin: 0;
    padding: 12px 8px 2px;
}

.title-box .article-meta {
    justify-content: center;
    gap: 12px;
    padding: 0 8px 8px;
    font-size: 11px;
}

/* 一覧ページの見出しも同じ枠の見た目に */
.topics-list h2 {
    background-color: white;
    color: #000000;
    font-size: 13px;
    text-align: center;
    border: 1px solid #999999;
    border-left: 5px solid #00cccc;
    padding: 12px 8px;
    margin-bottom: 18px;
}

/* --- 2列（当時は本文510px＋広告180px） --- */
.two-column-layout {
    gap: 24px;
}

.sidebar {
    width: 180px;
}

.sidebar-section {
    margin-bottom: 12px;
}

.sidebar-title {
    background-color: white;
    color: #000000;
    font-size: 12px;
    border-bottom: 1px solid #999999;
    border-left: 5px solid #00cccc;
    padding: 4px 6px;
}

.sidebar-list a {
    font-size: 12px;
    padding: 4px 8px;
}

.sidebar-close {
    display: none !important;
}

/* --- 写真と撮影情報（写真480、撮影情報は幅480の枠、撮影地→撮影者→撮影日） --- */
.article-photos {
    margin: 0;
}

.photo-item {
    max-width: 482px;
    margin: 0 auto 28px;
}

.photo-item img {
    display: block;
    border: 1px solid #999999;
}

.photo-item figcaption,
.photo-info {
    box-sizing: border-box;
    background-color: white;
    border: 1px solid #999999;
    margin-top: 12px;
    padding: 3px 4px;
    font-size: 13px;
    color: #000000;
    text-align: center;
}

.photo-info span {
    display: inline;
    margin: 0 0.5em;
}

/* --- 本文（幅480の枠の中に中央寄せ） --- */
.article-body {
    box-sizing: border-box; /* 枠と余白込みで写真（482px）と同じ幅にする */
    max-width: 482px;
    margin: 0 auto 10px;
    border: 1px solid #999999;
    background-color: white;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    color: #000000;
    padding: 13px 6px;
}

/* --- フッター --- */
.classic-footer {
    text-align: center;
    padding: 30px 18px 15px;
    font-size: 13px;
    border-top: none; /* 既存の footer の上の線を消す（当時は「トップページ」の下の線だけ） */
    margin-top: 0;
}

.classic-footer-nav img {
    vertical-align: middle;
}

.classic-footer-nav a {
    color: #0000cc;
    margin: 0 4px;
}

.classic-footer hr {
    border: 0;
    border-top: 1px solid #999999;
    margin: 10px 0;
}

.classic-footer .copyright,
.classic-footer .current-site {
    font-size: 12px;
    color: #333333;
    margin: 4px 0;
}

/* --- スマホ（768px以下）：同じ部品を縦に並べる。サイドバーは本文の下 --- */
@media (max-width: 768px) {
    .page-wrapper {
        border-left: none;
        border-right: none;
    }

    .classic-banner {
        height: auto;
        flex-wrap: wrap;
        align-items: center;
    }

    .classic-logo {
        margin: 6px 0 4px 8px;
    }

    .classic-photo {
        flex-basis: 100%;
        width: 100%;
        height: auto;
    }

    .classic-main {
        padding: 10px 10px 0;
    }

    .two-column-layout {
        flex-direction: column;
        gap: 10px;
    }

    .main-content {
        width: 100%;
    }

    .sidebar {
        position: static;
        width: 100%;
        max-width: none;
        height: auto;
        right: auto;
        box-shadow: none;
        padding-top: 0;
        overflow: visible;
        transition: none;
        z-index: auto;
    }

    .photo-item,
    .article-body {
        max-width: 100%;
    }

    .photo-info span {
        display: block;
        margin: 0;
    }

    .classic-footer {
        padding: 20px 10px 10px;
    }
}

/* --- ページ送り（2026-10-10）：枠をやめて数字を並べるだけにし、今のページは太字＋水色の下線 ---
   HTML は Elements/firsttrain_pager.ctp（span の中に a。今のページは span.current、使えない前へ/次へは span.disabled）。
   以前は外側の span と中の a の両方に枠と余白が付いて二重の箱になっていた */
.pagination {
    text-align: center;
    margin: 24px 0 8px;
    padding: 14px 0 0;
    border-top: 1px solid #dddddd;
    font-size: 13px;
    line-height: 1;
}

.pagination span,
.pagination a {
    border: none;
    padding: 0;
    margin: 0;
    background: none;
}

.pagination > span {
    display: inline-block;
    margin: 0 1px;
    vertical-align: middle;
}

.pagination > span > a,
.pagination .current,
.pagination .disabled {
    display: inline-block;
    box-sizing: border-box;
    min-width: 30px;
    height: 30px;
    line-height: 28px;
    padding: 0 6px;
    text-align: center;
    border-bottom: 2px solid transparent;
    color: #0000cc;
    text-decoration: none;
    font-weight: normal;
}

.pagination > span > a:hover {
    background: none;
    border-bottom-color: #999999;
}

.pagination .current {
    background: none; /* 既存の .pagination .current（紺の塗り）を消す */
    color: #000000;
    font-weight: bold;
    border-bottom-color: #00cccc;
}

.pagination .prev-link,
.pagination .next-link {
    margin: 0 10px;
}

.pagination .disabled {
    color: #bbbbbb;
}

@media (max-width: 480px) {
    .pagination .prev-link,
    .pagination .next-link {
        margin: 0 4px;
    }

    .pagination > span > a,
    .pagination .current,
    .pagination .disabled {
        min-width: 26px;
        padding: 0 4px;
    }
}
