/* ==========================================================
   ボランティア・物資支援プラットフォーム 共通スタイル
   ========================================================== */
:root {
  --navy: #1e3a5f;
  --navy-dark: #14283f;
  --navy-light: #2c5282;
  --accent: #f2994a;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #222831;
  --text-muted: #6b7280;
  --border: #e2e8f0;
  --danger: #d64545;
  --success: #2f9e5b;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--navy-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.logo {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.main-nav a {
  color: #e7edf5;
  font-size: 0.95rem;
  white-space: nowrap;
}

.main-nav a:hover {
  color: #fff;
  text-decoration: none;
  opacity: 0.85;
}

.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  width: 28px;
  height: 22px;
  position: relative;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  left: 0;
}

.nav-toggle-label span {
  top: 10px;
}

.nav-toggle-label span::before {
  top: -9px;
}

.nav-toggle-label span::after {
  top: 9px;
}

/* ---------- Flash messages ---------- */
.flash {
  max-width: 1080px;
  margin: 1rem auto 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.flash.info {
  background: #e3edf9;
  color: var(--navy-dark);
  border: 1px solid #b9d3ee;
}

.flash.success {
  background: #e6f6ec;
  color: var(--success);
  border: 1px solid #b7e5c8;
}

.flash.error {
  background: #fbe9e9;
  color: var(--danger);
  border: 1px solid #f2c1c1;
}

/* ---------- Layout ---------- */
.site-main {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.site-footer {
  background: var(--navy-dark);
  color: #cfd9e6;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.85rem;
}

.site-footer a {
  color: #cfd9e6;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 2.5rem 1.75rem;
  margin-bottom: 2rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}

.hero p {
  margin: 0;
  color: #dfe8f4;
}

/* ---------- Sections / Cards ---------- */
.list-section {
  margin-bottom: 2.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.section-header h2 {
  color: var(--navy);
  font-size: 1.25rem;
  margin: 0;
  border-left: 5px solid var(--accent);
  padding-left: 0.6rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card h3 {
  margin: 0.4rem 0 0.4rem;
  font-size: 1.05rem;
  color: var(--text);
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--navy-light);
  text-decoration: underline;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.card-desc {
  font-size: 0.9rem;
  color: #444;
  margin: 0 0 0.75rem;
}

.card-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}

.empty {
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--navy);
  border: 1px solid var(--border);
}

.badge.status-open {
  background: #e6f6ec;
  color: var(--success);
  border-color: #b7e5c8;
}

.badge.status-closed {
  background: #f0f0f0;
  color: var(--text-muted);
}

.badge.badge-type {
  background: #fdf1e4;
  color: var(--accent);
  border-color: #f6d9b6;
  margin-left: 0.35rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius);
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: var(--navy-light);
  text-decoration: none;
}

.btn-small {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--navy);
}

.btn-secondary:hover {
  background: #eef2f7;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #b93a3a;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 520px;
  margin: 0 auto;
}

.form-card h1 {
  color: var(--navy);
  font-size: 1.3rem;
  margin-top: 0;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.form-group .hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.form-errors {
  background: #fbe9e9;
  border: 1px solid #f2c1c1;
  color: var(--danger);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.1rem;
  font-size: 0.9rem;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.2rem;
}

.terms-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: pre-line;
  line-height: 1.6;
  margin-bottom: 0.6rem;
  max-height: 180px;
  overflow-y: auto;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

.form-footer-link {
  text-align: center;
  font-size: 0.88rem;
  margin-top: 1rem;
  color: var(--text-muted);
}

/* ---------- Tables (mypage) ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 480px;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  background: #f2f5f9;
  color: var(--navy);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}

.tabs a {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}

.tabs a.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  font-weight: 600;
}

/* ---------- Admin ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

select.status-select {
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  width: auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-toggle-label {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-dark);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .main-nav a {
    padding: 0.85rem 1.25rem;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-toggle:checked ~ .main-nav {
    max-height: 400px;
  }

  .hero {
    padding: 2rem 1.25rem;
  }

  .hero h1 {
    font-size: 1.3rem;
  }

  .section-header {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
