/* ============================================================
   持ち寄りれもん 専用ページ 共通スタイル
   色・線・余白・文字サイズは れもんハウスのサイト（STUDIO）の
   デザインルールに合わせています。
   ============================================================ */

:root {
  --ink: #261F1C;          /* Lemon Black：文字・線 */
  --green: #67B16A;        /* Lemon Dark Green：ボタン・リンク・緑線 */
  --green-dark: #559659;   /* ボタンのホバー用（緑を少し暗く） */
  --paper: #F7F5F0;        /* コメントの背景などのごく薄い地色 */
  --line: #261F1C;         /* 線は 1px の Lemon Black */
  --muted: #6E6763;        /* 補足文字（4.5:1 を満たす濃さ） */
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
          "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  --gutter: 20px;          /* SP の横マージン */
}
@media (min-width: 900px) {
  :root { --gutter: 80px; } /* PC の横マージン */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: #fff;
  font-size: 14px; line-height: 1.8; -webkit-font-smoothing: antialiased;
}
a { color: var(--green); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* --- ページ全体の枠 --- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }

/* --- 上部のナビ（サイトへ戻る） --- */
.topbar { height: 56px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.topbar a { color: var(--ink); text-decoration: none; font-size: 14px; }
.topbar a:hover { color: var(--green); }

/* --- 見出し（サイトのテキストスタイルに合わせる） --- */
.h-page  { font-size: 40px; font-weight: 700; line-height: 1.2; margin: 0; }
.h-large { font-size: 32px; font-weight: 700; line-height: 1.3; margin: 0; }
.h-small { font-size: 26px; font-weight: 700; line-height: 1.3; margin: 0; }
.lead { font-size: 14px; margin: 20px 0 0; max-width: 640px; }
.note { font-size: 11px; color: var(--muted); }
@media (max-width: 899px) {
  .h-page { font-size: 26px; }
  .h-large { font-size: 26px; }
  .h-small { font-size: 22px; }
}

/* --- セクションの縦の余白 --- */
.section { padding-top: 60px; padding-bottom: 100px; }
@media (min-width: 900px) { .section { padding-top: 80px; padding-bottom: 120px; } }
.section-head { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 900px) {
  .section-head { flex-direction: row; justify-content: space-between; align-items: flex-end; }
}

/* --- ボタン --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  min-height: 48px; padding: 12px 24px; border-radius: 999px; border: 1px solid transparent;
  background: var(--green); color: #fff; font-size: 14px; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: background .15s ease;
}
.btn:hover { background: var(--green-dark); color: #fff; }
.btn-line { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn[aria-disabled="true"] { background: #cfcfcf; cursor: default; }

/* --- カードのグリッド --- */
.grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 40px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* --- カード --- */
.card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  color: inherit; text-decoration: none;
}
a.card:hover .card-title { color: var(--green); }
.card-thumb {
  position: relative; aspect-ratio: 16 / 10; background: var(--paper) center / cover no-repeat;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 44px;
}
.pill {
  position: absolute; top: 12px; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--ink);
}
.pill-kind { left: 12px; }
.pill-date { right: 12px; }
.pill-done { left: 12px; background: var(--green); color: #fff; }
.pill-ended { left: 12px; background: var(--ink); color: #fff; }
.card-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title { font-size: 18px; font-weight: 700; line-height: 1.4; margin: 0; }
.card-meta { font-size: 11px; color: var(--muted); }
.card-body .btn { margin-top: auto; }

/* 1件だけのときは横長にして幅いっぱいに */
@media (min-width: 900px) {
  .grid.is-single { grid-template-columns: 1fr; }
  .grid.is-single .card { flex-direction: row; }
  .grid.is-single .card-thumb { width: 50%; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--line); }
  .grid.is-single .card-body { padding: 32px 40px; justify-content: center; gap: 14px; }
  .grid.is-single .card-title { font-size: 26px; }
  .grid.is-single .btn { width: auto; align-self: flex-start; padding: 12px 40px; margin-top: 20px; }
}

/* --- 金額と進捗バー --- */
.amount-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.amount { font-size: 22px; font-weight: 700; line-height: 1.1; }
.amount-label { font-size: 11px; color: var(--muted); display: block; }
.goal { font-size: 11px; color: var(--muted); white-space: nowrap; }
.track { height: 10px; border-radius: 999px; background: #EDEAE4; overflow: hidden; }
.fill { height: 100%; background: var(--green); border-radius: 999px; transition: width .6s ease; }
.stats { display: flex; gap: 20px; font-size: 11px; color: var(--muted); }
.stats b { font-size: 14px; color: var(--ink); margin-right: 2px; }
.soon { color: #B0620C; }

/* --- 空のとき・読み込み中 --- */
.empty { padding: 40px 0; color: var(--muted); font-size: 14px; }

/* ============================================================
   願いの詳細ページ
   ============================================================ */
.detail { display: grid; grid-template-columns: 1fr; gap: 40px; padding-top: 28px; padding-bottom: 140px; }
@media (min-width: 900px) {
  .detail { grid-template-columns: 7fr 5fr; gap: 40px; padding-top: 40px; padding-bottom: 120px; align-items: start; }
}
.detail-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hero {
  position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden;
  background: var(--paper) center / cover no-repeat; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 64px;
}
.detail-title { font-size: 26px; font-weight: 700; line-height: 1.4; margin: 0; }
@media (min-width: 900px) { .detail-title { font-size: 32px; } }
.body-text { font-size: 14px; margin: 0; white-space: pre-line; }
.subhead {
  font-size: 14px; font-weight: 700; margin: 20px 0 0; padding-left: 10px;
  border-left: 3px solid var(--green); line-height: 1.5;
}

/* 金額の箱（PC では右に固定、SP では本文の中） */
.panel {
  border: 1px solid var(--line); border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 14px; background: #fff;
}
@media (min-width: 900px) { .panel { position: sticky; top: 24px; } }
.panel .amount { font-size: 32px; }
.panel .stats b { font-size: 20px; }
.panel .track { height: 12px; }
.remain { font-size: 14px; }
.done-text { color: var(--green); font-weight: 700; }
.ended-text { color: var(--muted); }
.panel .note { margin: 0; }

/* コメント */
.comments { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.comment { background: var(--paper); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.comment-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-bottom: 2px; }
.comment-top b { color: var(--ink); }
.comment.anon .comment-top b { color: var(--muted); font-weight: 400; }
.comment-date { color: var(--muted); white-space: nowrap; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0 0; }

/* SP と PC で、金額の箱を出す場所を切り替える */
.only-pc { display: none; }
@media (min-width: 900px) { .only-pc { display: block; } .only-sp { display: none; } }

/* SP：スクロール後に上に貼りつく要約 */
.compact {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: #fff;
  border-bottom: 1px solid var(--line); padding: 10px var(--gutter) 12px;
  transform: translateY(-110%); transition: transform .2s ease;
}
.compact.is-on { transform: translateY(0); }
.compact-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12px; }
.compact-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact .track { height: 6px; margin-top: 8px; }
@media (min-width: 900px) { .compact { display: none; } }

/* SP：画面下に固定する「持ち寄る」 */
.footbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff;
  border-top: 1px solid var(--line); padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.footbar-info { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); flex-shrink: 0; line-height: 1.4; }
.footbar-info b { font-size: 12px; color: var(--ink); }
.footbar .btn { flex: 1; }
@media (min-width: 900px) { .footbar { display: none; } }

/* ============================================================
   アーカイブ
   ============================================================ */
.totals { display: flex; gap: 32px; }
.totals div { display: flex; flex-direction: column; }
.totals > div > span { font-size: 11px; color: var(--muted); }
.totals b { font-size: 28px; line-height: 1.2; }
.totals b span { font-size: inherit; color: inherit; }
.card.is-ended .card-thumb { filter: grayscale(.4); }
.card-after {
  font-size: 13px; padding-top: 10px; border-top: 1px solid var(--line);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
