/* 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: dnp-shuei-nmincho-std, sans-serif;
    font-style: normal;
    font-weight: 400;
    background-color: #e0e0d9; /* 全体の薄いグレー背景 */
    color: #333;
    line-height: 1.8;
}

header {
    width: 100%;
    height: 100px;
}

.logo-placeholder{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: transparent;
}

.logo-placeholder img{
    width: 200px;
    height: auto;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    padding-bottom: 5px;
  position: relative;
}

nav ul li a:hover::before {
  transform-origin: left top;
  transform: scale(1, 1);
}


nav ul li a::before {
  background: #333;
  content: '';
  width: 100%;
  height: 1px;
  position: absolute;
  left: 0;
  bottom: 0;
  transform-origin: right top;
  transform: scale(0, 1);
  transition: transform .3s;
}

.about-page, .reason-section, #dictionaries {
    position: relative;
    overflow: hidden; /* 雲が画面外へはみ出るのを防ぐ */
    z-index: 0;
}

/* 2. アニメーションレイヤーの基本スタイル */
.cloud-animation-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%; /* ループ用に幅を2倍にする */
    height: 100%;
    z-index: -1; /* 一番下の階層に配置 */
    background-image: url('../img/cloud.png'); /* 提供された雲の画像 */
    background-repeat: repeat-x;
    background-size: contain; /* 画像の比率を維持 */
    opacity: 0.5; /* 背景に馴染ませるために透明度を調整（デザインに合わせて変更可） */
    pointer-events: none; /* マウス操作を邪魔しない */
    animation: cloudMove 60s linear infinite; /* 60秒かけてゆっくり動く */
}

/* 3. 雲を横に動かすアニメーション */
@keyframes cloudMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* 幅の半分まで進むと、継ぎ目なくループする */
    }
}

/* 4. 既存コンテンツを雲より上に確実に表示させる */
.intro-hero, 
.reason-section, 
.zyobun {
    position: relative;
    z-index: 1;
}



/* 縦書き共通クラス */
.vertical-text {
    writing-mode: vertical-rl;
    text-align: justify;
    padding: 80px 0;
    line-height: 4;
}

/* ヒーローセクション */
.intro-hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 100px;
}

.intro-hero-content{
    display: flex;
    justify-content: space-between;
}

.vertical-title-red {
    writing-mode: vertical-rl;
    color: #AE1F1F;
    font-size: 2.5rem;
    padding-left: 20px;
    margin-right: 50px;
}

.intro-main-text{
    font-size: 20px;
}

.horizontal-sub-title{
    text-align: center;
    font-size: 36px;
}

.reason-grid{
    font-size: 16px;
    width: auto;
    height: 670px;
    margin-bottom: 150px;
}

/* 編纂者セクション（ダークグレー） */
.compilers-section {
    background-color: #3d3d3f;
    color: #fff;
    padding: 100px 50px;
}

.section-title-white {
    margin-bottom: 60px;
    font-weight: 400;
    letter-spacing: 0.2em;
}

.compilers-grid {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.reason-grid{
    margin: auto;
}

.person-card {
    flex: 1;
    text-align: center;
}

.p-name {
    display: block;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.p-image-box {
    width: 100%;
    aspect-ratio: 3/3.5;
    background-color: #676767; /* 画像プレースホルダー */
    border:solid 2px #333;
    margin-bottom: 20px;
}
.p-image-box img{
    width: 100%;
}

.p-desc {
    text-align: left;
    font-size: 0.85rem;
    line-height: 1.8;
}

.p-desc h4 {
    margin-bottom: 10px;
    font-weight: 400;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 5px;
}

/* 年表セクション */
/* 年表セクション全体 */
.timeline-section {
    position: relative;
    padding: 150px 0;
    background-color: #f0f0f0; /* 画像の薄いグレー */
    overflow: hidden;
}

.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 0 50px;
}

/* タイトル：右側に縦書きで配置 */
.timeline-title {
    writing-mode: vertical-rl;
    font-size: 36px;
    font-weight: 400;
    color: #333;
    position: absolute;
    right: 50px;
    top: 0;
    letter-spacing: 0.3em;
}

/* 年表のメインエリア */
.timeline-inner {
    width: 1000px;
    position: relative;
    margin-top: 100px;
    padding-top: 2px; /* 線の厚み分 */
}

/* 横に走る直線 */
.timeline-base-line {
    position: absolute;
    top: 0;
    right: 0;
    width: 0; /* 最初は幅0（GSAPで伸ばす） */
    height: 1.5px;
    background-color: #333;
    z-index: 1;
}

/* 項目の並び（右から左へ流れる） */
.timeline-scroll-area {
    display: flex;
    flex-direction: row-reverse; /* 右から左へ並べる */
    justify-content: flex-start;
    gap: 80px; /* 項目間の幅 */
    padding-right: 150px; /* タイトルとの被り防止 */
}

.timeline-item {
    position: relative;
    width: auto;
    opacity: 0; /* 最初は隠す */
    transform: translateX(20px); /* 少し右にずらしておく */
}

/* 線上のドット */
.t-dot {
    position: absolute;
    top: -5px; /* 線の上に重なる位置 */
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background-color: #333;
    border-radius: 50%;
    z-index: 2;
}

/* 縦書きの文字コンテンツ */
.t-content {
    writing-mode: vertical-rl;
    padding-top: 40px; /* ドットからの距離 */
    height: 400px; /* 縦書きの長さ（画像に合わせる） */
}

.t-year {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1.5rem; /* 縦書きなので「左側」の余白になる */
    display: inline-block;
}

.t-event {
    font-size: 1rem;
    line-height: 2.2;
    text-align: justify;
}

/*序文*/
.zyobun .zyobun-text{
    margin: auto;
}
.zyobun h2{
    text-align: center;
    margin: 100px 0 0 0;
}

.zyobun .vertical-text{
    margin: auto;
    line-height: 2;
}
.zyobun .vertical-text p{
    padding: 0 30px;
}

.site-footer {
    background-color: #e0e0d9;
    padding: 0;
    position: relative;
    bottom: -20px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0;
    text-align: left; /* 左寄せ */
}
.footer-inner img{
    width: 200px;
}
.footer-logo {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 20px;
    color: #333;
    letter-spacing: 0.1em;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    gap: 10px;
    padding: 0;
    margin-bottom: 30px;
}

.footer-nav ul li a {
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
}

.footer-line {
    border: none;
    border-top: 1px solid #999;
    width: 100%;
}

.copyright {
    font-size: 0.75rem;
    color: #666;
    letter-spacing: 0.02em;
    margin: 20px 0;
}

/* アニメーションさせる要素の初期状態 */
.vertical-text p, 
.compilers-section, 
h2 {
  opacity: 0;
  will-change: transform, opacity, filter;
}

/* 縦書き設定の確認（河馬印風の余白） */
.vertical-text p {
  margin-left: 1.5em; /* 文章ごとの間隔 */
  letter-spacing: 0.15em;
}
/* --- スマホ・タブレット対応 (768px以下) --- */
@media (max-width: 768px) {
    /* ヘッダー・ハンバーガーメニュー (TOPページと共通) */
    .hamburger {
        display: block;
        width: 30px;
        height: 25px;
        position: relative;
        z-index: 100;
        cursor: pointer;
    }
    .hamburger span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #333;
        position: absolute;
        transition: 0.3s;
    }
    .hamburger span:nth-child(1) { top: 0; }
    .hamburger span:nth-child(2) { top: 10px; }
    .hamburger span:nth-child(3) { top: 20px; }

    .hamburger.open span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
    .hamburger.open span:nth-child(2) { opacity: 0; }
    .hamburger.open span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: rgba(224, 224, 217, 0.98);
        z-index: 90;
        transition: 0.5s;
        padding-top: 100px;
    }
    nav.open { right: 0; }
    nav ul { flex-direction: column; align-items: center; }
    nav ul li { margin: 20px 0; }

    /* ヒーローセクション */
    .intro-hero {
        padding: 50px 20px;
        height: auto;
        min-height: 80vh;
    }
    .intro-hero-content {
        flex-direction: column-reverse; /* タイトルを上に */
        align-items: center;
    }
    .vertical-title-red {
        margin: 0 0 40px 0;
        padding: 0;
        font-size: 2rem;
        writing-mode: horizontal-tb; 
    }
    .intro-main-text {
        writing-mode: vertical-rl;
        font-size: 14px;
        height: auto;
        max-height: none;
        text-align: left;
        align-items: center;
    }
    .vertical-text {
        writing-mode: vertical-rl;
        font-size: 14px;
        line-height: 2.2;
    }
    /* なぜ作られたの？セクション */
    .reason-section {
        padding: 60px 20px;
    }
    .horizontal-sub-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    .reason-grid{
        writing-mode: horizontal-tb; 
    }


    /* 編纂者セクション */
    .compilers-grid {
        flex-direction: column;
        gap: 50px;
    }
    .person-card {
        width: 100%;
    }

    /* ★年表セクション：縦型へ変換 */
    .timeline-container {
        padding: 0 20px;
    }
    .timeline-title {
        position: relative;
        right: auto;
        top: auto;
        writing-mode: horizontal-tb;
        text-align: center;
        margin-bottom: 50px;
        letter-spacing: 0.1em;
    }
    .timeline-inner {
        width: 100%;
        margin-top: 0;
    }
    .timeline-base-line {
        top: 0;
        left: 25px; /* 左側に縦線を引く */
        width: 1.5px !important;
        height: 100%;
    }
    .timeline-scroll-area {
        flex-direction: column; /* 縦並び */
        padding: 0 0 0 50px; /* 線の右側にコンテンツ */
        gap: 40px;
    }
    .t-dot {
        left: -30px;
        top: 5px;
        transform: none;
    }
    .t-content {
        writing-mode: horizontal-tb;
        height: auto;
        padding-top: 0;
    }
    .t-year {
        margin-bottom: 5px;
    }

/* --- スマホ・タブレット対応 (768px以下) --- */
@media (max-width: 768px) {

    /* 序文セクションのスマホ設定 */
    .zyobun {
        padding: 60px 0; /* 左右の余白をなくしてスクロール領域を広げる */
    }

    .zyobun h2 {
        margin: 0 0 30px 0; /* タイトルの余白調整 */
        text-align: center;
    }

    /* 序文のテキストエリア：スマホのみスクロールを有効化 */
    .zyobun .zyobun-text {
        width: 100%;             /* 画面幅いっぱいに広げる */
        height: 50vh;            /* スクロールを発生させるための高さ固定（画面の半分程度） */
        padding: 20px 40px;      /* 内側の余白 */
        
        /* 縦書き横スクロールの設定 */
        writing-mode: vertical-rl; 
        overflow-x: auto;        /* 横方向のスクロールを許可 */
        overflow-y: hidden;      /* 縦方向は固定 */
        direction: rtl;          /* スクロールの開始位置を右端にする */
        border-bottom: 1px solid #d0cfca;
        box-sizing: border-box;
        
        /* 指での操作をなめらかにする */
        -webkit-overflow-scrolling: touch;
    }

    /* rtlの影響で文字順が乱れないためのリセット */
    .zyobun .zyobun-text p {
        direction: ltr;
        margin-left: 2em; /* 行間（縦書きなので左側の余白） */
        display: inline-block;
    }

    /* スマホ用スクロールバーの見た目調整（必要に応じて） */
    .zyobun .zyobun-text::-webkit-scrollbar {
        height: 8px;
    }
    .zyobun .zyobun-text::-webkit-scrollbar-thumb {
        background: #bba590;
        border-radius: 4px;
    }
    .zyobun .zyobun-text::-webkit-scrollbar-track {
        background: #f0ece9;
    }
}
}
