/* Cultural Variation in Gender: site styles */
:root {
  --navy: #1f3864;
  --text: #1f1f1f;
  --muted: #4a4a4a;
  --line: #c9c9c9;
  --pale: #deeaf6;
  --header-row: #c6d9f1;
  --link: #0062a8;
  --focus: #ffbf47;
  font-family: Aptos, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; background: #fff; }
a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible,
.leaflet-marker-icon:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: #fff; padding: .5rem 1rem; z-index: 2000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* Header */
.site-header { background: var(--pale); padding: 1.5rem 0 1.25rem; margin-bottom: 1rem; }
h1 { color: var(--navy); margin: 0 0 .25rem; font-size: 2rem; line-height: 1.2; }
h2 { color: var(--navy); font-size: 1.4rem; margin: 2rem 0 .5rem; }
h3 { color: var(--navy); font-size: 1.1rem; margin: 1.25rem 0 .25rem; }
.byline { margin: 0 0 .75rem; color: var(--muted); }
.intro { margin: 0; max-width: 70ch; }

/* Filters */
.controls { margin-bottom: .75rem; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: .5rem .9rem .75rem; margin: 0; }
legend { font-weight: 700; padding: 0 .3rem; }
.filter { display: inline-flex; align-items: center; gap: .4rem; margin: .35rem 1.25rem .1rem 0; cursor: pointer; }
.filter input { width: 1.1rem; height: 1.1rem; margin: 0; }
.swatch {
  display: inline-block; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #333;
}
.count { margin: .5rem 0 0; color: var(--muted); }

/* Map */
#map { height: 62vh; min-height: 380px; border: 1px solid var(--line); border-radius: 6px; }
.pin span {
  display: block; width: 18px; height: 18px; margin: 1px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #333, 0 1px 3px rgba(0,0,0,.45);
}
.leaflet-popup-content { font-family: inherit; font-size: .95rem; line-height: 1.45; margin: 12px 16px; }
.popup h2 { font-size: 1.15rem; margin: 0 0 .1rem; }
.popup .term { margin: 0 0 .5rem; color: var(--muted); font-style: italic; }
.popup p { margin: 0 0 .6rem; }
.popup h3 { font-size: .95rem; margin: .75rem 0 .25rem; }
.popup ul, .popup ol { margin: 0; padding-left: 1.2rem; }
.popup li { margin-bottom: .3rem; }
.kinds { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .6rem; padding: 0; list-style: none; }
.kind {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem;
  border: 1px solid var(--line); border-radius: 999px; padding: .05rem .55rem;
}
.kind .swatch { width: .75rem; height: .75rem; border-width: 1px; flex-shrink: 0; }
.popup .kinds, details .kinds, td .kinds { padding-left: 0; }
.sources li { font-size: .88rem; }

/* List of places */
.hint { margin: 0 0 .75rem; color: var(--muted); }
.search { display: block; font-weight: 700; margin-bottom: .75rem; }
.search input {
  display: block; width: 100%; max-width: 30rem; margin-top: .3rem; padding: .45rem .6rem;
  font: inherit; border: 1px solid #767676; border-radius: 4px;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #808080; padding: .5rem .6rem; text-align: left; vertical-align: top; }
thead th { background: var(--header-row); }
thead th button {
  font: inherit; font-weight: 700; color: var(--text); background: none; border: 0; padding: 0;
  cursor: pointer; text-align: left;
}
thead th button::after { content: " ↕"; color: var(--muted); font-weight: 400; }
th[aria-sort="ascending"] button::after { content: " ▲"; color: var(--text); }
th[aria-sort="descending"] button::after { content: " ▼"; color: var(--text); }
.show-on-map {
  display: block; margin-top: .3rem; font: inherit; font-size: .88rem; color: var(--link);
  font-weight: 400; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer;
}
td .kinds { margin: 0; }
details summary { cursor: pointer; color: var(--link); }
details[open] summary { margin-bottom: .4rem; }
details p { margin: 0 0 .5rem; }
details h4 { font-size: .95rem; margin: .5rem 0 .2rem; color: var(--navy); }
details ul, details ol { margin: 0 0 .4rem; padding-left: 1.2rem; }
.no-results { color: var(--muted); font-style: italic; }

.about { max-width: 75ch; }
.notice { background: #fff4e5; border: 1px solid #e0a040; padding: .75rem; border-radius: 4px; }

.site-footer { border-top: 1px solid var(--line); margin-top: 2.5rem; padding: 1rem 0 2rem; color: var(--muted); font-size: .9rem; }

@media (max-width: 600px) {
  h1 { font-size: 1.6rem; }
  #map { height: 55vh; }
}
@media print {
  #map, .controls, .search, .skip-link, .show-on-map { display: none; }
  details > *:not(summary) { display: block; }
}
