/* /violence-map/ (tools/violence_build.py, src/violence.js) - scoped to .vio-page; shares agri.css (map, notice). */
.vio-controls { margin: .6rem 0; }
.vio-row { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.vio-lab { font-weight: 600; }
.vio-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.vio-chip { font: inherit; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-block-size: 44px; min-inline-size: 3.6rem; padding: .3rem .55rem; border: 1px solid var(--border); border-radius: 16px; background: var(--panel, var(--bg)); color: inherit; cursor: pointer; }
/* the count circles above each year: all (white), women (pink), under 17 (sky blue) - the same colours as the map's badges */
.vio-cns { display: flex; gap: 3px; min-block-size: 22px; align-items: center; }
.vio-cn { display: inline-block; min-inline-size: 22px; block-size: 22px; padding: 0 4px; border-radius: 11px; border: 1px solid #fff; box-sizing: border-box; font: 700 12px/20px system-ui, sans-serif; text-align: center; }
.vio-cn-n { background: #fff; color: #111; border-color: #6b7280; }
.vio-cn-w { background: #db2777; color: #fff; }
.vio-cn-u { background: #38bdf8; color: #082f49; }
.vio-ckey { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; font-size: .9rem; }
.vio-ckey > span { display: inline-flex; align-items: center; gap: .3rem; }
/* the site's floating "?" sits at the column's right edge on a wide screen: the years box leaves it a free strip, so it hides no letter */
@media (min-width: 481px) { .vio-yearsbox { padding-inline-start: 3.2rem; } }
/* phone: three years in a row, so the chips do not push the map a screen away */
@media (max-width: 480px) {
  #vioYears { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: .25rem; inline-size: 100%; }
  #vioYears .vio-chip { min-inline-size: 0; padding: .2rem .1rem; border-radius: 12px; gap: 0; line-height: 1.25; }
  #vioYears .vio-chip[data-y="all"] { grid-column: span 2; }   /* the totals are the widest numbers */
  #vioYears .vio-chip > span:last-child { white-space: nowrap; font-size: .92rem; }   /* "2000-2011" stays on one line */
  #vioYears .vio-cns { gap: 2px; min-block-size: 20px; }
  #vioYears .vio-cn { min-inline-size: 20px; block-size: 20px; padding: 0 3px; font: 700 11px/18px system-ui, sans-serif; }
}
.vio-chip[aria-pressed="true"] { background: var(--accent, #1f6b4a); color: var(--on-accent, #fff); border-color: var(--accent, #1f6b4a); font-weight: 600; }
/* a long press on a chip selects: no text selection and no callout menu on it; the press target is always the button */
.vio-chip { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.vio-chip > * { pointer-events: none; }
.vio-chint { flex: 0 0 100%; margin: 0; font-size: .85rem; color: var(--muted); }
.vio-chip:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.vio-adv { margin: .6rem 0; }
.vio-filters { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; padding: .4rem 0; }
.vio-filters label { display: inline-flex; gap: .4rem; align-items: center; }
.vio-filters input, .vio-filters select { font: inherit; min-block-size: 44px; padding: .3rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--panel, var(--bg)); color: inherit; }
.vio-sum { margin: .5rem 0; font-weight: 600; }
.vio-map { block-size: min(70vh, 600px); min-block-size: 360px; }
.vio-dot { display: inline-block; inline-size: 14px; block-size: 14px; border-radius: 50%; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); box-sizing: border-box; }
.vio-keys { display: flex; flex-direction: column; gap: .2rem; margin: .6rem .2rem; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel, var(--bg)); }
.vio-keyhead { font-weight: 600; }
.vio-keyrow { display: flex; align-items: center; gap: .7rem; min-block-size: 44px; font-size: 1.05rem; line-height: 1.4; }
.vio-keyrow .vio-dot { inline-size: 20px; block-size: 20px; }
.vio-keynote { font-size: .95rem; color: var(--muted); }
.vio-pie { flex: none; inline-size: 26px; block-size: 26px; border-radius: 50%; background: conic-gradient(#b42318 0 200deg, #7e22ce 200deg 300deg, #6b7280 300deg 360deg); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); box-sizing: border-box; }
.vio-mk { box-sizing: border-box; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); cursor: pointer; display: grid; place-items: center; }
.vio-mk:focus-visible { outline: 3px solid #111; outline-offset: 3px; }
.vio-mkn { display: grid; place-items: center; border-radius: 50%; background: #fff; color: #111; font-weight: 700; line-height: 1; }
.vio-years { border-collapse: collapse; inline-size: 100%; max-inline-size: 36rem; }
.vio-years :is(th, td) { padding: .3rem .5rem; border-block-end: 1px solid var(--border, #cbd5cf); text-align: start; }
.vio-years td { font-variant-numeric: tabular-nums; }
.vio-years tfoot :is(th, td) { font-weight: 700; }
.vio-years tbody th { font-weight: 400; }
.vio-towns > summary { cursor: pointer; margin-block: .6rem; }
@media (max-width: 600px) { .vio-years { font-size: .85rem; } .vio-years :is(th, td) { padding: .3rem .25rem; overflow-wrap: normal; } }   /* four columns fit a 320 px phone, no side scroll */
.vio-list { list-style: none; padding: 0; margin: 0; }
.vio-case { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .3rem; border-block-end: 1px solid var(--border); line-height: 1.5; }
.vio-case .vio-dot { margin-block-start: .3rem; inline-size: 16px; block-size: 16px; }
.vio-src { font-size: .88rem; color: var(--muted); }
.vio-src a { text-decoration: underline; }
.vio-more { font: inherit; padding: .6rem 1.2rem; min-block-size: 44px; margin: .8rem 0; border: 1px solid var(--border); border-radius: 999px; background: var(--panel, var(--bg)); color: inherit; cursor: pointer; }
.vio-counts { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .3rem 0 .6rem; }
.vio-counts > span { display: inline-flex; gap: .35rem; align-items: center; }
.vio-wa a { font-weight: 600; text-decoration: underline; display: inline-flex; gap: .35rem; align-items: center; min-block-size: 44px; }
.vio-dh { margin: .2rem 0; font-size: 1.3rem; }
.vio-nomap #vioMapBlock { display: none; }
dialog.vio-dialog { border: 0; border-radius: 14px; padding: 0; margin: auto; width: 92% !important; max-width: 640px !important; height: auto; max-height: 90%; background: var(--panel, var(--bg, #fff)); color: inherit; box-shadow: 0 10px 40px rgba(0,0,0,.35); overflow: hidden; }
.vio-dialog::backdrop { background: rgba(0,0,0,.55); }
.vio-dbody { padding: 3.2rem 1.2rem 1.4rem; max-block-size: 100%; overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; }
.vio-dx { position: absolute; inset-block-start: .5rem; inset-inline-start: .5rem; z-index: 2; inline-size: 44px; block-size: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel, var(--bg, #fff)); color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.vio-dx:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
dialog.vio-dialog[open] { display: flex; flex-direction: column; }
.vio-dialog .vio-dbody { flex: 1 1 auto; min-block-size: 0; }
@media (max-width: 640px) { dialog.vio-dialog { width: calc(100% - 16px) !important; max-width: none !important; height: calc(100% - 16px); max-height: none; margin: 8px; } .vio-dbody { max-block-size: none; block-size: 100%; } }
@media (min-width: 900px) { #vioMapBlock { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 0 1.2rem; align-items: start; } #vioMapBlock > .vio-map { grid-column: 1; grid-row: 1 / span 3; } #vioMapBlock > .vio-keys { grid-column: 2; grid-row: 1; margin-block-start: 0; } #vioMapBlock > .vio-hint { grid-column: 2; grid-row: 2; } }
/* full screen: the map block fills the screen - Fullscreen API where there is one, this same rule set pinned with position:fixed where there is not */
body.vio-fs-lock { overflow: hidden; }
/* the site's page zoom (style.css) multiplies viewport units too: without the division the block is taller than the screen by that factor */
#vioMapBlock.vio-fs { align-items: stretch; position: fixed; inset: 0; z-index: 1000; display: flex !important; flex-direction: column; box-sizing: border-box; inline-size: 100%; block-size: calc(100vh / var(--a11y-zoom, 1.3)); block-size: calc(100dvh / var(--a11y-zoom, 1.3)); margin: 0; padding: 8px; background: var(--bg, #fff); overflow: hidden; }
#vioMapBlock.vio-fs > .vio-map { flex: 1 1 auto; block-size: auto; min-block-size: 0; margin: 0; }
#vioMapBlock.vio-fs > .vio-keys { flex: none; max-block-size: calc(34vh / var(--a11y-zoom, 1.3)); max-block-size: calc(34dvh / var(--a11y-zoom, 1.3)); overflow: auto; margin: 6px 0 0; padding: .3rem .8rem; }
#vioMapBlock.vio-fs > .vio-keys > * { flex-shrink: 0; }   /* a short legend box scrolls; its lines are never squeezed over each other */
#vioMapBlock.vio-fs > .vio-hint { display: none; }
@media (min-width: 900px) { #vioMapBlock.vio-fs { flex-direction: row; gap: 10px; } #vioMapBlock.vio-fs > .vio-keys { flex: 0 0 20rem; max-block-size: none; margin: 0; align-self: stretch; } }
.vio-fsbtn { white-space: nowrap; font: inherit; font-weight: 600; font-size: .95rem; min-block-size: 44px; padding: 0 .9rem; cursor: pointer; color: #111; background: #fff; border: 0; border-radius: 4px; }
.vio-fsbox .vio-fsbtn { inline-size: auto; block-size: auto; }   /* the map library's 29px square would cut the words */
/* the way out of full screen must be seen at once (Ram 11-26: the page opens in it) */
#vioMapBlock.vio-fs .vio-fsbtn { color: #fff; background: #111; font-size: 1.1rem; line-height: 1; inline-size: calc(44px / var(--a11y-zoom, 1.3)); min-block-size: calc(44px / var(--a11y-zoom, 1.3)); padding: 0; }   /* an X only (Ram 11-26), small (Ram 11-27): 44px on screen, the least a finger needs */
#vioMapBlock.vio-fs .vio-fsbox { box-shadow: 0 0 0 2px #fff, 0 1px 6px rgba(0,0,0,.4); }
/* legend show/hide: phone full screen only (Ram 11-27) */
#vioMapBlock .vio-keybox { display: none; }
.vio-keybox .vio-keybtn { inline-size: auto; block-size: auto; min-block-size: calc(44px / var(--a11y-zoom, 1.3)); padding: 0 .7rem; white-space: nowrap; font-family: inherit; font-weight: 600; font-size: .8rem; line-height: 1.2; color: #111; background: #fff; border: 0; border-radius: 4px; cursor: pointer; }
@media (max-width: 899px) {
  #vioMapBlock.vio-fs .vio-keybox { display: block; }
  #vioMapBlock.vio-fs.vio-nokeys > .vio-keys { display: none; }
}

/* the big counter: it always shows what the year chips select */
.vio-film { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .2rem 1rem; padding: .5rem .1rem .2rem; text-align: center; }   /* centred, one block (Ram 11-26) */
.vio-fnum { font-size: 2.9rem; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; color: #b42318; }
.vio-fcap { font-size: 1.45rem; font-weight: 600; }
.vio-fnote { flex: 0 0 100%; font-size: .88rem; color: var(--muted); }
/* under-17 (Ram 11-25): a sky-blue ring round the town marker + a count badge in the same colour with dark digits (Ram 11-26); legend swatch; list tag text is plain */
.vio-ring { display: inline-block; flex: none; inline-size: 20px; block-size: 20px; border-radius: 50%; background: #fff; border: 4px solid #38bdf8; box-shadow: 0 0 0 1px rgba(0,0,0,.45); box-sizing: border-box; vertical-align: middle; }
.vio-keyu17 { align-items: center; }
.vio-mk.vio-u17 { box-shadow: 0 0 0 4px #38bdf8, 0 0 0 5px rgba(0,0,0,.45); }
.vio-mku { position: absolute; inset-block-start: -9px; inset-inline-end: -9px; min-inline-size: 18px; block-size: 18px; padding: 0 4px; border-radius: 9px; background: #38bdf8; color: #082f49; font: 700 12px/18px system-ui, sans-serif; text-align: center; border: 1px solid #fff; box-sizing: border-box; }

/* women (Ram 11-26): a pink ring + a pink count badge on the opposite corner; badge colour = ring colour; a town with both rings has sky blue inside, pink outside */
.vio-ring.vio-ringw { border-color: #db2777; }
.vio-keyw { align-items: center; }
.vio-mk.vio-w { box-shadow: 0 0 0 4px #db2777, 0 0 0 5px rgba(0,0,0,.45); }
.vio-mk.vio-u17.vio-w { box-shadow: 0 0 0 4px #38bdf8, 0 0 0 5px #fff, 0 0 0 9px #db2777, 0 0 0 10px rgba(0,0,0,.45); }
.vio-mk.vio-u17.vio-w:focus-visible { outline-offset: 11px; }
/* far zoom: thinner rings, so circles take less of the map (the reach used for merging is in violence.js measure()) */
.vio-mk.vio-sm.vio-u17 { box-shadow: 0 0 0 3px #38bdf8, 0 0 0 4px rgba(0,0,0,.45); }
.vio-mk.vio-sm.vio-w { box-shadow: 0 0 0 3px #db2777, 0 0 0 4px rgba(0,0,0,.45); }
.vio-mk.vio-sm.vio-u17.vio-w { box-shadow: 0 0 0 3px #38bdf8, 0 0 0 4px #fff, 0 0 0 7px #db2777, 0 0 0 8px rgba(0,0,0,.45); }
.vio-mk.vio-sm.vio-u17.vio-w:focus-visible { outline-offset: 9px; }
.vio-mkw { position: absolute; inset-block-end: -9px; inset-inline-start: -9px; min-inline-size: 18px; block-size: 18px; padding: 0 4px; border-radius: 9px; background: #db2777; color: #fff; font: 700 12px/18px system-ui, sans-serif; text-align: center; border: 1px solid #fff; box-sizing: border-box; }

/* the legend on a phone is dense (Ram 11-26): small rows; in full screen it gets up to 44% of the
   screen and the rest of its explanations is reached by scrolling; sizes are before the site's 1.3 page zoom. */
@media (max-width: 899px) {
  #vioMapBlock > .vio-keys { flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 0 .7rem; margin-inline: 0; padding: .25rem .5rem; }
  #vioMapBlock > .vio-keys > * { flex: 0 0 100%; }
  #vioMapBlock > .vio-keys > label.vio-keyrow { flex: 0 0 auto; gap: .3rem; min-block-size: 26px; }
  #vioMapBlock .vio-keyhead { font-size: .7rem; line-height: 1.25; }
  #vioMapBlock .vio-keyrow { gap: .4rem; min-block-size: 0; padding-block: 1px; font-size: .7rem; line-height: 1.2; }
  #vioMapBlock .vio-keynote { font-size: .66rem; }
  #vioMapBlock .vio-keyrow .vio-dot { inline-size: 14px; block-size: 14px; }
  #vioMapBlock .vio-keyrow .vio-ring { inline-size: 15px; block-size: 15px; border-width: 3px; }
  #vioMapBlock .vio-keyrow .vio-pie { display: inline-block; inline-size: 16px; block-size: 16px; }
  #vioMapBlock.vio-fs > .vio-keys > .vio-keynote { order: 1; }   /* the three colours and the two rings first: they show without scrolling */
  #vioMapBlock.vio-fs > .vio-keys { max-block-size: calc(44vh / var(--a11y-zoom, 1.3)); max-block-size: calc(44dvh / var(--a11y-zoom, 1.3)); margin-block-start: 4px; }
}
