/* FreeBSD ports example theme, in the tone of the FreeBSD project's own site:
   the project red for the bar, dark grey text on white, deep red links,
   pale grey bands. Every text/background pair meets WCAG 2.2 AA; the
   ratios are listed in README.md. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --band: #f9f0f0;        /* accent band */
  --text: #444444;        /* 9.7:1 on white */
  --muted: #5f5f5f;       /* 6.4:1 on white, 5.7:1 on --band */
  --border: #dddddd;
  --link: #990000;        /* 8.9:1 on white */
  --bar: #ab2b28;         /* the project red — white on it is 6.8:1 */
  --bar-text: #ffffff;
  --bar-ink: #ab2b28;     /* icon tint — 6.8:1 on white */
  --thead: #f1f3f1;       /* table heads; --text on it is 8.7:1 */
  --foot: #f0f1f5;
  --mark: #ffe8a3;        /* search highlight behind --text */
  --code: #f4f4f4;
  --focus: #1a79ff;       /* focus ring, 4.0:1 on white; white inside the bar */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #333333; --surface: #2b2b2b; --band: #3a3333; --text: #eeeff1; --muted: #c4c6ca;
    --border: #4d4d4d; --link: #ff8a80; --bar-ink: #ff8a80; --thead: #272727;
    --foot: #2b2b2b; --mark: #6d4c41; --code: #272727;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); text-rendering: optimizeLegibility; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code, .mono, pre { font-family: var(--mono); }
pre { background: var(--code); padding: .75rem 1rem; overflow-x: auto; border-radius: 4px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: .5rem; z-index: 2; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.bar { background: var(--bar); color: var(--bar-text); }
.bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.75rem; min-height: 4.5rem; padding-block: .5rem; }
.bar a { color: var(--bar-text); text-decoration: none; }
.bar a:hover { text-decoration: underline; }
.brand { font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; }
.bar nav a { font-weight: 600; }
.bar nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.searchbox { margin-left: auto; display: flex; gap: .25rem; }
.searchbox input { width: 16rem; max-width: 50vw; border-color: transparent; }
.searchbox button { background: var(--bar-text); color: var(--bar); border-color: var(--bar-text); }
input, button { font: inherit; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); }
button { cursor: pointer; font-weight: 600; }

main.wrap { padding-block: 1.25rem 3rem; }
h1, h2, h3 { color: var(--text); font-weight: 600; line-height: 1.25; }
h1 { font-size: 2.1rem; margin: .25rem 0 .5rem; letter-spacing: -.02em; }
h2 { font-size: 1.45rem; margin-top: 2.25rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.lead { font-size: 1.05rem; max-width: 46rem; }
.muted { color: var(--muted); }
.count { color: var(--muted); font-size: .8em; font-weight: 400; }
.crumbs { font-size: .9rem; color: var(--muted); }

.grid { width: 100%; border-collapse: collapse; background: var(--surface); }
.grid th, .grid td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.grid thead th { font-size: .9rem; background: var(--thead); color: var(--text); font-weight: 600; }
.grid .num { text-align: right; font-family: var(--mono); }
.grid tr.virtual td { color: var(--muted); }
@media (max-width: 40rem) { .grid td:last-child, .grid th:last-child { display: none; } .grid tr.keep-last td:last-child { display: table-cell; } }

.port .origin { font-family: var(--mono); }
.port .version { font-family: var(--mono); color: var(--muted); font-size: .8em; }
.port .comment { font-size: 1.1rem; margin-top: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; background: var(--surface); padding: 1rem; border: 1px solid var(--border); border-radius: 4px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-line; }
.cols { columns: 16rem; padding-left: 1.1rem; font-family: var(--mono); font-size: .9rem; }

.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.prose { max-width: 46rem; }
.foot { background: var(--foot); color: var(--text); font-size: .875rem; padding-block: 1.25rem; margin-top: 2rem; }
.foot .build { color: var(--muted); margin-bottom: 0; }   /* 5.7:1 light, 8.3:1 dark on --foot */
/* Cookie banner: both choices the same size and weight, as consent asks. */
.consent { position: fixed; inset: auto 0 0 0; z-index: 3; background: var(--surface); color: var(--text); border-top: 2px solid var(--bar-ink); box-shadow: 0 -2px 12px rgb(0 0 0 / .15); }
.consent-inner { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; padding-block: .9rem; }
.consent p { margin: 0; max-width: 46rem; }
.consent-actions { display: flex; gap: .5rem; }
.consent-actions button { min-width: 7rem; min-height: 2.75rem; }

.searchform label { display: block; font-weight: 600; margin-bottom: .25rem; }
.searchform .row { display: flex; gap: .5rem; }
.searchform input[type=search] { flex: 1; min-width: 0; }
.results-layout { display: grid; grid-template-columns: 14rem 1fr; gap: 1.5rem; margin-top: 1rem; }
@media (max-width: 48rem) { .results-layout { grid-template-columns: 1fr; } }
#facets h3 { font-size: .9rem; text-transform: uppercase; color: var(--muted); margin: 1rem 0 .25rem; }
#facets ul { list-style: none; padding: 0; margin: 0; }
#facets button { border: 0; background: none; color: var(--link); padding: .1rem 0; font-weight: 400; text-align: left; }
#facets button[aria-pressed=true] { font-weight: 600; text-decoration: underline; }
.results { padding-left: 1.2rem; }
.results li { margin-bottom: 1rem; }
.results .hit-title { font-family: var(--mono); font-weight: 600; }
.results mark { background: var(--mark); color: var(--text); }

/* Port page */
.port-head h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.badge { font-family: var(--mono); font-size: .75em; background: var(--code); border: 1px solid var(--border); border-radius: 4px; padding: .05rem .45rem; }
.linkrow { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; padding: 0; margin: .25rem 0 1rem; font-size: .95rem; }
.port-grid { display: grid; grid-template-columns: minmax(16rem, 26rem) 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 52rem) { .port-grid { grid-template-columns: 1fr; } }
.port-grid .descr h2 { margin-top: 0; }
.facts.compact { margin-top: 1rem; }
.notice { border-left: 4px solid var(--bar); background: var(--band); padding: .6rem .8rem; margin: .5rem 0; }
.notice-expires, .notice-deprecated { border-color: var(--focus); }
.scroll { overflow-x: auto; }
.pkgtable td, .pkgtable th { white-space: nowrap; }
.deplist { padding-left: 1.1rem; font-size: .9rem; }
.deplist li { margin: .1rem 0; }
h3 { font-size: 1rem; margin: 1.25rem 0 .4rem; }
details.more { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: .5rem .8rem; margin: .5rem 0; }
details.more summary { cursor: pointer; font-weight: 600; }
details.more[open] summary { margin-bottom: .5rem; }
.plist { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: .85rem; overflow-wrap: anywhere; }
.hash { font-size: .8rem; overflow-wrap: anywhere; }
pre.message { white-space: pre-wrap; }
.commits td { font-size: .92rem; }
.log { color: var(--muted); font-size: .85rem; margin-top: .3rem; }

/* Front page */
.home-grid { display: grid; grid-template-columns: 1fr 19rem; gap: 2rem; align-items: start; }
@media (max-width: 60rem) { .home-grid { grid-template-columns: 1fr; } }
.home-side section { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: .25rem 1rem 1rem; margin-bottom: 1rem; }
.home-side h2 { margin-top: .75rem; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; margin: 0; }
.stats dd { margin: 0; text-align: right; font-family: var(--mono); }
.vulnlist { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.vulnlist li { margin-bottom: .6rem; }
.vulnlist .muted { display: block; font-size: .85rem; }
.pkgtable thead th { text-transform: none; letter-spacing: 0; }

/* Icons: drawn strokes in the text colour, sized to the line. */
.icon { width: 1.05em; height: 1.05em; vertical-align: -0.15em; margin-right: .3em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h2 .icon { width: .95em; height: .95em; margin-right: .4em; color: var(--bar-ink); }
.iconlink { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; text-decoration: none; }
.iconlink .icon { margin: 0; }
.notice .icon { color: var(--bar-ink); }
.nowrap { white-space: nowrap; }

/* Front-page band, as the project's own front page has. */
.hero { background: var(--band); padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.hero h1 { margin-top: 0; }
.totals { font-size: 1.05rem; margin-bottom: 0; }
.bar a:focus-visible, .bar input:focus-visible, .bar button:focus-visible { outline-color: var(--bar-text); }
