/* ============================================================
   Comer Wine List — styles
   モバイルファースト（9割スマホ想定）。現行サイトより“ほんの少し”カジュアルに。
   ============================================================ */

:root {
  --bg: #e7e4de;           /* ベージュ→ほんの少しグレー寄り */
  --ink: #3a2e28;          /* 温かみのある濃茶 */
  --ink-soft: #8a7d73;     /* サブ情報 */
  --line: #cdbfb2;         /* 罫線 */
  --accent: #7a4a3a;       /* 差し色（テラコッタ寄り） */
  --card: #f4eee7;         /* ほんのり浮かせる面 */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  font-size: 62.5%;               /* 1rem = 10px */
  background-color: var(--bg);
  color: var(--ink);
  font-family: 'Jost', 'Shippori Mincho', -apple-system, BlinkMacSystemFont,
    'Helvetica Neue', sans-serif;
  font-feature-settings: "palt";
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  /* 全体を選択・コピー不可に（メニューらしいアプリ的挙動） */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 和文は明朝でエレガントに */
.ja {
  font-family: 'Shippori Mincho', 'Hiragino Mincho ProN', 'YuMincho', serif;
  font-weight: 400;
}


p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 500; }

.container {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 5vw;
}

/* ---------- ローディングオーバーレイ ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.overlay img {
  width: 150px;
  height: auto;
  mix-blend-mode: multiply;   /* 白背景の webp をベージュ地に馴染ませる */
  opacity: 0;
  animation: overlay-logo-in 0.9s ease 0.15s forwards;
}
@keyframes overlay-logo-in {
  to { opacity: 1; }
}
.overlay.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- ヘッダー ---------- */
.site-header {
  padding: 8rem 0 0;
  text-align: center;
}

.site-header h1 {
  display: inline-block;
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.5rem 2.4rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.tax-note {
  margin-top: 2.4rem;
  color: var(--ink-soft);
}
.tax-note p {
  font-size: 1.15rem;
  line-height: 1.6;
}
.tax-note .en { letter-spacing: 0.04em; }

/* ---------- 種類セクション ---------- */
main { padding-bottom: 14rem; }
/* 右エッジのレール索引と価格が重ならないよう、本文に右ガター（狭い画面のみ） */
@media (max-width: 700px) {
  main.container { padding-right: calc(5vw + 2.6rem); }
}

/* 国の大見出し */
.country-head {
  margin-top: 8.5rem;
  text-align: center;
  scroll-margin-top: 1.5rem;
}
#list-root > .country-head:first-child { margin-top: 4rem; }
.country-head .country-name {
  display: inline-flex;
  align-items: center;
  gap: 1.6rem;
  font-family: 'Cormorant Garamond', 'Shippori Mincho', serif;
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--ink);
}
/* 両サイドの極細ライン（アンダーラインの代わりの控えめなアクセント） */
.country-head .country-name::before,
.country-head .country-name::after {
  content: "";
  display: block;
  width: 2.8rem;
  height: 1px;
  background: var(--line);
}

.type-section { padding-top: 7rem; scroll-margin-top: 1.5rem; }
/* 国見出しとカテゴリ（種類）の余白 */
.country-head + .type-section { padding-top: 5rem; }

.type-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.9rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.type-head .dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  flex: 0 0 auto;
  align-self: center;
}
.type-head .en {
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.type-head .jp {
  flex-basis: 100%;
  font-size: 1.2rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

/* ---------- ワイン1件 ---------- */
.wine {
  display: flow-root;
  padding: 1.8rem 0;
  margin-top: 16px;
  border-bottom: 1px dashed var(--line);
  margin-right: -0.8rem;         /* 波線＋金額を右へ（レールの国イニシャルと重ならない範囲で） */
}

.wine-main { min-width: 0; }

/* 上段：No. は常に品名の上。ロゴが無ければ No. のみ左寄せ */
.wine-top {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.4rem;   /* No. のみ（ロゴなし）は小さめ */
}
/* ロゴありは No.（左・絶対配置）＋ ロゴ（中央）を並列に */
.wine-top.has-logo {
  justify-content: center;
  min-height: 2rem;
  margin-bottom: 2rem;   /* ロゴの下の余白 */
}
.wine-top.has-logo .wine-no {
  position: absolute;
  left: 0;
  top: 0.2rem;
}

/* タイトル行：No. ＋ 品名 ＋ 金額 を同じ行に（品名が伸縮、金額は右） */
.wine-title {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}
.wine-title .wine-name {
  flex: 1 1 auto;
  min-width: 0;
}
.wine-title .wine-price {
  flex: 0 0 auto;
  margin-left: auto;   /* .wine が右に伸びた分、金額も右端（＝波線の端）に揃う */
}
.wine-no {
  flex: 0 0 auto;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--accent);
  opacity: 0.85;
  letter-spacing: 0.05em;
}
.wine-country {
  font-size: 1.05rem;
  color: var(--ink-soft);
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.wine-vintage {
  margin-left: 0.7rem;
  font-size: 1.1rem;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

/* 生産者ロゴ：No./金額の上に中央配置。ロゴは透過背景前提（色付きロゴもそのまま表示）。
   横長／正方形どちらも枠内に収める。実サイズは microCMS の logoSize（S/M/L）。 */
.wine-logo {
  display: block;
  width: auto;
  height: auto;
  margin: 0;                   /* 中央寄せは .wine-top の flex に任せる */
  object-fit: contain;
  object-position: center;
}
/* max-height は正方形・縦長ロゴ、max-width は横長ロゴの大きさを決める */
.wine-logo.logo-s { max-height: 4.6rem; max-width: 45%; }
.wine-logo.logo-m { max-height: 6rem;   max-width: 60%; }
.wine-logo.logo-l { max-height: 7.4rem;  max-width: 78%; }

.wine-name {
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.wine-kana {
  margin-top: 0.3rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.wine-producer {
  margin-top: 0.45rem;
  font-size: 1.25rem;
  font-weight: 300;
  color: #5d5049;
}
.wine-variety {
  margin-top: 0.25rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.wine-taste {
  margin-top: 0.6rem;
  font-size: 1.2rem;
  line-height: 1.55;
  color: #52463f;
}

.wine-price {
  flex: 0 0 auto;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.wine-price .yen {
  font-size: 1.15rem;
  font-weight: 400;
  margin-right: 0.15rem;
  color: var(--ink-soft);
}

/* ---------- フッター ---------- */
.site-footer {
  text-align: center;
  padding: 7rem 0 5rem;
}
.footer-logo {
  width: 170px;
  max-width: 60%;
  height: auto;
  /* 白背景の webp をベージュ地に馴染ませる（黒線は残り白は透ける） */
  mix-blend-mode: multiply;
}

/* ---------- カラードット・レール索引（右エッジ） ---------- */
.rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;                        /* 国ブロック間の余白 */
  padding: 1.2rem 0.9rem 1.2rem 1.4rem;
  touch-action: none;                 /* スクラブ中のスクロール抑制 */
  transition: opacity 0.3s ease, transform 0.3s ease;
}
/* スクラブ中のテキスト選択・長押しメニュー・タップ光を抑制（iOS対策） */
.rail, .rail *, .rail-tip {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.rail.hidden {
  opacity: 0;
  transform: translateY(-50%) translateX(1rem);
  pointer-events: none;
}
/* 国ブロック：イニシャル＋（展開時のみ）種類ドット */
.rail-country {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.rail-ini {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  padding: 0.2rem 0.3rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.rail-country.expanded .rail-ini { color: var(--ink); }   /* 現在地の国を強調 */

/* 既定は種類ドット非表示。現在地の国だけ展開 */
.rail-country .rail-dot { display: none; }
.rail-country.expanded .rail-dot { display: block; }

.rail-dot {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--c);
  opacity: 0.55;
  box-shadow: 0 0 0 0 rgba(58, 46, 40, 0);
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.rail-dot.active {
  opacity: 1;
  transform: scale(1.55);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--c);
}

/* ── 触れている間だけ拡大（普段は細いままリスト幅を維持）── */
.rail { transition: gap 0.12s ease, padding 0.12s ease, background 0.12s ease; }
.rail-dot { transition: width 0.12s ease, height 0.12s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.rail-ini { transition: color 0.2s ease, font-size 0.12s ease; }

.rail.grabbing {
  gap: 1.5rem;
  padding-left: 3rem;                 /* 左に広げて掴みやすく（拡大中のみ） */
  background: rgba(244, 238, 231, 0.94);
  border-radius: 1.6rem 0 0 1.6rem;
  box-shadow: -4px 0 20px rgba(58, 46, 40, 0.14);
  backdrop-filter: blur(4px);
}
.rail.grabbing .rail-country { gap: 1.2rem; }
.rail.grabbing .rail-ini { font-size: 1.35rem; color: var(--ink); }
.rail.grabbing .rail-dot { width: 1.3rem; height: 1.3rem; opacity: 0.85; }
.rail.grabbing .rail-dot.active {
  opacity: 1;
  transform: scale(1.4);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--c);
}

/* スクラブ／タップ時に出る現在地ラベル */
.rail-tip {
  position: fixed;
  right: 3.4rem;
  z-index: 101;
  transform: translateY(-50%);
  padding: 0.5rem 1rem;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--bg);
  background: var(--ink);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(58, 46, 40, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, right 0.12s ease, font-size 0.12s ease;
}
.rail-tip.show { opacity: 1; }

/* スクラブ中（拡大中）は、親指と拡大レールの左まで離して大きく表示 */
.rail.grabbing ~ .rail-tip {
  right: 8rem;
  font-size: 1.5rem;
  padding: 0.7rem 1.4rem;
}

/* ---------- 少し広い画面 ---------- */
@media (min-width: 560px) {
  .site-header h1 { font-size: 3.6rem; }
  .wine-name { font-size: 2.1rem; }
}
