@charset "UTF-8";

/* ==========================================
   1. ページ全体のベース設定
   ========================================== */
body {
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    box-sizing: border-box;
    overflow-x: hidden;
}

.haikei {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: -1;
}

/* ==========================================
   2. タイトル
   ========================================== */
.titleborder {
    padding: 30px 20px 10px 20px;
}

#main {
    display: table;
    margin: 0 auto;
    background-color: #00e667;
    padding: 15px 40px;
    border: 3px solid #333333;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
    text-shadow: 
        -2px -2px 0 #333333,  2px -2px 0 #333333,
        -2px  2px 0 #333333,  2px  2px 0 #333333;
}

/* ==========================================
   3. 沿革ブロック（1つの箱に完全統合）
   ========================================== */
.owaku-total {
    max-width: 750px;
    margin: 40px auto;
    padding: 35px 40px;
    background-color: #ffffff;
    border: 2px solid #333333;
    box-shadow: 6px 6px 0 #333333;
    box-sizing: border-box;
}

.timeline-box {
    position: relative;
    padding-left: 25px;
    /* 💡 上から下まで途切れなく真っ直ぐ通るグリーンの1本線 */
    border-left: 3px solid #00e667; 
}

.timeline-box p {
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    margin: 0 0 30px 0;
    position: relative;
    text-align: left;
}

.timeline-box p:last-child {
    margin-bottom: 0;
}

/* 年号のスタイル */
.timeline-box p span {
    display: inline-block;
    font-weight: bold;
    color: #007032;
    margin-right: 15px;
    font-size: 18px;
    vertical-align: top;
}

/* 縦線の上に重なるポッチ（丸） */
.timeline-box p::before {
    content: "";
    position: absolute;
    left: -32px;
    top: 6px;
    width: 11px;
    height: 11px;
    background-color: #ffffff;
    border: 3px solid #333333;
    border-radius: 50%;
}

/* ==========================================
   4. リンク移動ボタン
   ========================================== */
.linkidou {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    width: 6.6vw;       
    min-width: 60px;
    height: auto;
    z-index: 9999;
}

.link {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.p4, .p5, .p6 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 16vw; 
    min-height: 120px;
    font-weight: bold;
    color: #fff;
    border: 1px solid #094;
    box-shadow: -3px 3px #007032;
    transition: 0.5s ease-in-out;
    background-color: #00e667;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}

.p4 { flex-direction: column; }
.p5, .p6 { flex-direction: row; }

.kaiten {
    transform: rotate(90deg);
    white-space: nowrap;
}

.char {
    transform: rotate(270deg);
    display: inline-block;
    text-decoration: underline;
}

.p4:hover, .p5:hover, .p6:hover {
    box-shadow: none;
    color: #00e667;
    background-color: #094;
    transform: translateX(-5px); 
}

/* ==========================================
   5. 📱 スマホ画面（横幅767px以下）完全対策
   ========================================== */
@media screen and (max-width: 767px) {
    .linkidou {
        width: 15vw !important;
        transform: translateY(-75%); 
    }
    
    .p4, .p5, .p6 {
        height: 25vw;
        font-size: 11px;
    }

    #main {
        font-size: 22px;
        padding: 10px 20px;
        width: calc(100% - 18vw) !important;
        margin: 0 0 10px 0 !important;
        box-sizing: border-box;
    }
    
    .owaku-total {
        width: calc(100% - 18vw) !important; /* ボタンに被らない道幅 */
        margin-left: 10px !important;
        margin-right: auto !important;
        padding: 20px 15px;
    }

    .timeline-box p {
        font-size: 14px;
    }

    .timeline-box p span {
        display: block; /* スマホ時は年号の下に本文を改行 */
        margin-bottom: 3px;
        font-size: 16px;
    }
}
