/* ========================================
   基本設定 - 50代スマートフォン最適化
   ======================================== */

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

:root {
    --color-primary: #1a2332;
    --color-secondary: #8b7355;
    --color-accent: #c9a66b;
    --color-bg: #faf9f7;
    --color-white: #ffffff;
    --color-text: #222222;
    --color-text-light: #555555;
    --color-border: #d0cdc9;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 50代向け最適化 */
    --font-size-base: 18px;
    --font-size-large: 20px;
    --font-size-title: 24px;
    --line-height-base: 1.8;
    --tap-target-min: 48px;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: var(--line-height-base);
    overflow-x: hidden;
    font-size: var(--font-size-base);
    /* iOSのタップハイライト除去 */
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   ページ切り替え
   ======================================== */

.page {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.page.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   ヘッダー - 大きく見やすく
   ======================================== */

.header {
    text-align: center;
    padding: 32px 24px 28px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #2c3e50 100%);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.main-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    line-height: 1.5;
}

.subtitle {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.12em;
    opacity: 0.95;
}

/* ========================================
   メインメニュー - スマホ最適化
   ======================================== */

.menu-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

.course-item {
    background: var(--color-white);
    border-radius: 16px;
    margin-bottom: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.course-number {
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
    color: var(--color-white);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.course-content {
    padding: 24px 20px;
}

.sake-name {
    font-family: 'Noto Serif JP', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.dish-name {
    color: var(--color-text);
    font-size: 17px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--color-border);
    font-weight: 500;
}

/* ========================================
   情報セクション - 大きなタップエリア
   ======================================== */

.info-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-section {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
}

.info-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
}

.info-summary {
    font-size: 17px;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 16px;
}

/* 大きなタップボタン（最低48px高さ） */
.detail-button {
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
    color: var(--color-white);
    border: none;
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 17px;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    text-decoration: none;
    min-height: var(--tap-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.25);
}

.detail-button:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(139, 115, 85, 0.3);
}

/* ========================================
   詳細ページ - 読みやすさ重視
   ======================================== */

.detail-header {
    background: var(--color-white);
    padding: 20px 20px 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 大きな戻るボタン */
.back-button {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    color: var(--color-secondary);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 20px;
    margin-bottom: 16px;
    transition: var(--transition);
    font-family: 'Noto Sans JP', sans-serif;
    border-radius: 10px;
    min-height: var(--tap-target-min);
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: center;
}

.back-button:active {
    background: var(--color-border);
    transform: scale(0.98);
}

.detail-course-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-course-number {
    font-size: 13px;
    color: var(--color-accent);
    font-weight: 600;
    letter-spacing: 0.1em;
}

.detail-sake-name {
    font-family: 'Noto Serif JP', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.6;
}

.detail-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 28px 20px 120px;
    min-height: calc(100vh - 280px);
}

.detail-section-header {
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 3px solid var(--color-accent);
}

.detail-type-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.5;
}

/* 大きな文字サイズと行間 */
.detail-text {
    font-size: 18px;
    line-height: 2;
    color: var(--color-text);
}

.detail-text p {
    margin-bottom: 20px;
}

.placeholder-text {
    color: var(--color-text-light);
    font-style: italic;
    text-align: center;
    padding: 48px 24px;
    font-size: 17px;
}

/* ========================================
   詳細ページナビゲーション - 大きなボタン
   ======================================== */

.detail-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: space-around;
    padding: 10px 8px;
    z-index: 100;
    /* iPhoneの下部バーに対応 */
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.nav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 6px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 10px;
    font-family: 'Noto Sans JP', sans-serif;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
}

.nav-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    display: block;
    line-height: 1.4;
    text-align: center;
}

.nav-item.active .nav-label {
    color: var(--color-white);
    font-weight: 700;
}

/* ========================================
   スマートフォン向け最適化
   ======================================== */

/* タッチスクロールの改善 */
body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
}

/* テキスト選択の改善 */
.detail-text {
    -webkit-user-select: text;
    user-select: text;
}

/* ボタンのタッチフィードバック */
button, a.detail-button, .nav-item {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* フォーカス時の見やすいアウトライン */
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* ========================================
   アニメーション - 控えめに
   ======================================== */

@keyframes slideInFromBottom {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.course-item {
    animation: slideInFromBottom 0.5s ease forwards;
}

.course-item:nth-child(1) { animation-delay: 0.05s; }
.course-item:nth-child(2) { animation-delay: 0.1s; }
.course-item:nth-child(3) { animation-delay: 0.15s; }
.course-item:nth-child(4) { animation-delay: 0.2s; }
.course-item:nth-child(5) { animation-delay: 0.25s; }
.course-item:nth-child(6) { animation-delay: 0.3s; }
.course-item:nth-child(7) { animation-delay: 0.35s; }

/* ========================================
   アクセシビリティ改善
   ======================================== */

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #1a1a1a;
        --color-white: #2a2a2a;
        --color-text: #e0e0e0;
        --color-text-light: #b0b0b0;
        --color-border: #404040;
        --color-primary: #e0e0e0;
    }
}

/* 大きいフォントサイズの設定（システム設定対応） */
@media (prefers-contrast: high) {
    :root {
        --color-text: #000000;
        --color-border: #999999;
    }
    
    .info-section,
    .back-button {
        border-width: 3px;
    }
}

/* 動きを減らす設定（システム設定対応） */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
