/* =========================================================
   FEATURED ARTICLES — Hub + Archive + Context View
   Safari-safe accordion cleanup
========================================================= */

/* -----------------------------------------
   Base width + centering
------------------------------------------ */

.featured-articles,
.featured-articles-wrapper {
  width: 100%;
  --fa-max: 900px;
  --fa-pad: 2rem;
  overflow-wrap: anywhere;
}

.featured-articles .issue-header .inner,
.featured-articles .article-bios .inner,
.featured-articles .featured-description-row > div:last-child,
.featured-articles-wrapper .issue-header .inner,
.featured-articles-wrapper .article-bios .inner,
.featured-articles-wrapper .featured-description-row > div:last-child {
  width: 100%;
  max-width: var(--fa-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--fa-pad);
  padding-right: var(--fa-pad);
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .featured-articles .article-grid,
  .featured-articles-wrapper .article-grid {
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
  }

  .featured-articles .article-grid > div:nth-child(2),
  .featured-articles-wrapper .article-grid > div:nth-child(2) {
    width: 100%;
    max-width: var(--fa-max);
    margin-left: auto;
    margin-right: auto;
    min-width: 0;
    justify-self: center;
  }
}

.featured-articles .article-bios-list,
.featured-articles .feature-article-description,
.featured-articles .authors-wrap,
.featured-articles-wrapper .article-bios-list,
.featured-articles-wrapper .feature-article-description,
.featured-articles-wrapper .authors-wrap {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.featured-articles .featured-author-group-row,
.featured-articles .issue-header,
.featured-articles [id^="author-group-"],
.featured-articles-wrapper .featured-author-group-row,
.featured-articles-wrapper .issue-header,
.featured-articles-wrapper [id^="author-group-"] {
  scroll-margin-top: 9rem;
}

/* =========================================================
   Contributors / accordion
========================================================= */

.featured-articles .authors-wrap,
.featured-articles-wrapper .authors-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  columns: unset !important;
  column-count: unset !important;
  column-gap: 0 !important;
  padding-top: 0.5rem;
  min-width: 0;
}

.featured-articles .authors-wrap .single-author,
.featured-articles-wrapper .authors-wrap .single-author {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  float: none;
  clear: both;
  border: 0;
  break-inside: auto !important;
  -webkit-column-break-inside: auto !important;
  page-break-inside: auto !important;
}

/* Toggle row */
.featured-articles .single-author-link.featured-toggle,
.featured-articles-wrapper .single-author-link.featured-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 1.2rem 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

/* Remove theme pseudo-lines */
.featured-articles .single-author-link.featured-toggle::before,
.featured-articles .single-author-link.featured-toggle::after,
.featured-articles-wrapper .single-author-link.featured-toggle::before,
.featured-articles-wrapper .single-author-link.featured-toggle::after {
  content: none !important;
  display: none !important;
}

.featured-articles .single-author-link.featured-toggle:hover h2,
.featured-articles .single-author-link.featured-toggle:focus h2,
.featured-articles-wrapper .single-author-link.featured-toggle:hover h2,
.featured-articles-wrapper .single-author-link.featured-toggle:focus h2 {
  text-decoration: underline;
}

.featured-articles .single-author-summary,
.featured-articles-wrapper .single-author-summary {
  display: block;
  width: 100%;
  min-width: 0;
}

.featured-articles .single-author-summary p,
.featured-articles-wrapper .single-author-summary p {
  margin: 0;
}

.featured-articles .authors-wrap .single-author .single-author-summary h2,
.featured-articles .article-bios-list .authors-wrap .single-author .single-author-summary h2,
.featured-articles .single-author-link.featured-toggle .single-author-summary h2,
.featured-articles .single-author header h2,
.featured-articles-wrapper .authors-wrap .single-author .single-author-summary h2,
.featured-articles-wrapper .article-bios-list .authors-wrap .single-author .single-author-summary h2,
.featured-articles-wrapper .single-author-link.featured-toggle .single-author-summary h2,
.featured-articles-wrapper .single-author header h2 {
  font-family: "ModeratLight", sans-serif;
  font-weight: normal;
  font-size: 1.5em;
  line-height: 1.275;
  margin: 0 0 0.83em;
  position: relative;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.featured-articles .authors-wrap .single-author h2,
.featured-articles-wrapper .authors-wrap .single-author h2 {
  margin-bottom: 0.83em;
}

.featured-articles .authors-wrap .single-author .single-author-summary .featured-set-month,
.featured-articles .article-bios-list .authors-wrap .single-author .single-author-summary .featured-set-month,
.featured-articles .single-author-link.featured-toggle .single-author-summary .featured-set-month,
.featured-articles-wrapper .authors-wrap .single-author .single-author-summary .featured-set-month,
.featured-articles-wrapper .article-bios-list .authors-wrap .single-author .single-author-summary .featured-set-month,
.featured-articles-wrapper .single-author-link.featured-toggle .single-author-summary .featured-set-month,
#featured-archive-bios .featured-set-month {
  font-size: 16px !important;
  line-height: 1.4 !important;
  margin: 0;
}

.featured-articles .article-bios-list .author-group-letter,
.featured-articles .featured-author-group-row .author-group-letter,
.featured-articles-wrapper .article-bios-list .author-group-letter,
.featured-articles-wrapper .featured-author-group-row .author-group-letter {
  font-size: 16px !important;
  line-height: 1.2 !important;
  margin-bottom: 1rem;
}

#featured-archive-bios .single-author h2 {
  margin: 0 0 0.83em 0 !important;
}

.featured-articles .featured-toggle-icon,
.featured-articles-wrapper .featured-toggle-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 2rem;
  line-height: 1;
}

/* PANEL: fully collapsed by default */
.featured-articles .featured-author-panel,
.featured-articles-wrapper .featured-author-panel {
  display: none !important;
  height: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

.featured-articles .featured-author-panel[hidden],
.featured-articles-wrapper .featured-author-panel[hidden] {
  display: none !important;
}

.featured-articles .featured-author-panel::before,
.featured-articles .featured-author-panel::after,
.featured-articles-wrapper .featured-author-panel::before,
.featured-articles-wrapper .featured-author-panel::after {
  content: none !important;
  display: none !important;
}

.featured-articles .featured-author-panel-inner,
.featured-articles-wrapper .featured-author-panel-inner {
  padding: 0;
  margin: 0;
  border: 0 !important;
}

/* OPEN STATE */
.featured-articles .single-author.is-open .single-author-link.featured-toggle,
.featured-articles-wrapper .single-author.is-open .single-author-link.featured-toggle {
  border-bottom: 0;
}

.featured-articles .single-author.is-open .featured-author-panel,
.featured-articles-wrapper .single-author.is-open .featured-author-panel {
  display: block !important;
  height: auto;
  overflow: visible;
  padding-top: 0.75rem !important;
  padding-bottom: 2rem !important;
  margin: 0 !important;
  border-bottom: 1px solid currentColor !important;
}

.featured-articles .single-author.is-open .featured-author-panel .featured-author-panel-inner,
.featured-articles-wrapper .single-author.is-open .featured-author-panel .featured-author-panel-inner {
  padding: 0.75rem 0 1rem 0;
  margin: 0;
  border: 0 !important;
}

/* Hide first separator inside open panel if Gutenberg/theme injects one */
.featured-articles .single-author.is-open .featured-author-panel hr:first-child,
.featured-articles-wrapper .single-author.is-open .featured-author-panel hr:first-child,
.featured-articles .single-author.is-open .featured-author-panel .wp-block-separator:first-child,
.featured-articles-wrapper .single-author.is-open .featured-author-panel .wp-block-separator:first-child {
  display: none !important;
}

.featured-articles-wrapper .article-bios .single-author .single-author-bio {
  display: none;
}

.featured-articles-wrapper .article-bios .single-author.is-open .single-author-bio {
  display: block;
  margin-top: 1rem;
}

/* =========================================================
   Featured article cards
   Reset global theme ul/li rules
========================================================= */

.featured-articles .featured-author-panel .featured-list,
.featured-articles-wrapper .featured-author-panel .featured-list {
  margin-top: 1.5rem !important;
}

.featured-articles .featured-list,
.featured-articles-wrapper .featured-list {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1rem !important;
  list-style: none !important;
  margin: 1.5rem 0 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

.featured-articles .featured-list-item,
.featured-articles-wrapper .featured-list-item {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 240px !important;
  margin: 0 !important;
  padding: 0 !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

.featured-articles .featured-list-item > .article,
.featured-articles-wrapper .featured-list-item > .article {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
  padding: 1.2rem !important;
  box-sizing: border-box !important;
}

.featured-articles .featured-list-item > .article > a,
.featured-articles-wrapper .featured-list-item > .article > a,
.featured-articles .featured-list-item .featured-article-link,
.featured-articles-wrapper .featured-list-item .featured-article-link {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
}

.featured-articles .featured-list-item h4,
.featured-articles-wrapper .featured-list-item h4 {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  overflow: hidden !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.featured-articles .featured-list-item .authors,
.featured-articles-wrapper .featured-list-item .authors {
  margin-top: auto !important;
  max-width: none !important;
}

.featured-articles .featured-list li,
.featured-articles-wrapper .featured-list li {
  display: block !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.featured-articles .featured-list p,
.featured-articles .featured-list ul,
.featured-articles .featured-list ol,
.featured-articles .featured-list li,
.featured-articles-wrapper .featured-list p,
.featured-articles-wrapper .featured-list ul,
.featured-articles-wrapper .featured-list ol,
.featured-articles-wrapper .featured-list li {
  max-width: none !important;
}

@media (max-width: 1100px) {
  .featured-articles .featured-list,
  .featured-articles-wrapper .featured-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 700px) {
  .featured-articles .featured-list,
  .featured-articles-wrapper .featured-list {
    grid-template-columns: 1fr !important;
  }

  .featured-articles .featured-list-item,
  .featured-articles-wrapper .featured-list-item {
    height: auto !important;
    min-height: 220px !important;
  }
}

/* archive link */
.featured-articles .featured-archive-link,
.featured-articles-wrapper .featured-archive-link {
  margin: 1.5rem 0 0;
}

.featured-articles .featured-archive-link a,
.featured-articles-wrapper .featured-archive-link a {
  text-decoration: underline;
}

/* =========================================================
   Topbar / bottombar (context view)
   Align with article text column
========================================================= */

.fa-topbar-inline,
.fa-bottombar-inline {
  width: 100%;
  background: var(--fa-topbar-bg, #fff);
  padding: 0.6rem 0;
}

.fa-topbar-inner {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 50px;
  padding-right: 50px;
  box-sizing: border-box;
}

.fa-topbar-link {
  display: block;
  font-size: 14px;
  line-height: 1.33;
  text-decoration: underline;
  margin: 0;
}

/* Desktop article layout */
@media (min-width: 1024px) {
  body.single-article .fa-topbar-inline,
  body.single-article .fa-bottombar-inline {
    display: grid;
    grid-template-columns: 1fr minmax(0, 765px) 1fr;
  }

  body.single-article .fa-topbar-inner,
  body.single-article .fa-bottombar-inline .fa-topbar-inner {
    grid-column: 2;
    max-width: 765px;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

/* Tablet */
@media (max-width: 1023px) {
  body.single-article .fa-topbar-inner,
  body.single-article .fa-bottombar-inline .fa-topbar-inner {
    max-width: 765px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .fa-topbar-inline,
  .fa-bottombar-inline {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .fa-topbar-inner,
  .fa-bottombar-inline .fa-topbar-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* =========================================================
   Safety
========================================================= */

.featured-articles,
.featured-articles *,
.featured-articles-wrapper,
.featured-articles-wrapper * {
  box-sizing: border-box;
}

.featured-articles .article-grid,
.featured-articles .article-grid > *,
.featured-articles-wrapper .article-grid,
.featured-articles-wrapper .article-grid > * {
  min-width: 0;
}

/* =========================================================
   Mobile
========================================================= */

@media (max-width: 768px) {
  .featured-articles,
  .featured-articles-wrapper {
    padding-top: 0;
  }

  .featured-articles .issue-header .inner,
  .featured-articles .article-bios .inner,
  .featured-articles .featured-description-row > div:last-child,
  .featured-articles-wrapper .issue-header .inner,
  .featured-articles-wrapper .article-bios .inner,
  .featured-articles-wrapper .featured-description-row > div:last-child {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .featured-articles .single-author-link.featured-toggle,
  .featured-articles-wrapper .single-author-link.featured-toggle {
    gap: 1rem;
    padding: 1rem 0;
  }

  .featured-articles .featured-toggle-icon,
  .featured-articles-wrapper .featured-toggle-icon {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 1.6rem;
  }
}

.author-index-vertical a {
  color: #000;
  opacity: 1;
  text-decoration: none;
}

.author-index-vertical .disabled {
  color: #999;
  opacity: 0.35;
}

.featured-contributor-bio .single-author-link::after,
.featured-contributor-bio .single-author-link::before,
.featured-contributor-bio h2::after,
.featured-contributor-bio h2::before {
  content: none !important;
  display: none !important;
}

.featured-contributor-bio .featured-toggle-icon {
  display: none !important;
}

/* Hide leftover empty header inside contributor bio */
.featured-articles .featured-contributor-bio header,
.featured-articles-wrapper .featured-contributor-bio header,
.featured-contributor-bio header {
  display: none !important;
}

/* Kill pseudo-elements attached to that header */
.featured-articles .featured-contributor-bio header::before,
.featured-articles .featured-contributor-bio header::after,
.featured-articles-wrapper .featured-contributor-bio header::before,
.featured-articles-wrapper .featured-contributor-bio header::after,
.featured-contributor-bio header::before,
.featured-contributor-bio header::after {
  content: none !important;
  display: none !important;
}
