/* static/css/landing.css */
/* ランディングページ専用CSS */
:root {
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --bg: #ffffff;
  --bg-secondary: #f5f5f7;
  --border: rgba(0, 0, 0, 0.08);
  --gold: #c8862a;
}
/* ─── Body ─── */
.landing-body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               "Hiragino Sans", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.landing-main {
  width: 100%;
}
/* ─── Header ─── */
.landing-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 44px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--border);
}
.landing-header-inner {
  max-width: 100%;
  margin: 0;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.landing-logo {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.landing-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.landing-nav-link {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.landing-nav-link:hover {
  color: var(--text-primary);
}
.landing-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
/* ===== Header Search Box (Step 2: 装飾のみ、JS は Step 3) ===== */
/* PC 用: input + 内蔵ボタン形式 */
.header-search--pc {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
  height: 32px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color .15s ease;
}
.header-search--pc:focus-within {
  border-color: var(--gold);
}
.header-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 4px 0 14px;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
}
.header-search-input::placeholder {
  color: var(--text-tertiary);
}
.header-search-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-right: 1px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.header-search-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}
.header-search-icon {
  width: 18px;
  height: 18px;
}
/* モバイル用: 虫眼鏡ボタン単体（PC 時は非表示） */
.header-search-mobile-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.header-search-mobile-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}
/* ===== Search Dropdown (Step 3) ===== */
.header-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  max-width: calc(100vw - 48px);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  padding: 6px 0;
}
.header-search-dropdown[hidden] {
  display: none;
}
.header-search-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-primary);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: background .12s ease;
}
.header-search-item:hover,
.header-search-item.is-active {
  background: var(--bg-secondary);
}
.header-search-item-lemma {
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}
.header-search-item-cefr {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}
.header-search-item-meaning {
  color: var(--text-secondary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.header-search-item-surface {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.header-search-empty {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}
/* ===== Mobile Search Panel (Step 3) ===== */
.landing-mobile-search {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  padding: 12px 16px;
  z-index: 1050;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}
.landing-mobile-search:not([hidden]) {
  transform: translateY(0);
  opacity: 1;
}
.landing-mobile-search[hidden] {
  display: none;
}
.landing-mobile-search-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.header-search--mobile {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: border-color .15s ease;
}
.header-search--mobile:focus-within {
  border-color: var(--gold);
  background: var(--bg);
}
.header-search-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 2px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s ease;
}
.header-search-close:hover {
  background: rgba(0, 0, 0, 0.05);
}
/* モバイル時の dropdown は input 直下に inline 配置（fullwidth） */
.header-search--mobile .header-search-dropdown,
.landing-mobile-search-inner > .header-search-dropdown {
  position: static;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  box-shadow: none;
  border: 1px solid var(--border);
}
.landing-btn-ghost {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 980px;
  transition: color 0.15s, background 0.15s;
}
.landing-btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}
.landing-btn-primary {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 980px;
  background: var(--blue);
  transition: background 0.15s;
}
.landing-btn-primary:hover {
  background: var(--blue-hover);
}
/* ─── Mega Menu ─── */
.mega-menu-wrapper {
  position: relative;
}
.mega-menu-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0;
  transition: color .15s;
}
.mega-menu-trigger:hover { color: var(--text-primary); }

.mega-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(0,0,0,.1);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  min-width: 360px;
  z-index: 1000;
  animation: megaFadeIn .18s ease;
}
@keyframes megaFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.mega-menu__inner {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mega-menu__section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mega-menu__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #86868b;
  padding: 4px 8px 2px;
  margin: 0;
}
.mega-menu__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: background .15s;
}
.mega-menu__item:hover { background: #f5f5f7; }
.mega-menu__item--muted { opacity: .6; pointer-events: none; }
.mega-menu__item-thumb { flex-shrink: 0; }
.mega-menu__item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mega-menu__item-title {
  font-size: 15px;
  font-weight: 600;
  color: #1d1d1f;
}
.mega-menu__item-meta {
  font-size: 12px;
  color: #86868b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mega-menu__item-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--gold);
  color: #fff;
  border-radius: 2px;
}
.mega-menu__item-level {
  font-size: 11px;
  color: #86868b;
}
/* Lite版（音声付き）作品のアイコン — レベルバッジの右に並べる
   親 .mega-menu__item-meta が display:flex; gap:6px なので
   左マージンは gap で吸収される */
.nav-lite-badge {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}
/* トップページの作品カード／hero-carousel 用 Lite 小アイコン
   親 (.story-card-meta / .hero-carousel-meta) が flex + gap なので
   左マージンは不要 */
.story-card-lite-badge,
.hero-carousel-lite-badge {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.mega-menu-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,.08);
  text-align: center;
}
/* ─── レスポンシブ ─── */
/* ─── ハンバーガーボタン ─── */
.landing-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background .15s;
}
.landing-hamburger:hover { background: rgba(0,0,0,.06); }
.landing-hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: #1d1d1f;
  border-radius: 999px;
  transition: all .2s;
}
.landing-hamburger.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.landing-hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.landing-hamburger.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ─── モバイルメニュー ─── */
.landing-mobile-menu {
  position: fixed;
  top: 44px;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(100vh - 44px);
  background: #fff;
  z-index: 999;
  overflow-y: auto;
}
.landing-mobile-menu__inner {
  padding: 16px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
}
.landing-mobile-section {
  padding: 12px 0;
}
.landing-mobile-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #86868b;
  margin: 0 0 8px;
}
.landing-mobile-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  text-decoration: none;
  color: #1d1d1f;
  border-radius: 10px;
  transition: background .15s;
}
.landing-mobile-item:hover { background: #f5f5f7; }
.landing-mobile-item-thumb { flex-shrink: 0; }
.landing-mobile-item-info {
  display: flex; flex-direction: column; gap: 4px;
}
.landing-mobile-item-title {
  font-size: 16px; font-weight: 500;
}
.landing-mobile-item-meta {
  font-size: 12px; color: #86868b;
  display: flex; align-items: center; gap: 6px;
}
.landing-mobile-item-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--gold);
  color: #fff;
  border-radius: 2px;
}
.landing-mobile-item-level {
  font-size: 12px;
  color: #86868b;
}
.landing-mobile-divider {
  height: 0.5px;
  background: rgba(0,0,0,.1);
  margin: 4px 0;
}
.landing-mobile-link {
  display: block;
  padding: 14px 12px;
  font-size: 16px;
  color: #1d1d1f;
  text-decoration: none;
  border-radius: 10px;
  transition: background .15s;
}
.landing-mobile-link:hover { background: #f5f5f7; }

/* ─── レスポンシブ ─── */
@media (max-width: 767px) {
  .landing-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 10px;
  }
  .landing-nav { display: none; }
  .landing-hamburger {
    display: flex;
    margin-left: auto;
    z-index: 1001;
    flex-shrink: 0;
  }
  .mega-menu-wrapper { display: none; }
  /* PC 検索 box は非表示、モバイル虫眼鏡を表示 */
  .header-search--pc {
    display: none;
  }
  .header-search-mobile-btn {
    display: flex;
  }
  /* ログインボタン：モバイルではラベルを「ログイン」に短縮 */
  .landing-btn-login__prefix {
    display: none;
  }
  /* ログインボタン見切れ対策：間隔・余白を詰める */
  .landing-header-actions { gap: 6px; }
  .landing-btn-login { padding: 0 12px; }
}

/* ─── Header User ─── */
.landing-btn-login {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  background: #1a1108;
  color: #faf7f2;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  transition: background .15s;
  white-space: nowrap;
}
.landing-btn-login:hover { background: #2d1e0e; }

.header-user {
  position: relative;
}
.header-user-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  border: 0.5px solid rgba(0,0,0,.15);
  border-radius: 50%;
  cursor: pointer;
  color: #1a1108;
  transition: background .15s;
}
.header-user-btn:hover { background: rgba(0,0,0,.05); }

.header-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.header-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #c8862a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.header-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 0.5px solid rgba(0,0,0,.12);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
  min-width: 200px;
  z-index: 1100;
  padding: 8px;
}
.header-user-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1108;
  padding: 8px 12px 2px;
}
.header-user-menu-email {
  font-size: 11px;
  color: #8b7355;
  padding: 0 12px 8px;
}
.header-user-menu-divider {
  height: 0.5px;
  background: #e8e0d4;
  margin: 4px 0;
}
.header-user-menu-item {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: #1a1108;
  text-decoration: none;
  border-radius: 6px;
  transition: background .15s;
}
.header-user-menu-item:hover { background: #f5f0e8; }

/* ─── Login Tooltip ─── */
.login-tooltip {
  position: fixed;
  z-index: 9999;
  background: #1a1108;
  color: #faf7f2;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  min-width: 220px;
  pointer-events: auto;
  animation: tooltipIn .18s ease;
}
@keyframes tooltipIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-tooltip__text {
  color: rgba(255,255,255,.7);
  margin-bottom: 10px;
  line-height: 1.5;
}
.login-tooltip__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  background: #c8862a;
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.login-tooltip__btn:hover { background: #b3741e; }
.login-tooltip__close {
  position: absolute;
  top: 8px; right: 10px;
  background: none; border: none;
  color: rgba(255,255,255,.4);
  cursor: pointer; font-size: 16px;
  line-height: 1; padding: 0;
}

/* ─── Project Gutenberg credit ─── */
.gutenberg-credit { margin-top: 3rem; padding: 1rem 1.5rem; border-top: 0.5px solid #e0ddd8; font-size: 12px; color: #aaa; text-align: center; }
.gutenberg-credit a { color: #888; text-decoration: underline; }
.gutenberg-credit a:hover { color: #c8862a; }

/* ─── Outline Gold Button (SSoT) ───
   ゴールド枠付きリンクの共通スタイル。
   ・通常版（.btn-outline-gold）：本文セクションやダッシュボード用
   ・小さめ版（.btn-outline-gold--sm）：ヘッダーのメガメニュー用
   モバイルメニュー内は .landing-mobile-link と併用するため、
   末尾の合成セレクタで元のサイズを保持する。 */
.btn-outline-gold,
.btn-outline-gold--sm {
  display: inline-block;
  color: var(--gold);
  background: transparent;
  text-decoration: none;
  border: 1px solid var(--gold);
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.btn-outline-gold {
  font-size: 13px;
  padding: 6px 16px;
}
.btn-outline-gold--sm {
  font-size: 12px;
  padding: 4px 12px;
}
.btn-outline-gold:hover,
.btn-outline-gold--sm:hover {
  background: var(--gold);
  color: #fff;
  text-decoration: none;
}
/* モバイルメニュー内では .landing-mobile-link のサイズ感を優先 */
.landing-mobile-link.btn-outline-gold--sm {
  padding: 14px 12px;
  font-size: 16px;
}

/* ===== merged from audio_tag.css (2026-05-11) ===== */
/* Reusable "audio narration" tag.
 *
 * Used in 4 places to indicate that a work has audio narration:
 *   1. Story Grid Card (library.html, index.html top grid)
 *   2. Hero Carousel (index.html top of page)
 *   3. Story Detail page hero (story/story_detail.html)
 *
 * Markup:
 *   <div class="audio-tag">
 *     <img class="audio-tag__icon" src=".../lite-version.svg" width="20" height="20" alt="">
 *     朗読音声付き
 *   </div>
 *
 * Per-location margin/positioning is set in the host template's
 * own <style> block (or in story_card_extra.css for grid cards).
 */

.audio-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  line-height: 20px;
  color: var(--ink-muted, #8b7355);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.audio-tag__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
/* ===== /merged from audio_tag.css ===== */

/* ===== merged from story_card_extra.css (2026-05-11) ===== */
/* Extra story-card styles loaded by index.html and library.html.
 *
 * Background: index.html and library.html include
 * components/story_grid_card.html but do NOT load
 * static/css/story_card.css. Instead, base .story-card-* rules are
 * inlined in <style> blocks within each template.
 *
 * Rather than continuing to duplicate per-feature additions across
 * both templates, new card styles introduced after Phase 2 live in
 * this dedicated file, loaded once per template.
 *
 * Future: existing inline .story-card-* rules from index.html and
 * library.html may be migrated here as a separate refactor.
 */

/* === Audio tag positioning within story-card ===
 *
 * Visual styles live in audio_tag.css (.audio-tag base class).
 * This rule only adjusts placement in the card layout.
 */
.story-card-audio-tag {
  margin: 6px 0 2px;
}


/* === Status badge (library 専用、enrich_stories_with_remote_progress 注入時のみ表示) ===
 *
 * .completed   = 読了済み（緑系、SAVED EPISODES の解説タグと同トーン）
 * .in-progress = 学習中（金ベージュ系、既存ジャンルバッジと同トーン）
 *
 * dashboard 側の .db-tag-explain (#e8f0e8 / #2a6a3a) と
 * .db-tag-text (#faf0e0 / #a06820) の色を流用して整合性を保つ。
 */
.story-card-status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  margin-left: 4px;
  vertical-align: middle;
}
.story-card-status-badge.completed {
  background: #e8f0e8;
  color: #2a6a3a;
}
.story-card-status-badge.in-progress {
  background: #faf0e0;
  color: #a06820;
}

/* === Summary row (library 専用、読書 % と正答率を 1 行で表示) ===
 *
 * 表示パターン:
 *   "読書 73% · 正答率 82%"   両方ある時
 *   "読書 73%"                 読書中で正答率閾値未満
 *   "正答率 82%"               未読書だがクイズだけ進めた時
 *   非表示                      どちらも無い時 (テンプレ側で抑制)
 */
.story-card-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 12px;
  color: var(--ink-light, #5c4a30);
  font-family: var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}
.story-card-summary-item {
  font-weight: 600;
}
.story-card-summary-sep {
  color: var(--ink-muted, #8b7355);
  opacity: 0.6;
}
/* ===== /merged from story_card_extra.css ===== */
