/* ホームの棚（js/home-shelves.js と対）
 *
 * 上から: 木と植物の棚（横スワイプ）/ あなたへのおすすめ（2×2）/ 続きから見る / 2% の帯 /
 *         各セクション（2×2・名前と価格つき・縦に積む）
 *
 * 色のついた背景は木と植物の棚だけ（2026-09-28 葉太指定）。帯より下は白地のまま。
 *
 * 強さ: --plant-veil（木と植物・背景に重ねる白の濃さ）。0 = 写真そのまま。
 *   2026-09-28 に 3 段階を見比べて「控えめ = .35」に決めた。変えるならこの 1 か所。
 */
.home-feed {
    --plant-veil: .35;
    display: flex;
    flex-direction: column;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
}

/* ページの並びが決まるまで（is-settling）は出さない */
.dashboard-grid-section.is-settling > .home-feed { display: none !important; }

/* 旧来の棚（横 1 列）は丸ごと隠す。has-home-shelves は js/home-shelves.js が動いた時だけ付く。
 * 中身は隠れたまま描かれ続け、js/home-shelves.js がそのデータを使って上の棚を組む。 */
.dashboard-grid-section.has-home-shelves > .dashboard-section { display: none !important; }

/* ---- 木と植物の棚（大きいカードの横スワイプ） ----
 * カード: 木の板と植物の写真。商品 4 件は白い台紙に載せる（商品写真は背景つきのものが多く、
 *   模様の上に直接置くと境目が消えて見にくかったため・2026-09-28 実測）。
 * 後ろの背景: 表示中のカードの植物の色の写真。2 枚を重ねてフェードで切り替え、下へ地の色に溶かす。 */
.plant-shelf {
    --plant-card-w: min(340px, 84vw);
    position: relative;
    isolation: isolate;
    margin: 4px -4px 12px;
    padding: 36px 0 26px;
    overflow: hidden;
}
.plant-shelf-bg-layer {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center top;
    opacity: 0;
    transition: opacity 300ms ease;
}
.plant-shelf-bg-layer.is-on { opacity: 1; }
.plant-shelf::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, var(--plant-veil)) 0%,
        rgba(255, 255, 255, calc(var(--plant-veil) + .1)) 55%,
        var(--geal-bg-primary, #ffffff) 100%);
}

.plant-shelf-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 14px;
    padding: 0 14px 4px;
    scrollbar-width: none;
}
.plant-shelf-rail::-webkit-scrollbar { display: none; }

.plant-card {
    flex: 0 0 var(--plant-card-w);
    width: var(--plant-card-w);
    aspect-ratio: 340 / 420;
    box-sizing: border-box;
    scroll-snap-align: start;
    border-radius: 8px;
    overflow: hidden;
    padding: 12px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    background-color: #d9c3a3; /* 板の画像が届く前の仮の木の色 */
    background-image:
        linear-gradient(rgba(255, 255, 255, var(--plant-veil)), rgba(255, 255, 255, var(--plant-veil))),
        var(--plant-board, none);
    background-size: cover;
    background-position: center;
    box-shadow: 0 3px 14px rgba(10, 10, 10, .22);
}

.plant-card-title {
    margin: 0 0 0 4px;
    font-family: var(--font-main, "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif);
    font-weight: 900;
    font-size: 24px;
    line-height: 1.2;
    color: #1B1B1F;
    text-shadow: 0 0 8px rgba(255, 255, 255, .85), 0 0 2px rgba(255, 255, 255, .9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plant-card-quad {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(20, 10, 0, .28);
}
.plant-card-item {
    display: block;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    background: #f6f6f8;
}
.plant-card-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.plant-card-item:focus-visible { outline: 2px solid #0A0A0A; outline-offset: 2px; }

.plant-card-more {
    all: unset;
    cursor: pointer;
    margin: auto 0 0 4px;
    align-self: flex-start;
    font-size: 12.5px;
    font-weight: 700;
    color: #1B1B1F;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-shadow: 0 0 8px rgba(255, 255, 255, .85);
}
.plant-card-more:focus-visible { outline: 2px solid #0A0A0A; outline-offset: 2px; border-radius: 2px; }


/* ---- 見出し（おすすめ / 続きから見る / 各セクション） ---- */
.home-block { margin: 18px 0 20px; }
.home-block-title {
    margin: 0 12px 10px;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.25;
    color: var(--geal-text-primary, #111);
}

/* ---- 2×2（名前と価格つき）: あなたへのおすすめ / 帯より下の各セクション ---- */
.home-pick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 12px;
}
.home-pick-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.home-pick-ph {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--geal-border, #e5e7eb);
}
.home-pick-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-pick-name {
    font-size: 13px;
    line-height: 1.4;
    color: var(--geal-text-secondary, #374151);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.home-pick-price {
    font-family: var(--font-num, "Space Grotesk", sans-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--geal-text-primary, #111);
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.home-pick-was { font-size: 12px; font-weight: 500; color: var(--geal-text-muted, #6b7280); }
.home-pick-item:focus-visible { outline: 2px solid #0A0A0A; outline-offset: 2px; border-radius: 8px; }
/* ハートを重ねるときのセル（js/home-shelves.js）。ハートは写真の右上 = セルの右上 */
.home-pick-cell { position: relative; min-width: 0; }

.home-section-more {
    all: unset;
    cursor: pointer;
    display: inline-block;
    margin: 12px 12px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-purple, #6B21A8);
}
.home-section-more[hidden] { display: none; }
.home-section-more:hover { text-decoration: underline; }
.home-section-more:focus-visible { outline: 2px solid #0A0A0A; outline-offset: 2px; border-radius: 2px; }

/* ---- 続きから見る（テーマ別の小さいカードの横スワイプ） ---- */
.home-continue-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 12px;
    padding: 0 12px 4px;
    scrollbar-width: none;
}
.home-continue-rail::-webkit-scrollbar { display: none; }
.continue-card {
    flex: 0 0 min(260px, 68vw);
    scroll-snap-align: start;
    box-sizing: border-box;
    border: 1px solid var(--geal-border, #e5e7eb);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--geal-bg-card, #fff);
}
.continue-card-title { margin: 0; font-size: 16px; font-weight: 900; color: var(--geal-text-primary, #111); }
.continue-card-quad { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.continue-card-item {
    display: block;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: var(--geal-bg-secondary, #f5f5f5);
}
.continue-card-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.continue-card-more {
    margin-top: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-purple, #6B21A8);
    text-decoration: none;
}
.continue-card-more:hover { text-decoration: underline; }

/* ---- 2% の帯（横幅いっぱい） ---- */
.home-band {
    margin: 8px -4px 20px;
    padding: 22px 18px;
    background: #0F3D24;
    color: #ffffff;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}
.home-band-title { margin: 0 0 6px; font-size: 20px; font-weight: 900; line-height: 1.35; color: #ffffff; }
.home-band-sub { margin: 0; font-size: 12.5px; line-height: 1.6; color: rgba(255, 255, 255, .82); }
.home-band-fig { text-align: right; line-height: 1; }
.home-band-fig b { display: block; font-family: var(--font-num, "Space Grotesk", sans-serif); font-size: 44px; font-weight: 700; color: #ffffff; }
.home-band-fig span { font-size: 11px; color: rgba(255, 255, 255, .78); }

@media (prefers-reduced-motion: reduce) {
    .plant-shelf-bg-layer { transition: none; }
}

/* ---- 読み込み中の仮の形（buyer-dashboard.js の startDashboardSettling が置く）----
 * 本物と同じ「大きいカードの横スワイプ → 2×2」の形にしておく（2026-09-29）。
 * 以前は旧来の横 1 列の棚の形が 2 段出ていて、読み込み中だけ昔のホームに見えていた。 */
.home-skeleton { max-width: 560px; margin: 0 auto; }
.home-skeleton__swipe { display: flex; gap: 12px; overflow: hidden; padding: 36px 16px 26px; }
.home-skeleton__swipe > span { flex: 0 0 min(340px, 84vw); aspect-ratio: 340 / 420; border-radius: 8px; }
.home-skeleton__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 16px 16px; }
.home-skeleton__grid > span { aspect-ratio: 1; border-radius: 8px; }
.home-skeleton span {
    background-color: #E2E5DF;
    background-image: linear-gradient(90deg, #E2E5DF 0%, #F0F2EE 50%, #E2E5DF 100%);
    background-size: 800px 100%;
    animation: geal-skeleton-shimmer 1.4s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .home-skeleton span { animation: none; } }
