/* Editorial archive and article page. Loaded only there (includes/editorial.php). */

/* Pagination */

.editorial-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 40px 0 60px;
}

.editorial-pagination .editorial-load-more {
  padding: 12px 28px;
  text-decoration: none;
  border: 1px solid #000;
  border-radius: 100px;
  color: #000;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.editorial-pagination .editorial-load-more:hover {
  background: #000;
  color: #fff;
}

.editorial-pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
}

.editorial-pages .page-numbers {
  display: inline-block;
  text-decoration: none;
  min-width: 36px;
  padding: 8px 10px;
  text-align: center;
  color: #000;
}

.editorial-pages .page-numbers.current {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.editorial-pagination a:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Archive heading */

/* custom.css removes the sticky-header offset from every archive for the shop's banner, which
   hid the top of category and author pages under the header. Give it back to these two. */
body.archive.category.bb-buddypanel.sticky-header .site-content,
body.archive.author.bb-buddypanel.sticky-header .site-content {
  padding-top: 94px !important;
}

.editorial-header {
  margin: 36px 0 28px;
}

.editorial-header__kicker {
  margin: 0 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b6b6b;
}

.editorial-header__title {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 400;
}

.editorial-header__intro {
  max-width: 640px;
  margin-top: 12px;
  color: #4d4d4d;
}

.editorial-header__intro p:last-child {
  margin-bottom: 0;
}

.editorial-filters ul {
  display: flex;
  gap: 8px;
  margin: 20px 0 0;
  padding: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.editorial-filters ul::-webkit-scrollbar {
  display: none;
}

.editorial-filters li a {
  display: block;
  padding: 6px 14px;
  border: 1px solid #000;
  border-radius: 100px;
  color: #000;
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  text-decoration: none;
}

.editorial-filters li a:hover,
.editorial-filters li a[aria-current="page"] {
  background: #000;
  color: #fff;
}

.editorial-filters li a:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .editorial-header {
    margin: 24px 0 20px;
  }

  .editorial-header__title {
    font-size: 26px;
  }

  /* Let the chip row run to the screen edge so it reads as scrollable. */
  .editorial-filters ul {
    margin-right: -20px;
    padding-right: 20px;
  }
}

/* Cards */

.post-grid .entry-label {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #000;
  text-decoration: none;
}

.post-grid .entry-label:hover {
  text-decoration: underline;
}

/* The theme's #a3a3a3 is 2.5:1 on white; #6b6b6b reaches 5.3:1 (WCAG AA). */
.post-grid article .entry-content,
.post-grid article .entry-content p,
.post-grid .entry-meta .post-date {
  color: #6b6b6b;
}

.post-grid a:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Article */

.editorial-article__header {
  margin: 16px 0 24px;
}

.editorial-article__breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.editorial-article__breadcrumb li + li::before {
  content: "/";
  margin: 0 8px;
  color: #6b6b6b;
}

.editorial-article__breadcrumb a {
  color: #000;
  text-decoration: none;
}

.editorial-article__breadcrumb a:hover {
  text-decoration: underline;
}

.single-post .editorial-article__title {
  margin: 0 0 12px;
  font-size: 36px;
  line-height: 1.2;
}

.editorial-article__byline {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #6b6b6b;
}

.editorial-article__byline a {
  color: #000;
}

.editorial-article__media {
  margin: 20px 0 0;
}

.editorial-article__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.editorial-article a:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* On a laptop the picture sits beside the title, whole and uncropped. The header starts on the
   780px text column the theme gives single posts and extends to its right. */
@media (min-width: 1024px) {
  .editorial-article__header {
    width: min(940px, calc(50vw + 350px));
    margin: 24px 0 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 48px;
    align-items: center;
  }

  .editorial-article__media {
    display: flex;
    justify-content: center;
    margin: 0;
  }

  /* Whole picture, never taller than 360px, so a portrait one cannot push the text down. */
  .editorial-article__media img {
    width: auto;
    max-width: 100%;
    max-height: min(360px, calc(100vh - 200px));
    aspect-ratio: auto;
  }

  .single-post .editorial-article__title {
    font-size: 44px;
  }
}

/* A landscape picture at 360px is a thumbnail; from 1440px give it room. */
@media (min-width: 1440px) {
  .editorial-article__header--landscape {
    width: min(1100px, calc(50vw + 350px));
    grid-template-columns: minmax(0, 1fr) 520px;
  }
}

@media (max-width: 767px) {
  .single-post .editorial-article__title {
    font-size: 28px;
  }
}

/* Contents */

.editorial-article .entry-content :is(h2, h3)[id] {
  scroll-margin-top: 110px;
}

.editorial-contents__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.4;
}

.editorial-contents__list li {
  margin: 0;
  padding: 5px 0;
}

.editorial-contents__list li a {
  color: #4d4d4d;
  text-decoration: none;
}

.editorial-contents__list li a:hover {
  color: #000;
  text-decoration: underline;
}

.editorial-contents--inline {
  margin: 0 0 16px;
  padding: 0 16px;
  border: 1px solid #e5e5e5;
}

.editorial-contents--inline summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  list-style: none;
}

.editorial-contents--inline summary::-webkit-details-marker {
  display: none;
}

.editorial-contents--inline summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s;
}

.editorial-contents--inline[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.editorial-contents--inline summary:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.editorial-contents--inline .editorial-contents__list {
  padding-bottom: 12px;
}

.editorial-contents--rail {
  display: none;
}

/* From 1280px the list moves into the left margin beside the text and stays in view. */
@media (min-width: 1280px) {
  .editorial-contents--inline {
    display: none;
  }

  .editorial-article__body {
    position: relative;
  }

  /* The theme's overflow-x: hidden on #page makes it the scroll container, so nothing inside can
     stick to the viewport. clip trims the same overflow without that side effect. */
  .single-post #page {
    overflow: visible;
    overflow-x: clip;
  }

  .editorial-contents--rail {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    right: calc(100% + 48px);
    width: min(240px, calc(50vw - 390px - 72px));
  }

  .editorial-contents__sticky {
    position: sticky;
    top: 140px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 16px;
    border: 1px solid #e5e5e5;
  }

  .editorial-contents__title {
    margin: 0;
    padding-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
  }
}

/* Author */

.editorial-author {
  margin: 40px 0;
  padding: 28px 0;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
}

.editorial-author__kicker {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b6b6b;
}

.single-post .editorial-author__name {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.3;
}

.editorial-author__bio {
  max-width: 640px;
  color: #4d4d4d;
}

.editorial-author__more {
  display: inline-block;
  margin-top: 4px;
  color: #000;
  text-decoration: underline;
}

.editorial-author__more::after {
  content: " \2192";
}

.editorial-author__more:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}
