/* 支援みつかる 共通スタイル。比喩は市の公報・官報のお知らせ欄。決定事項は docs/DESIGN.md（ADR-0011）。
   色は紙（白）・墨・灰・罫・朱の 5 つと、ヘッダー帯の淡・非選択タブの地の 2 つ。角丸、影、グラデーション、ピル、チップは使わない。 */
:root {
  --paper: #ffffff;
  --band: #f3f0e8;
  --tab: #e4dfd3;
  --ink: #1a1a1a;
  --gray: #5c5c5c;
  --rule: #c9c4b8;
  --vermilion: #b02a1f;
  /* Web フォントは使わず端末の書体だけで組む。Windows 10 以降は BIZ UD、Mac と iOS はヒラギノ（docs/DESIGN.md） */
  --mincho: "BIZ UDPMincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --gothic: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, "Noto Sans JP", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  font-size: 16px;
}
body {
  margin: 0;
  font-family: var(--gothic);
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  overflow-wrap: anywhere;
  /* 本文が短くてもフッターの帯を画面の下端に置く */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1 0 auto;
  width: 100%;
}
h1,
h2,
h3 {
  font-family: var(--mincho);
  font-weight: 400;
  line-height: 1.4;
}
h1 {
  font-size: 2rem;
  margin: 16px 0 8px;
}
h2 {
  font-size: 1.5rem;
  margin: 32px 0 8px;
}
h3 {
  font-size: 1.25rem;
}
a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: var(--vermilion);
}
:focus-visible {
  outline: 2px solid var(--vermilion);
  outline-offset: 2px;
}
.wrap {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) {
  .wrap {
    padding: 0 24px;
  }
}
/* 1024px 以上では検索画面だけ、左にフォーム、右に結果の 2 カラムにする */
@media (min-width: 1024px) {
  .wrap {
    padding: 0 32px;
  }
  .search-layout {
    display: grid;
    grid-template-columns: 18rem 1fr;
    gap: 0 32px;
    align-items: start;
  }
  .search-layout .options {
    flex-direction: column;
  }
  .search-layout .results-head {
    margin-top: 0;
  }
  .search-layout .results-head h2 {
    margin-top: 16px;
  }
}
.muted,
.hint,
.unknown,
.estimated {
  color: var(--gray);
}
.hint {
  font-size: 0.875rem;
  margin: 0;
}

/* ヘッダー帯。題字の下の二重罫がこのサイトの特徴的な細部 */
.site-header {
  background: var(--band);
  padding-top: 16px;
}
.masthead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding-bottom: 8px;
  border-bottom: 3px double var(--ink);
}
.masthead {
  font-family: var(--mincho);
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0;
}
.masthead a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
/* サイトの印。公文書の公印を模した朱の角印（DESIGN.md、ADR-0012）。大きさはサイト名の字の高さに合わせる */
.masthead .seal {
  display: block;
  width: 1em;
  height: 1em;
  flex: none;
}
.tagline {
  margin: 0;
  font-size: 0.875rem;
  color: var(--gray);
}
/* 入口のタブ。選択中のタブは白地で下の本文とつながる */
.entrances {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  border-bottom: 1px solid var(--gray);
}
.entrances a {
  display: block;
  min-height: 44px;
  padding: 8px 24px;
  margin-bottom: -1px;
  background: var(--tab);
  border: 1px solid var(--gray);
  text-decoration: none;
}
.entrances a:hover {
  text-decoration: underline;
}
.entrances a[aria-current="page"] {
  background: var(--paper);
  border-top: 3px solid var(--ink);
  border-bottom-color: var(--paper);
  padding-top: 6px;
  font-weight: 700;
  text-decoration: none;
}
/* 本文の最初の見出しの上余白（16px）と合わせて、タブから 24px 空ける */
main {
  padding-top: 8px;
  padding-bottom: 48px;
}

/* 検索フォーム。節は見出しと横罫で分け、枠で囲わない */
.form-section {
  border-bottom: 1px solid var(--rule);
  padding: 0 0 16px;
}
.form-section h2 {
  font-size: 1.25rem;
  margin: 16px 0 8px;
}
fieldset.filter {
  border: none;
  padding: 0;
  margin: 0 0 16px;
  min-width: 0;
}
fieldset.filter legend {
  font-weight: 700;
  padding: 0;
}
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
}
.option {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 0;
  min-height: 32px;
}
.count {
  color: var(--gray);
  font-variant-numeric: tabular-nums;
}
.count::before {
  content: "（";
}
.count::after {
  content: "）";
}
.filter.inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 8px 0;
}
.filter.inline label {
  font-weight: 700;
}
input[type="checkbox"] {
  accent-color: var(--ink);
}
input[type="search"],
input[type="number"],
select {
  font: inherit;
  color: var(--ink);
  padding: 4px 8px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  max-width: 100%;
}
input[type="search"] {
  flex: 1 1 12rem;
  min-width: 0;
}
input[type="number"] {
  width: 8em;
}
button,
.button {
  font: inherit;
  padding: 4px 16px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}
button[type="submit"],
.button.primary {
  background: var(--vermilion);
  border-color: var(--vermilion);
  color: var(--paper);
}

/* 検索結果。締切の表として読めるよう、横罫だけで組む */
.results-head {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.results-head h2 {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.results-head p {
  margin: 0;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
.results-table th {
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
.results-table td {
  padding: 12px 8px;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
.results-table .col-deadline,
.results-table .col-amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.results-table .line {
  display: block;
  white-space: nowrap;
}
.results-table .col-area {
  min-width: 4.5em;
}
.results-table .title {
  font-family: var(--mincho);
  font-size: 1.125rem;
  line-height: 1.5;
}
.sub {
  display: block;
  color: var(--gray);
  font-size: 0.875rem;
}
.deadline .date,
.deadline .left {
  display: block;
}
.deadline .left {
  color: var(--gray);
  font-size: 0.875rem;
}
.deadline.soon .left {
  color: var(--vermilion);
  font-weight: 700;
}
.deadline.closed {
  color: var(--gray);
}
.empty {
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 8px 0;
}
.pagination {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 24px 0;
  font-variant-numeric: tabular-nums;
}
.pagination .disabled {
  color: var(--gray);
}

/* 詳細 */
.back {
  margin: 16px 0 0;
}
.organizer {
  margin: 0;
}
.detail-deadline {
  margin: 8px 0 0;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.detail-deadline .deadline,
.detail-deadline .deadline .date,
.detail-deadline .deadline .left {
  display: inline;
}
.detail-deadline .deadline .left {
  margin-left: 8px;
  font-size: 1rem;
}
/* 要約は見出しを付けずリード文として置く。主ボタンの直前に読ませる */
.lead {
  max-width: 44rem;
  margin: 16px 0 0;
}
.detail .actions {
  margin: 16px 0 0;
}
.caution {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--gray);
}
.detail h2 {
  margin: 40px 0 8px;
}
.facts {
  max-width: 56rem;
  margin: 0 0 24px;
  padding: 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
.facts .row {
  display: grid;
  grid-template-columns: 9em 1fr;
  gap: 4px 16px;
  padding: 8px 0;
}
.facts .row + .row {
  border-top: 1px solid var(--rule);
}
.facts dt {
  font-weight: 700;
}
.facts dd {
  margin: 0;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.facts .muted {
  font-size: 0.875rem;
}
/* 応募資格の原文。色つきの左縁は使わず（DESIGN.md の禁止）、字下げだけで引用と示す */
.quote {
  max-width: 44rem;
  margin: 0 0 0 16px;
}
/* 出典と更新は主要な内容と区画を分ける。墨の罫の下に、灰の小さな文字で置く */
.provenance {
  max-width: 56rem;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
  font-size: 0.875rem;
  color: var(--gray);
}
.detail .provenance h2 {
  font-size: 1rem;
  color: var(--gray);
  margin: 0 0 8px;
}
.provenance dl {
  display: grid;
  grid-template-columns: 8em 1fr;
  gap: 4px 16px;
  margin: 0;
}
.provenance dd {
  margin: 0;
}

/* このサイトについて */
.prose {
  max-width: 44rem;
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-variant-numeric: tabular-nums;
}
.prose th,
.prose td {
  border-bottom: 1px solid var(--rule);
  padding: 8px;
  text-align: left;
}
.prose th {
  border-bottom-color: var(--ink);
}

/* フッターは墨の帯でページの終わりを示す。朱は墨の上でコントラストが足りないので使わない */
.site-footer {
  background: var(--ink);
  color: var(--band);
  padding: 32px 0 40px;
}
.site-footer p {
  margin: 0 0 16px;
}
/* サイトの案内（このサイトについて、情報源、お問い合わせ）はヘッダーに置かず、フッターにまとめる */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.site-footer a {
  color: #ffffff;
}
.site-footer a:hover {
  text-decoration-color: #ffffff;
}
.site-footer :focus-visible {
  outline-color: #ffffff;
}

/* 640px 未満では表の 1 行を縦に積み、各セルの先頭に列名を添える */
@media (max-width: 639px) {
  .results-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .results-table,
  .results-table tbody,
  .results-table tr,
  .results-table td {
    display: block;
  }
  .results-table tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--rule);
  }
  .results-table td {
    border: none;
    padding: 0 0 4px;
    display: grid;
    grid-template-columns: 5em 1fr;
    gap: 8px;
  }
  .results-table td::before {
    content: attr(data-label);
    color: var(--gray);
    font-size: 0.875rem;
  }
  .results-table .col-title {
    grid-template-columns: 1fr;
  }
  .results-table .col-title::before {
    content: none;
  }
  .results-table .col-deadline,
  .results-table .col-amount {
    text-align: left;
  }
  .deadline .date,
  .deadline .left {
    display: inline;
  }
  .deadline .left {
    margin-left: 8px;
  }
  .facts .row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .masthead {
    font-size: 1.25rem;
  }
  .tagline {
    order: 3;
    flex-basis: 100%;
  }
  .entrances a {
    flex: 1 1 0;
    padding: 8px;
    text-align: center;
  }
}
