/* What the exchange needs on top of the site's own stylesheet, which arrives from the
   marketing site and owns the type, the colors, the header, the footer and the buttons. Only
   what is particular to a catalog is here: cards, a search box, filters and a form. Every color,
   step of spacing, text size and corner is named from that sheet's tokens rather than restated,
   so the two halves of deaktech.com cannot drift apart. */

.ex-shell {
  align-items: stretch;
}

/* One reading column, the same width as the home page bands use, so an exchange page and a
   marketing page line up when a visitor moves between them. */
.ex-column {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.ex-column-narrow {
  width: min(640px, 100%);
}

.ex-heading {
  color: var(--brand-blue);
  font-size: 32px;
  margin: var(--space-s) 0 var(--space);
}

.ex-prose {
  font-size: var(--text-prose);
  line-height: 1.6;
  margin: 0 0 var(--space);
  white-space: pre-line;
}

/* The find band. The search box is the first thing on the home page, because a visitor who
   knows what they want should not have to read anything first. */
/* The whole exchange is on this band now - the name, the search, the categories and what they
   answer with - so it is spaced to the standard gap rather than to the marketing bands' 48px.
   The name starts near the top and the first rows of the grid are reachable without scrolling,
   which is the point of having put them on one page. */
.ex-band-find {
  background: var(--paper);
  padding-top: var(--space);
  padding-bottom: var(--space);
}

/* What the exchange is and the two ways into it are one line: the name and its sentence on the
   left, and beside them the two things a visitor can do about it. Set as a row rather than
   stacked, so the search below is the next thing down the page and the categories after it,
   instead of the visitor scrolling past buttons to reach either. Wraps on a narrow screen, where
   there is no room for two columns and the buttons drop under the name they belong to. */
.ex-find-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  margin: 0 0 var(--space);
}

/* The name and its sentence take the room left over, down to the width the sentence needs to
   read as a sentence. Below that the row wraps rather than squeezing the words into a column. */
.ex-find-titles {
  flex: 1 1 420px;
}

/* Inside the row the buttons carry no spacing of their own: the row places them. On a card the
   same class is pushed to the bottom by its own margin, which here would drop them off the line. */
.ex-find-head .ex-card-actions {
  margin: 0;
  padding-top: 0;
}

/* The name and what the place is for are one statement, so they are set as one: the same weight,
   and touching, with the line height doing the separating rather than a margin. Anything between
   them reads as the name being a heading over a sentence instead of part of it. */
.ex-find h1 {
  color: var(--brand-blue);
  font-size: 34px;
  line-height: 1.2;
  margin: 0;
}

/* The trademark is a claim, not part of the name, so it is set lighter and smaller than the name
   it follows, raised to sit just under the tops of the letters, and pulled in tight against the
   last of them: the space the font leaves after a lowercase letter is judged for another letter,
   and is too wide for a mark this size. Every number is in em, which is what makes one set of
   them right at every heading size, including the smaller one narrow screens use. */
.ex-mark {
  font-size: 0.55em;
  font-weight: 400;
  vertical-align: 0.45em;
  margin-left: -0.18em;
}

.ex-tagline {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

/* The field and the button are large, because the search is the one thing on the home page a
   visitor is meant to reach for. Nothing is drawn around the pair: the field carries its own
   outline, which is what shows where to type, and a rectangle around both of them only fenced off
   what was already the most obvious thing on the page. A results page carries the same search in
   the narrow form, where the results below it are what deserves the room. */
.ex-search {
  margin: 0 0 var(--space);
}

/* What the field searches is written in the field itself, where someone about to type is already
   looking. The label stays for anything reading the page aloud, which has no placeholder to read. */
.ex-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ex-search-row {
  display: flex;
  gap: var(--space-m);
  flex-wrap: wrap;
}

.ex-search-input {
  flex: 1 1 380px;
  font-family: inherit;
  font-size: 22px;
  padding: var(--space-l) 22px;
  border: 2px solid var(--line-control);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
}

.ex-search .ex-button {
  font-size: 20px;
  padding: var(--space-l) 40px;
}

.ex-search-input:focus {
  outline: none;
  border-color: var(--brand-blue);
}

/* How a button looks is not decided here. It is the same button the rest of the site uses, and
   'ex-button' says only that it is one, which the two rules below need in order to say where a
   button on the exchange is wider or spaced differently than it is elsewhere. */
.ex-button-wide {
  width: 100%;
}

/* A second action under the first. The gap is what makes it a second action rather than the
   bottom half of the first one, which is how they read with their edges touching. */
.ex-button-wide + .ex-button {
  margin-top: var(--space-s);
}

/* The categories. Each one is a way in for a visitor who does not have a word to search for,
   which is most of them on a first visit. The smallest a box may be is set so four of them sit
   across the reading column: the set takes the column's whole width however many there are, and
   adding a category makes the boxes no wider than the column. */
.ex-categories {
  list-style: none;
  margin: 0 0 var(--space);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space);
}

.ex-category {
  display: block;
  height: 100%;
  padding: var(--space);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}

.ex-category:hover {
  border-color: var(--brand-blue);
}

/* The category the list is narrowed to. Marked by its outline, which is what says "this is the
   one" everywhere else, and tinted so it still reads as chosen once the pointer has moved off it
   and the hover color has gone. */
.ex-category-on {
  border-color: var(--brand-blue);
  background: var(--shade-chosen);
}

.ex-category-name {
  display: block;
  font-weight: 700;
  font-size: 18px;
  color: var(--brand-blue);
  margin-bottom: 6px;
}

.ex-category-blurb {
  display: block;
  font-size: var(--text-control);
  line-height: 1.45;
}

/* Listings, wherever they are listed. */
.ex-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space);
  margin: 0 0 var(--space-l);
}

.ex-card {
  display: flex;
  flex-direction: column;
  padding: var(--space);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.ex-card-name {
  font-size: 19px;
  margin: 0 0 6px;
}

.ex-card-name a {
  color: var(--brand-blue);
  text-decoration: none;
}

.ex-card-name a:hover {
  text-decoration: underline;
}

.ex-card-seller {
  font-size: var(--text-control);
  margin: 0 0 var(--space-m);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ex-card-seller a {
  color: inherit;
  font-weight: 700;
}

.ex-card-where {
  color: var(--ink-quiet);
}

.ex-card-note {
  font-size: var(--text-control);
  margin: 0 0 var(--space-m);
  color: var(--ink-quiet);
}

/* Facts a buyer decides on: laid out as a list of terms so a screen reader reads the label
   with its value, and so a missing fact simply does not appear. */
.ex-card-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-m);
  margin: 0 0 var(--space-m);
  font-size: var(--text-control);
}

.ex-card-facts dt {
  font-weight: 700;
  color: var(--ink-quiet);
}

/* A value keeps the lines the seller typed. Most of these are a few words, but the ones they
   write themselves are paragraphs, and a page that runs their paragraphs together shows them
   something they did not write. */
.ex-card-facts dd {
  margin: 0;
  white-space: pre-line;
}

.ex-card-actions {
  margin: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  padding-top: var(--space-m);
}

/* The logo stands alone at the top of the page, and it is given a fixed height rather than a
   fixed width: a wordmark and a round emblem are different shapes, and height is what decides
   whether either of them towers over the page it introduces. */
.ex-company-head {
  margin: var(--space-s) 0 var(--space);
}

/* The company's name, which is a value in the list of its facts and is drawn as one. It stays
   a heading in the markup because it is what the page is about; nothing about being that needs
   it to look different from the values beside it. */
.ex-company-title {
  font: inherit;
  margin: 0;
}

.ex-logo {
  height: 72px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

/* A quiet line beside something, for what a reader wants to know before acting and would
   not read if it were the size of the thing it is about. Held to about half the reading column,
   so it sits as a short block under what it belongs to rather than a single line drawn all the
   way across the page, which reads as the page talking rather than as a note. */
.ex-side-note {
  display: block;
  max-width: 46ch;
  font-size: var(--text-note);
  color: var(--ink-quiet);
  line-height: 1.45;
  margin: var(--space-xs) 0 var(--space-m);
}

.ex-column > h2 {
  color: var(--brand-blue);
  font-size: 22px;
  margin: var(--space-xl) 0 var(--space-m);
}

.ex-detail-side {
  padding: var(--space);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  align-self: start;
}

/* The same panel standing at the left margin instead of in a column, on a page that has no
   second column. Wider than it is as a column, because here it carries the company's
   description as well as its facts, and a paragraph in the width of a facts column is a
   paragraph two or three words to a line. */
.ex-detail-side-alone {
  max-width: 620px;
  margin: var(--space) 0 var(--space-2xl);
}

/* What a search answered with. The widths are the room each column is given rather than a
   measurement of the page, so they hold their proportions at any width and a long offering wraps
   instead of pushing the rest of the row off the screen. */
.ex-listings {
  table-layout: fixed;
}

.ex-listings-offering {
  width: 80ch;
}

.ex-listings-provider {
  width: 30ch;
}

/* Room for the whole heading, its sort mark and the cell's own padding, rather than for the date
   underneath it, which is the shorter of the two. */
.ex-listings-updated {
  width: 20ch;
}

/* A heading names its column and has to be read as a whole to do it, so it is never broken across
   two lines. The values below are free to wrap: an offering can run to a hundred characters and
   forcing that onto one line would push the rest of the row off the page. */
.ex-listings th {
  white-space: nowrap;
}

/* A heading is the control that sorts by its column, so it reads as the heading it already was
   rather than as a link into somewhere else. The mark is what says the list is in this column's
   order, and it is given room whether or not it is there, so turning a column around does not
   shift the heading beside it. */
.ex-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.ex-sort:hover {
  color: var(--brand-blue);
}

.ex-sort-mark {
  font-size: 11px;
  min-width: 11px;
}

/* Where the next run is asked for. It holds nothing until there is something to say, so it takes
   only the room a message would need if one ever appears. */
.ex-listings-more {
  margin: 0 0 var(--space-xl);
}

/* Said the way the application says it, so nothing found reads the same to somebody who works in
   both halves of DeakTech. */
/* What the grid is showing, said above it: the words that were searched for, or the category
   that was chosen. */
.ex-listings-heading {
  margin: 0 0 var(--space);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--brand-blue);
}

.ex-listings-empty {
  text-align: center;
  color: var(--ink-quiet);
  font-style: italic;
  padding: var(--space-xl) var(--space-m);
}

/* Forms: the quote request, and the loader. */
.ex-form {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-l);

  /* Six more than the 16 that separates everything else above it, so that it does not read as
     sitting closer. Text carries a little empty space above and below its letters, and two
     paragraphs 16 apart therefore look about 27 apart; a border has none, so the same 16 to this
     box looked 21. This buys back the difference, and collapses with the margin below whatever
     introduces the form, so it is the gap rather than an addition to it. */
  margin-top: 22px;
}

/* A form of a few short fields, such as a span of dates to read a report for, is only as wide as
   they are, rather than a box across the column with the fields at one end of it. */
.ex-form-fit {
  width: fit-content;
}

/* A form of one line of words, such as a question asked of a report, takes half the column:
   room for a sentence without a box running the width of the page. */
.ex-form-half {
  width: 50%;
}

.ex-field {
  margin: 0 0 var(--space);
}

/* A field that asks what else to call something is not a question until the reader has said their
   answer is not on the list, so it is off the form until they do. The form is asked what is
   chosen rather than this being switched on by script, which is what keeps it right when the page
   comes back with the choice already made and the answer already filled in. Which option means
   other is marked by the page that renders the list, so no id is written here.

   It matches the marker's value and not merely its presence, because the page renders the
   attribute empty on the options that are not other rather than leaving it off, and every one of
   them would otherwise answer to this. */
.ex-form:not(:has(option[data-other="true"]:checked)) .ex-field-other {
  display: none;
}

/* A label with something on the far side of it that qualifies the field rather than names it,
   which so far means how much of a limit is left. A row rather than the label floated against,
   so that a label too long for the width wraps instead of running underneath it. */
.ex-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-s);
}

.ex-label {
  display: block;
  font-size: var(--text-small);
  font-weight: 700;
  margin-bottom: 6px;
}

.ex-input,
.ex-textarea,
.ex-select {
  width: 100%;
  font-family: inherit;
  font-size: var(--text);
  padding: 10px var(--space-m);
  border: 2px solid var(--line-control);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
}

.ex-input:focus,
.ex-textarea:focus,
.ex-select:focus {
  outline: none;
  border-color: var(--brand-blue);
}

/* A date is short whatever column it sits in, so it is given the width the application gives one
   rather than the whole column. */
.ex-input[type="date"] {
  max-width: 380px;
}

.ex-input-code {
  max-width: 180px;
  font-size: 22px;
  letter-spacing: 0.2em;
}

.ex-hint {
  display: block;
  font-size: var(--text-note);
  color: var(--ink-quiet);
  margin-top: 6px;
}

/* How much of a field's limit has been used, at the top right of the box it belongs to, which is
   where a reader who is running out of room looks for it. It reads as a hint and is one, so only
   what the position needs is said here: the margin that puts a hint below its field is wrong
   above one, and the number must not be allowed to break across two lines. */
.ex-count {
  margin-top: 0;
  white-space: nowrap;
}

/* What went wrong, where the person who has to fix it will see it: at the top of what they
   were doing, in words that say what to do next. */
.ex-trouble {
  font-size: var(--text);
  line-height: 1.5;
  color: var(--trouble);
  background: var(--trouble-shade);
  border: 2px solid var(--trouble);
  border-radius: var(--radius);
  padding: var(--space-m) 14px;
  margin: 0 0 var(--space);
}

/* Nothing wrong is not something to say. A validation summary is on the page before there is
   anything in it, and it is never empty even then, because it is rendered around a list that has
   nothing in it - so the class the framework marks it with while everything is fine is what says
   so, and :empty alone left an outlined red box sitting under the heading of a form nobody had
   filled in yet. */
.ex-trouble:empty,
.ex-trouble.validation-summary-valid {
  display: none;
}

.ex-trouble ul {
  margin: 0;
  padding-left: var(--space-l);
}

/* A table of what has been loaded, on the internal pages only. */
.ex-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  font-size: var(--text-control);
  margin: 0 0 var(--space-xl);
}

.ex-table th,
.ex-table td {
  text-align: left;
  padding: 10px var(--space-m);
  border-bottom: 2px solid var(--shade);
}

.ex-table th {
  color: var(--ink-quiet);
}

/* A moment reads as one thing, so its date, time and zone are never broken across lines. */
.ex-table .ex-when {
  white-space: nowrap;
}

/* Something to do about one row of a table, opened from a small link under it so the row reads
   as a row until somebody wants it. What opens is one box: the field, its button beside it, and
   whatever the field found below them, so the answer is in the same place as the question. */
.ex-tool {
  margin-top: var(--space-s);
}

/* Read as a link, so it carries none of the marker a disclosure would otherwise show. */
.ex-tool summary {
  display: inline;
  list-style: none;
  color: var(--brand-blue);
  font-size: var(--text-small);
  font-weight: 700;
  cursor: pointer;
}

.ex-tool summary::-webkit-details-marker {
  display: none;
}

.ex-tool summary:hover {
  text-decoration: underline;
}

.ex-tool-box {
  min-width: 280px;
  margin-top: var(--space-s);
  padding: var(--space-m);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.ex-tool-box .ex-field {
  margin-bottom: var(--space-m);
}

.ex-tool-row {
  display: flex;
  gap: var(--space-s);
}

.ex-tool-row .ex-input {
  flex: 1;
  min-width: 0;
}

.ex-tool-empty {
  margin: var(--space-m) 0 0;
  color: var(--ink-quiet);
}

/* What a search found, each one a choice: the name to know it by, and below it what tells two
   of the same name apart. */
.ex-picks {
  list-style: none;
  margin: var(--space-m) 0 0;
  padding: 0;
  border-top: 2px solid var(--shade);
}

.ex-pick {
  display: block;
  width: 100%;
  padding: 10px var(--space-s);
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-bottom: 2px solid var(--shade);
  cursor: pointer;
}

.ex-pick:hover,
.ex-pick:focus-visible {
  background: var(--shade);
  outline: none;
}

.ex-pick-name {
  display: block;
  font-weight: 700;
  color: var(--brand-blue);
}

.ex-pick-more {
  display: block;
  font-size: var(--text-small);
  color: var(--ink-quiet);
}

@media (max-width: 768px) {
  .ex-heading,
  .ex-find h1 {
    font-size: 26px;
  }

  /* A fitted form goes by the width a date box says it needs, and iPhone draws one wider than it
     says, so there the box is given a width that holds a date and the form fits to that. */
  .ex-form-fit .ex-input[type="date"] {
    width: 12em;
  }

  .ex-form-half {
    width: auto;
  }
}
