/* ごみの日カレンダー
   「1画面でごみ出しが分かる」ことを最優先にする。装飾より判読性。 */

:root {
  --bg: #ffffff;
  --fg: #1a1d21;
  --muted: #5c6470;
  --line: #dfe3e8;
  --panel: #f6f8fa;
  --accent: #0b6b3a;
  --warn-bg: #fff6e5;
  --warn-line: #e8a33d;
  --sat: #eaf3fb;
  --sun: #fdeef0;

  --k-burnable: #e4572e;
  --k-nonburnable: #6b7280;
  --k-plastic: #d9a400;
  --k-container: #2b7fd4;
  --k-paper: #2f9e44;
  --k-cloth: #7a9e2f;
  --k-metal: #7c8794;
  --k-battery: #7b52c4;
  --k-spray: #b8529e;
  --k-hazard: #c02942;
  --k-branch: #5a8f3d;
  --k-bulky: #444e5c;
  --k-other: #545b66;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.75;
  font-size: 16px;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }

a { color: #0a5ca8; }
a:hover { text-decoration: none; }

/* ---------------------------------------------------------------- ヘッダ */
.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-head .wrap { display: flex; align-items: center; min-height: 56px; }
.brand { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--fg); }

.crumbs { border-bottom: 1px solid var(--line); background: var(--panel); font-size: .82rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4em; margin: 0; padding: 8px 0; }
.crumbs li + li::before { content: "›"; margin-right: .4em; color: var(--muted); }
.crumbs [aria-current] { color: var(--muted); }

main { padding: 20px 0 48px; }

h1 { font-size: 1.45rem; line-height: 1.4; margin: .2em 0 .6em; }
h2 { font-size: 1.15rem; margin: 2em 0 .6em; padding-left: .5em; border-left: 4px solid var(--accent); }

.lead { margin: 0 0 1.2em; }
.lead b { color: var(--accent); }

/* ------------------------------------------------------------ 曜日表（核） */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.schedule {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 620px;
}
table.schedule th.day {
  padding: 8px 4px;
  font-size: .95rem;
  background: var(--panel);
  border: 1px solid var(--line);
  width: 14.28%;
}
table.schedule th.sat { background: var(--sat); color: #1a5f9e; }
table.schedule th.sun { background: var(--sun); color: #b3273c; }

table.schedule td.cell {
  vertical-align: top;
  border: 1px solid var(--line);
  padding: 8px 6px;
  height: 96px;
}
table.schedule td.sat { background: #f7fbfe; }
table.schedule td.sun { background: #fffafb; }
table.schedule td.empty { background: #fafbfc; }
.none { color: #9aa2ad; font-size: .8rem; }

.chip {
  display: block;
  margin: 0 0 4px;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  background: var(--k-other);
  word-break: auto-phrase;
}
/* 備考由来（「Xと同じ日」）は枠線だけにして、表の一次情報と区別する */
.chip.sub {
  color: var(--fg);
  background: #fff;
  border: 1px dashed currentColor;
  font-weight: 500;
  opacity: .95;
}

.k-burnable { background: var(--k-burnable); }
.k-nonburnable { background: var(--k-nonburnable); }
.k-plastic { background: var(--k-plastic); }
.k-container { background: var(--k-container); }
.k-paper { background: var(--k-paper); }
.k-cloth { background: var(--k-cloth); }
.k-metal { background: var(--k-metal); }
.k-battery { background: var(--k-battery); }
.k-spray { background: var(--k-spray); }
.k-hazard { background: var(--k-hazard); }
.k-branch { background: var(--k-branch); }
.k-bulky { background: var(--k-bulky); }
.k-other { background: var(--k-other); }

.chip.sub.k-burnable { color: var(--k-burnable); }
.chip.sub.k-nonburnable { color: var(--k-nonburnable); }
.chip.sub.k-plastic { color: #a37c00; }
.chip.sub.k-container { color: var(--k-container); }
.chip.sub.k-paper { color: var(--k-paper); }
.chip.sub.k-metal { color: var(--k-metal); }
.chip.sub.k-battery { color: var(--k-battery); }
.chip.sub.k-spray { color: var(--k-spray); }
.chip.sub.k-hazard { color: var(--k-hazard); }

/* 凡例 */
.legend {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .9rem;
}
.legend-title { margin: 0 0 .4em; font-weight: 700; }
.legend ul { margin: 0; padding-left: 1.2em; }
.legend-note { margin: .6em 0 0; color: var(--muted); font-size: .85rem; }

/* ------------------------------------------ 通常収集にないごみ（目立たせる） */
.special {
  margin: 28px 0 0;
  padding: 16px;
  background: var(--warn-bg);
  border: 2px solid var(--warn-line);
  border-radius: 10px;
}
.special h2 {
  margin: 0 0 .3em;
  border-left: none;
  padding-left: 0;
  font-size: 1.2rem;
  color: #8a5200;
}
.special-lead { margin: 0 0 .8em; font-size: .92rem; }
table.special-table { width: 100%; border-collapse: collapse; background: #fff; }
table.special-table th,
table.special-table td { border: 1px solid var(--warn-line); padding: 9px 10px; text-align: left; font-size: .92rem; }
table.special-table th { width: 34%; background: #fffaf0; white-space: nowrap; }

/* ------------------------------------------------------------ 一覧・その他 */
.town-list { list-style: none; padding: 0; }
.town-list.cols { columns: 2; column-gap: 24px; }
.town-list li { break-inside: avoid; padding: 2px 0; }

.area-list, .ward-list, .city-list { list-style: none; padding: 0; }
.area-list li, .ward-list li, .city-list li {
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.hint { color: var(--muted); font-size: .82rem; text-align: right; }

.notes ul { padding-left: 1.2em; }
.source { margin-top: 2em; font-size: .9rem; color: var(--muted); }
.source a { color: #0a5ca8; }
.contact { margin: .4em 0 0; }

/* 検索 */
.search-box { margin: 16px 0 24px; }
.search-box label { display: block; font-weight: 700; margin-bottom: .3em; font-size: .95rem; }
.search-box input {
  width: 100%;
  padding: 11px 12px;
  font-size: 1rem;
  border: 2px solid var(--line);
  border-radius: 8px;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-results { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.search-results li { border-bottom: 1px solid var(--line); }
.search-results li:last-child { border-bottom: none; }
.search-results a { display: block; padding: 10px 12px; text-decoration: none; }
.search-results a:hover { background: var(--panel); }

/* 広告枠（AdSense有効時のみ出力される） */
.ads { margin: 24px 0; }

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 20px 0 40px;
  font-size: .86rem;
  color: var(--muted);
}
.disclaimer { margin: 0 0 .6em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------- スマホ表示 */
/* 7列の表は狭い画面で潰れて読めない。曜日ごとの縦並びに切り替える。 */
@media (max-width: 700px) {
  table.schedule { min-width: 0; display: block; }
  table.schedule thead { display: none; }
  table.schedule tbody, table.schedule tr { display: block; }
  table.schedule td.cell {
    display: grid;
    grid-template-columns: 5.2em 1fr;
    align-items: start;
    gap: 10px;
    height: auto;
    min-height: 52px;
    padding: 10px;
    border-top: none;
  }
  table.schedule tr td.cell:first-child { border-top: 1px solid var(--line); }
  table.schedule td.cell::before {
    content: attr(data-day);
    font-weight: 700;
    font-size: .92rem;
  }
  table.schedule td.sat::before { color: #1a5f9e; }
  table.schedule td.sun::before { color: #b3273c; }
  .chip { display: inline-block; margin: 0 4px 4px 0; }
  .town-list.cols { columns: 1; }
  h1 { font-size: 1.25rem; }
  /* 「粗大ごみ」が2行に割れて読みにくいので、見出しと内容を上下に積む */
  table.special-table, table.special-table tbody, table.special-table tr { display: block; }
  table.special-table tr { margin-bottom: 10px; border: 1px solid var(--warn-line); }
  table.special-table th, table.special-table td { display: block; width: auto; border: none; }
  table.special-table th { background: #fffaf0; border-bottom: 1px solid var(--warn-line); white-space: normal; }
}

/* 公式ページに同名・別収集日の行がある場合の注意（誤った日に出すのを防ぐ） */
.ambiguous {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #fdecec;
  border: 2px solid #d9534f;
  border-radius: 8px;
}
.ambiguous p { margin: 0; font-size: .93rem; }

/* ------------------------------------------------------------- 粗大ごみ */
/* 料金は「いくらか」が一目で分かることを最優先にする */
.fee-box {
  margin: 0 0 20px;
  padding: 18px 20px;
  background: #f2f8f4;
  border: 2px solid var(--accent);
  border-radius: 10px;
}
.fee-box.ng { background: #fdecec; border-color: #d9534f; }
.fee-big {
  margin: 0 0 .2em;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent);
}
.fee-box.ng .fee-big { color: #c0392b; }
.fee-box p { margin: .3em 0 0; }
.fee-box .cond { color: var(--muted); font-size: .92rem; }

table.fee-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.fee-table th,
table.fee-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
table.fee-table thead th { background: var(--panel); white-space: nowrap; }
table.fee-table td.fee { white-space: nowrap; font-weight: 700; text-align: right; }
table.fee-table td.fee.ng { color: #c0392b; font-weight: 500; }
table.fee-table td.cond { color: var(--muted); font-size: .86rem; }
table.fee-table tbody tr:nth-child(even) { background: #fafbfc; }

.cat-nav ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cat-nav li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .9rem;
}
.cat-nav li .hint { margin-left: .4em; }
.cat-nav a { text-decoration: none; }

.crosslink {
  margin: 16px 0;
  padding: 11px 14px;
  background: var(--panel);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
}
.note-small { color: var(--muted); font-size: .86rem; }
.cat h2 { scroll-margin-top: 12px; }

@media (max-width: 700px) {
  .fee-big { font-size: 1.7rem; }
  table.fee-table { font-size: .88rem; }
  table.fee-table th, table.fee-table td { padding: 7px 6px; }
  table.fee-table td.cond { display: none; } /* 狭い画面では条件列を隠して料金を優先 */
}
