/* css/style.css - クック・マーケット 共通スタイル */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --bg: #FAF8F5;
  --main: #E05A47;
  --main-dark: #c94a3a;
  --text: #333333;
  --text-light: #666666;
  --border: #e8e2d9;
  --card: #ffffff;
  --soft: #f5f1eb;
  --success: #5a8f6b;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

a {
  color: var(--main);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

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

.layout {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 24px;
  padding: 24px 0;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar, .right-sidebar {
    display: none;
  }
}

/* ヘッダー */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--main);
}
.nav-links a {
  margin-left: 20px;
  color: var(--text);
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--main);
}

/* カード */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

/* 投稿フォーム */
.post-form textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  background: var(--soft);
}
.post-form textarea:focus {
  outline: none;
  border-color: var(--main);
}
.form-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.form-row input[type="number"],
.form-row input[type="text"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary {
  background: var(--main);
  color: #fff;
}
.btn-primary:hover {
  background: var(--main-dark);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--soft);
}
.btn-danger {
  background: #c94a3a;
  color: #fff;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* 投稿カード */
.post-card {
  position: relative;
}
.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
}
.user-info {
  flex: 1;
}
.nickname {
  font-weight: 700;
  color: var(--text);
}
.username {
  color: var(--text-light);
  font-size: 13px;
}
.post-content {
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.post-image {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 12px;
  display: block;
}
.post-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}
.post-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.price-tag {
  display: inline-block;
  background: var(--soft);
  color: var(--main);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 14px;
}

/* バッジ（指定SVG構造） */
.verified-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
}
.verified-badge .badge-bg {
  fill: #999;
}
.verified-badge.blue .badge-bg {
  fill: #1DA1F2;
}
.verified-badge.green .badge-bg {
  fill: #5a8f6b;
}
.verified-badge.red .badge-bg {
  fill: #E05A47;
}

/* アコーディオン（材料） */
.accordion {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
}
.accordion-header {
  background: var(--soft);
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion-body {
  padding: 16px;
  display: none;
}
.accordion-body.open {
  display: block;
}
.ingredient-list {
  list-style: none;
}
.ingredient-list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
}
.ingredient-list li:last-child {
  border-bottom: none;
}

/* つくれぽ */
.tsukurepo-item {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.tsukurepo-item:first-child {
  border-top: none;
}

/* プロフィール */
.profile-header {
  text-align: center;
  padding: 32px 0;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  border: 3px solid var(--border);
}
.badge-area {
  margin: 8px 0;
}

/* フォーム共通 */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 14px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  background: #fff;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--main);
}
.help-text {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

/* アラート */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
}
.alert-error {
  background: #fdecea;
  color: #c62828;
}
.alert-warning {
  background: #fff8e1;
  color: #f57c00;
}

/* サイドバー */
.sidebar .card,
.right-sidebar .card {
  position: sticky;
  top: 72px;
}
.menu-list {
  list-style: none;
}
.menu-list li a {
  display: block;
  padding: 10px 0;
  color: var(--text);
  font-weight: 500;
}
.menu-list li a:hover {
  color: var(--main);
}

/* ユーティリティ */
.text-muted {
  color: var(--text-light);
}
.text-center {
  text-align: center;
}
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.hidden {
  display: none !important;
}