/* Layout rules for the site's shared header and authored content. */
@media (any-pointer: coarse) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .content { overflow-wrap: anywhere; }
}

.profile-intro {
  display: grid;
  grid-template-columns: 14% minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.profile-intro figure,
.profile-details > p,
.teaching-photos figure {
  margin: 0;
}

.profile-intro img,
.teaching-photos img {
  display: block;
  float: none;
  width: 100%;
  height: auto;
  margin: 0;
}

.profile-contact {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

.profile-contact + .profile-contact {
  margin-inline-start: 1.25rem;
}

.profile-resource { display: inline-block; }

.content .flex-container {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: center;
  gap: 1.5rem;
  padding: .75rem 0;
}

.content .flex-item-left,
.content .flex-item-right {
  display: block;
  min-width: 0;
  margin: 0;
}

.content .flex-item-right > p { margin: 0; }

.content .video {
  display: block;
  width: 100%;
  max-width: 25rem;
  height: auto;
  aspect-ratio: 2 / 1;
  margin-inline: auto;
  border: 0;
}

.teaching-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
}

/* Keep all nine menu items in one row above the theme's mobile menu breakpoint. */
@media (any-pointer: coarse) and (min-width: 767px) and (max-width: 57rem) {
  .menu__link {
    padding-inline: clamp(.35rem, calc(5vw - 2rem), .9375rem);
  }
}

@media (max-width: 50rem) {
  .content .flex-container {
    grid-template-columns: minmax(0, 1fr);
    gap: .875rem;
  }
}

@media (any-pointer: coarse) and (max-width: 47.99rem) {
  .header { margin-top: 0; }

  .logo--mixed {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .5rem 1rem;
    padding: 1rem;
  }

  .logo--mixed .logo__item,
  .logo--mixed .logo__link {
    float: none;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .logo--mixed .logo__img {
    display: block;
    width: clamp(8rem, 32vw, 10rem);
    height: auto;
  }

  .content, .content .flex-item-right { text-align: start; }
}

@media (any-pointer: coarse) and (max-width: 40rem) {
  .wrapper { padding: 1rem; }
}

@media (max-width: 40rem) {

  .profile-intro,
  .teaching-photos { grid-template-columns: minmax(0, 1fr); }

  .profile-intro { gap: .75rem; }
  .profile-intro figure { width: min(9rem, 100%); }
  .profile-contact { display: block; }
  .profile-contact + .profile-contact { margin-inline-start: 0; }
  .profile-contact + br { display: none; }
}

/* The original publication Markdown identifies thumbnails by width and the floatleft fragment. */
@media (any-pointer: coarse) and (max-width: 40rem) {
  .content figure:has(> img[width="12.5%"][src$="#floatleft"]) {
    margin: 1.5rem 0 .5rem;
  }

  .content figure > img[width="12.5%"][src$="#floatleft"] {
    display: block;
    float: none;
    width: min(9rem, 100%);
    height: auto;
    margin: 0;
  }

  .content figure:has(> img[width="12.5%"][src$="#floatleft"]) + p > strong:first-child font[size],
  .content figure:has(> img[width="12.5%"][src$="#floatleft"]) + strong font[size] {
    font-size: inherit;
  }
}

.content .member-roster > ul {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.5rem 1rem;
  padding: 0;
  margin: 0 0 1.25rem;
  list-style: none;
}

.member-roster li {
  margin: 0;
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.member-roster img {
  width: 100px;
  max-width: 100%;
  height: auto;
  vertical-align: bottom;
}

@media (max-width: 55rem) {
  .content .member-roster > ul {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
  }
}

.group-gallery {
  position: relative;
}

.group-gallery__photos {
  display: flex;
  width: 100%;
  aspect-ratio: 1018 / 345;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background-color: #fff;
}

.group-gallery__photos::-webkit-scrollbar {
  display: none;
}

.group-gallery__photos img {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  height: 100%;
  object-fit: contain;
  scroll-snap-align: start;
}

.group-gallery button {
  padding: 0;
  border: 0;
  margin: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.group-gallery :focus-visible {
  outline: 2px solid var(--link);
  outline-offset: -2px;
}

.group-gallery__back, .group-gallery__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
}

.group-gallery__back { left: 0; }
.group-gallery__next { right: 0; }

.group-gallery__back::after, .group-gallery__next::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: solid currentColor;
  border-width: 0 3px 3px 0;
  filter: drop-shadow(0 1px 2px #333);
}

.group-gallery__back::after { transform: rotate(135deg); }
.group-gallery__next::after { transform: rotate(-45deg); }

.group-gallery__dots {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
}

.group-gallery__dots button {
  width: 24px;
  height: 26px;
}

.group-gallery__dots button::after {
  box-sizing: border-box;
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid #333;
  border-radius: 50%;
  background: #fff;
}

.group-gallery__dots button[aria-pressed="true"]::after {
  background: #333;
}

@media (max-width: 40rem) {
  .group-gallery__photos { aspect-ratio: 16 / 10; }
}

/* Home news */
.home-news {
  scroll-margin-block-start: 1rem;
}

.news-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  margin-bottom: .65rem;
}

.news-heading h2, .news-heading p { margin: 0; }
.news-heading p { color: var(--bar); font-size: .875rem; }

.news-scroll {
  max-height: min(28rem, 65vh);
  max-height: min(28rem, 65svh);
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
  scrollbar-color: var(--menu-hover) var(--paper);
  border-block: 1px solid var(--section-rule);
}

.news-scroll:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.content .news-scroll ul {
  list-style: none;
  margin: 0;
  padding: 0 .75rem;
}

.content .news-scroll li {
  display: grid;
  grid-template-columns: 4.75rem 4.75rem minmax(0, 1fr);
  align-items: baseline;
  column-gap: 1rem;
  margin: 0;
  padding: .85rem 0;
  text-align: start;
  line-height: 1.65;
}

.news-scroll time { color: var(--bar); font-variant-numeric: tabular-nums; white-space: nowrap; }
.news-scroll .news-copy {
  text-align: justify;
  text-align-last: start;
  overflow-wrap: anywhere;
}
.news-copy .news-rating { white-space: nowrap; }

@media (max-width: 44rem) {
  .content .news-scroll ul { padding-inline: .5rem; }
  .content .news-scroll li {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .25rem .8rem;
  }
  .news-scroll .news-copy {
    grid-column: 1 / -1;
    hyphens: auto;
  }
}

@media print {
  .news-heading p { display: none; }
  .news-scroll { max-height: none; overflow: visible; scrollbar-gutter: auto; }
  .content .news-scroll li { break-inside: avoid; }
}
