/* =========================================
   ねこの手 style.css
   スマホファースト / 猫と学校プリントがテーマ
   ========================================= */

:root {
  --ink: #3e3229;          /* 文字色(こげ茶) */
  --paper: #fdfaf4;        /* 背景(プリント用紙の白) */
  --card: #ffffff;         /* カード背景 */
  --tabby: #e8833a;        /* メインカラー(茶トラのオレンジ) */
  --tabby-soft: #fdeede;   /* オレンジのうすい版 */
  --sage: #7fa98e;         /* カテゴリ用グリーン */
  --line: #eadfd2;         /* 罫線 */
  --danger: #d9534f;       /* 締切間近・削除 */
  --muted: #9b8d7f;        /* 補足テキスト */
  --radius: 14px;
}

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

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  padding-bottom: 96px; /* FABの分の余白 */
}

/* ---------- ヘッダー ---------- */
.header {
  background: var(--card);
  border-bottom: 3px solid var(--tabby);
  padding: 16px 20px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-size: 1.4rem;
  color: var(--tabby);
  cursor: pointer;
  user-select: none;
}

.tagline {
  font-size: 0.75rem;
  color: var(--muted);
}

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

.screen-title {
  font-size: 1.2rem;
  margin: 12px 0 16px;
}

/* ---------- 検索・フィルター ---------- */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--card);
}

.search-input:focus {
  outline: 2px solid var(--tabby);
  border-color: var(--tabby);
}

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.85rem;
  cursor: pointer;
}

.chip.active {
  background: var(--tabby);
  border-color: var(--tabby);
  color: #fff;
  font-weight: bold;
}

.filter-check {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- 一覧カード ---------- */
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.notice-card:active {
  transform: scale(0.98);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.category-tag {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sage);
  color: #fff;
}

.required-tag {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
}

.card-title {
  font-size: 1.05rem;
  font-weight: bold;
}

.card-deadline {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.card-deadline.soon {
  color: var(--danger);
  font-weight: bold;
}

/* ---------- 投稿フォーム ---------- */
.notice-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: bold;
}

.form-label input,
.form-label textarea,
.form-label select {
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--paper);
}

.form-label input:focus,
.form-label textarea:focus,
.form-label select:focus {
  outline: 2px solid var(--tabby);
}

.required-mark {
  font-size: 0.7rem;
  color: #fff;
  background: var(--tabby);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
  font-weight: normal;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  background: var(--tabby-soft);
  border-radius: 10px;
  padding: 12px;
}

.submit-btn {
  padding: 14px;
  background: var(--tabby);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: bold;
  cursor: pointer;
}

.submit-btn:disabled {
  opacity: 0.6;
}

/* ---------- 詳細表示 ---------- */
.detail-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-top: 8px;
}

.detail-title {
  font-size: 1.25rem;
  margin: 8px 0 12px;
}

.detail-content {
  white-space: pre-wrap; /* 改行を活かす */
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.detail-meta {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.detail-deadline-big {
  background: var(--tabby-soft);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-weight: bold;
  margin-bottom: 12px;
}

.detail-deadline-big.soon {
  background: #fbe4e3;
  color: var(--danger);
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.share-btn {
  flex: 2;
  padding: 14px;
  background: var(--sage);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.delete-btn {
  flex: 1;
  padding: 14px;
  background: var(--card);
  color: var(--danger);
  border: 1.5px solid var(--danger);
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
}

/* ---------- 共通パーツ ---------- */
.back-btn {
  background: none;
  border: none;
  color: var(--tabby);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 8px 0;
}

.fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--tabby);
  color: #fff;
  font-size: 2rem;
  border: none;
  box-shadow: 0 4px 12px rgba(62, 50, 41, 0.25);
  cursor: pointer;
  line-height: 1;
}

.empty-message {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  font-size: 0.9rem;
}

.empty-cat {
  font-size: 3rem;
  margin-bottom: 8px;
}

.loading {
  text-align: center;
  color: var(--muted);
  padding: 32px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  z-index: 100;
  white-space: nowrap;
}

/* PCで見たとき少しゆったり */
@media (min-width: 600px) {
  .container {
    padding: 24px;
  }
}
