/* btn-end : Force button to bottom of element */
.btn-end {
  margin-top: auto;
}
  
/* article-cards */
.article-cards {
  display: grid;
  gap: 50px 30px;
  margin-bottom: 50px;
}
.article-cards article,
.article-cards iframe,
.article-cards img,
.article-cards section {
  box-sizing: border-box;
}

/* Zero gap spacing - for tight block layouts */
.article-cards-no-gap {
  gap: 0;
}

.article-cards article {
  box-sizing: border-box;
  display: flex;
  flex: 1;
  flex-direction: column;
}
article.article-padded {
  padding: 10px;
}
.article-cards iframe {
  width: 100%;
}
  
.article-cards-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}
.article-cards-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.article-cards-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.article-cards-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
.article-cards-cols-5 {
  grid-template-columns: repeat(5, 1fr);
}
.article-cards-cols-6 {
  grid-template-columns: repeat(6, 1fr);
}
.article-cards-cols-7 {
  grid-template-columns: repeat(7, 1fr);
}
.article-cards-cols-8 {
  grid-template-columns: repeat(8, 1fr);
}
.article-cards-cols-8 {
  grid-template-columns: repeat(8, 1fr);
}
.article-cards-cols-9 {
  grid-template-columns: repeat(9, 1fr);
}
.article-cards-cols-10 {
  grid-template-columns: repeat(10, 1fr);
}
.article-cards-cols-11 {
  grid-template-columns: repeat(11, 1fr);
}
.article-cards-cols-12 {
  grid-template-columns: repeat(12, 1fr);
}

.article-cards section {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: start;
}

.article-cards article label {
  background-color: #333;
  color: #ddd;
  display: block;
  font-size: 12px;
  padding: 2px 4px;
  margin: 0;
  text-align: center;
}
.article-cards article label.important {
/* #2e3192 or #000 */
  background-color: #2e3192;
}

.article-cards section + iframe, 
.article-cards section + img {
    margin-left: 30px;
}

.article-cards h6 {
  line-height: 16px;
}

.article-cards h5+h6,
.article-cards h6+h6 {
  margin-top: 4px !important;
}
.article-cards section h5 {
  margin-bottom: 0;
}
.article-cards section h6 {
  margin: 0;
  font-weight: normal;
}
  
.article-cards a img {
  width: 100%;
}

/* MIDDLE: VERTICALLY CENTER IMAGES IN CARDS */
.article-cards-center article, /* Deprecated class */
.article-cards-middle article {
  justify-content: center;
}

/* HORIZONTAL CARDS */
.article-cards-horizontal.article-cards-cols-1 {
  flex-direction: column;
}
  
/* Assume 50% width is a reasonable default */
.article-cards-horizontal img,
.article-cards-horizontal iframe {
  width: 50%;
}
.article-cards-horizontal article {
  flex-direction: row;
}
  
.article-cards-horizontal section {
  padding:0 10px;
  justify-content: start;
  width: min-content; /* ? */
}

/* BORDERED CARDS */
.article-cards-bordered article {
  border: 1px solid  #E6EBED;
  border-radius: 5px;
}

.article-cards-bordered section {
  padding: 0 10px 10px 10px;
}

/* Stretch cards across rows/columns */
.article-rows-2 {
  grid-row: span 2;
}
.article-rows-3 {
  grid-row: span 3;
}
.article-cols-2 {
  grid-column: span 2;
}
.article-cols-3 {
  grid-column: span 3;
}
.article-cols-4 {
  grid-column: span 4;
}
.article-cols-5 {
  grid-column: span 5;
}
.article-cols-6 {
  grid-column: span 6;
}
.article-cols-7 {
  grid-column: span 7;
}
.article-cols-8 {
  grid-column: span 8;
}


/* Centered cards switch to flexbox, so we have to override most of the grid config */
.article-cards.article-cards-centered {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.article-cards-centered.article-cards-cols-1 article {
  width: 100%;
  min-width: 100%;
}
.article-cards-centered.article-cards-cols-2 article {
  width: 48%;
  max-width: 48%;
  min-width: 48%;
}
.article-cards-centered.article-cards-cols-3 article {
  width: 31%;
  max-width: 31%;
  min-width: 31%;
}
.article-cards-centered.article-cards-cols-4 article {
  width: 22.5%;
  max-width: 22.5%;
  min-width: 22.5%;
}
.article-cards-centered.article-cards-cols-5 article {
  width: 17.5%;
  max-width: 17.5%;
  min-width: 17.5%;
}
.article-cards-centered.article-cards-cols-6 article {
  width: 14%;
  max-width: 14%;
  min-width: 14%;
}


@media (max-width: 767px) { 
  /* Drop to 2 columns */
  .article-cards-cols-3,
  .article-cards-cols-4,
  .article-cards-cols-5,
  .article-cards-cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Drop horizontal cards to 1 column */
  .article-cards-horizontal {
    grid-template-columns: repeat(1, 1fr);
  }
}
  
@media (max-width: 480px) {
  /* Drop to 1 column */
  .article-cards-cols-2,
  .article-cards-cols-3,
  .article-cards-cols-4,
  .article-cards-cols-5,
  .article-cards-cols-6 {
    grid-template-columns: repeat(1, 1fr);
  }

  /* Convert horizontal cards to regular columns */
  .article-cards-horizontal article {
    flex-direction: column;
  }
  .article-cards-horizontal img,
  .article-cards-horizontal iframe,
  .article-cards-horizontal section {
    width: 100%;
  }
}
