/* ============================================================
   私を見つけてください - 公開側スタイル
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: #2c3e50;
  background: #f7f8fa;
  line-height: 1.7;
}

a { color: #2c5aa0; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ----- Header ----- */
.site-header {
  background: #fff;
  border-bottom: 2px solid #2c5aa0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.site-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #2c3e50;
}
.site-logo-main {
  font-size: 22px;
  font-weight: bold;
  color: #2c5aa0;
}
.site-logo-sub {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}
.site-nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}
.site-nav a {
  color: #555;
  padding: 4px 0;
}
.site-nav a:hover {
  color: #2c5aa0;
  text-decoration: none;
  border-bottom: 2px solid #2c5aa0;
}

/* ----- Search Bar ----- */
.search-bar {
  background: #2c5aa0;
  padding: 16px 0;
}
.search-bar-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 8px;
}
.search-bar input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 4px;
  font-size: 15px;
}
.search-bar button {
  padding: 10px 24px;
  background: #fff;
  color: #2c5aa0;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  font-size: 15px;
}
.search-bar button:hover { background: #f0f0f0; }

/* ----- Flash ----- */
.flash {
  max-width: 1200px;
  margin: 12px auto;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 14px;
}
.flash-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.flash-error   { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }
.flash-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }
.flash-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }

/* ----- Main ----- */
.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  min-height: 60vh;
}

/* ----- Page Header ----- */
.page-header {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}
.page-header h1 {
  margin: 0 0 4px;
  font-size: 24px;
  color: #2c3e50;
}
.muted { color: #888; font-size: 13px; }

/* ----- Hero (Home) ----- */
.hero {
  background: linear-gradient(135deg, #2c5aa0 0%, #1e3a8a 100%);
  color: #fff;
  padding: 48px 20px;
  border-radius: 8px;
  margin-bottom: 32px;
}
.hero-inner { max-width: 800px; margin: 0 auto; text-align: center; }
.hero-title { font-size: 32px; margin: 0 0 16px; font-weight: bold; }
.hero-lead { font-size: 15px; opacity: 0.95; margin: 0 0 24px; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.hero-stat {
  background: rgba(255,255,255,0.15);
  padding: 16px 32px;
  border-radius: 6px;
  min-width: 120px;
}
.hero-stat-num {
  display: block;
  font-size: 28px;
  font-weight: bold;
}
.hero-stat-label {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.9;
}

/* ----- Section ----- */
.section { margin-bottom: 40px; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #2c5aa0;
}
.section-header h2 {
  margin: 0;
  font-size: 20px;
  color: #2c3e50;
}
.section-more {
  font-size: 13px;
  color: #2c5aa0;
}

/* ----- Person Grid ----- */
.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.person-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
}
.person-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-decoration: none;
}
.person-card-image {
  aspect-ratio: 4 / 3;
  background: #f0f0f0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.person-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.person-card-noimage {
  color: #aaa;
  font-size: 13px;
}
.person-card-body { padding: 12px; }
.person-card-type {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
  font-weight: bold;
}
.type-deceased { background: #fee; color: #c0392b; }
.type-protected { background: #e8f4fd; color: #2c5aa0; }
.person-card-name {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #2c3e50;
}
.person-card-meta {
  font-size: 12px;
  color: #888;
  display: flex;
  gap: 8px;
}
.person-card-excerpt {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
  line-height: 1.5;
}

/* Highlight (search) */
.person-card mark {
  background: #fff3a0;
  padding: 0 2px;
}

/* ----- Filter Form ----- */
.filter-form {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 24px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}
.filter-row:last-child { margin-bottom: 0; }
.filter-row label {
  font-size: 13px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-row select,
.filter-row input[type="number"],
.filter-row input[type="text"] {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}
.search-input-large {
  width: 100%;
  padding: 12px 16px !important;
  font-size: 16px !important;
}

/* ----- Buttons ----- */
.btn-primary,
.btn-secondary,
.btn-clear,
.btn-back {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: #2c5aa0;
  color: #fff;
}
.btn-primary:hover { background: #1e3a8a; text-decoration: none; }
.btn-secondary {
  background: #fff;
  color: #2c5aa0;
  border: 1px solid #2c5aa0;
}
.btn-secondary:hover { background: #f0f4f8; text-decoration: none; }
.btn-clear {
  background: #eee;
  color: #555;
}
.btn-clear:hover { background: #ddd; text-decoration: none; }
.btn-back {
  background: #f0f0f0;
  color: #555;
}

/* ----- Pagination ----- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.pagination a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #ddd;
  background: #fff;
  color: #2c5aa0;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
}
.pagination a:hover { background: #f0f4f8; text-decoration: none; }
.pagination a.current {
  background: #2c5aa0;
  color: #fff;
  border-color: #2c5aa0;
}
.pagination-gap { color: #888; padding: 0 6px; }
.pagination .page-indicator {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
.pagination .page-indicator .page-input {
  width: 28px;
  height: 36px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  outline: none;
  padding: 0 0 0 8px;
  -moz-appearance: textfield;
  transition: background .15s;
}
.pagination .page-indicator .page-input:focus {
  background: #f8f9fa;
}
.pagination .page-indicator .page-input::-webkit-inner-spin-button,
.pagination .page-indicator .page-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pagination .page-indicator .page-total {
  padding: 0 10px 0 1px;
  font-size: 13px;
  font-weight: 400;
  color: #bbb;
  cursor: default;
  user-select: none;
}

/* ----- Person Detail ----- */
.person-detail {
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.person-detail-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}
.person-detail-type {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 12px;
}
.person-detail-name {
  font-size: 28px;
  margin: 8px 0 4px;
  color: #2c3e50;
}
.person-detail-kana {
  color: #888;
  font-size: 14px;
  margin: 0 0 8px;
}
.person-detail-public-id {
  color: #aaa;
  font-size: 12px;
  font-family: monospace;
  margin: 0;
}

.person-detail-images { margin-bottom: 32px; }
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.image-item { margin: 0; }
.image-item a { display: block; }
.image-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}
.image-item figcaption {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  text-align: center;
}

.person-detail-section { margin-bottom: 32px; }
.person-detail-section h2 {
  font-size: 18px;
  border-left: 4px solid #2c5aa0;
  padding-left: 12px;
  margin: 0 0 16px;
  color: #2c3e50;
}

.info-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  margin: 0;
}
.info-list dt {
  color: #888;
  font-size: 13px;
  padding-top: 2px;
}
.info-list dd {
  margin: 0;
  color: #2c3e50;
  font-size: 14px;
}

.person-features {
  background: #f9f9f9;
  padding: 16px;
  border-radius: 4px;
  border-left: 3px solid #2c5aa0;
  margin: 0;
  font-size: 14px;
}

.person-detail-contact {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 20px;
}
.person-detail-contact h2 {
  border-left-color: #f57c00;
}

.person-detail-source {
  font-size: 13px;
  color: #666;
}

.person-detail-footer {
  margin-top: 24px;
  text-align: center;
}

/* ----- Empty / Error ----- */
.empty {
  text-align: center;
  color: #888;
  padding: 48px 20px;
  background: #fff;
  border: 1px dashed #ccc;
  border-radius: 6px;
}

.error-page {
  text-align: center;
  padding: 64px 20px;
}
.error-code {
  font-size: 72px;
  color: #2c5aa0;
  margin: 0;
  font-weight: bold;
}
.error-message {
  font-size: 20px;
  color: #2c3e50;
  margin: 16px 0 8px;
}
.error-detail {
  color: #888;
  margin-bottom: 32px;
}
.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ----- Footer ----- */
.site-footer {
  background: #2c3e50;
  color: #ccc;
  padding: 32px 20px;
  margin-top: 64px;
}
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.site-footer-note {
  font-size: 12px;
  line-height: 1.8;
  margin: 0 0 12px;
}
.site-footer-copy {
  font-size: 11px;
  color: #888;
  margin: 0;
}

/* ----- Responsive ----- */
@media (max-width: 640px) {
  .site-header-inner { flex-direction: column; align-items: flex-start; }
  .site-nav { width: 100%; justify-content: space-around; }
  .hero-title { font-size: 24px; }
  .hero-stat { padding: 12px 20px; min-width: 100px; }
  .hero-stat-num { font-size: 22px; }
  .person-detail { padding: 20px; }
  .person-detail-name { font-size: 22px; }
  .info-list { grid-template-columns: 1fr; gap: 4px; }
  .info-list dt { margin-top: 8px; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row label { width: 100%; }
}
