/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; /* Prevent scrollbars from the container */
}

/* Slide Container - Aspect Ratio 16:9 for desktop, auto for mobile */
.slide-container {
    position: relative;
    width: 90vw; /* Responsive width */
    max-width: 1280px; /* Max width for large screens */
    aspect-ratio: 16 / 9;
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden; /* Hide slides that are not active */
    border-radius: 8px;
}

/* Individual Slide Styling */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Restore explicit vh height */
    min-height: 100vh;
    background-color: #ffffff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out, transform 0.6s ease-in-out;
    padding: 2% 3%;
    padding-bottom: 5%; /* 下部に余白を追加 */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto; /* PCビューでもスクロール可能にする */
    -webkit-overflow-scrolling: touch; /* スムーズなスクロール */
    backface-visibility: hidden; /* 3D変換時のちらつきを防止 */
    -webkit-backface-visibility: hidden; /* Safari対応 */
    will-change: transform, opacity; /* GPUアクセラレーションのヒント */
}

.slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* スワイプアニメーション用のクラス */
.slide.slide-up-out {
    transform: translateY(-100%);
    opacity: 0;
}

.slide.slide-up-in {
    transform: translateY(0);
    opacity: 1;
}

.slide.slide-down-out {
    transform: translateY(100%);
    opacity: 0;
}

.slide.slide-down-in {
    transform: translateY(0);
    opacity: 1;
}

/* Slide Content Area */
.slide-content {
    width: 100%; /* Let it fill the padded area */
    margin-bottom: 2em; /* コンテンツの下部にマージン追加 */
}

/* --- Layout Variations --- */

/* Common styles for flex layouts */
.layout-text-left .slide-content,
.layout-text-right .slide-content,
.layout-img-right-large .slide-content,
.layout-img-left-large .slide-content,
.layout-multi-block-text-right .slide-content {
    display: flex;
    align-items: flex-start;
    width: 100%;
    height: 100%; /* 高さを100%に */
    justify-content: space-between;
}

/* Text content wrapper */
.slide-text-content {
    text-align: left;
    overflow-wrap: break-word;
    min-width: 0;
}

/* Text Left - Image Right (Standard) - Use width */
.layout-text-left .slide-text-content { width: 50%; order: 1; flex-shrink: 1; }
.layout-text-left .slide-image { width: 45%; order: 2; max-height: 65%; flex-shrink: 0;}

/* Text Right - Image Left - Use width */
.layout-text-right .slide-text-content { width: 50%; order: 2; flex-shrink: 1;}
.layout-text-right .slide-image { width: 45%; order: 1; max-height: 65%; flex-shrink: 0;}

/* Text Left - Image Right (Large Image) - Use width */
.layout-img-right-large .slide-text-content { width: 35%; order: 1; flex-shrink: 1; }
.layout-img-right-large .slide-image { width: 60%; order: 2; max-height: 70%; flex-shrink: 0;}

/* Text Right - Image Left (Large Image) - Use width */
.layout-img-left-large .slide-text-content { width: 35%; order: 2; flex-shrink: 1;}
.layout-img-left-large .slide-image { width: 60%; order: 1; max-height: 70%; flex-shrink: 0;}

/* Image Left - Multi Block Text Right */
.layout-multi-block-text-right .slide-text-content {
    width: 45%;
    order: 2;
    display: flex;
    flex-direction: column;
    flex-shrink: 1;
    max-height: 90%; /* 高さを制限し、コンテンツがはみ出さないようにする */
    overflow-y: auto; /* 必要に応じてスクロール可能にする */
    justify-content: center; /* 中央揃え */
}
.layout-multi-block-text-right .slide-image {
    width: 50%;
    order: 1;
    max-height: 70%;
    object-fit: contain;
    align-self: center;
    flex-shrink: 0;
}
.layout-multi-block-text-right h2 {
    margin-bottom: 0.8em;
    text-align: center;
}

/* テキストブロックの調整 */
.text-block {
    display: flex;
    align-items: flex-start;
    gap: 0.8em;
    margin-bottom: 1.2em; /* 間隔をやや狭く */
}
.text-block:last-child {
    margin-bottom: 0;
}

.icon-placeholder {
    flex: 0 0 25px;
    height: 25px;
    background-color: #3498db;
    display: inline-block;
    margin-top: 0.2em;
    border-radius: 50%;
}

.text-block h3 {
    font-size: clamp(16px, 1.6vw, 24px); /* サイズを少し小さく */
    margin-bottom: 0.2em; /* 間隔を狭く */
    color: #2c3e50;
}

.text-block p {
    font-size: clamp(13px, 1.1vw, 18px); /* サイズを少し小さく */
    line-height: 1.4; /* 行間を狭く */
    margin-bottom: 0;
    color: #555;
}

/* Images within the flex layout */
.slide-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0;
    object-fit: contain;
    align-self: center;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 20vh; /* Limit height based on viewport height */
}

/* Title Slide Styles */
.title-slide {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    gap: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2em;
    padding-bottom: 4em; /* 下部に余白を追加 */
    border-radius: 8px;
}

.title-slide h1 {
    font-size: clamp(36px, 6vw, 72px);
    margin-bottom: 0.5em;
    color: #2c3e50;
    width: 100%;
    text-align: center;
}

.title-slide p {
    font-size: clamp(18px, 2vw, 30px);
    text-align: center;
    margin-bottom: 0.5em;
    color: #34495e;
}

.title-slide .presenter {
    font-size: clamp(14px, 1.3vw, 22px);
    margin-top: 2em;
    margin-bottom: 1em; /* 発表者名の下にマージンを追加 */
    font-style: italic;
    color: #7f8c8d;
}

.title-slide .title-image {
    max-height: 40%;
    margin-bottom: 1em;
    order: -1;
}

/* Summary and Thank You Slides */
.summary-slide {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    gap: 0.7em; /* 間隔をさらに狭くして画像に余裕を持たせる */
    height: 100%;
    padding-top: 2%; /* 上部パディングをさらに減らして画像用のスペースを確保 */
    padding-bottom: 4%; /* 下部パディングを増やす */
    box-sizing: border-box;
}

/* 画像を横に並べるためのコンテナ */
.summary-slide .images-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 0.8em;
    max-width: 90%; /* コンテナ全体の幅をさらに拡大 */
}

.image-container {
    flex: 1;
    max-width: 48%; /* コンテナの幅をさらに拡大 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.summary-slide .summary-image {
    max-height: 280px; /* 画像の最大高さをさらに増加 */
    object-fit: contain;
    display: block;
    width: auto;
    max-width: 100%;
}

.summary-slide h2 {
    font-size: clamp(24px, 3.2vw, 40px); /* タイトルをやや小さく */
    text-align: center;
    width: auto;
    max-width: 80%;
    border-bottom: none;
    margin-bottom: 0;
    flex-shrink: 0;
    color: #2c3e50;
}

.summary-slide ul {
    font-size: clamp(15px, 1.6vw, 24px); /* リストフォントをやや小さく */
    text-align: left;
    width: 85%;
    max-width: 90%;
    color: #34495e;
    margin-top: 0.2em; /* 上部マージンを減らす */
}

.thank-you-slide {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    gap: 1.5em;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2em;
    padding-bottom: 4em; /* 下部パディングを増やす */
    border-radius: 8px;
}

.thank-you-slide h2 {
    font-size: clamp(32px, 5vw, 60px);
    border-bottom: none;
    text-align: center;
    color: #2c3e50;
}

.thank-you-slide .thankyou-image {
    max-height: 35%;
    margin-bottom: 1em;
}

.contact-list {
    list-style-type: none;
    font-size: clamp(16px, 1.8vw, 24px);
    text-align: center;
    color: #34495e;
}

.contact-list li {
    margin-bottom: 0.5em;
}

.thank-you-text {
    font-size: clamp(18px, 2vw, 28px);
    margin-top: 1em;
    margin-bottom: 1.5em; /* 下部マージンを追加 */
    font-style: italic;
    color: #2c3e50;
}

/* Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    background-color: rgba(52, 152, 219, 0.7);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s, transform 0.2s;
}

.nav-btn:hover {
    background-color: rgba(41, 128, 185, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

/* General Styling */
h2 {
    font-size: clamp(22px, 2.5vw, 36px); /* タイトルを少し小さく */
    color: #2c3e50;
    margin-bottom: 0.7em; /* 下マージンを少し減らす */
    padding-bottom: 0.2em;
    border-bottom: 2px solid #3498db;
}

.slide-text-content ul {
    list-style-type: none;
    margin-left: 0;
    padding-left: 0; /* Reset default ul padding */
}

/* Add padding for ol numbering */
.slide-text-content ol {
    list-style-position: outside; /* Ensure numbers are outside the item */
    padding-left: 1.8em; /* Adjust padding for number alignment */
    margin-left: 0;
}

.slide-text-content li {
    position: relative;
    padding-left: 1.5em;
    margin-bottom: 0.7em; /* マージンを少し減らす */
    font-size: clamp(14px, 1.5vw, 22px); /* サイズ調整 */
    line-height: 1.4; /* 行間を少し詰める */
    color: #34495e;
}

/* Apply bullet only to li inside ul */
.slide-text-content ul > li:before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.page-number {
    position: fixed; /* 絶対位置から固定位置に変更 */
    bottom: 10px;
    right: 15px;
    font-size: clamp(12px, 1.2vw, 16px);
    color: #7f8c8d;
    background-color: rgba(255, 255, 255, 0.7); /* 背景を少し透明に */
    padding: 2px 8px;
    border-radius: 10px;
    z-index: 10; /* 他の要素より前面に表示 */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding: 0;
        margin: 0;
        overflow: hidden; /* Prevent body scrolling entirely on mobile */
        min-height: 100vh;
        background-color: #ffffff;
        -webkit-overflow-scrolling: touch;
        position: fixed; /* モバイルでの固定位置表示 */
        width: 100%; /* 画面全体を確実に覆う */
        height: 100%; /* 画面全体を確実に覆う */
    }

    .slide-container {
        aspect-ratio: auto;
        height: 100vh;
        min-height: 100vh;
        width: 100vw;
        max-width: 100vw;
        overflow: hidden; /* モバイルでのオーバーフローを確実に防止 */
        border-radius: 0;
        box-shadow: none;
        position: relative; /* 相対位置指定 */
    }

    .slide {
        position: absolute;
        height: 100vh; /* Restore explicit vh height */
        min-height: 100vh;
        padding: 15px 15px;
        padding-bottom: 30px; /* モバイル表示での下部パディングを増やす */
        opacity: 0;
        visibility: hidden;
        flex-direction: column;
        justify-content: flex-start; /* コンテンツを上寄せにする */
        align-items: center; /* 横方向は中央揃えを維持 */
        transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out, transform 0.6s ease-in-out;
        overflow-y: auto; /* Allow scrolling within the slide if content overflows */
        -webkit-overflow-scrolling: touch; /* Improve scroll momentum on iOS */
        will-change: transform, opacity; /* GPUアクセラレーションのヒント */
    }

    .slide.active {
        opacity: 1;
        visibility: visible;
        z-index: 1;
        position: absolute;
        top: 0;
        left: 0;
    }

    /* アニメーション用のクラスのモバイル調整 */
    .slide.slide-up-in {
        transform: translateY(0);
        z-index: 2;
    }

    .slide.slide-up-out {
        transform: translateY(-100%);
        z-index: 1;
    }

    .slide.slide-down-in {
        transform: translateY(0);
        z-index: 2;
    }

    .slide.slide-down-out {
        transform: translateY(100%);
        z-index: 1;
    }

    .layout-text-left .slide-content,
    .layout-text-right .slide-content,
    .layout-img-right-large .slide-content,
    .layout-img-left-large .slide-content,
    .layout-multi-block-text-right .slide-content {
        flex-direction: column;
        align-items: stretch; /* 中央揃えから変更し、幅いっぱいに広げる */
        justify-content: flex-start; /* アイテムを上寄せにする */
    }

    .layout-text-left .slide-text-content, .layout-text-left .slide-image,
    .layout-text-right .slide-text-content, .layout-text-right .slide-image,
    .layout-img-right-large .slide-text-content, .layout-img-right-large .slide-image,
    .layout-img-left-large .slide-text-content, .layout-img-left-large .slide-image,
    .layout-multi-block-text-right .slide-text-content, .layout-multi-block-text-right .slide-image {
        width: 100%;
        order: 0; /* orderもリセット */
        margin-bottom: 0; /* レイアウト固有のマージンをリセット */
    }

    .slide-image {
        max-height: 20vh; /* Limit height based on viewport height */
        margin-top: 0; /* 上マージンは不要 */
        margin-bottom: 1em; /* 画像の下に適切なマージンを設定 */
    }

    .slide-text-content {
        margin-bottom: 2.5em; /* モバイル表示でのコンテンツ下部マージンを増やす */
    }

    h2 {
        text-align: center;
    }

    .title-slide, .thank-you-slide {
        padding-top: 2em;
        padding-bottom: 2em;
    }

    .nav-btn {
        display: none; /* モバイルでは非表示 */
    }

    .summary-slide .images-row {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        max-width: 95%;
    }

    .image-container {
        max-width: 85%; /* モバイルでも画像を大きく */
    }

    .summary-slide .summary-image {
        max-height: 200px; /* モバイルでの最大高さも増加 */
    }

    .summary-slide {
        padding-top: 3%;
        padding-bottom: 4%; /* 下部パディングを増やす */
        gap: 1em;
    }

    .summary-slide ul {
        margin-top: 0.5em;
        width: 90%;
    }

    /* Mobile adjustments for letter slides */
    .letter-slide {
        padding-top: 1em; /* Add padding for mobile */
        justify-content: flex-start;
        overflow-y: auto; /* モバイル表示でもスクロールを確保 */
    }

    .letter-slide h1 {
        margin-top: 0; /* モバイルでのマージン調整 */
        font-size: clamp(24px, 6vw, 32px); /* モバイルでの文字サイズ調整 */
    }

    .letter-slide h2 {
        font-size: clamp(18px, 5vw, 24px); /* モバイルでの文字サイズ調整 */
    }

    .letter-slide h3 {
        font-size: clamp(14px, 4vw, 18px); /* モバイルでの文字サイズ調整 */
    }

    .letter-image {
        max-width: 98%; /* モバイル表示では幅を広げる */
        width: auto; /* モバイルでは固定幅を解除 */
        min-height: auto; /* モバイルでは最小高さを解除 */
        height: auto; /* 高さは自動調整 */
        margin-top: 0.5em;
        margin-bottom: 2em; /* Add some bottom margin */
    }

    /* モバイルでの拡大アイコンの調整 */
    .artwork-image::after, .letter-image::after {
        font-size: 16px; /* アイコンを少し小さく */
        bottom: 5px;
        right: 5px;
        padding: 3px;
    }

    /* Mobile adjustments for video player */
    .video-player {
        max-height: 50vh; /* Limit video height on mobile */
    }

    /* Re-adjust Special Talents mobile layout */
    .layout-multi-block-text-right .slide-text-content {
        /* flex: 1; */ /* Remove flex-grow */
        /* min-height: 0; */ /* Remove min-height */
        /* overflow-y: auto; should be inherited */
        margin-bottom: 2.5em;
        padding-top: 1em; /* Add padding to the top of the text content */
    }

    /* モバイル表示でのSpecial Talents & Interestsスライドのコンテナ修正 */
    .layout-multi-block-text-right .text-blocks-container {
        max-height: none; /* 高さ制限を解除 */
        overflow-y: visible; /* スクロールを無効化 */
    }

    /* Mobile adjustments for Special Talents slide image */
    .layout-multi-block-text-right .slide-image {
        /* max-height: 25vh; */ /* Remove strict vh limit */
        max-height: 30vh; /* 画像の高さを小さくしてテキストスペースを確保 */
        width: 85%; /* Center image slightly */
        margin-bottom: 0.5em; /* 画像下の余白を減らす */
        flex-shrink: 0; /* Prevent image from shrinking too much */
    }

    /* Add top margin for Special Talents title on mobile */
    .layout-multi-block-text-right h2 {
        margin-top: 0.5em;
    }

    /* Mobile adjustments for artwork slides */
    .artwork-grid {
        flex-direction: column; /* Stack items vertically */
        gap: 1em; /* Adjust gap for vertical spacing */
        align-items: center; /* Center items horizontally in column */
    }

    .artwork-item {
        flex-basis: auto; /* Let items take needed height */
        width: 100%;
        margin-bottom: 1em; /* Add space below each item */
        max-width: 90%; /* モバイルでの最大幅を調整 */
    }

    .artwork-image {
        max-height: 60vh;
        width: auto; /* モバイルでは固定幅を解除 */
        max-width: 90%; /* モバイルでの最大幅を制限 */
    }

    /* Mobile order adjustment for Why Punahou slide */
    .summary-slide .images-row {
        order: 2; /* Display images after the text */
    }

    .summary-slide ul {
        order: 1; /* Display text before the images */
        margin-top: 1.5em; /* Add margin above the text */
        margin-bottom: 1em; /* Ensure space below text */
    }

    /* Remove the explicit height setting for artwork slide on mobile */
    /*
    .artwork-slide {
        height: auto;
        flex-shrink: 0;
    }
    */

    .title-slide {
        padding-top: 1.5em;
        padding-bottom: 3em; /* モバイル表示での下部マージンを調整 */
    }

    .title-slide .presenter {
        margin-bottom: 1.5em; /* モバイル表示での下部マージンを増加 */
    }

    .thank-you-slide {
        padding-top: 2.5em; /* モバイル表示での上部パディングを増やす */
        padding-bottom: 3em; /* モバイル表示での下部パディングを調整 */
    }

    .thank-you-text {
        margin-bottom: 1em; /* モバイル表示での下部マージンを調整 */
    }

    /* モバイル表示でのテキストブロックの間隔調整 */
    .text-block {
        margin-bottom: 0.8em; /* モバイル表示での間隔をさらに狭く */
    }

    .text-block h3 {
        font-size: clamp(14px, 4vw, 20px); /* モバイル表示での文字サイズを調整 */
        margin-bottom: 0.1em; /* モバイル表示での間隔を狭く */
    }

    .text-block p {
        font-size: clamp(12px, 3.5vw, 16px); /* モバイル表示での文字サイズを調整 */
        line-height: 1.3; /* 行間をさらに詰める */
    }

    /* アイコンプレースホルダーのサイズ調整 */
    .icon-placeholder {
        flex: 0 0 20px;
        height: 20px;
        margin-top: 0.1em;
    }

    .thank-you-slide h2 {
        margin-bottom: 1em; /* タイトル下のマージンを増やす */
    }

    .thank-you-slide .thankyou-image {
        max-height: 30%; /* モバイル表示での画像サイズを調整 */
        margin-bottom: 1.5em; /* 画像下のマージンを増やす */
    }

    /* モバイル表示でのページ番号位置調整 */
    .page-number {
        bottom: 5px;
        right: 10px;
        font-size: 12px;
        padding: 1px 6px;
    }
}

@media (max-width: 480px) {
    h2 { font-size: clamp(18px, 5vw, 24px); }
    .slide-text-content li { font-size: clamp(12px, 4vw, 18px); }
    .slide-image { max-height: 35%; }
    .slide-container { width: 100vw; }

    .slide {
        min-height: 100vh;
        padding: 15px 10px;
    }

    .title-slide h1 {
        font-size: clamp(28px, 8vw, 42px);
    }

    .title-slide p {
        font-size: clamp(16px, 4vw, 22px);
    }
}

/* Special Talents & Interestsスライド用のコンテナ */
.text-blocks-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-height: 75%;
    overflow-y: auto;
}

/* Recommendation Letter Slide Styles */
.letter-slide {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align items to the start (top) */
    align-items: center;
    text-align: center;
    height: 100%;
    padding-top: 0; /* Reduce padding further to move title up */
    box-sizing: border-box;
    overflow-y: auto; /* レターを含むスライドをスクロール可能に */
    -webkit-overflow-scrolling: touch;
}

.letter-slide h1 {
    font-size: clamp(28px, 4vw, 48px); /* Adjust size as needed */
    color: #2c3e50; /* Match title slide h1 color */
    margin-bottom: 0.1em;
    border-bottom: none;
    margin-top: 0.5em; /* タイトルの上部マージンを調整 */
}

.letter-slide h2 {
    width: 100%;
    margin-bottom: 0; /* Space between title and image */
    font-size: clamp(20px, 2.5vw, 32px); /* サイズを少し小さく */
    color: #333;
    border-bottom: none; /* Remove potential inherited border */
}

.letter-slide h3 {
    font-size: clamp(16px, 2vw, 24px); /* サイズを少し小さく */
    margin-bottom: 0.5em;
    color: #555;
}

.letter-image {
    max-width: 98%; /* 幅をさらに拡大 */
    width: 550px; /* 固定幅を設定 */
    min-height: 700px; /* 最小の高さを設定 */
    height: auto; /* 高さは自動調整 */
    object-fit: contain; /* Maintain aspect ratio */
    border: 1px solid #eee; /* Optional: subtle border */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Optional: subtle shadow */
    border-radius: 4px;
    margin-top: 0.5em; /* Add specific top margin */
    margin-bottom: 2em; /* 下部にマージンを追加してスクロール時に余白を確保 */
    cursor: zoom-in; /* ズーム可能を示すカーソル */
    position: relative; /* 拡大アイコン用の位置指定 */
}

/* 画像の注目エフェクト用アニメーション */
@keyframes pulseHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 10px 25px rgba(0,0,0,0.25);
        filter: brightness(1.1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        filter: brightness(1);
    }
}

/* ページロード時のアニメーション */
.artwork-image.highlight, .letter-image.highlight {
    animation: pulseHighlight 1.8s ease-in-out;
    animation-iteration-count: 2; /* 2回繰り返す */
}

/* クリックで拡大できることを示すサイン */
.artwork-image, .letter-image {
    cursor: zoom-in; /* ズーム可能を示すカーソル */
    position: relative; /* アイコン配置のための基準位置 */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* ホバー時のアニメーション */
}

/* ホバー時のエフェクト */
.artwork-image:hover, .letter-image:hover {
    transform: scale(1.02); /* 少し拡大 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); /* 影を強調 */
}

/* 拡大アイコンを画像の右下に配置 */
.artwork-image::after, .letter-image::after {
    content: "🔍"; /* 拡大鏡アイコン */
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 5px;
    border-radius: 50%;
    font-size: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 5;
}

/* Video Slide Styles */
.video-slide {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    height: 100%;
    padding: 2%;
    box-sizing: border-box;
}

.video-slide h2 {
    margin-bottom: 1em; /* Space below title */
    border-bottom: none; /* Remove default border if any */
}

.video-player {
    max-width: 90%; /* Increase video width limit */
    max-height: 85%; /* Increase video height limit */
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 目次のネストしたリスト項目の文字サイズを調整 */
.toc-content ol > li > ul > li {
    font-size: 0.9em; /* 親要素の90%のサイズにする */
    margin-bottom: 0.5em; /* 下マージンも少し詰める */
    /* ネストしたリストには追加の点をつけない */
}

.toc-content ol > li > ul > li:before {
    content: "•"; /* ネストしたリストにも点を付ける場合 */
    /* content: none; */ /* 点をつけない場合 */
}

/* Style for page notes in ToC */
.toc-content .toc-page-note {
    font-size: 0.7em; /* Slightly smaller than the main list item */
    color: #555; /* Make it less prominent */
    margin-left: 0.5em; /* Add some space before the note */
}

/* Artwork Slide Styles */
.artwork-slide {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    padding: 2% 3%;
    box-sizing: border-box;
    overflow-y: auto; /* アートワークスライドもスクロール可能に */
    -webkit-overflow-scrolling: touch;
}

.artwork-slide h2 {
    width: 100%;
    text-align: center;
    margin-bottom: 1.5em; /* Space below title */
}

.artwork-grid {
    display: flex; /* Use flexbox for simple horizontal alignment */
    justify-content: center; /* Center items horizontally */
    align-items: flex-start; /* 上揃えに変更 */
    gap: 3%; /* Space between images */
    width: 100%;
}

.artwork-item {
    flex: 0 0 auto; /* サイズを自然に保つ */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2em; /* 下部にマージンを追加 */
    max-width: 45%; /* 最大幅を制限 */
}

.artwork-image {
    max-width: 100%;
    height: auto; /* 高さ制限を削除し、自然なサイズで表示 */
    width: 400px; /* 固定幅を設定 */
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer; /* クリック可能を示す */
}

/* モーダル表示用のスタイル */
.image-modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

.modal-content {
    display: block;
    max-width: 95%; /* 最大幅を拡大 */
    max-height: 95vh; /* 最大高さを拡大 */
    object-fit: contain;
    margin: auto;
    animation: zoomIn 0.3s ease; /* ズームインアニメーション */
}

/* ズームインアニメーション */
@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* レターとアートワークのモーダルサイズを個別に調整 */
.letter-modal {
    max-width: 90%;
    width: 800px; /* レターは大きく表示 */
}

.artwork-modal {
    max-width: 85%;
    width: 600px; /* アートワークは少し小さく表示 */
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 101;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
    text-decoration: none;
}

/* モバイル表示のモーダル設定 */
@media (max-width: 768px) {
    .modal-content {
        max-width: 98%;
        max-height: 90vh;
    }

    .letter-modal,
    .artwork-modal {
        width: auto; /* モバイルでは固定幅を解除 */
        max-width: 95%;
    }

    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 36px;
    }
}

/* Safari 対応のための特別な調整 */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari 固有のCSS */
    .slide {
        /* iOSでは100vhが正確に動作しない問題への対応 */
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
        padding-bottom: 70px; /* iOSで確実にコンテンツが表示されるようにパディングを増やす */
    }

    .slide-content {
        margin-bottom: 3em; /* iOSでのマージンを増加 */
    }

    .title-slide, .thank-you-slide {
        padding-bottom: 5em; /* iOSでの下部パディングを増やす */
    }

    /* iOS Safariでのスクロール問題に対応 */
    .letter-slide, .artwork-slide {
        -webkit-overflow-scrolling: touch;
        padding-bottom: 80px; /* iOSでスクロール可能なコンテンツの下部余白を増やす */
    }
}

/* モバイル表示のスワイプ指示アイコン */
.swipe-indicator {
    display: none; /* デフォルトでは非表示 */
    position: absolute;
    bottom: 80px; /* 下から位置を調整 */
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 20;
    animation: swipeUpDown 2s infinite ease-in-out;
}

.swipe-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%) rotate(-45deg);
    border-top: 3px solid #3498db;
    border-right: 3px solid #3498db;
    margin-top: 5px; /* 少し下にずらして上向きの矢印に */
}

.swipe-text {
    position: absolute;
    bottom: 130px; /* インジケーターの上に表示するため位置を上げる */
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: rgba(0, 0, 0, 0.7);
    text-align: center;
    width: 200px;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.7); /* 背景を少し透明に */
    padding: 5px 10px;
    border-radius: 15px;
}

/* 上下に動くアニメーション */
@keyframes swipeUpDown {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-15px);
    }
}

@media (max-width: 768px) {
    /* モバイルでのみ表示 */
    .title-slide .swipe-indicator,
    .title-slide .swipe-text {
        display: block;
    }
}

/* ズーム説明テキスト */
.zoom-instruction {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin: 0.5em 0 1em 0;
    font-style: italic;
    opacity: 0.8;
    width: 100%;
}