/* Shared styles for every page, loaded after each page's own: alignment of boxed text, arrows and icons, and the marker on links that leave the site.

   Boxes: text in a box uses the font's own line height, so it sits dead centre. With the body's
   1.65 line height the browser rounds the text baseline to a whole pixel, which left text up to
   1px high, by a different amount in each box. The height that removes goes back in as padding
   (--box-lh-gap), so boxes keep their size. Each box sets its vertical padding as --box-py.
   Icons beside text (contact rows, store buttons) are centred by their row, so they line up once the
   text is centred too. Icon drawings themselves are centred in their 24x24 frame.

   Arrows: the arrow character is not in the site fonts, so devices drew it from a system font,
   sitting low and looking different on each phone. .arrow now draws one arrow, the height of a
   capital letter and resting on the baseline, so it lines up with the text everywhere. */

:root { --box-lh-gap: 0.17em; }

.profile-link, .paper-data-link, .paper-link, .store-btn, .tag-filter, .tag-filter-all, .tl-tag, .phase-chip,
.contact-label, .contact-value {
  line-height: normal;
  padding-top: calc(var(--box-py, 0px) + var(--box-lh-gap));
  padding-bottom: calc(var(--box-py, 0px) + var(--box-lh-gap));
}

.arrow {
  display: inline-block;
  width: 0.9em;
  height: 0.7em;
  vertical-align: baseline;
  overflow: hidden;
  white-space: nowrap;
  text-indent: 2em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14'%3E%3Cpath d='M1.5 7h14.5M10.5 1.5 16 7l-5.5 5.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14'%3E%3Cpath d='M1.5 7h14.5M10.5 1.5 16 7l-5.5 5.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Links that leave the site: a small out arrow, and on hover the colour of where they go (--ext).
   .ext adds the arrow at the top right of its text, like a superscript: on the link itself in the nav and footer,
   or on a span round the link text inside cards and buttons. .ext-card is a whole card that leaves. Colours have a darker version for light mode. */
:root { --ext: var(--accent); }
.to-substack { --ext: #ff6719; }
.to-feedings { --ext: #0083b8; }
.to-benchcalc { --ext: #0f766e; }
.to-scholar { --ext: #1a73e8; }
.to-orcid { --ext: #5f8a1a; }
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) .to-feedings { --ext: #00baff; }
  :root:not(.light-mode) .to-benchcalc { --ext: #2dd4bf; }
  :root:not(.light-mode) .to-scholar { --ext: #8ab4f8; }
  :root:not(.light-mode) .to-orcid { --ext: #a6ce39; }
}
:root.dark-mode .to-feedings { --ext: #00baff; }
:root.dark-mode .to-benchcalc { --ext: #2dd4bf; }
:root.dark-mode .to-scholar { --ext: #8ab4f8; }
:root.dark-mode .to-orcid { --ext: #a6ce39; }

.ext::after {
  content: '';
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.2em;
  vertical-align: 0.35em;
  background-color: currentColor;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 9 9 3M4 3h5v5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 9 9 3M4 3h5v5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ext:hover::after, a:hover > .ext::after, a:hover > * > .ext::after { opacity: 1; }
.link-strip-item .ext::after, .paper-link .ext::after, .profile-link .ext::after { opacity: 1; }
.link-strip-item .ext::after { background-color: var(--accent); }
.ext-card:hover .ext::after { background-color: var(--ext); }
.nav-link.ext:hover { color: var(--ext); background: color-mix(in srgb, var(--ext) 12%, transparent); }
.footer-links a.ext:hover { color: var(--ext); }
.ext-card:hover { background: color-mix(in srgb, var(--ext) 12%, transparent) !important; }
.ext-card:hover h3 { color: var(--ext); }
.profile-link[class*="to-"]:hover { color: var(--ext); border-color: var(--ext); background: color-mix(in srgb, var(--ext) 12%, transparent); }
