/*
  Helvetic Ruby posts (layout: source/layouts/series/helvetic-ruby.erb).
  The blog's own neutral colours; only links and the year tiles take the
  conference's ruby red.
  The conference's gem, knitted stitch by stitch, sits big beside the title
  with my knitted avatar in front of it. Title and picture share a grid and the images have
  their size set, so nothing jumps while they load. The years of the series are a sidebar on wide screens and
  tiles at the end of the post on narrow ones.
*/
:root {
  --hr-ruby: #cc0000;
  --hr-red: #e80101;
}

main a, footer a { color: var(--hr-ruby); }

.series-title .date {
  margin-top: 0.8rem;
  text-align: left;
}

/* Title and knitted gem */
.series-title {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 1rem;
  margin: 2.5rem 0 3rem;
}

.series-title h1.main-title {
  margin: 0;
  text-align: left;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* The knitted conference gem, big, with my knitted avatar in front of it */
.series-art {
  position: relative;
  width: clamp(6rem, 30vw, 11rem);
  margin-right: 0.5rem;
}

.series-gem {
  display: block;
  width: 72%;
  height: auto;
  margin-left: auto;
  rotate: 8deg;
}

.series-avatar {
  position: absolute;
  left: 0;
  bottom: -6%;
  width: 52%;
  height: auto;
  filter: drop-shadow(1px 2px 2px #00000033);
}

/* The knitted avatar in the footer too; it is square-ish, not a circle */
header img.avatar {
  border-radius: 0;
  width: 58px;
  height: auto;
}

/* The years: tiles at the end of the post */
.series {
  margin: 4rem 0 1rem;
}

.series-heading {
  margin: 0 0 1rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-text);
}

.series ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}

main .series .series-item {
  display: block;
  height: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #cc000008;
  border: 2px solid #cc000026;
  color: var(--color-text);
  font-weight: normal;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

main .series a.series-item:hover {
  filter: none;
  border-color: var(--hr-ruby);
  transform: translateY(-2px);
}

.series-year {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--hr-ruby);
}

.series-name {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  line-height: 1.3;
}

main .series [aria-current="page"] {
  background: var(--hr-red);
  border-color: var(--hr-red);
  color: #fff;
}

main .series [aria-current="page"] .series-year { color: #fff; }

/* Wide screens: the years move into the empty space left of the text */
@media (min-width: 1240px) {
  .series {
    position: fixed;
    top: 7rem;
    right: calc(50% + 22.5rem + 2rem);
    width: 13rem;
    margin: 0;
  }

  .series ol { grid-template-columns: 1fr; }
}
