/* by Creasant */
@media screen and (max-width: 1200px) {
  #block-mtpc-secondfooter .field--name-field-mtpc-profile-listing-item {
    grid-template-columns: repeat(4, 1fr);
  }
  
  
  #block-mtpc-secondfooter .collaborating_universities_wrapper .field--name-field-mtpc-profile-listing-item {
    grid-template-columns: repeat(8, 1fr);
    gap: 40px;
  }

  #block-mtpc-secondfooter .collaborating_universities_wrapper .field--name-field-mtpc-profile-listing-item > .field__item {
    grid-column: span 2;
  }

  #block-mtpc-secondfooter .collaborating_universities_wrapper .field--name-field-mtpc-profile-listing-item > .field__item:nth-child(n+4):nth-child(-n+6) {
    order: 1;
  }

  #block-mtpc-secondfooter .collaborating_universities_wrapper .field--name-field-mtpc-profile-listing-item > .field__item:nth-child(4) {
    grid-column: 2 / span 2;
  }
}

@media screen and (max-width: 1180px) {
  .intro-text {
    font-size: 18px;
  }
  
  h2 {
    font-size: 38px;
  }
  
  .mtpc_pagetitle.mtpc_gallery h1 {
    font-size: 38px;
  }
  
  h3 {
    font-size: 30px;
  }
  
  header .mtpc_header .header {
    background-size: auto 95%;  
  }
  
  header .mtpc_header .header:after {
    height: 10px;
    bottom: -7px;
  }
  
  header .mtpc_header .header.mobile .wrapper .logos .logos_right {
    gap: 20px;
  }
  
  header .mtpc_header .header .wrapper .logos .logos_left .logo_one img,
  header .mtpc_header .header.mobile .wrapper .logos .logos_right img {
    width: auto !important;
    height: 35px;
  }
  
}

@media screen and (max-width: 1000px) {
  .resources-section {
    width: unset;
    min-width: unset;
    margin: unset !important;
  }
  
  .resources-section .mtpc-2col-section-wrapper {
    gap: 20px;
  }
  
}

@media only screen and (min-width: 768px) and (max-width: 999px) {
  .theme-wrapper.mtpc-4col-section .mtpc-4col-section-wrapper > .mtpc-4col-item {
    margin-bottom: 40px !important;
  }
}

@media (max-width: 991px) {
  /* ===== Speaker listing: 2 per row, left-aligned ===== */
  .speaker-wrapper > .field__items { justify-content: flex-start; }

  .speaker-wrapper > .field__items > .field__item,
  .speaker-wrapper[data-count="4"] > .field__items > .field__item { flex-basis: 50%; max-width: 50%; }

  /* dividers: right-hand card of each row only */
  .speaker-wrapper[data-count] > .field__items > .field__item:nth-child(2n)::before   { display: block; }
  .speaker-wrapper[data-count] > .field__items > .field__item:nth-child(2n+1)::before { display: none; }

  /* ===== Speaker detail card: stack the columns ===== */
  .speaker-section { padding-left: 20px; padding-right: 20px; }

  .speaker-section .mtpc-2col-section-wrapper {
    flex-direction: column;
    padding: 36px 24px 32px;
    border-radius: 20px;
  }

  .speaker-section .mtpc-2col-item--1,
  .speaker-section .mtpc-2col-item--2 { flex: 0 0 auto; max-width: 100%; width: 100% !important; }

  .speaker-section .mtpc-2col-item--1 {
    padding: 0 0 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid #1a9e8a;
    border-image: linear-gradient(90deg,
        rgba(26,158,138,0) 0%,
        #1a9e8a 25%,
        #1a9e8a 75%,
        rgba(26,158,138,0) 100%) 1;
  }

  .speaker-section .mtpc-2col-item--2 {
    padding: 0;
    border-left: 0;
    border-image: none;
    margin-left: 0 !important;
  }

  /* ===== Prev / next arrows: no room beside the card, so hide ===== */
  .speaker-section .next-previous-wrapper { display: none; }
}

@media screen and (max-width: 920px) {
  header .mtpc_header .header.mobile .wrapper .logos .logos_right img {
    display: none;
  }
  
  header .mtpc_header .header .wrapper .logos .logos_left .logo_one img {
    height: 30px;
  }
}

@media screen and (max-width: 900px) {
  .crf-table {
    min-width: 1200px;
  }
}