/* corporatelaw.cy — shared styles for Feed and Library (Manifest uses header.css) */
@import url('/assets/header.css');

:root {
  --ink: #1F1B16; --muted: #5A5348; --rule: #D2C9B8; --hair: #ECE7DC; --line: #B9AF9C;
  --paper: #FBFAF6; --white: #FFFFFF; --sel: #EFEADF; --ok: #2E6A47; --warn: #8A5A12;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: 'EB Garamond', Georgia, serif; font-size: 19px; line-height: 1.5; }
a { color: var(--ink); }
a:hover { color: var(--muted); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1, h2 { font-family: 'IM Fell English', Georgia, serif; font-weight: 400; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.vignette { flex: 0 0 auto; object-fit: contain; }
.n { font-variant-numeric: tabular-nums; }
button { font-family: inherit; }

/* status line and card: green while every source was checked in the last 3 days */
.dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 5px; background: var(--ok); }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 32px; font-size: 17px; }
.status .state, .status-card .state, .status-card .ago { color: var(--ok); }
.is-stale .dot { background: var(--warn); }
.is-stale .state, .is-stale .ago { color: var(--warn) !important; }

/* tabs and groups, shared by Library and Feed */
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--ink); }
.tabs button { min-height: 52px; padding: 0 22px; border: 0; background: transparent; font-size: 19px; color: var(--ink); cursor: pointer; }
.tabs button[aria-selected="true"] { font-weight: 600; box-shadow: inset 0 -3px 0 var(--ink); }
.grp { display: flex; align-items: baseline; gap: 12px; min-height: 40px; padding: 8px 12px; border: 0; background: transparent;
  font-size: 17px; line-height: 1.3; color: var(--ink); cursor: pointer; text-align: left; }
.grp .n { color: var(--muted); }
.grp[aria-pressed="true"], .grp[aria-current="true"] { background: var(--sel); font-weight: 600; }

/* kind labels: one colour per kind, same as the design boards */
.kind { flex: 0 0 auto; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; font-size: 13px; font-weight: 500;
  line-height: 1; transform: translateY(-2px); white-space: nowrap; }
.k-law { background: #2B3F5C; color: #FFFFFF; }
.k-regulations { background: #7A5A2E; color: #FFFFFF; }
.k-treaty { background: #4B4F7A; color: #FFFFFF; }
.k-decision { background: #E8DDE6; color: #4A2E45; }
.k-guidance { background: #DCE6F0; color: #1F3550; }
.k-form { background: #F1E3C4; color: #5A4210; }
.k-record { background: #D6E7E4; color: #1F4740; }
.k-notice { background: #E3E0D8; color: #3D372E; }
.k-unclassified { background: #FFFFFF; color: var(--ink); border: 1px dashed var(--ink); }

/* ---------- Library ---------- */
.library { max-width: 1200px; padding-top: 40px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 28px; }
.title-block { display: flex; flex-direction: column; gap: 24px; }
.title-row { display: flex; align-items: center; gap: 20px; }
.title-row .vignette { width: 112px; height: 112px; }
.title-text { display: flex; flex-direction: column; gap: 4px; }
.library h1 { font-size: 48px; line-height: 1.05; }
.lead { font-size: 18px; }
.search { display: flex; width: 100%; }
.search input { flex: 1 1 auto; min-width: 0; height: 56px; padding: 0 20px; border: 1px solid var(--ink); border-right: 0; border-radius: 0;
  background: var(--white); font-family: inherit; font-size: 20px; color: var(--ink); }
.search button { height: 56px; padding: 0 32px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-size: 19px; font-weight: 500; cursor: pointer; }
.lib-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px 48px; }
.groups { flex: 1 1 240px; max-width: 290px; display: flex; flex-direction: column; }
.groups .grp { width: 100%; min-height: 44px; border-bottom: 1px solid var(--hair); }
.groups .grp span:first-child { flex: 1 1 auto; }
.lib-list { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-bottom: 14px; }
.list-head h2 { font-size: 30px; line-height: 1.2; }
.list-head h2 .n { font-family: 'EB Garamond', Georgia, serif; font-size: 18px; color: var(--muted); }
.sort { display: flex; align-items: center; gap: 6px; font-size: 16px; color: var(--muted); }
.sort select { height: 40px; padding: 0 8px; border: 1px solid var(--line); background: var(--white); font-family: inherit; font-size: 16px; color: var(--ink); }
.cols { display: flex; gap: 16px; padding: 8px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
  font-family: 'IM Fell English SC', Georgia, serif; font-size: 15px; letter-spacing: 0.06em; color: var(--muted); }
.cols span:first-child { flex: 1 1 auto; }
.cols span:nth-child(2), .row .d1, .am .d1 { flex: 0 0 104px; text-align: right; }
.cols span:nth-child(3), .row .d2, .am .d2 { flex: 0 0 120px; text-align: right; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows > li { border-bottom: 1px solid var(--rule); }
.rows .loading { padding: 24px 0; border: 0; }
.row { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; }
.row .main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row .t { display: flex; align-items: baseline; gap: 10px; }
.row .t a { font-size: 20px; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; }
.row .t a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bits { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; font-size: 15px; color: var(--muted); }
.row .d1, .row .d2 { font-size: 17px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.am-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0; border: 0; background: transparent;
  font-size: 15px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.am-toggle svg { transition: transform .15s; }
.am-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.ams { margin: 0 0 14px 22px; padding: 0 0 0 18px; list-style: none; border-left: 1px solid var(--ink); }
.am { display: flex; align-items: baseline; gap: 16px; padding: 6px 0; border-top: 1px solid var(--hair); }
.am .main { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; }
.am .main a { font-size: 17px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
.am .main span { font-size: 14px; color: var(--muted); }
.am .d1, .am .d2 { font-size: 16px; font-variant-numeric: tabular-nums; }
.list-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; font-size: 16px; }
.list-foot button, .btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 1px solid var(--ink);
  background: transparent; color: var(--ink); text-decoration: none; font-size: 17px; cursor: pointer; }

/* ---------- Feed ---------- */
.feed { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 48px; }
.feed-title { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; padding-top: 40px; }
.feed-title h1 { font-size: 56px; line-height: 1; }
.feed-title .lead { max-width: 560px; line-height: 1.45; }
.rail { flex: 1 1 220px; max-width: 248px; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 24px 0 40px;
  display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.rail-label { padding: 0 8px 8px; font-size: 16px; }
.rail .y summary { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 8px; cursor: pointer; list-style: none; }
.rail .y summary::-webkit-details-marker { display: none; }
.rail .y summary::before { content: ''; width: 6px; height: 6px; border-right: 1.4px solid var(--muted); border-bottom: 1.4px solid var(--muted);
  transform: rotate(-45deg); margin-right: 4px; transition: transform .15s; }
.rail .y[open] summary::before { transform: rotate(45deg); }
.rail .yl { flex: 1 1 auto; font-family: 'IM Fell English', Georgia, serif; font-size: 22px; }
.rail .n { font-size: 15px; color: var(--muted); }
.rail .ms { display: flex; flex-direction: column; padding: 0 0 8px 18px; }
.rail .m, .undated-link { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; text-decoration: none; font-size: 17px; }
.rail .m span:first-child, .undated-link span:first-child { flex: 1 1 auto; }
.undated-link { margin-top: 8px; border-top: 1px solid var(--rule); font-size: 16px; color: var(--muted); min-height: 36px; }
.feed-main { flex: 999 1 640px; min-width: 0; padding: 24px 0 96px; display: flex; flex-direction: column; gap: 32px; }

.status-card { display: flex; align-items: center; gap: 24px; padding: 16px 24px 16px 16px; border: 1px solid var(--rule); background: var(--white); }
.status-card .vignette { width: 112px; height: 112px; }
.sc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.state-big { display: flex; align-items: center; gap: 8px; font-family: 'IM Fell English', Georgia, serif; font-size: 28px; line-height: 1.1; }
.ago { font-size: 16px; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: stretch; gap: 2px; height: 16px; }
.bars span { flex: 1 1 0; min-width: 2px; }
.bars .bar { background: var(--ok); }
.bars .gap { border: 1px solid var(--ink); background: var(--white); }
.sc-details summary { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 16px; line-height: 1.4; cursor: pointer; list-style: none; }
.sc-details summary::-webkit-details-marker { display: none; }
.sc-details .toggle { flex: 0 0 auto; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.sc-panel { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; margin-top: 12px; border-top: 1px solid var(--hair); font-size: 15px; }
.sources { margin: 0; padding: 0; list-style: none; columns: 3 220px; column-gap: 40px; }
.sources li { break-inside: avoid; display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 16px; border-bottom: 1px solid var(--hair); }
.sources .tick { flex: 0 0 12px; width: 12px; height: 7px; border-left: 1.75px solid var(--ok); border-bottom: 1.75px solid var(--ok); transform: rotate(-45deg) translate(1px, -2px); }
.sources .src { flex: 1 1 auto; min-width: 0; }
.sources time { flex: 0 0 auto; white-space: nowrap; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sources li.is-stale .tick { border-color: var(--warn); }

.filter { display: flex; flex-direction: column; gap: 12px; }
.fgroups { display: flex; flex-wrap: wrap; gap: 4px; }
.month h2 { padding: 16px 0 12px; border-bottom: 1px solid var(--ink); display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 32px; line-height: 1.2; }
.month h2 .n { font-family: 'EB Garamond', Georgia, serif; font-size: 16px; color: var(--muted); }
.day { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 24px 0 28px; border-bottom: 1px solid var(--rule); scroll-margin-top: 16px; }
.day-num { flex: 0 0 112px; align-self: flex-start; position: sticky; top: 16px; display: flex; flex-direction: column; }
.day-num .num { font-family: 'IM Fell English', Georgia, serif; font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums; }
.day-num .muted { font-size: 16px; }
.day-body { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.pub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 4px; }
.pub-name { font-size: 17px; font-weight: 500; }
.pub-head .n { font-size: 15px; }
.pub ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hair); }
.pub li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.doc-title { display: flex; align-items: baseline; gap: 10px; }
.doc-title a { font-size: 19px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
.doc-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pub .meta { font-size: 15px; color: var(--muted); }
.empty { padding: 32px 0; border-top: 1px solid var(--ink); font-size: 18px; }
.undated { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding: 24px; border: 1px solid var(--rule); scroll-margin-top: 16px; }
.undated .vignette { width: 88px; height: 88px; }
.undated > div { flex: 1 1 360px; display: flex; flex-direction: column; gap: 4px; }
.undated h2 { font-size: 26px; }
.undated p { font-size: 17px; }
[hidden] { display: none !important; }

footer.site { border-top: 1px solid var(--rule); }
footer.site .wrap { padding-top: 24px; padding-bottom: 36px; font-size: 15px; color: var(--muted); }

@media (max-width: 860px) {
  .wrap { padding: 0 16px; }
  .library { padding-top: 28px; }
  .library h1 { font-size: 40px; }
  .title-row .vignette { width: 88px; height: 88px; }
  .search button { padding: 0 20px; }
  .groups { max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .groups .grp { width: auto; border: 0; min-height: 40px; }
  .cols span:nth-child(3), .row .d2, .am .d2 { display: none; }
  .cols span:nth-child(2), .row .d1, .am .d1 { flex-basis: 88px; }
  .tabs button { padding: 0 14px; font-size: 17px; }
  .feed-title h1 { font-size: 44px; }
  .rail { order: 3; position: static; max-height: none; max-width: none; flex-basis: 100%; padding: 24px 0 48px; border-top: 1px solid var(--ink); }
  .status-card { align-items: flex-start; gap: 12px; padding: 16px; }
  .status-card .vignette { width: 56px; height: 56px; }
  .state-big { font-size: 24px; }
  .day-num { flex-basis: 100%; position: static; flex-direction: row; align-items: baseline; gap: 12px; }
  .day-num .num { font-size: 40px; }
}
