/* The owner app's one stylesheet, linked after the brand's fonts.css and tokens.css. It uses the
   tokens and nothing else for colour and type (docs/brand.md), so light and dark both come from
   tokens.css. Every component here is on the style guide page, Pages/StyleGuide.cshtml. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* An author's display rule would otherwise beat the browser's, and show what is meant to be hidden. */
[hidden] {
  display: none !important;
}

/* The app's own widths. It is used mostly on desktop screens (ADR 0004), so the page is wide,
   while a line of text still stops at the brand's measure. */
:root {
  --app-width: 80rem;
  --app-gutter: clamp(1.25rem, 4vw, 3rem);
  --app-panel: 50rem;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--kh-color-bg);
  color: var(--kh-color-text);
  font-family: var(--kh-font-sans);
  font-size: var(--kh-size-body);
  line-height: var(--kh-leading-body);
}

/* Layout */

.wrap {
  width: 100%;
  max-width: calc(var(--app-width) + 2 * var(--app-gutter));
  margin-inline: auto;
  padding-inline: var(--app-gutter);
}

main {
  flex: 1;
  padding-block: 2.5rem 4rem;
}

/* The skip link moves focus here; the page itself needs no ring around it. */
main:focus {
  outline: none;
}

.narrow {
  max-width: 30rem;
}

/* A page with a side menu: the menu above the content on a narrow screen, and a column on the left
   of it on a wide one, where the menu stretches to the height of the row so that its rule runs
   beside the whole of the content. The content takes the rest of the page; its paragraphs keep the
   measure. */
.side-menu-layout {
  display: grid;
  gap: 2rem 3rem;
}

.side-menu-content {
  min-width: 0;
}

/* Changes waiting to be published, the same line in the same place above every page of a site but Overview. Less
   than a message, since it stays there for as long as the owner goes on making changes. */
.publish-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  max-width: var(--app-panel);
  margin: 0 0 1.5rem;
  padding: 0.5rem 1.25rem;
  border-left: 6px solid var(--kh-color-accent);
  background: var(--kh-color-surface);
}

.publish-banner p {
  max-width: none;
  margin: 0;
}

/* A bold value in the content is an email address or a web address, which a browser reads as one
   word, so a long one would push a phone's page sideways; it breaks wherever it has to. */
.side-menu-content strong,
.narrow strong {
  overflow-wrap: anywhere;
}

.side-menu {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--kh-color-rule);
}

.side-menu-heading {
  margin: 0 0 0.75rem;
  font-family: var(--kh-font-serif);
  font-size: var(--kh-size-h3);
  overflow-wrap: anywhere;
}

.side-menu-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-menu-list a[aria-current="page"] {
  font-weight: 600;
  text-decoration-thickness: 3px;
}

@media (min-width: 48rem) {
  .side-menu-layout {
    grid-template-columns: 13rem minmax(0, 1fr);
  }

  .side-menu {
    padding: 0.75rem 1.5rem 0 0;
    border-bottom: 0;
    border-right: 1px solid var(--kh-color-rule);
  }

  .side-menu-list {
    flex-direction: column;
  }
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background: var(--kh-color-surface);
  color: var(--kh-color-accent);
}

.skip-link:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header {
  border-bottom: 1px solid var(--kh-color-rule);
}

/* The padding and gap keep the wordmark's clear space, half its height on every side. */
.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1rem;
}

.wordmark,
.wordmark:hover {
  display: block;
  color: var(--kh-color-text);
}

.wordmark svg {
  display: block;
  width: auto;
  height: 1.75rem;
}

/* The links, after the owner's email address in the owner's navigation: on one line where they fit,
   and the links on the next where they don't. */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}

/* Quieter than the links, since it goes nowhere. An address has no spaces to break at, so a long one
   breaks where it has to rather than widen a phone's page. */
.site-nav-account {
  max-width: none;
  margin: 0;
  color: var(--kh-color-muted);
  overflow-wrap: anywhere;
}

.site-nav-list,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  max-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav-list a[aria-current="page"] {
  font-weight: 600;
  text-decoration-thickness: 3px;
}

.sign-out {
  margin: 0;
}

/* Sign-out is a form's button, which reads as one more link, in the navigation or in a sentence. */
.nav-button,
.link-button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--kh-color-accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.nav-button:hover,
.link-button:hover {
  color: var(--kh-color-accent-hover);
  text-decoration-thickness: 2px;
}

.site-footer {
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--kh-color-rule);
  color: var(--kh-color-muted);
}

.footer-links {
  margin-bottom: 1rem;
}

/* The company's registered details are small print, there for the law rather than to be read, so
   they are the one thing in the app set at small and the one paragraph that runs the page's width. */
.site-footer p {
  max-width: none;
  margin: 0;
  font-size: var(--kh-size-small);
}

/* Text */

h1,
h2,
h3 {
  margin: 0 0 1rem;
  font-weight: 600;
  line-height: var(--kh-leading-heading);
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--kh-font-display);
}

h3 {
  font-family: var(--kh-font-serif);
}

h1 {
  font-size: var(--kh-size-h1);
}

h2 {
  margin-top: 2.5rem;
  font-size: var(--kh-size-h2);
}

h3 {
  margin-top: 2rem;
  font-size: var(--kh-size-h3);
}

p,
ul,
ol {
  max-width: var(--kh-measure);
  margin: 0 0 1rem;
}

.page-heading {
  margin-bottom: 2rem;
}

.page-heading h1 {
  margin-bottom: 0.75rem;
}

/* The measure is in rem, so larger text needs a little more of it for the same line length. */
.lead {
  max-width: 42rem;
  font-size: var(--kh-size-lead);
}

a {
  color: var(--kh-color-accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--kh-color-accent-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--kh-color-focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* A site's web address and the button that copies it. The address has no spaces to break at, so a
   long one breaks wherever it has to rather than push a phone's page sideways. */
.site-address a {
  overflow-wrap: anywhere;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  margin: 0 0 0 0.25rem;
  padding: 0.25rem;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--kh-color-accent);
  vertical-align: middle;
  cursor: pointer;
}

.copy-button:hover {
  color: var(--kh-color-accent-hover);
  background: var(--kh-color-surface);
}

/* A tick in place of the copy icon for a moment, once the address is copied; the status says so too. */
.copy-button .copied-icon,
.copy-button[data-copied] .copy-icon {
  display: none;
}

.copy-button[data-copied] .copied-icon {
  display: block;
}

/* Buttons, on a button or on a link */

.button {
  display: inline-block;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--kh-color-accent);
  border-radius: 4px;
  background: var(--kh-color-accent);
  color: var(--kh-color-on-accent);
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--kh-color-accent-hover);
  background: var(--kh-color-accent-hover);
  color: var(--kh-color-on-accent);
}

.button-secondary {
  border-color: var(--kh-color-border);
  background: var(--kh-color-surface);
  color: var(--kh-color-accent);
}

.button-secondary:hover {
  border-color: var(--kh-color-accent-hover);
  background: var(--kh-color-surface);
  color: var(--kh-color-accent-hover);
}

/* A button that can't be pressed yet, such as Upload file while a file is on its way. */
.button:disabled,
.button:disabled:hover {
  border-color: var(--kh-color-rule);
  background: var(--kh-color-rule);
  color: var(--kh-color-muted);
  cursor: not-allowed;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5rem;
}

/* Form fields */

.field {
  max-width: var(--kh-measure);
  margin: 0 0 1.5rem;
}

.field-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.field-hint {
  margin: 0 0 0.5rem;
  color: var(--kh-color-muted);
}

.field-error {
  margin: 0 0 0.5rem;
  color: var(--kh-color-danger);
  font-weight: 600;
}

.field-invalid {
  padding-left: 1rem;
  border-left: 4px solid var(--kh-color-danger);
}

.input {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--kh-color-border);
  border-radius: 4px;
  background: var(--kh-color-surface);
  color: var(--kh-color-text);
  font: inherit;
}

.field-invalid .input {
  border-color: var(--kh-color-danger);
}

/* A box for text of several lines, as wide as a line of text, which the owner can make taller. */
.text-area {
  resize: vertical;
}

/* An input for a number of a few digits, as wide as it needs. */
.input-number {
  width: 6rem;
}

/* A list to choose one item from, in an input's look. That look takes away the browser's arrow, so this
   one is drawn in the text's colour; a forced-colours mode drops what is drawn, so there the browser's
   own comes back. */
.select {
  display: block;
  max-width: 100%;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  border: 2px solid var(--kh-color-border);
  border-radius: 4px;
  background-color: var(--kh-color-surface);
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    right 1.25rem center,
    right 0.875rem center;
  background-size: 0.375rem 0.375rem;
  background-repeat: no-repeat;
  color: var(--kh-color-text);
  font: inherit;
  appearance: none;
  cursor: pointer;
}

.field-invalid .select {
  border-color: var(--kh-color-danger);
}

@media (forced-colors: active) {
  .select {
    padding-right: 0.75rem;
    appearance: auto;
  }
}

/* A search over a list: its fields side by side on a wide screen, with the button level with their
   controls, and one above another on a narrow one. */
.search {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 1rem;
}

.search > .field:first-child {
  flex: 0 1 24rem;
}

.password-input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.password-input .input {
  flex: 1 1 12rem;
}

/* An input with the rest of its answer after it, such as the end of a web address. On a narrow
   screen the suffix goes under the input rather than squeezing it. */
.input-suffixed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.input-suffixed .input {
  flex: 1 1 10rem;
  width: auto;
  min-width: 0;
}

.input-suffix {
  font-weight: 600;
}

/* The line a check of the answer fills in. Empty, it takes no room, but stays a live region. */
.field-status {
  margin: 0.5rem 0 0;
}

.field-status:empty {
  margin: 0;
}

.field-status-ok,
.field-status-problem {
  font-weight: 600;
}

.field-status-ok {
  color: var(--kh-color-success);
}

.field-status-problem {
  color: var(--kh-color-danger);
}

.checkbox {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 0.75rem;
}

.checkbox-input {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  accent-color: var(--kh-color-accent);
}

.checkbox-label {
  cursor: pointer;
}

.checkbox-input:disabled,
.checkbox-input:disabled ~ .checkbox-label {
  color: var(--kh-color-muted);
  cursor: not-allowed;
}

.checkbox .field-hint {
  grid-column: 2;
  margin: 0.25rem 0 0;
}

/* Fields under one legend, such as checkboxes that each choose a part of one thing. */
.fieldset {
  min-width: 0;
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
}

.fieldset-legend {
  margin-bottom: 0.75rem;
  padding: 0;
  font-weight: 600;
}

.fieldset > .field-hint {
  max-width: var(--kh-measure);
  margin-bottom: 0.75rem;
}

.fieldset.field-invalid {
  padding-left: 1rem;
  border-left: 4px solid var(--kh-color-danger);
}

.fieldset > .field:last-child {
  margin-bottom: 0;
}

/* Things the owner puts in order, each a panel of its own fields with its Move up and Move down buttons:
   beside it on a wide screen, and under it on a narrow one. */
.reorder {
  max-width: var(--app-panel);
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.reorder-item {
  display: grid;
  gap: 1rem 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--kh-color-rule);
  border-radius: 4px;
  background: var(--kh-color-surface);
}

.reorder-item + .reorder-item {
  margin-top: 0.75rem;
}

.reorder-item-content {
  min-width: 0;
}

.reorder-item-content > :last-child {
  margin-bottom: 0;
}

.reorder-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (min-width: 40rem) {
  .reorder-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .reorder-buttons {
    flex-direction: column;
  }
}

/* A file input. The browser draws its button and the name of the file chosen; the button is
   given the look of a secondary button. */
.file-input {
  display: block;
  max-width: 100%;
  color: var(--kh-color-text);
  font: inherit;
}

.file-input::file-selector-button {
  min-height: 2.75rem;
  margin-right: 1rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--kh-color-border);
  border-radius: 4px;
  background: var(--kh-color-surface);
  color: var(--kh-color-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.file-input::file-selector-button:hover {
  border-color: var(--kh-color-accent-hover);
  color: var(--kh-color-accent-hover);
}

.field-invalid .file-input::file-selector-button {
  border-color: var(--kh-color-danger);
}

.file-input:disabled {
  color: var(--kh-color-muted);
}

.file-input:disabled::file-selector-button {
  border-color: var(--kh-color-rule);
  color: var(--kh-color-muted);
  cursor: not-allowed;
}

/* How far an upload has gone: a bar while the file is sent, and a moving one, with no value,
   while it is checked. The words say which. */
.upload-progress {
  max-width: var(--kh-measure);
  margin: 0 0 1.5rem;
}

.upload-status {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.upload-bar {
  display: block;
  width: 100%;
  height: 0.75rem;
  accent-color: var(--kh-color-accent);
}

/* The Photos page's folder: a box to choose a folder in or drop one on, which the script marks while a folder is
   dragged over it, then what it found in the folders chosen. A path from the owner's tree can be long and has no
   spaces to break at, so it breaks anywhere rather than widen the page. */
.drop-zone {
  max-width: var(--app-panel);
  margin: 0 0 1.5rem;
  padding: 1.5rem;
  border: 2px dashed var(--kh-color-border);
  border-radius: 4px;
}

.drop-zone > .field {
  margin-bottom: 0;
}

.drop-zone-over {
  border-color: var(--kh-color-accent);
  background: var(--kh-color-surface);
}

.photos-found {
  margin: 0 0 1.5rem;
}

.photos-found-count {
  font-weight: 600;
}

.photo-paths {
  max-width: var(--app-panel);
  padding-left: 1.25rem;
  overflow-wrap: anywhere;
}

.photo-path {
  overflow-wrap: anywhere;
}

.error-summary {
  max-width: var(--kh-measure);
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  border: 3px solid var(--kh-color-danger);
  border-radius: 4px;
  background: var(--kh-color-surface);
}

/* It takes the focus when the page loads, so it shows the ring however it got it. */
.error-summary:focus {
  outline: 3px solid var(--kh-color-focus);
  outline-offset: 2px;
}

.error-summary-title {
  margin: 0 0 0.75rem;
  font-family: var(--kh-font-serif);
  font-size: var(--kh-size-h3);
}

.error-summary-list {
  margin: 0;
  padding-left: 1.25rem;
}

.error-summary-list a,
.error-summary-list a:hover {
  color: var(--kh-color-danger);
  font-weight: 600;
}

/* Messages, the publishing status and the empty state: panels on the page */

.message,
.status {
  padding: 1rem 1.25rem;
  border: 1px solid var(--kh-color-rule);
  border-left: 6px solid var(--kh-color-border);
  border-radius: 4px;
  background: var(--kh-color-surface);
}

/* A panel fills the width it is given, up to --app-panel, and the text inside it fills the panel. */
.message,
.status-panel,
.empty-state {
  max-width: var(--app-panel);
  margin: 0 0 1.5rem;
}

.message p,
.status p,
.empty-state p {
  max-width: none;
}

/* The edge is on the inner element, which htmx swaps; it fills the panel so panels in a row match. */
.status-panel {
  display: flex;
  flex-direction: column;
}

.status {
  flex: 1;
}

.message-title,
.status-state,
.empty-state-title {
  margin: 0 0 0.5rem;
  font-family: var(--kh-font-serif);
  font-size: var(--kh-size-h3);
  font-weight: 600;
}

.message-body > :last-child,
.status-detail > :last-child,
.empty-state > :last-child {
  margin-bottom: 0;
}

.message-information {
  border-left-color: var(--kh-color-accent);
}

.message-success {
  border-left-color: var(--kh-color-success);
}

.message-success .message-title {
  color: var(--kh-color-success);
}

.message-warning {
  border-left-color: var(--kh-color-warning);
}

.message-warning .message-title {
  color: var(--kh-color-warning);
}

.message-error {
  border-left-color: var(--kh-color-danger);
}

.message-error .message-title {
  color: var(--kh-color-danger);
}

.status-running {
  border-left-color: var(--kh-color-accent);
}

.status-published {
  border-left-color: var(--kh-color-success);
}

.status-published .status-state {
  color: var(--kh-color-success);
}

.status-failed {
  border-left-color: var(--kh-color-danger);
}

.status-failed .status-state {
  color: var(--kh-color-danger);
}

/* A pulse beside "Publishing", which only decorates: the words say the state. */
.status-running .status-state::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.5em;
  border-radius: 50%;
  background: var(--kh-color-accent);
  vertical-align: middle;
  animation: kh-pulse 1.6s ease-in-out infinite;
}

@keyframes kh-pulse {
  50% {
    opacity: 0.2;
  }
}

.status-refresh {
  margin: 0.75rem 0 0;
}

.empty-state {
  padding: 2rem 1.5rem;
  border: 2px dashed var(--kh-color-rule);
  border-radius: 4px;
}

/* Words from the owner's published site as visitors will read them, such as its footer, set apart from the page
   around them. Its links only look like links: the owner is reading, not visiting. A long name or email address
   breaks rather than widen the page. */
.preview {
  max-width: var(--app-panel);
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--kh-color-rule);
  border-radius: 4px;
  background: var(--kh-color-surface);
  overflow-wrap: anywhere;
}

.preview p {
  max-width: none;
}

.preview > :last-child {
  margin-bottom: 0;
}

.preview-link {
  color: var(--kh-color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Panels side by side on a wide screen, and one above another on a narrow one. */
.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
  margin: 0 0 1.5rem;
}

.columns > * {
  max-width: none;
  margin: 0;
}

/* Numbers on a dashboard, three to a row on a wide screen and one on a narrow one. A tile that is a link
   says so by its label, underlined as any link is, and by its edge under the pointer. */
.tiles {
  display: grid;
  gap: 1.5rem;
  margin: 0 0 1.5rem;
}

@media (min-width: 48rem) {
  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--kh-color-rule);
  border-radius: 4px;
  background: var(--kh-color-surface);
  color: var(--kh-color-text);
  text-decoration: none;
}

a.tile:hover {
  border-color: var(--kh-color-accent);
  color: var(--kh-color-text);
}

.tile-number {
  font-family: var(--kh-font-display);
  font-size: var(--kh-size-h1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: var(--kh-leading-heading);
}

a.tile .tile-label {
  color: var(--kh-color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a.tile:hover .tile-label {
  color: var(--kh-color-accent-hover);
  text-decoration-thickness: 2px;
}

/* Tables */

/* Positioned, so that a visually hidden label inside it is clipped with the table rather than widening the page. */
.table-wrap {
  position: relative;
  margin: 0 0 1.5rem;
  overflow-x: auto;
}

.table {
  border-collapse: collapse;
}

.table caption {
  padding-bottom: 0.5rem;
  font-weight: 600;
  text-align: left;
}

.table th,
.table td {
  padding: 0.625rem 1.5rem 0.625rem 0;
  border-bottom: 1px solid var(--kh-color-rule);
  text-align: left;
  vertical-align: top;
}

.table thead th {
  border-bottom: 2px solid var(--kh-color-border);
}

.table th:last-child,
.table td:last-child {
  padding-right: 0;
}

.table .numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* A time in a table is kept short and on one line; its full form is its title. */
.table time {
  white-space: nowrap;
}

/* The arrow beside the column a table is sorted by only decorates: aria-sort says the same to a screen
   reader, so the arrow is given no words of its own where the browser allows. */
.sort-link::after {
  display: inline-block;
  margin-left: 0.375em;
  font-size: 0.75em;
}

[aria-sort="ascending"] > .sort-link::after {
  content: "\25B2";
  content: "\25B2" / "";
}

[aria-sort="descending"] > .sort-link::after {
  content: "\25BC";
  content: "\25BC" / "";
}

/* A record's facts: each label beside its value on a wide screen, and above it on a narrow one. A value
   such as an email address or a web address has no spaces to break at, so it breaks where it has to. */
.facts {
  max-width: var(--app-panel);
  margin: 0 0 1.5rem;
}

.fact {
  padding-block: 0.625rem;
  border-bottom: 1px solid var(--kh-color-rule);
}

.fact dt {
  font-weight: 600;
}

.fact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 40rem) {
  .fact {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 1.5rem;
  }
}

/* Pages of a long list */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1.5rem;
}

.pager-position {
  margin: 0;
}

.pager-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* htmx's own indicator styles are off (ADR 0004), so its two classes are defined here. */

.htmx-indicator {
  opacity: 0;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
  transition: opacity 200ms ease-in;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
