/* 基本スタイル */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Arial', 'Helvetica', sans-serif;
    background-color: white;
    color: black;
    overflow-x: hidden;
    transition: background-color 1s ease, color 1s ease;
}

/* ローディング画面 */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 150px;
    font-weight: normal;
    z-index: 1000;
    transition: font-size 0.3s ease, font-weight 0.3s ease;
}

.final-count {
    font-weight: normal;
    color: white;
}

/* マーベル風イントロ */
#marvel-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.marvel-image {
    width: 0;
    height: 0;
    margin: 5px;
    object-fit: cover;
    transition: all 0.5s ease;
}

/* メインコンテンツ */
#content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px;
    position: relative;
    z-index: 1001;
}

/* メイン画像コンテナ */
#main-image-container {
    position: relative;
    width: calc(100% + 60px);
    max-width: none;
    margin: 0 -30px 30px;
    height: 50vh;
    overflow: hidden;
}

#image_main {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-in-out;
}

/* 記念誌セクション */
#anniversary-100 {
    margin-bottom: 30px;
}

.anniversary-100-image-container {
    height: 70vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

#anniversary-100-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
}

/* フルワイドセクション */
.full-width-section {
    width: 100%;
    margin: 30px 0;
    position: relative;
    clear: both;
}

.full-width-section .section-content {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    color: white;
    margin: 0;
}

/* ヘッダーオーバーレイ */
.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.3));
    color: white;
    text-align: center;
    padding: 0;
}

.header-overlay h2 {
    font-size: 3.5em;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    letter-spacing: 0.05em;
    font-weight: normal;
}

.header-overlay small {
    font-family: "Yu Gothic", YuGothic, sans-serif;
    font-size: 1.8em;
    letter-spacing: 0.1em;
    display: block;
    line-height: 1.2;
    margin-top: 10px;
    font-weight: normal;
}

/* ギャラリー */
.gallery-image {
    width: 250px;
    height: 250px;
    object-fit: cover;
    margin-right: 10px;
    flex-shrink: 0;
    cursor: pointer;
}

#gallery-container {
    width: 100%;
    position: relative;
    padding: 20px 0;
    overflow: hidden;
    margin: 0;
}

#gallery {
    display: flex;
    position: relative;
    left: 0;
    transition: left 0.3s ease;
}

/* 共通の矢印スタイル */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
}

/* ギャラリーの矢印 */
#gallery-prev,
#gallery-next {
    font-size: 24px;
    padding: 10px 15px;
}

#gallery-prev { left: 10px; }
#gallery-next { right: 10px; }

/* メインコンテンツスタイル */
main {
    padding: 0;
}

h2, h3 {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 25px;
}

.view-more {
    text-decoration: none;
    color: white;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.1em;
    position: relative;
    padding-right: 20px;
    margin-bottom: 30px;
}

.view-more::after {
    content: '>';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* モーダル */
#modal {
    display: none;
    position: fixed;
    z-index: 1004;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: pointer;
}

#modal.show {
    display: block;
    opacity: 1;
}

#modal-close {
    position: fixed;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

#modal-instruction {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #f1f1f1;
    padding: 10px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#modal.show #modal-instruction {
    opacity: 1;
}

/* ハンバーガーメニュー */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1003;
    background-color: #000080;
    padding: 10px;
    width: 50px;
    height: 50px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.hamburger-menu:hover {
    background-color: #000066;
}

.bar1, .bar2, .bar3 {
    width: 35px;
    height: 6px;
    background-color: #FF7F50;
    margin: 3px 0;
    transition: 0.4s;
}

.change .bar1 {
    transform: rotate(-45deg) translate(-8px, 8px);
}

.change .bar2 {
    opacity: 0;
}

.change .bar3 {
    transform: rotate(45deg) translate(-8px, -8px);
}

/* メニュー */
.menu {
    position: fixed;
    right: -375px;
    top: 0;
    width: 375px;
    height: 100%;
    background-color: #000080;
    transition: 0.3s;
    z-index: 1002;
    overflow-y: auto;
}

.menu.open {
    right: 0;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 120px;
}

.menu ul li {
    padding: 15px 20px;
    position: relative;
    display: block;
    margin: 5px 0;
}

.menu ul li a {
    color: white;
    text-decoration: none;
    display: inline-block;
    padding-left: 10px;
    font-size: 1.3em;
    font-weight: bold;
    padding: 5px 0;
}

.menu ul li a:hover {
    color: #FFA500;
}

/* サブメニューのスタイル */
.menu > ul > li.has-submenu > .submenu {
    display: none;
    padding-left: 35px;
    margin-top: 10px;
}

.has-submenu.open > .submenu {
    display: block;
}

/* サブメニューのトリガーのスタイル */
.submenu-trigger {
    position: relative;
    padding-right: 5px;
}

/* べてのサュートリガーに三角マークを表示 */
.submenu-trigger::after {
    content: '▼';
    position: absolute;
    right: -35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: white;
}

/* 開いているときの三角マークを回転 */
.has-submenu.open > a.submenu-trigger::after {
    content: '▼';
    transform: translateY(-50%) rotate(180deg);
}

/* サブメニュー内のサブメニューのトリガーにも三角マークを表示 */
.submenu .has-submenu > a.submenu-trigger::after {
    content: '▼';
    position: absolute;
    right: -35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: white;
}

/* サブメニュー内の開いているサブメニューの三角マークを回転 */
.submenu .has-submenu.open > a.submenu-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

/* フッター */
footer {
    text-align: center;
    padding: 30px;
    margin-top: 30px;
    background-color: rgba(0, 0, 0, 0.8);
}

/* コンテンツセクション */
.content-section {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    gap: 30px;
    position: relative;
    clear: both;
}

.text-content {
    flex: 1;
}

/* 詩のセクション */
.poem-section {
    margin: 30px 0;
    padding: 0 30px 30px 30px;
    background-image: url('../images/写真/image_poem.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.poem-container {
    font-family: 'Noto Serif JP', serif;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    font-size: 18px;
    line-height: 2;
    color: #000;
    max-height: 100vh;
    overflow-x: auto;
    position: relative;
    padding-right: 30px;
}

.poem-header {
    margin-left: 20px;
    padding-left: 20px;
}

.poem-content {
    margin-left: 75px;
}

.poem-title {
    font-weight: normal;
    font-size: 25px;
    margin: 0 0 20px 0;
    padding-right: 20px;
}

.poem-author {
    
    bottom: px;
    right: 100px;
    font-size: 16px;
}

.poem-author p {
    margin: 5px 0;
}

.poem-verse {
    margin-bottom: 30px;
}

.poem-verse:not(:first-child) {
    margin-right: 1em;
}

.poem-verse h3 {
    font-weight: normal;
    font-size: 20px;
    margin: 0 0 20px 0;
}

.poem-verse p {
    margin: 0 0 10px 0;
}

.vertical-bracket {
    -ms-text-combine-upright: all;
    text-combine-upright: all;
    font-feature-settings: "vpal";
    font-size: 0.8em;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    #content {
        padding: 15px;
    }

    .content-section {
        flex-direction: column;
    }

    .gallery-image {
        width: calc((100% - 30px) / 4);
    }

    .full-width-section,
    #news-section,
    #random-articles,
    #special-section,
    #photo-gallery,
    #anniversary-100,
    .poem-section,
    .content-section {
        margin: 15px 0;
    }

    .content-section {
        margin-bottom: 15px;
        gap: 15px;
    }

    .view-more {
        margin-bottom: 15px;
    }

    .poem-verse {
        margin-bottom: 15px;
    }

    footer {
        padding: 15px;
        margin-top: 15px;
    }

    #main-image-container {
        width: calc(100% + 30px);
        margin: 0 -15px 30px;
    }
}

@media (max-width: 480px) {
    #content {
        padding: 0 10px;
    }

    #main-image-container {
        width: calc(100% + 20px);
        margin: 0 -10px 30px;
    }
}

/* モーダル内の矢印ボタン */
.modal-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 32px;
    padding: 20px 25px;
    cursor: pointer;
    z-index: 1005;
    transition: background-color 0.3s ease;
}

.modal-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

#modal-prev {
    left: 20px;
}

#modal-next {
    right: 20px;
}

/* スマートフォン向けの調整 */
@media (max-width: 768px) {
    .modal-arrow {
        padding: 15px 20px;
        font-size: 24px;
    }
    
    #modal-prev {
        left: 10px;
    }
    
    #modal-next {
        right: 10px;
    }
}

/* メニューのインデックス番号のスタイル */
.menu-index {
    color: #FF7F50;  /* コーラル色 */
    font-family: monospace;
    opacity: 0.8;
    display: inline-block;
    width: 30px;  /* 記号の幅を広げる */
    text-align: center;
    font-size: 1.2em;  /* サブメニューの記号サイズ */
}

/* 大項目のスタイル調整 */
.menu > ul > li {
    padding: 15px 20px;
    margin: 5px 0;
}

/* 大項目のリンクスタイル */
.menu > ul > li > a {
    font-size: 1.3em;
    font-weight: bold;
    padding: 5px 0;
}

/* 大項目（◼️）のインデックス記号のサイズ調整 */
.menu > ul > li > .menu-index {
    font-size: 1.4em;  /* 記号サイズをさらに大きく */
    width: 35px;  /* 幅を広げる */
    color: #FFA500;  /* オレンジ色に変更 */
    margin-right: 5px;  /* 右側の余白を追加 */
    filter: brightness(0) invert(1);  /* 白色に変更するためのフィルター追加 */
}

.menu-index:hover {
    opacity: 1;
}

/* 大項目が開いているときの下部パディングを調整 */
.has-submenu.open {
    padding-bottom: 0;
}

/* 最後のサブメニュー項目の下部マージンを調整 */
.submenu li:last-child {
    margin-bottom: 20px;
}

/* サブメニュー内のサブメニューの距離調整 */
.submenu .submenu {
    margin-top: 20px !important;  /* 上の項目との距離 */
    padding-left: 35px;  /* インデント */
}

/* サブメニュー内のサブメニュー項目のパディング調整 */
.submenu .submenu li {
    padding: 10px 0;  /* 項目間の距離 */
}

/* サブメニュー内の has-submenu クラスの下部パディング調整 */
.submenu .has-submenu {
    padding-bottom: 2px;  /* 下の項目との距離 */
}

/* お知らせセクション */
#news-section {
    margin: 30px 0;
}

#news-section .section-content {
    background: #fff;
    color: #000;
    border: none;
    box-shadow: 0 3px 8px 1px rgba(0,0,0,0.2);
    height: auto;
    min-height: 300px;
    max-height: 600px;
    padding: 30px;
    position: relative;
    overflow-y: auto;
}

/* 見出しのスタイル */
#news-section h2 {
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 2.4em;
    color: #000;
    font-weight: bold;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 15px;
}

#news-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #FF7F50;
}

.news-container {
    display: flex;
    position: relative;
}

.news-text {
    width: 70%;
    position: relative;
    z-index: 2;
}

.news-items {
    margin-top: 20px;
}

.news-item {
    display: flex;
    align-items: baseline;
    margin-bottom: 25px;
    gap: 30px;
}

.news-date {
    font-family: 'Arial', sans-serif;
    color: #FF7F50;
    font-weight: 500;
    min-width: 100px;
    font-size: 1em;
}

.news-item p {
    margin: 0;
    flex: 1;
    font-size: 1em;
    line-height: 1.8;
    color: #000;
}

.news-image {
    flex: 0 0 50%;
    height: 300px;
    position: absolute;
    right: 0;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .news-container {
        flex-direction: column;
    }

    .news-text {
        width: 100%;
        flex: auto;
        margin-top: 220px;
    }

    .news-image {
        width: 100%;
        flex: auto;
        height: 200px;
        position: absolute;
        top: 0;
        right: 0;
        order: -1;
    }

    .news-item {
        flex-direction: column;
        gap: 10px;
    }

    .news-date {
        min-width: auto;
    }

    #news-section .section-content {
        max-height: 600px;
    }
}

/* メイン画像グリッドを更新 */
#image_grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 4px;
    padding: 4px;
    background-color: rgba(0, 0, 0, 0.3);
}

.grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ランダムなグリッドスパンのためのクラス */
.grid-span-2-col {
    grid-column: span 2;
}

.grid-span-2-row {
    grid-row: span 2;
}

.grid-span-3-col {
    grid-column: span 3;
}

.grid-span-3-row {
    grid-row: span 3;
}

/* メインタイトルコンテナのスタイルを更新 */
#main-title-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 2;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px 0;
}

#main-title-container h2 {
    font-size: 3.5em;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    letter-spacing: 0.05em;
    font-weight: normal;
}

#main-title-container small {
    font-family: "Yu Gothic", YuGothic, sans-serif;
    font-size: 1.8em;
    letter-spacing: 0.1em;
    display: block;
    line-height: 1.2;
    margin-top: 10px;
    font-weight: normal;
}

/* Special Sectionのスタイル - 重複を完全に削除し、1つにまとめる */
.special-section-container {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: transparent;
    background-image: url('../images/トップページ_写真/photo_main_2.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    margin: 20px 0;
    overflow: hidden;
    z-index: 1;
    border: 1px solid black;
}

.special-section-content {
    position: relative;
    z-index: 3;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px 0;
}

.special-section-content h2 {
    font-size: 3.2rem;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    letter-spacing: 0.2em;
    font-weight: normal;
    color: white;
    font-family: Arial, sans-serif;
}

.special-section-content p {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    margin-top: 10px;
    font-weight: normal;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-family: Arial, sans-serif;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .special-section-container {
        height: 300px;
    }

    .special-section-content h2 {
        font-size: 2rem;
    }

    .special-section-content p {
        font-size: 1rem;
    }
}

/* Anniversary Image Container - main-image-sectionのスタイル */
.anniversary-image-container {
    position: relative;
    width: 100%;
    height: 400px;  /* special-sectionと同じ高さ */
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .anniversary-image-container,
    .special-section-container {
        height: 300px;  /* モバイル時は両方とも300px */
    }

    .special-section-content h2 {
        font-size: 2.5em;
    }

    .special-section-content p {
        font-size: 1.4em;
    }
}

/* ハンバーガーメニューの表示制御を更新 */
.hamburger-menu {
    display: flex;  /* 常に表示するように変更 */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1003;
    background-color: #000080;
    padding: 10px;
    width: 50px;
    height: 50px;
}

/* メニューのレスポンシブ対応を追加 */
@media (max-width: 768px) {
    .hamburger-menu {
        top: 15px;  /* スマートフォンでは上部に寄せる */
        right: 15px;
        width: 40px;  /* サイズを少し小さく */
        height: 40px;
    }

    .bar1, .bar2, .bar3 {
        width: 25px;  /* バーのサイズも調整 */
        height: 4px;
        margin: 2px 0;
    }

    /* メニューの幅を画面サイズに応じて調整 */
    .menu {
        width: 100%;  /* スマートフォンでは全幅 */
        right: -100%;  /* 初期位置を調整 */
    }

    .menu ul {
        margin-top: 80px;  /* ハンバーガーメニューの下に配置 */
    }

    .menu ul li {
        padding: 12px 15px;  /* パディングを調整 */
    }

    .menu ul li a {
        font-size: 1.1em;  /* フォントサイズを調整 */
    }

    /* サブメニューの調整 */
    .menu > ul > li.has-submenu > .submenu {
        padding-left: 25px;
    }

    /* メニューインデックスの調整 */
    .menu-index {
        width: 25px;
        font-size: 1em;
    }
}

/* さらに小さい画面サイズ向けの調整 */
@media (max-width: 480px) {
    .hamburger-menu {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }

    .bar1, .bar2, .bar3 {
        width: 20px;
        height: 3px;
        margin: 2px 0;
    }

    .menu ul {
        margin-top: 60px;
    }

    .menu ul li {
        padding: 10px 12px;
    }

    .menu ul li a {
        font-size: 1em;
    }
}

/* main-image-sectionの定義を削除し、新しいindex-anniversary-sectionを追加 */
#index-anniversary-section {
    width: 100%;
    position: relative;
    margin: 30px 0;
    padding: 0;
    height: auto;
}

#index-anniversary-section .anniversary-image-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

/* 以下、既存のスタイルを継承 */

/* Photo Gallery セクションのレスポンシブ対応 */
@media (max-width: 768px) {
    #photo-gallery {
        margin: 15px -15px; /* ネガティブマージンで画面幅いっぱいに */
    }

    #gallery-container {
        padding: 10px 0; /* パディングを調整 */
    }

    .gallery-image {
        width: 200px; /* スマートフォンでの画像サイズを調整 */
        height: 200px;
    }

    /* ギャラリーの矢印ボタンのサイズと位置を調整 */
    .gallery-arrow {
        padding: 8px 12px;
        font-size: 20px;
    }

    #gallery-prev { 
        left: 5px; 
    }
    
    #gallery-next { 
        right: 5px; 
    }
}

/* さらに小さい画面サイズ向けの調整 */
@media (max-width: 480px) {
    .gallery-image {
        width: 150px; /* より小さい画面での画像サイズ */
        height: 150px;
    }

    .gallery-arrow {
        padding: 6px 10px;
        font-size: 18px;
    }
}

/* 追加するスタイル */
.hero-image-content {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
}

.background-image-main {
    background-image: url('/images/トップページ_写真/トップページ_1.jpeg');
}

.no-decoration-link {
    text-decoration: none;
}
