/* 院内文書検索。入口ごとの色は誤用防止のための区別（UI.md）。色だけに頼らずラベルでも示す */
:root {
  --manual: #0f766e;
  --manual-bg: #ecfdf5;
  --guideline: #9f1239;
  --guideline-bg: #fff1f2;
  --ordinance: #3f6212;
  --ordinance-bg: #f7fee7;
  --text: #1f2933;
  --muted: #52606d;
  --border: #d9e2ec;
  --warning-bg: #fffbea;
  --warning-border: #f0b429;
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--text);
  line-height: 1.7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f8fafc;
}

a { color: #1d4ed8; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.entrances {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entrance-link {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.entrance-link.is-current { color: #fff; font-weight: 700; }
.entrance-link.entrance-manual.is-current { background: var(--manual); border-color: var(--manual); }
.entrance-link.entrance-guideline.is-current { background: var(--guideline); border-color: var(--guideline); }
.entrance-link.entrance-ordinance.is-current { background: var(--ordinance); border-color: var(--ordinance); }

.entrance-banner {
  padding: 6px 16px;
  color: #fff;
  font-size: 0.95rem;
}

.entrance-banner.entrance-manual { background: var(--manual); }
.entrance-banner.entrance-guideline { background: var(--guideline); }
.entrance-banner.entrance-ordinance { background: var(--ordinance); }

.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 { font-size: 1.5rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }

.lead, .hint { color: var(--muted); }
.hint { font-size: 0.9rem; margin: 8px 0 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: 12px;
  border-top: 6px solid;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card.entrance-manual { border-top-color: var(--manual); }
.card.entrance-guideline { border-top-color: var(--guideline); }
.card.entrance-ordinance { border-top-color: var(--ordinance); }
.card-label { font-size: 1.2rem; font-weight: 700; }
.card-description { color: var(--muted); font-size: 0.95rem; }

.badge {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e4e7eb;
  font-size: 0.85rem;
}

.search {
  display: grid;
  grid-template-columns: 4em 1fr;
  gap: 8px 12px;
  align-items: center;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.search input, .search select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #9aa5b1;
  border-radius: 8px;
  font: inherit;
}

.search button {
  grid-column: 2;
  justify-self: start;
  padding: 10px 28px;
  border: 0;
  border-radius: 8px;
  background: var(--manual);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.answer, .no-answer, .sources, .notice {
  margin-top: 24px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
}

.answer { border-left: 6px solid var(--manual); }
.answer-text { margin: 0; font-size: 1.05rem; }
.cite { text-decoration: none; font-weight: 700; }

.no-answer, .notice {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.pages {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.page-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  margin-bottom: 6px;
}

.cite-no { font-weight: 700; color: var(--manual); }

.page img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  background: #fff;
}

.page:target .page-caption { background: var(--manual-bg); }

.site-footer {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  background: #fff;
}

@media (max-width: 600px) {
  .search { grid-template-columns: 1fr; }
  .search button { grid-column: 1; width: 100%; }
}
