/* The Research page: the lab's research areas as tiles. Mobile first: one
   column on phones, two from 640 px, three from 1100 px (the wide layout,
   which the 80% zoom of tokens.css makes about 1375 px wide). The title is the
   link of the tile and its ::after covers the whole tile; the topic chips, below
   a rule at the foot, sit above it and link to the publications on each topic
   (no link inside another).
   The page of one area (research_area.html) is at the end. */

.research-page { padding-top: 20px; padding-bottom: 48px; }

.area-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.area-card { display: flex; min-width: 0; }
.area-card article {
  position: relative; display: flex; flex: 1; flex-direction: column; min-width: 0;
  border: 1.5px solid var(--line); background: var(--white);
}
.area-card:has(.area-link):hover article { border-color: var(--blue); }
.area-body { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 16px 16px 16px; }
/* Reached from /research/#face-recognition (or a link with the tile's id). */
.area-card:target article { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }

/* The cover: the editor's 16:9 crop of the picture, as wide as the card, or the generated
   bars of the datasets, coloured by the tile's first topic. The box has its shape before the
   picture arrives. The bars are sized from the box (container units; the px are for old browsers). */
.area-cover {
  --bar: var(--v-bar); position: relative; display: block; flex: none; aspect-ratio: 16 / 9; overflow: hidden;
  container-type: size; background: var(--v-bg); border-bottom: 1.5px solid var(--v-bd);
}
.area-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.area-cover:has(img) { background: var(--tint); border-color: var(--tint); }
.area-cover .vbars { --bw: 30px; --gap: 14px; --sink: -16px; --cap-gap: 10px; --bw: 15cqh; --gap: 7cqh; --sink: -8cqh; --cap-gap: 5cqh; }

.area-card h2 { margin: 0; font-size: 24px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.area-text { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.area-link { color: inherit; text-decoration: none; }
.area-link::after { content: ""; position: absolute; inset: 0; }
.area-link:hover { color: var(--blue); }
.area-link:focus-visible { outline: none; }
.area-link:focus-visible::after { outline: var(--focus); outline-offset: 3px; }
.area-foot { display: flex; flex-direction: column; margin-top: auto; padding-top: 16px; }
.area-topics { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; }
.area-go + .area-topics { margin-top: 12px; padding-top: 14px; border-top: 1.5px solid var(--line); }
.area-foot > .area-topics:first-child { padding-top: 0; }
.area-topics a.chip:focus-visible { outline: var(--focus); outline-offset: 2px; }
.area-topics .chip { max-width: 100%; white-space: normal; }
.area-page-topics a.chip:focus-visible { outline: var(--focus); outline-offset: 2px; }
.area-go { align-self: flex-end; font-size: 22px; line-height: 1; font-weight: 700; color: var(--blue); }
.area-card:has(.area-link):hover .area-go { transform: translateX(2px); }

/* Nothing published yet. */
.area-empty { max-width: 560px; padding: 32px 0 8px; }
.area-empty h2 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 700; }
.area-empty p { margin: 8px 0 0; color: var(--muted); }
.area-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.area-empty-actions .button { flex: 1 1 220px; justify-content: space-between; min-height: 48px; padding: 0 18px; }

@media (min-width: 640px) {
  .area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .area-body { padding: 20px 22px 20px; }
}

@media (min-width: 900px) {
  .research-page { padding-top: 32px; padding-bottom: 88px; }
  .area-card h2 { font-size: 28px; }
  .area-text { margin-top: 10px; font-size: 16px; }
  .area-empty { padding-top: 48px; }
  .area-empty-actions .button { flex: none; justify-content: center; gap: 10px; }
}

@media (min-width: 1100px) {
  .area-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .area-body { padding: 24px 26px 22px; }
}

/* The page of one area: the cover at the width of the text, the Markdown text
   (the .res-prose rules of resources.css) and the topics, which link to the publications. */
.area-page { padding-top: 24px; padding-bottom: 48px; }
.area-page-main { min-width: 0; max-width: 840px; }
.area-page .area-cover { border: 1.5px solid var(--v-bd); }
.area-page .area-cover:has(img) { border-color: var(--tint); }
.area-prose { margin-top: 28px; }
.area-page-topics { margin-top: 36px; }
.area-page-topics h2 { margin: 0 0 12px; padding-top: 12px; border-top: 2px solid var(--ink); font-size: 22px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.area-page .back-button { margin-top: 36px; }

@media (min-width: 900px) {
  .area-page { padding-top: 48px; padding-bottom: 88px; }
  .area-prose { margin-top: 40px; }
  .area-page-topics { margin-top: 48px; }
  .area-page-topics h2 { font-size: 26px; }
  .area-page .back-button { display: inline-flex; width: auto; padding: 0 20px; }
}
