/* lawsdata.css ─ トップページ(法令の一覧表)専用。共通部分は common.css */

.tip{margin:18px 0 14px;background:#fff;border:1px solid var(--line);border-left:4px solid var(--gold);border-radius:6px;padding:10px 14px;font-size:13.5px}
.tip p{margin:0}
.tip details{margin-top:6px}
.tip summary{cursor:pointer;color:var(--link)}
.tip ul{margin:8px 0 2px 1.2em;padding:0}
.tip li{margin:3px 0}
.tip code{font-family:ui-monospace,"Cascadia Mono",Consolas,monospace;font-size:12.5px;background:#EEF2F8;border-radius:4px;padding:0 5px}

.tools{background:var(--card);border:1px solid var(--line);border-radius:8px;padding:14px 16px;display:grid;gap:12px}
.row{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center}
.search{flex:1 1 320px;position:relative}
.search input{width:100%;font:inherit;padding:9px 36px 9px 12px;border:1px solid #B8C3D6;border-radius:6px;background:#fff}
.search input:focus{outline:2px solid var(--link);outline-offset:0;border-color:var(--link)}
.search input.bad{border-color:#B91C1C;outline-color:#B91C1C}
.search button{position:absolute;right:4px;top:4px;width:30px;height:30px;border:0;background:none;font-size:18px;color:var(--mute);cursor:pointer;border-radius:4px}
.search button:hover{background:#EEF2F8}
.re{display:inline-flex;gap:6px;align-items:center;font-size:13.5px;cursor:pointer;white-space:nowrap}
.re input{width:16px;height:16px;accent-color:var(--th)}
.reerr{margin:-6px 0 0;font-size:12.5px;color:#B91C1C}
.grp{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.grp>label{font-size:12.5px;color:var(--mute);margin-right:2px}
.chip{font:inherit;font-size:13px;padding:4px 12px;border-radius:999px;border:1px solid #B8C3D6;background:#fff;color:var(--ink);cursor:pointer}
.chip[aria-pressed="true"]{background:var(--th);border-color:var(--th);color:#fff}
.chip .n{opacity:.75;font-size:11.5px;margin-left:4px}
.chip:focus-visible,.btn:focus-visible,.pager button:focus-visible,th button:focus-visible,.re input:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.btn{font:inherit;font-size:13px;padding:4px 12px;border:1px solid #B8C3D6;background:#fff;border-radius:6px;cursor:pointer;color:var(--ink)}
.btn:hover{background:#EEF2F8}
.btn.reset{display:inline-flex;align-items:center;gap:6px;border-color:var(--th);color:var(--th);font-weight:600}
.btn.reset svg{width:15px;height:15px;flex:none}
select{font:inherit;font-size:13px;padding:3px 6px;border:1px solid #B8C3D6;border-radius:6px;background:#fff}
.count{font-size:13px;color:var(--mute);margin-left:auto}
.count b{color:var(--ink)}

.tablewrap{margin-top:14px;background:var(--card);border:1px solid var(--line);border-radius:8px;overflow:auto;scroll-margin-top:calc(var(--bar-h) + 8px)}
table{width:100%;min-width:996px;table-layout:fixed;border-collapse:separate;border-spacing:0;font-size:14px}
/* 列の幅。Quarto が表に <col style="width:20%"> を自動で付けるため、!important で上書きする。
   1 列目は「種別」の見出しと、いちばん長い「概要情報」の印が、改行されない最小の幅 */
#tbl col:nth-child(1){width:94px!important}
#tbl col:nth-child(2){width:auto!important}   /* 余った幅は、法令名の列だけが受け取る(最小は 996 - 他の列の合計 = 360px) */
#tbl col:nth-child(3){width:170px!important}
#tbl col:nth-child(4){width:260px!important}
#tbl col:nth-child(5){width:112px!important}
thead th{position:sticky;top:0;background:var(--th);color:#fff;text-align:left;padding:0;font-weight:600;white-space:nowrap;z-index:2}
thead th button{all:unset;box-sizing:border-box;display:block;width:100%;padding:10px 12px;cursor:pointer}
thead th button:hover{background:#2A4A80}
thead th button::after{content:"↕";margin-left:6px;opacity:.45;font-size:12px}
thead th[aria-sort="ascending"] button::after{content:"▲";opacity:1;color:var(--gold)}
thead th[aria-sort="descending"] button::after{content:"▼";opacity:1;color:var(--gold)}
tbody tr{--rowbg:#fff}
tbody tr.g:nth-of-type(even){--rowbg:var(--stripe)}
tbody tr.c{--rowbg:#FBFCFE}
tbody tr.g:hover,tbody tr.c:hover{--rowbg:#E4ECF8}
tbody td{padding:9px 12px;border-top:1px solid var(--line);vertical-align:top;background:var(--rowbg);overflow-wrap:anywhere}
tbody tr.c td{font-size:13.5px}
tbody tr.c td:first-child{border-left:3px solid var(--gold)}

/* 左の 2 列(種別・法令名)を固定:横スクロールしても、左端に残る */
thead th:nth-child(1),tbody td:nth-child(1){position:sticky;left:0;z-index:1}
thead th:nth-child(2),tbody td:nth-child(2){position:sticky;left:94px;z-index:1;border-right:1px solid var(--line)}
thead th:nth-child(1),thead th:nth-child(2){z-index:4}
.tablewrap.scrolled thead th:nth-child(2),.tablewrap.scrolled tbody td:nth-child(2){box-shadow:6px 0 6px -4px rgba(20,40,75,.3)}
td.t{white-space:nowrap}
td.d{white-space:normal}
td.d small{display:block;color:var(--mute);font-size:12px}
td.u{white-space:nowrap;color:var(--mute)}
.nm{display:flex;gap:8px;align-items:flex-start}
.tog{flex:none;width:24px;height:24px;border:1px solid #B8C3D6;background:#fff;border-radius:5px;cursor:pointer;
  font-size:11px;line-height:1;color:var(--th);padding:0;margin-top:1px}
.tog:hover{background:#EEF2F8}
.tog:focus-visible{outline:2px solid var(--gold);outline-offset:1px}
.tog::before{content:"▶"}
.tog[aria-expanded="true"]::before{content:"▼"}
.nm .sp{flex:none;width:24px}
.note{display:block;color:var(--mute);font-size:12.5px}
.cnt{display:inline-block;margin-left:6px;padding:0 8px;border-radius:999px;background:#E3EAF6;color:var(--th);font-size:12px;font-weight:700;white-space:nowrap}
.bd{display:inline-block;padding:0 8px;border-radius:4px;font-size:12px;font-weight:700;white-space:nowrap;margin:0 4px 2px 0}
.bd.p{background:var(--pend-bg);color:var(--pend-fg)}
.bd.o{background:var(--ok-bg);color:var(--ok-fg)}
td.tyb span{display:inline-block;white-space:nowrap;padding:0 8px;border-radius:4px;background:#E8EDF6;color:var(--th);font-size:12.5px}
.empty{padding:36px;text-align:center;color:var(--mute)}
.empty.err{color:#B91C1C}

.pager{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:center;margin:16px 0 0}
.pager button{font:inherit;font-size:13.5px;min-width:36px;padding:5px 10px;border:1px solid #B8C3D6;background:#fff;border-radius:6px;cursor:pointer;color:var(--ink)}
.pager button[aria-current="page"]{background:var(--th);border-color:var(--th);color:#fff}
.pager button:disabled{opacity:.4;cursor:default}
.pager .gap{color:var(--mute)}

@media (max-width:700px){
  .tablewrap{border:0;background:none;overflow:visible}
  table,tbody{display:block}
  table{min-width:0}
  colgroup{display:none}
  thead th:nth-child(n),tbody td:nth-child(n){position:static;box-shadow:none!important;border-right:0}
  thead{display:none}
  tbody tr{display:grid;grid-template-columns:1fr;gap:2px;background:#fff;border:1px solid var(--line);border-radius:8px;margin:0 0 10px;padding:8px 10px}
  tbody tr.c{margin:-6px 0 10px 14px;border-left:3px solid var(--gold)}
  tbody td{border:0;padding:2px 0;background:none!important;width:auto!important}
  tbody td[data-l]::before{content:attr(data-l) "  ";color:var(--mute);font-size:12px}
  tbody tr.c td:first-child{border-left:0}
  .count{margin-left:0}
}
