@charset "UTF-8";

/* ==========================================================================
   1. ブラウザスタイルのリセット & 共通基本設定
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* 画面幅が縮んでもレイアウトが崩れない魔法の設定 */
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    color: #333333;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    background: #ECECEC;
}

img {
    border: none;
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

ul {
    list-style: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* ==========================================================================
   2. 全体レイアウト設定（★スマホ対応に強化）
   ========================================================================== */
#container {
    text-align: left;
    margin: 0 auto;
    width: 100%;          /* スマホなどの小さな画面では自動で横幅100%に縮む */
    max-width: 1000px;    /* PCなどの大画面では、既存HP通り1000pxで綺麗にストップする */
    min-height: 100%;
    background-color: #FFFFFF;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* 多言語リンクバー（最上部） */
.lang-bar {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 20px;
    text-align: right;
    font-size: 13px;
    color: #cbd5e1;
    font-weight: 500;
}

.lang-bar a {
    color: #475569;
    text-decoration: none;
    margin: 0 6px;
    display: inline-block;
    padding: 2px 4px;
    transition: color 0.2s;
}

.lang-bar a:hover {
    color: #397131;
    text-decoration: underline;
    background-color: transparent !important;
}

/* スマホ時は多言語バーを中央揃えにして押しやすくする */
@media (max-width: 600px) {
    .lang-bar {
        text-align: center;
        padding: 10px;
        font-size: 12px;
    }
}

#header {
    background-color: #FFFFFF;
    border-bottom: 4px solid #397131;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* スマホ時に縦並びを許可 */
    gap: 15px;
}

/* スマホ時にヘッダーのロゴと印刷ボタンを中央縦並びにする */
@media (max-width: 600px) {
    #header {
        flex-direction: column;
        padding: 15px;
    }
}

#contents {
    padding: 0 20px 30px;
    background-color: #FFFFFF;
    color: #666666;
    flex: 1;
}

@media (max-width: 600px) {
    #contents {
        padding: 0 10px 20px; /* スマホ時は左右の余白を少し狭めて画面を広く使う */
    }
}

/* ==========================================================================
   3. ヘッダー部の装飾
   ========================================================================== */
#title_logo a {
    display: inline-block;
    transition: opacity 0.2s;
}

#title_logo a:hover {
    opacity: 0.7;
}

#explanation #print {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

#explanation #print a {
    display: inline-block;
    color: #ffffff;
    background-color: #397131;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

#explanation #print a:hover {
    background-color: #274d21;
    color: #ffffff;
}

#trace {
    text-align: left;
    margin: 15px 30px 5px;
    font-size: 12px;
    color: #666666;
}

@media (max-width: 600px) {
    #trace {
        margin: 10px 10px 5px;
    }
}

#trace a {
    color: #6666FF;
    text-decoration: none;
}

#trace a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   4. コンテンツ・会社案内UI（★ここが劇的に変わります）
   ========================================================================== */
#page_title {
    text-align: left;
    margin: 15px 0;
}

#page_title h1 {
    font-size: 18px;
    color: #333333;
    font-weight: bold;
    padding-left: 10px;
    border-left: 4px solid #397131;
}

#contents a:link,
#contents a:visited {
    color: #6666FF;
    text-decoration: none;
}

#contents a:hover {
    color: #6633FF;
    text-decoration: underline;
    background-color: #CCFFFF;
}

/* サムネイルエリア */
.thumbnail-nav {
    background-color: #f9f9f9;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 25px;
}

/* 【PC時】8枚を横一列（8列×1行）に並べる */
.thumbnail-list {
    display: grid;
    grid-template-columns: repeat(8, 1fr); 
    gap: 8px; 
}

/* 【スマホ時】画面幅に応じて自動で折り返す設定（メディアクエリ） */
@media (max-width: 768px) {
    /* タブレットや大きめのスマホ：横4列×2行に自動変化 */
    .thumbnail-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}
@media (max-width: 480px) {
    /* 通常のスマホ：指で押しやすいように横2列×4行に自動変化 */
    .thumbnail-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

.thumbnail-item button {
    display: block;
    width: 100%;
    text-align: center;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px;
    background-color: #ffffff;
    transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.2s ease;
}

.thumbnail-item button img {
    display: block;
    width: 100%; 
    height: auto;
    margin-bottom: 4px;
    aspect-ratio: 250 / 180; /* 横長比率を常にキープ */
    object-fit: cover;
    border-radius: 2px;
}

.thumbnail-item button span {
    font-size: 11px;
    font-weight: bold;
    color: #64748b;
    display: block;
    white-space: nowrap; 
    transition: color 0.25s ease;
}

.thumbnail-item button:hover {
    border-color: #94a3b8;
    background-color: #f1f5f9;
    transform: translateY(-2px);
}

#thumbnail-item.active button {
    border-color: #e60012;
    background-color: #fff5f5;
    box-shadow: 0 0 6px rgba(230, 0, 18, 0.15);
}

.thumbnail-item.active button span {
    color: #e60012;
}

/* OpenSeadragon ビューワー領域 */
#main {
    width: 100%;
    margin-bottom: 20px;
}

#openseadragon-viewer {
    width: 100%;
    height: 650px; /* PCでの表示高さ */
    background-color: #333333;
    border: 1px solid #999999;
}

/* スマホ時は縦が長くなりすぎないようビューワーの高さを少し抑える */
@media (max-width: 768px) {
    #openseadragon-viewer {
        height: 450px;
    }
}

#info_chirashi {
    font-family: sans-serif;
    font-size: 12px;
    color: #555555;
    line-height: 1.5;
    text-align: left;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    border-radius: 4px;
}

/* ==========================================================================
   5. フッター部の装飾
   ========================================================================== */
#footer {
    background-color: #FFFFFF;
    border-top: 4px solid #397131;
    padding: 20px 30px;
    color: #666666;
    font-size: 12px;
}

#footer a:link,
#footer a:visited {
    color: #6666FF;
    text-decoration: none;
}

#footer a:hover {
    color: #6633FF;
    text-decoration: underline;
    background-color: #CCFFFF;
}

.footer-upper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 600px) {
    .footer-upper {
        flex-direction: column;
        text-align: center;
    }
}

#footer address {
    font-style: normal;
}

#footer address strong {
    color: #333333;
    margin-left: 5px;
}

#footer #ez a {
    font-size: 10px;
    color: #CCCCCC;
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
}

#footer #explanation {
    font-size: 11px;
    color: #666666;
    line-height: 1.6;
    text-align: justify;
}

/* ==========================================================================
   6. 印刷用設定
   ========================================================================== */
@media print {
    #container {
        margin: 0;
        box-shadow: none;
        width: 100%;
    }
    #header, #footer, .thumbnail-nav, #info_chirashi, #trace, .lang-bar {
        display: none !important;
    }
    #openseadragon-viewer {
        border: none;
        height: 100%;
    }
}

/* ==========================================================================
   会社案内ページ用：選択されたサムネイル（アクティブ）の装飾
   ========================================================================== */
/* 選択中のボタンに赤枠と薄赤の背景を適用 */
.thumbnail-nav .thumbnail-list .thumbnail-item.active button {
    border-color: #e60012 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 6px rgba(230, 0, 18, 0.15) !important;
}

/* 選択中のボタン内の文字（1P、2Pなど）も赤色に変更 */
.thumbnail-nav .thumbnail-list .thumbnail-item.active button span {
    color: #e60012 !important;
}
