/* ============================================================
   style.css — フリマクラブ 共通スタイル
   ============================================================ */

/* --- リセット・基本 ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  color: #333;
  background: #f5f5f5;
  line-height: 1.7;
}
a { color: #2a7ae2; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* --- レイアウト -------------------------------------------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* --- ヘッダー --------------------------------------------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  height: 60px;
}
.site-logo {
  font-size: 1.2rem; font-weight: 700;
  color: #e44c23; text-decoration: none; white-space: nowrap;
}
.header-nav {
  display: flex; gap: 16px; flex: 1;
  font-size: 0.9rem;
}
.header-nav a { color: #555; }
.header-nav a:hover { color: #e44c23; text-decoration: none; }
.header-actions {
  display: flex; align-items: center; gap: 10px;
}
.header-user {
  font-size: 0.9rem; color: #333;
  display: flex; align-items: center; gap: 4px;
}
.notif-badge {
  background: #e44c23; color: #fff;
  font-size: 0.7rem; font-weight: 700;
  border-radius: 9999px; padding: 1px 6px;
  min-width: 18px; text-align: center;
}
.badge-admin {
  background: #6c3483; color: #fff;
  font-size: 0.75rem; padding: 2px 8px;
  border-radius: 4px;
}

/* --- ボタン ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 6px;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-primary  { background: #e44c23; color: #fff; }
.btn-outline  { background: #fff; color: #e44c23; border: 1.5px solid #e44c23; }
.btn-gray     { background: #eee; color: #555; }
.btn-danger   { background: #c0392b; color: #fff; }
.btn-success  { background: #27ae60; color: #fff; }
.btn-full     { width: 100%; }

/* --- フォーム --------------------------------------------- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-label .required { color: #e44c23; margin-left: 4px; font-size: 0.8rem; }
.form-control {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid #ccc; border-radius: 6px;
  font-size: 1rem; font-family: inherit;
  transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: #2a7ae2; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.82rem; color: #777; margin-top: 4px; }
.form-error { font-size: 0.85rem; color: #c0392b; margin-top: 4px; }

/* --- アラート --------------------------------------------- */
.alert {
  padding: 14px 18px; border-radius: 6px;
  margin-bottom: 20px; font-size: 0.95rem;
}
.alert-success { background: #d5f5e3; color: #1a6b40; border: 1px solid #a9dfbf; }
.alert-error   { background: #fdecea; color: #922b21; border: 1px solid #f1948a; }
.alert-warning { background: #fef9e7; color: #7d6608; border: 1px solid #f9e79f; }
.alert-info    { background: #ebf5fb; color: #1a5276; border: 1px solid #aed6f1; }

/* --- カード ----------------------------------------------- */
.card {
  background: #fff; border-radius: 8px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}
.card-body { padding: 20px; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }

/* --- 出品カード -------------------------------------------- */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.item-card { background: #fff; border-radius: 8px; border: 1px solid #e0e0e0; overflow: hidden; }
.item-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-2px); transition: all 0.2s; }
.item-card a { color: inherit; text-decoration: none; }
.item-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f0f0f0; }
.item-thumb-placeholder {
  width: 100%; aspect-ratio: 1;
  background: #f0f0f0;
  display: flex; align-items: center; justify-content: center;
  color: #bbb; font-size: 2rem;
}
.item-info { padding: 10px 12px; }
.item-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.item-price { font-size: 1rem; font-weight: 700; color: #e44c23; }
.item-area  { font-size: 0.78rem; color: #888; margin-top: 4px; }

/* --- 区分バッジ -------------------------------------------- */
.badge {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
}
.badge-sell { background: #fde8e0; color: #c0392b; }
.badge-buy  { background: #e0f0ff; color: #1a5276; }
.badge-give { background: #e0f5e8; color: #1a6b40; }
.badge-want { background: #fef5e0; color: #7d6608; }

/* --- ページネーション ------------------------------------- */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin: 32px 0;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 6px;
  font-size: 0.9rem; border: 1px solid #ddd; background: #fff;
  color: #333;
}
.pagination a:hover { background: #f0f0f0; text-decoration: none; }
.pagination .current { background: #e44c23; color: #fff; border-color: #e44c23; }

/* --- サイドバー ------------------------------------------- */
.content-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.sidebar { background: #fff; border-radius: 8px; border: 1px solid #e0e0e0; padding: 16px; }
.sidebar-title { font-size: 0.9rem; font-weight: 700; color: #555; margin-bottom: 12px; }
.sidebar-menu a {
  display: block; padding: 8px 0;
  font-size: 0.9rem; color: #333;
  border-bottom: 1px solid #f0f0f0;
}
.sidebar-menu a:hover { color: #e44c23; text-decoration: none; }

/* --- 評価 ------------------------------------------------- */
.stars { color: #f39c12; letter-spacing: 2px; }
.rating-count { font-size: 0.82rem; color: #888; margin-left: 4px; }

/* --- ページヘッダー --------------------------------------- */
.page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}
.page-title { font-size: 1.4rem; font-weight: 700; }

/* --- フッター --------------------------------------------- */
.site-footer {
  background: #2c2c2c; color: #aaa;
  padding: 32px 0; margin-top: 48px;
  font-size: 0.88rem;
}
.footer-inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.footer-logo { color: #e44c23; font-weight: 700; font-size: 1rem; }
.footer-nav { display: flex; gap: 20px; }
.footer-nav a { color: #aaa; }
.footer-nav a:hover { color: #fff; }
.footer-copy { color: #666; }

/* --- メイン ------------------------------------------------ */
.site-main { padding: 24px 0 48px; min-height: calc(100vh - 160px); }

/* --- テーブル --------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #e0e0e0; }
th { background: #f5f5f5; font-weight: 600; }
tr:hover td { background: #fafafa; }

/* --- レスポンシブ ----------------------------------------- */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .content-layout { grid-template-columns: 1fr; }
  .item-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .item-grid { grid-template-columns: 1fr; }
}
