@charset "utf-8";

/* ============================================================
   栃木の直売マルシェ
   生成り(紙)の地に、深緑と柿色を効かせた低彩度のパレット。
   面の区切りは影ではなく1pxの罫線で作り、見出しだけ明朝を使う。
   ============================================================ */

:root {
  --paper: #faf8f3;
  --paper-2: #f2eee4;
  --paper-3: #e9e4d6;
  --ink: #22201b;
  --ink-2: #5f5a4e;
  --line: #ded7c8;
  --line-strong: #c9c0ac;
  --forest: #33503c;
  --forest-deep: #24402d;
  --kaki: #a8481f;
  --kaki-soft: #f6e7dc;
  --indigo: #35526f;
  --indigo-soft: #e4eaf1;
  --danger: #a32d20;

  --r-s: 4px;
  --r-m: 8px;
  --r-pill: 999px;

  --container: 1120px;
  --gutter: 16px;

  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --gothic: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (min-width: 720px) {
  :root { --gutter: 24px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 15px;
  line-height: 1.75;
  /* 日本語の字間を詰めて、欧文混じりでも間延びしないようにする */
  font-feature-settings: "palt" 1;
  text-underline-offset: 0.2em;
}

h1, h2, h3, h4 {
  font-family: var(--mincho);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
  margin: 0;
}

p { margin: 0; }

img { max-width: 100%; }

a { color: var(--forest-deep); }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- レイアウト ---------- */

.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* フォーム主体の画面は行長を抑えたほうが読みやすいので別枠にする */
.container {
  max-width: 680px;
  margin-inline: auto;
  padding: 0 var(--gutter) 56px;
}
.container.wide { max-width: var(--container); }

.section { padding: 40px 0; }
.section + .section { padding-top: 0; }
.section--tint { background: var(--paper-2); border-block: 1px solid var(--line); margin-block: 40px; }
.section--tint + .section { padding-top: 40px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 { font-size: 20px; }
.section-head .count { font-size: 13px; color: var(--ink-2); font-family: var(--gothic); font-weight: 400; }
.see-all {
  font-size: 13px;
  font-weight: 700;
  color: var(--forest-deep);
  text-decoration: none;
  white-space: nowrap;
}
.see-all:hover { text-decoration: underline; }

@media (min-width: 720px) {
  .section { padding: 56px 0; }
  .section-head h2 { font-size: 24px; }
}

/* ---------- ヘッダー ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px var(--gutter);
  background: rgba(250, 248, 243, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-logo {
  font-family: var(--mincho);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.site-nav-links { display: none; }

.site-nav-cta {
  margin-left: auto;
  flex: none;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--forest-deep);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav-cta:hover { border-color: var(--forest); background: #fff; }
.site-nav-cta.current { background: var(--forest); border-color: var(--forest); color: #fff; }

@media (min-width: 860px) {
  .site-nav { padding: 14px 32px; }
  .site-nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-left: 32px;
  }
  .site-nav-links a {
    position: relative;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    padding: 4px 0;
  }
  .site-nav-links a:hover { color: var(--forest-deep); }
  .site-nav-links a.current { color: var(--forest-deep); }
  .site-nav-links a.current::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: var(--forest);
  }
}

/* ---------- 下部タブバー(モバイル専用) ---------- */

body.has-bottom-nav { padding-bottom: 68px; }

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1500;
  display: flex;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  flex: 1;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}
.bottom-nav-item.active { color: var(--forest-deep); }
.bottom-nav-item.active .bottom-nav-label { box-shadow: inset 0 -2px 0 var(--forest); }

/* デスクトップはヘッダーのナビが担うので、下部タブバーは出さない */
@media (min-width: 860px) {
  .bottom-nav { display: none; }
  body.has-bottom-nav { padding-bottom: 0; }
}

/* ---------- ヒーロー ---------- */

.hero {
  position: relative;
  background: var(--forest-deep);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-slide.active { opacity: 1; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 28, 20, 0) 55%, rgba(20, 28, 20, 0.55) 100%),
    linear-gradient(100deg, rgba(20, 28, 20, 0.88) 0%, rgba(20, 28, 20, 0.66) 46%, rgba(20, 28, 20, 0.34) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding-block: 52px 44px;
  max-width: 640px;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #e6ddc9;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  margin-bottom: 18px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(27px, 5.4vw, 44px);
  line-height: 1.4;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.hero-lead {
  color: #efe9da;
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 22px;
}
.hero-note { color: #e2dbca; font-size: 12px; margin-top: 12px; }

.hero-search { display: flex; gap: 8px; }
.hero-search .search-bar { flex: 1; min-width: 0; }
.hero-search button {
  flex: none;
  padding: 0 16px;
  min-height: 48px;
  border: none;
  border-radius: var(--r-m);
  background: var(--kaki);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.hero-search button:hover { background: #8f3c17; }

.hero-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-quick a {
  font-size: 12px;
  font-weight: 600;
  color: #f3eee1;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--r-pill);
  padding: 5px 12px;
}
.hero-quick a:hover { background: rgba(255, 255, 255, 0.14); }

.hero-pause {
  position: absolute;
  right: var(--gutter);
  bottom: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.hero-dots { position: absolute; right: calc(var(--gutter) + 46px); bottom: 24px; z-index: 2; display: flex; gap: 6px; }
.hero-dot {
  width: 7px; height: 7px; padding: 0;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}
.hero-dot.active { background: #fff; width: 18px; border-radius: var(--r-pill); }

@media (min-width: 720px) {
  .hero-inner { padding-block: 84px 76px; }
  .hero-lead { font-size: 15px; }
}

/* ---------- 検索フィールド ---------- */

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  padding: 0 14px;
}
.search-bar:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(51, 80, 60, 0.14); }
/* input[type=search]という汎用ルール(フォームのセクション)と詳細度が同点だと
   ソース順で汎用側が勝ってしまい、入力欄自体にも枠線・背景が付いて二重の箱に
   見えてしまう。type属性まで含めて詳細度を上げ、確実にこちらを優先させる */
.search-bar input[type="search"] {
  flex: 1;
  min-width: 0;
  width: auto;
  min-height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px; /* 他のinputと同様、iOSで入力時に拡大されるのを防ぐため16px未満にしない */
  color: var(--ink);
}
.search-bar input[type="search"]::placeholder { color: #6f6a5c; }

/* 一覧ページの検索帯 */
.filter-bar {
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  padding: 16px 0;
}
.filter-bar .wrap { display: flex; flex-direction: column; gap: 12px; }
.filter-bar .search-bar { max-width: 460px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-row[hidden] { display: none; }
.filter-row select { max-width: 280px; }
.filter-label { font-size: 12px; font-weight: 700; color: var(--ink-2); flex: none; }
.result-count { font-size: 13px; color: var(--ink-2); }

/* ---------- チップ(絞り込み) ---------- */

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chip-row--scroll::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.chip:hover { border-color: var(--forest); color: var(--forest-deep); }
.chip.is-active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

/* ---------- バッジ ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  border-radius: var(--r-s);
  background: var(--paper-3);
  color: var(--ink-2);
  white-space: nowrap;
}
.tag--today { background: var(--forest); color: #fff; }
.tag--special { background: var(--kaki-soft); color: var(--kaki); }
.tag--event { background: var(--kaki-soft); color: var(--kaki); }
.tag--labor { background: var(--indigo-soft); color: var(--indigo); }
.tag--ships { background: var(--indigo-soft); color: var(--indigo); }

/* 既存フォーム画面(post/admin)が使っているバッジ記法も同じ見た目に揃える */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  border-radius: var(--r-s);
  background: var(--paper-3);
  color: var(--ink-2);
}
.badge.special, .badge.event { background: var(--kaki-soft); color: var(--kaki); }
.badge.labor { background: var(--indigo-soft); color: var(--indigo); }

/* ---------- 出品カード ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px 14px;
}
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(3, 1fr); gap: 30px 18px; } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }

.hscroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > .pcard { flex: none; width: 216px; }

/* カードの高さを揃え、コメントの行数が違っても農家名の行が同じ高さに並ぶようにする */
.pcard { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }

.pcard-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--paper-2);
}
.pcard-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.pcard:hover .pcard-media { border-color: var(--forest); }
.pcard:hover .pcard-media img { transform: scale(1.04); }

/* 写真が無い出品のタイル。減光したカテゴリ写真の上にカテゴリ名を置く。
   実物の写真と誤認させないための表示なので、この2つのラベルは消さないこと */
.pcard-media--tile img { opacity: 0.85; }
.pcard:hover .pcard-media--tile img { transform: none; }
.pcard-tile-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mincho);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: var(--ink);
}
.pcard-stock {
  position: absolute;
  right: 6px;
  bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 6px;
  border-radius: var(--r-s);
  background: rgba(250, 248, 243, 0.86);
  border: 1px solid var(--line);
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.pcard-flags { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; }

.pcard-body { padding-top: 10px; flex: 1; display: flex; flex-direction: column; }
.pcard-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pcard:hover .pcard-title { text-decoration: underline; }
.pcard-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--kaki);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.pcard-price .yen { font-size: 12px; margin-left: 1px; }
.pcard-price.is-ask { font-size: 14px; color: var(--ink-2); }
.pcard-note {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pcard-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.pcard-foot .producer-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pcard-place { flex: none; font-size: 11px; color: var(--ink-2); }
.pcard-fresh { font-size: 12px; color: var(--ink-2); }

.avatar {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--forest);
}
.avatar.c1 { background: #3f6247; }
.avatar.c2 { background: #a8481f; }
.avatar.c3 { background: #35526f; }
.avatar.c4 { background: #7a5c38; }
.avatar.c5 { background: #63527c; }
.avatar.c6 { background: #4c7a6b; }
.avatar.c7 { background: #8a5a7e; }
.avatar.c8 { background: #4f6b8a; }
.avatar--lg { width: 64px; height: 64px; font-size: 26px; border: 3px solid var(--paper); }

/* ---------- 農家カード ---------- */

.farmer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) { .farmer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .farmer-grid { grid-template-columns: repeat(3, 1fr); } }

.fcard {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.fcard:hover { border-color: var(--forest); }
.fcard-thumb {
  flex: none;
  width: 84px;
  height: 84px;
  border-radius: var(--r-m);
  object-fit: cover;
  background: var(--paper-2);
}
/* カバー写真が無い農家は、頭文字を大きく置いたタイルで代用する */
.fcard-thumb--initial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mincho);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  background: var(--forest);
}
.fcard-thumb--initial.c1 { background: #3f6247; }
.fcard-thumb--initial.c2 { background: #a8481f; }
.fcard-thumb--initial.c3 { background: #35526f; }
.fcard-thumb--initial.c4 { background: #7a5c38; }
.fcard-thumb--initial.c5 { background: #63527c; }
.fcard-thumb--initial.c6 { background: #4c7a6b; }
.fcard-thumb--initial.c7 { background: #8a5a7e; }
.fcard-thumb--initial.c8 { background: #4f6b8a; }
.fcard-body { min-width: 0; flex: 1; }
.fcard-name { font-family: var(--mincho); font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.fcard:hover .fcard-name { text-decoration: underline; }
.fcard-place { font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.fcard-crops {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fcard-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- イベント / 求人カード ---------- */

.list-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .list-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .list-grid { grid-template-columns: repeat(3, 1fr); } }

.ecard {
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.ecard:hover { border-color: var(--forest); }
.ecard-date {
  flex: none;
  width: 58px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  overflow: hidden;
  text-align: center;
  background: var(--paper-2);
  align-self: flex-start;
}
.ecard-date .m { display: block; font-size: 10px; font-weight: 700; padding: 3px 0; background: var(--forest); color: #fff; letter-spacing: 0.08em; }
.ecard-date .d { display: block; font-size: 22px; font-weight: 700; line-height: 1.3; font-family: var(--mincho); }
.ecard-date .w { display: block; font-size: 10px; color: var(--ink-2); padding-bottom: 4px; }
.ecard-body { min-width: 0; flex: 1; }
.ecard-title { font-size: 15px; font-weight: 700; line-height: 1.5; margin-bottom: 4px; }
.ecard:hover .ecard-title { text-decoration: underline; }
.ecard-meta { font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.ecard-desc {
  font-size: 13px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ecard-farmer { font-size: 12px; color: var(--ink-2); margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }

.jcard {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.jcard:hover { border-color: var(--indigo); }
.jcard-wage { font-size: 20px; font-weight: 700; color: var(--indigo); font-family: var(--mincho); margin-bottom: 2px; }
.jcard-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.jcard:hover .jcard-title { text-decoration: underline; }
.jcard-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.jcard-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jcard-farmer { font-size: 12px; color: var(--ink-2); margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }

/* ---------- トップ: 使い方の帯 ---------- */

.howto { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 720px) { .howto { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.howto-step { display: flex; gap: 12px; }
.howto-num {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--forest);
  color: var(--forest-deep);
  font-family: var(--mincho);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.howto-step h3 { font-size: 16px; margin-bottom: 2px; }
.howto-step p { font-size: 13px; color: var(--ink-2); line-height: 1.8; }

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.stat { display: flex; align-items: baseline; gap: 6px; }
.stat-num { font-family: var(--mincho); font-size: 26px; font-weight: 700; color: var(--forest-deep); }
.stat-label { font-size: 12px; color: var(--ink-2); }

/* ---------- トップ: 品目カテゴリ ---------- */

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }
.cat-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: var(--r-m);
  overflow: hidden;
  text-decoration: none;
  border: 1px solid var(--line);
}
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.cat-card:hover img { transform: scale(1.06); }
.cat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 24, 18, 0.08) 40%, rgba(20, 24, 18, 0.72) 100%);
}
.cat-card span {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 1;
  color: #fff;
  font-family: var(--mincho);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- トップ: サイド寄せウィジェット ---------- */

.widgets { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 860px) { .widgets { grid-template-columns: 1fr 1fr; gap: 32px; } }
.widget-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.mini-row:first-child { border-top: 1px solid var(--line); }
.mini-row:hover .mini-title { text-decoration: underline; }
.mini-date {
  flex: none;
  min-width: 46px;
  font-family: var(--mincho);
  font-size: 14px;
  font-weight: 700;
  color: var(--forest-deep);
}
.mini-title { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub { flex: none; font-size: 12px; color: var(--ink-2); }
.mini-wage { flex: none; font-size: 14px; font-weight: 700; color: var(--indigo); }

/* ---------- 農家向けの案内 ---------- */

.recruit {
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--paper-2);
  padding: 28px var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.recruit h2 { font-size: 20px; margin-bottom: 8px; }
.recruit p { font-size: 14px; color: var(--ink-2); line-height: 1.9; }
.recruit-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 720px) {
  .recruit { flex-direction: row; align-items: center; justify-content: space-between; padding: 32px; gap: 32px; }
  .recruit-body { flex: 1; }
}

/* ---------- ページ見出し ---------- */

.page-head { padding: 28px 0 22px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 26px; margin-bottom: 6px; }
.page-head p { font-size: 13px; color: var(--ink-2); }
.breadcrumb { font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* 旧レイアウトのページ見出し(post/admin/seller)も同じ体裁に寄せる */
.page-title-strip {
  max-width: var(--container);
  margin-inline: auto;
  padding: 28px var(--gutter) 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.page-title-strip h1 { font-size: 24px; margin-bottom: 4px; }
.page-title-strip p { font-size: 13px; color: var(--ink-2); }

/* ---------- 農家ページ ---------- */

.farmer-cover {
  width: 100%;
  aspect-ratio: 16 / 7;
  max-height: 340px;
  object-fit: cover;
  background: var(--paper-2);
  display: block;
}
.farmer-head { border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.farmer-head-inner { display: flex; gap: 14px; align-items: flex-end; margin-top: -32px; margin-bottom: 14px; }
.farmer-head h1 { font-size: 24px; padding-bottom: 4px; }
.farmer-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.farmer-desc { font-size: 14px; line-height: 1.95; white-space: pre-wrap; }

.contact-buttons { display: flex; gap: 10px; margin-top: 18px; max-width: 440px; }

/* モバイルでは連絡手段を画面下に固定する(この導線がサービスの目的そのもの) */
.contact-dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1600;
  display: flex;
  gap: 8px;
  padding: 10px var(--gutter);
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(250, 248, 243, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.contact-dock .btn { flex: 1; }
body.has-contact-dock { padding-bottom: 78px; }
@media (min-width: 860px) {
  .contact-dock { display: none; }
  body.has-contact-dock { padding-bottom: 0; }
}

.farmer-section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.farmer-section:last-of-type { border-bottom: none; }
.farmer-section h2 { font-size: 19px; margin-bottom: 16px; }
.farmer-section h2 .count { font-size: 13px; font-family: var(--gothic); font-weight: 400; color: var(--ink-2); margin-left: 8px; }

/* ---------- 評価・レビュー ---------- */

.stars { color: var(--kaki); font-size: 14px; letter-spacing: 1px; }
.stars.lg { font-size: 20px; }

.review-summary { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.review-summary b { font-size: 15px; color: var(--ink); }
.review-summary-count { color: var(--ink-2); }
.review-summary--empty { font-size: 12px; color: var(--ink-2); }

.review-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.review-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; }
.review-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.review-name { font-size: 13px; font-weight: 700; }
.review-date { font-size: 12px; color: var(--ink-2); margin-left: auto; }
.review-comment { font-size: 13px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; }

.rating-input { display: flex; gap: 4px; }
.rating-input button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: #fff;
  font-size: 18px;
  color: var(--line-strong);
  cursor: pointer;
}
.rating-input button.is-active { color: var(--kaki); border-color: var(--kaki); background: var(--kaki-soft); }

/* ---------- マップ ---------- */

.map-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 0; }
.map-toolbar select { flex: 1; min-width: 160px; max-width: 260px; }
.map-status { font-size: 12px; color: var(--ink-2); padding-bottom: 12px; }
#map { width: 100%; height: 380px; border-block: 1px solid var(--line); }
@media (min-width: 860px) { #map { height: 480px; } }
.distance-list { display: flex; flex-direction: column; gap: 14px; padding: 24px 0 40px; }
@media (min-width: 640px) {
  .distance-list { display: grid; grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .distance-list { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- ボタン ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-m);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--forest); color: #fff; }
.btn.primary:hover { background: var(--forest-deep); }
.btn.secondary { background: #fff; color: var(--forest-deep); border-color: var(--line-strong); }
.btn.secondary:hover { border-color: var(--forest); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn.line { background: #06c755; color: #fff; flex: 1; }
.btn.phone { background: var(--kaki); color: #fff; flex: 1; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- フォーム ---------- */

form.stack { display: flex; flex-direction: column; gap: 16px; }

label { font-size: 13px; font-weight: 700; display: block; margin-bottom: 6px; }

input[type=text], input[type=number], input[type=tel], input[type=url], input[type=date],
input[type=time], input[type=password], input[type=search], input[type=email], textarea, select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  font-size: 16px; /* iOSで入力時に拡大されるのを防ぐ */
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(51, 80, 60, 0.14);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.8; }
.field-help { font-size: 12px; color: var(--ink-2); margin-top: 6px; line-height: 1.7; }

/* スパム対策のハニーポット項目。人間には見えないが、
   フォームを自動入力するbotには存在してしまう位置に置く */
.hp-field {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; min-height: 0; width: 18px; height: 18px; }
.checkbox-row label { margin-bottom: 0; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 20px;
  margin-bottom: 18px;
}
.card h3 { font-size: 17px; margin-bottom: 14px; }

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: none; }
.item-row .actions { display: flex; gap: 8px; flex: none; }
.item-row .actions .btn { min-height: 38px; padding: 0 12px; font-size: 13px; }

.image-preview { width: 100%; max-width: 220px; border-radius: var(--r-m); margin-top: 10px; display: none; }
.image-preview.show { display: block; }

/* ---------- 状態表示 ---------- */

.loading, .error-message, .empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.9;
}
.error-message { color: var(--danger); }
.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-m);
  background: var(--paper-2);
}
.empty-state strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r-m);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 2000;
}
.toast.show { opacity: 1; }

/* スケルトン: カードの形のまま薄く明滅させる */
.skeleton-card .sk-photo { aspect-ratio: 4 / 3; border-radius: var(--r-m); }
.skeleton-card .sk-line { height: 11px; border-radius: 3px; margin-top: 10px; }
.skeleton-card .sk-line.w60 { width: 60%; }
.skeleton-card .sk-line.w40 { width: 40%; }
.sk-photo, .sk-line {
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 37%, var(--paper-2) 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease infinite;
}
@keyframes sk-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ---------- フッター ---------- */

.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: 40px 0 32px;
}
.footer-cols { display: flex; flex-wrap: wrap; gap: 28px 48px; margin-bottom: 28px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col-title { font-family: var(--mincho); font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.footer-col a { font-size: 13px; color: var(--ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--forest-deep); text-decoration: underline; }
.footer-note {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.9;
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}
.photo-credits { font-size: 11px; color: var(--ink-2); line-height: 1.9; margin-top: 10px; }
.photo-credits a { color: var(--ink-2); }
.footer-copyright { font-size: 11px; color: var(--ink-2); margin-top: 16px; }
