/* ============================================================
 * Phase 14 — Home v1 (オールピック / Pick型 / ShopMy同型)
 * Tifuler→Home 置換 (案III) / Journal→Profile (案ZZ)
 * Tier非公開 / LATEST TIFULER 段1 = 新着Tifulerディスカバリー
 * ============================================================ */

/* Top nav (5タブ横スライド / 位置 = LATEST TIFULER 見出しに完全整列)
 * .home-top-nav 自体に padding-left:20px を直付け = first-child の "L" が見出しの "L" と同じ X 座標
 */
.home-top-nav {
  display: flex;
  padding: 6px 0 0 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--line, #EAE6DF);
  background: white;
  position: sticky;
  top: var(--top-bar-h, 62px);
  z-index: 5;
}
@media (max-width: 430px) {
  .home-top-nav { top: calc(var(--top-bar-h, 62px) + env(safe-area-inset-top)); }
}
.home-top-nav::-webkit-scrollbar { display: none; }
.home-top-nav::after {
  content: '';
  flex: 0 0 20px;
}
.home-top-nav__tab {
  flex: 0 0 auto;
  padding: 13px 0;
  margin-right: 26px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--mist, #9C988F);
  cursor: pointer;
  position: relative;
  scroll-snap-align: start;
  transition: color 0.2s;
  white-space: nowrap;
}
.home-top-nav__tab:hover { color: var(--ink, #1F232E); }
.home-top-nav__tab.is-active {
  color: var(--ink, #1F232E);
}
.home-top-nav__tab.is-active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink, #1F232E);
}

/* Home panel */
.home-panel { display: none; padding-bottom: 100px; }
.home-panel.is-active { display: block; }

/* Section */
.home-section { margin-top: 28px; }
.home-section:first-child { margin-top: 24px; }

.home-section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 14px;
}
.home-section__title {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink, #1F232E);
  text-transform: uppercase;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.home-section__sub {
  font-size: 10px;
  font-weight: 400;
  color: var(--mist, #9C988F);
  letter-spacing: 0.06em;
  text-transform: none;
}
.home-section__more {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--line, #EAE6DF);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink, #1F232E);
  font-size: 13px;
  flex: 0 0 auto;
  transition: background 0.2s;
}
.home-section__more:hover { background: var(--bg-porcelain, #F8F5F1); }

/* Rail (横スクロールカルーセル) */
.home-rail {
  display: flex;
  gap: 12px;
  padding: 0 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.home-rail::-webkit-scrollbar { display: none; }
.home-rail::after {
  content: '';
  flex: 0 0 8px;
}

/* Card */
.home-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--line, #EAE6DF);
  display: flex;
  flex-direction: column;
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* Date badge (左上) */
.home-card__date {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink, #1F232E);
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Pick count badge (TRENDING NOW セクション用) */
.home-card__pickcount {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  background: rgba(31, 35, 46, 0.88);
  color: white;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Pick button (右上 ♡) */
.home-card__pick {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink, #1F232E);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: color 0.18s, background 0.18s, transform 0.15s;
  padding: 0;
}
.home-card__pick:hover { background: white; transform: scale(1.06); }
.home-card__pick:active { transform: scale(0.95); }
.home-card__pick svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}
.home-card__pick.is-picked {
  color: white;
  background: #D97757;
}
.home-card__pick.is-picked svg {
  fill: white;
  stroke: white;
}

/* Media */
.home-card__media {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--bg-porcelain, #F8F5F1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* HomeCare 商品画像 = 余白を残し中央配置 */
.home-card__media--product {
  aspect-ratio: 1 / 1;
  padding: 24px;
  background: linear-gradient(180deg, #FBFAF7 0%, #F4F1EC 100%);
}
.home-card__media--product img {
  object-fit: contain;
  width: 100%;
  height: 100%;
}
/* メンテ機材画像 = 余白あり / 商品同様の白背景で統一感 */
.home-card__media--equipment {
  aspect-ratio: 4 / 5;
  padding: 28px;
  background: linear-gradient(180deg, #FBFAF7 0%, #F4F1EC 100%);
}
.home-card__media--equipment img {
  object-fit: contain;
  width: 100%;
  height: 100%;
}
/* Tifuler ポートレート = 1:1 */
.home-card__media--portrait {
  aspect-ratio: 1 / 1;
  padding: 0;
  background: var(--bg-porcelain, #F8F5F1);
}
.home-card__media--portrait img {
  object-fit: cover;
}

/* Meta */
.home-card__meta {
  padding: 14px 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.home-card__brand {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: var(--mist, #9C988F);
  margin-bottom: 4px;
  letter-spacing: 0.06em;
}
.home-card__title {
  font-family: 'Noto Serif JP', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink, #1F232E);
  margin: 0 0 10px;
  line-height: 1.35;
  letter-spacing: 0.01em;
}
.home-card__owner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  color: var(--mist, #9C988F);
  margin-top: auto;
}
.home-card__owner img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 18px;
}
.home-card__handle {
  color: var(--ink, #1F232E);
  font-weight: 500;
}
.home-card__trust {
  font-feature-settings: 'tnum';
  margin-left: auto;
}
.home-card__endorsed {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  color: var(--mist, #9C988F);
  margin-top: auto;
  line-height: 1.4;
}

/* Tifuler card variant (段1: LATEST TIFULER + 段6: MOST TRUSTED TIFULERS) */
.home-card--tifuler { flex: 0 0 200px; }
.home-card--tifuler .home-card__brand {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  font-size: 9.5px;
  color: var(--mist, #9C988F);
}
.home-card--tifuler .home-card__title {
  font-size: 17px;
  margin-bottom: 8px;
}

/* Tifuler 段1 用 = 興味カテゴリ表示 */
.home-card__bio {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  color: var(--mist, #9C988F);
  margin-top: auto;
  line-height: 1.4;
}

/* 段6 用 Trust 数 強調 (Hero 的) */
.home-card__trust-large {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink, #1F232E);
  margin-top: auto;
  font-feature-settings: 'tnum';
  letter-spacing: 0.02em;
}
.home-card__trust-large span {
  font-size: 10px;
  font-weight: 400;
  color: var(--mist, #9C988F);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 2px;
}

/* Coming soon panel */
.home-comingsoon {
  text-align: center;
  padding: 100px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--mist, #9C988F);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Pick toast */
.pick-toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(31, 35, 46, 0.94);
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  letter-spacing: 0.04em;
}
.pick-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
 * ボトムナビ Profile タブ用 (Journal → Profile / アイコン img 化)
 * ============================================================ */
.tab-item__avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid currentColor;
  flex: 0 0 22px;
}
.tab-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
 * LATEST ROUTINE: 2x2 grid + AM/PM pill (2026-05-07)
 * HOMECARE 単品との差分明確化 / Routine = 商品セットを視覚化
 * ============================================================ */
.home-card__media--routine {
  position: relative;
  background: #FFFFFF;
  padding: 0;
}
.home-card__routine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  width: 100%;
  height: 100%;
  background: rgba(31, 35, 46, 0.06);
}
.home-card__routine-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #FFFFFF;
}
.home-card__routine-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(31, 35, 46, 0.85);
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.10em;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2;
}
