@charset "UTF-8";

/* =========================================
   基本リセット & フォント
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    /* Chrome等でのスワイプによる画面全体の揺れ・更新を防ぐ */
    overscroll-behavior: none; 
}

body {
    margin: 0;
    padding: 0;
    font-family: "Zen Maru Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    background-color: #f0f5f0; 
    overflow: hidden;       /* スクロール禁止 */
    touch-action: manipulation;
    
    /* 動的ビューポート（URLバーを計算した正確な高さ） */
    height: 100vh;          /* 古いブラウザ用予備 */
    height: 100dvh;         /* 最新ブラウザ用自動調整 */
}

/* =========================================
   PC閲覧時のレイアウト（中央にスマホサイズ固定）
   ========================================= */
.background-blur {
    position: fixed;
    inset: 0;
    background-color: #e6f0e6;
    z-index: -1;
}

.app-container {
    position: relative;
    width: 100vw;
    background-color: #ffffff;
    color: #333333;
    margin: 0 auto;
    
    /* 上から順にブロックを積み上げる強固なレイアウト */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    
    height: 100vh;
    height: 100dvh;
}

/* PC画面（幅が広い場合）は中央にスマホ比率の枠を作る */
@media (min-width: 600px) {
    .app-container {
        width: 400px;
        height: 850px;
        max-height: 95vh;
        max-height: 95dvh;
        margin-top: 2.5vh;
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    }
}

/* =========================================
   プログレスバー (上部ブロック)
   ========================================= */
.progress-container {
    flex: 0 0 auto; /* 高さを固定し潰れないようにする */
    display: flex;
    gap: 4px;
    padding: 20px 15px 10px; 
    z-index: 10;
}

.progress-segment {
    flex: 1;
    height: 4px;
    background-color: #e0e0e0; 
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: #32D74B; 
    transition: width 0.3s ease;
}

/* =========================================
   スライドコンテンツエリア (中央ブロック)
   ========================================= */
.slide-container {
    flex: 1; /* 余った高さをすべて吸収する */
    min-height: 0; /* flexbox内で要素がはみ出さないための魔法のコード */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.slide-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 15px 10px; /* 下部の余白を通常通りに */
}

/* タイトル（レッスンのテーマ） */
.slide-title {
    flex: 0 0 auto;
    font-size: 1.6rem;
    margin: 5px 0 15px;
    text-align: center;
    color: #32D74B; 
    font-weight: bold;
}

/* メディア（画像・動画）枠：可能な限り拡大させる */
.media-wrapper {
    flex: 1; /* 余った空間をすべて画像枠に使う */
    width: 100%;
    min-height: 0; /* 縮小を許可 */
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.media-content {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 全体を表示する */
}

/* 説明文エリア（教室の様子）：サイズを固定しスクロールさせる */
.slide-description-area {
    flex: 0 0 120px; /* 縦幅を120pxに完全固定 */
    height: 120px; 
    background: #f9f9f9;
    border: 1px solid #eeeeee;
    border-radius: 12px;
    padding: 15px;
    overflow-y: auto; /* 文章が長い場合は縦スクロール */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

/* スクロールバーのデザイン（細く表示） */
.slide-description-area::-webkit-scrollbar {
    width: 4px;
}
.slide-description-area::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.slide-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #444444;
    white-space: pre-wrap;
    word-break: break-word;
}

.loading-text {
    text-align: center;
    margin-top: 50px;
    color: #666;
    font-weight: bold;
}

/* =========================================
   常時表示ナビゲーションボタン ＆ TOPに戻る (下部ブロック)
   ========================================= */
.nav-buttons {
    flex: 0 0 auto; /* 高さを固定。絶対配置(浮遊)をやめて確実に下部に置く */
    width: 100%;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 10px 20px 25px; /* 下部の安全な余白 */
    z-index: 20;
}

.nav-btn {
    background: #32D74B; 
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(50, 215, 75, 0.3);
    -webkit-tap-highlight-color: transparent;
}

.nav-btn:active {
    background: #28a745;
    transform: scale(0.95);
}

/* 中央の「TOPに戻る」ボタン */
.btn-back {
    color: #32D74B;
    background: #ffffff;
    border: 2px solid #32D74B;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    padding: 10px 24px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back:active {
    background: #f0f0f0;
}

/* =========================================
   アニメーション
   ========================================= */
.animate-fade {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   全画面画像拡大モーダル用
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cursor-zoom {
    cursor: zoom-in;
}