/* Shared Instagram layout, matching the homepage at every breakpoint. */
body .pre-footer {
  --instagram-layout-gutter: max(15px, calc(50vw - 705px));
}
@media (min-width: 600px) and (max-width: 1023px) {
  body .pre-footer { --instagram-layout-gutter: clamp(28px, 4.7vw, 48px); }
}
@media (min-width: 1024px) and (max-width: 1535px) {
  body .pre-footer { --instagram-layout-gutter: clamp(48px, 4.5vw, 64px); }
}
body .pre-footer > .container {
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--instagram-layout-gutter) - var(--instagram-layout-gutter)) !important;
  max-width: 1410px !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding-inline: 0 !important;
}
body .pre-footer > .container > .prefooter:has(#sb_instagram) {
  order: -1;
}
body .pre-footer .prefooter {
  width: 100%;
}
body .pre-footer .prefooter:has(#sb_instagram) > h3 {
  display: flex !important;
  justify-content: center;
  margin: 0 0 22px;
  font-size: clamp(1rem, 1.45vw, 1.3rem) !important;
  line-height: 1.2;
  text-align: center !important;
  font-family: Georgia, 'Times New Roman', serif;
}
body .pre-footer #sb_instagram {
  width: 100% !important;
  max-width: none !important;
  margin: 0 auto !important;
}
body .pre-footer #sb_instagram #sbi_images .sbi_item {
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
body .pre-footer #sb_instagram .sbi_photo_wrap,
body .pre-footer #sb_instagram .sbi_photo {
  display: block;
  width: 100%;
}
body .pre-footer #sb_instagram .sbi_photo {
  aspect-ratio: 3 / 4;
  height: auto !important;
  padding-bottom: 0 !important;
  overflow: hidden;
  background-size: cover !important;
  background-position: center !important;
}
body .pre-footer #sb_instagram .sbi_photo img {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
/* Center the account name below the section title, including its avatar/bio. */
body .pre-footer :is(#sb_instagram .sb_instagram_header, .sb_instagram_header.sbi_header_outside) {
  width: 100%;
  float: none;
  display: flex;
  justify-content: center;
  text-align: center;
}
body .pre-footer :is(#sb_instagram .sb_instagram_header, .sb_instagram_header.sbi_header_outside) .sbi_header_link {
  display: block;
  float: none;
  margin-inline: auto;
  max-width: 100%;
}
body .pre-footer :is(#sb_instagram .sb_instagram_header, .sb_instagram_header.sbi_header_outside) .sbi_header_text {
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
body .pre-footer :is(#sb_instagram .sb_instagram_header, .sb_instagram_header.sbi_header_outside) .sbi_feedtheme_header_text {
  align-items: center;
  text-align: center;
}
body .pre-footer :is(#sb_instagram .sb_instagram_header, .sb_instagram_header.sbi_header_outside) .sbi_header_text h3 {
  justify-content: center;
  margin: 0 !important;
  padding: 0 !important;
  text-align: center !important;
}
.pre-footer .prefooter .home-prefooter__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #a40709;
  border-radius: 50%;
  color: #a40709;
  font-size: 1.3rem;
  text-decoration: none;
}
.pre-footer .prefooter .home-prefooter__social:hover,
.pre-footer .prefooter .home-prefooter__social:focus-visible {
  background: #a40709;
  color: #fff;
}

/* Keep the sponsor logos in the homepage prefooter only. */
body:not(.home) .pre-footer .prefooter:has(.logo-sponsor) {
  display: none !important;
}
