main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
}

.top-section {
  margin: 0 var(--padding-spacer-x) 0.75rem;
  padding: 0;
}

.top-section h1 {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

main .top-section.auto-section .top-ad-section {
  padding-bottom: 20px;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  text-align: center;
  min-height: 100px;
  position: relative;
  z-index: 10;
  margin: 0 calc(-1 * var(--padding-spacer-x));
}

.top-ad-section::before {
  z-index: 0;
  content: '';
  position: absolute;
  inset: 0;
  border-bottom: 2px solid var(--clr-red);
  margin-bottom: 30px;
}

.top-ad-section .top-ad {
  z-index: 1;
  position: relative;
}

main .top-section.auto-section .breadcrumb {
  margin: 0 calc(-1 * var(--padding-spacer-x));
  padding: 0.25rem 0;
  display: flex;
  flex-direction: column;
}

main .top-section.auto-section .breadcrumb-list {
  padding: 0.25rem 30px;
  text-transform: uppercase;
  color: var(--clr-grey);
  border-top: 2px solid #c5c5c5;
  border-bottom: 2px solid #c5c5c5;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

main .top-section.auto-section .breadcrumb-list li {
  display: inline;
}

main .top-section.auto-section .breadcrumb-list a {
  color: var(--clr-grey);
  width: 100%;
}

.ad-title {
  font-family: inherit;
  color: #333;
  font-size: 0.6rem;
  text-transform: uppercase;
  font-weight: bold;
}

.close-icon {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 16px;
  opacity: 1;
  cursor: pointer;
}

main .bottom-section.auto-section {
  position: fixed;
  text-align: center;
  bottom: 0;
  min-height: 50px;
  width: 380px;
  min-width: 380px;
  z-index: 500;
  left: 50%;
  background-color: rgb(255 255 255 / 70%);
  margin-left: -190px;
}

main .back-to-top {
  margin: 0 var(--padding-spacer-x);
}

main .back-top-top-section-header {
  display: flex;
  align-items: center;
  justify-content: left;
  gap: 10px;
  font-family: var(--article-heading-family);
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
}

.loading-animation {
  animation: loading 1.5s infinite linear;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  height: 100%;
}

.fixed-height {
  height: 626px;
}

main .section:not(.auto-section):first-child {
  margin-top: 0;
}

main .right-ad-section {
  height: 100%;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  
  100% {
    background-position: -200% 0;
  }
}

@media (min-width: 576px) {
  main .top-section.auto-section .top-ad-section {
    min-height: 125px;
  }

  .top-ad-section::before {
    margin: 0;
  }
}

@media (min-width: 768px) {
  main .bottom-section.auto-section {
    width: 100%;
    min-height: 75px;
    left: 0;
  }
}

@media (min-width: 768px) {
  /* avoids CLS before the right ad section moves into place */
  main > .section:not(.auto-section) {
    margin-right: calc(var(--padding-spacer-x) + var(--right-column-width, 330px));
    padding-right: var(--padding-spacer-x);
  }

  /* avoids CLS before the right ad section moves into place */
  main .right-section {
    display: none;
    grid-area: ads;
    min-height: 700px;
    z-index: 1;
  }

  main .curtain {
    position: fixed;
    z-index: -1;
    top: 0;
    width: 100%;
    left: 0;
    text-align: center;
  }

  /* shows the right ad section once it moves into place */
  main.grid-layout .right-section {
    position: relative;
    display: block;    
  }

  main.grid-layout .section {
    margin: 0;
    padding: 0;    
  }

  /* When right column is disabled, remove the margin */
  main:not(:has(.right-section)) > .section:not(.auto-section) {
    margin-right: var(--padding-spacer-x);
  }

  main.grid-layout {
    display: grid;
    gap: var(--padding-spacer-x);
    grid-template-columns: auto 1fr 330px auto;
    grid-template-rows: auto auto;
    /* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
    grid-template-areas:
      'top top top top'
      '. content ads .'
      'to-top to-top to-top to-top';
  }

  main .top-section {
    grid-area: top;
  }

  main .content-section {
    grid-area: content;
  }

  main .back-to-top {
    grid-area: to-top;
  }
}

@media (min-width: 1140px) {
  main .bottom-section.auto-section {
    max-width: 1140px;
    margin-left: -570px;
    left: 50%;
  }
}
