.event_section {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.event_block .wp-block-group {
  flex-grow: 1;
  margin-bottom: 50px;
}

.event_block .wp-block-columns {
  flex-grow: 1;
}

.event_block {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.event_block .event {
  max-width: 419px;
  min-width: 275px;
  margin: 25px;
  flex-basis: calc(33% - 50px);
  flex-grow: 1;
}
.event_block.site-main .event {
  flex-basis: calc(33% - 50px);
}
.event {
  position: relative;
  margin-bottom: 50px;
  flex-basis: 100%;
}
.event img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.event_details {
  position:absolute;
  bottom: 30px;
  left: 30px;
right:30px;}

.event_title {
  font-size: 32px;
  color: white;
  font-weight: 600;
  line-height: .75em;
}

.event_date {
  font-family: 'Gentona Book';
  font-style: italic;
  color: #ffe80a;
  font-size: 20px;
  font-weight: 300;
}

/* flip the pane when hovered */
.event:hover .event_flip, .event.hover .event_flip {
  transform: rotateY(180deg);
}

.front, .event, .back {
  width:100%;
  aspect-ratio: 417/485;
  
}
.event.featured {
  flex-basis: 100%;
}
.event.featured, .featured .back, .featured .front {
  aspect-ratio: 2;
}


/* flip speed */
.event_flip {
  transition: 0.8s;
  transform-style: preserve-3d;
  position: relative;
}

/* hide back of pane during swap */
.front, .back {
  backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
}

/* front pane, placed above back */
.front {
  z-index: 2;
  transform: rotateY(0deg);
  background-color:#ef9023;
}

/* back, initially hidden pane */
.back {
  transform: rotateY(180deg);
  background-color: #e8f4f7;
  position: relative;
}
.back {padding: 2em; padding-top:0; padding-bottom: 0;}

.back .event_title {color: #000;padding-bottom: .75em; padding-top:30px;}
.back .event_full_details {
  overflow: auto;
  height: 100%;
  
}
.event_no_flip .front {
    
  background-color: #ef9023;
}
.event_no_flip:hover .front {
  
  background-color: #FFF;
}

.event_no_flip:hover .front .event_title {
  color: #000000;
} 

_::-webkit-full-page-media, _:future, :root .event:hover .event_flip {
        transform: none;
    }

    _::-webkit-full-page-media, _:future, :root .event .front {
        opacity: 1;
        transition: all .3s ease-out;
    }

    _::-webkit-full-page-media, _:future, :root .event:hover .front {
        opacity: 0;
        transition: all .3s ease-in;
        z-index: 0;
    }

    _::-webkit-full-page-media, _:future, :root .event .back {
        transform: none;
    }

.wp-block-cover, .entry-content iframe, .events .featured_image {
  filter: drop-shadow(2px 5px 3px rgba(0,0,0,.5));
}
.events .featured_image {
  margin-bottom:50px;
}
.events p {
  padding-left:10%;
  padding-right:10%;
}

.events .wp-block-buttons {
  justify-content: center;
}
.events .entry-content {
  text-align:center;
  margin-bottom:50px;
}

.dark-text .event_title {color: #404040; text-shadow: 0px 0px 7px #ffffff77;}

.dark-text .event_date {
    color: #43a2c1; text-shadow: 0px 0px 7px #ffffff77;
}

@supports not (aspect-ratio: 1/1) {
.event::before {
      content: "";
      float: left;
      padding-top: 116.3%;
    }
    
    .event::after {
      clear: left;
      content: "";
      display: block;
    } 
  }

@media (min-width: 768px) {
  .event_date {
    font-size: 30px;
  }
  .event_title {
    font-size: 45px;
  }
}

.event {
  position: relative;
  margin-bottom: 50px;
  flex-basis: calc(50% - 25px);
}
.ce-upcoming-root .event {
  display:none
}
.ce-upcoming-root .event:nth-child(-n+2) {display:block;}

@media (min-width: 1600px){
  .ce-upcoming-root .event {
  flex-basis:calc(33% - 25px);
  display:none
}
.ce-upcoming-root .event:nth-child(-n+3) {display:block;}
}

/* Second shortcode layout: [church_events_upcoming] */
.ce-upcoming-section {
  background: #000000;
  color: #ffffff;
  margin-top: 50px;
  margin-bottom: 50px;
  padding: 50px;
  width: 100%;
  position: relative;
}

.ce-upcoming-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: fit-content;
  flex-basis: max-content;
  flex-shrink: 0;
  flex-grow: 1;
  margin-bottom: 0;
}

.ce-upcoming-header h5,
.ce-upcoming-header h3 {
  margin: 0;
  text-transform: uppercase;
}

.ce-upcoming-header h5 {
  font-weight: 200;
  font-size: 20px;
  margin-bottom: 10px;
  color: #ffffff;
}

.ce-upcoming-header h3 {
  font-weight: 600;
  font-size: 36px;
  line-height: 1em;
  color: #ffffff;
  padding-bottom: 15px;
}

.ce-upcoming-link {
  color: #ffffff;
  font-weight: 200;
  font-size: 24px;
  text-decoration: none;
}

.ce-upcoming-link:hover {
  font-weight: 600;
  border-bottom: 1px solid #ffffff;
  text-decoration: none;
}

.ce-upcoming-events-wrap {
  display: flex;
  gap: 50px;
  flex-wrap: nowrap;
  position: relative;
}

.ce-upcoming-events-scroll {
  position: relative;
  display: inline-flex;
  gap: 30px;
  overflow-x: auto;
  scroll-behavior: smooth;
  width: calc(100% - 90px);
  padding: 0;
}

.ce-upcoming-card {
  position: relative;
  flex: 0 0 33%;
  min-width: 260px;
  aspect-ratio: 417 / 485;
  text-decoration: none;
  color: #ffffff;
  overflow: hidden;
  background: #ef9023;
  margin-bottom: 0;
}

.ce-upcoming-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ce-upcoming-card-details {
  position: absolute;
  bottom: 30px;
  left: 30px;
  right: 30px;
}

.ce-upcoming-card-title {
  font-size: 45px;
  line-height: 0.75em;
  font-weight: 600;
}

.ce-upcoming-card-date {
  margin-top: 10px;
  font-size: 30px;
  color: #ffe80a;
  font-style: italic;
}

.ce-upcoming-more {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  background: #102635;
}

.ce-upcoming-more span {
  position: relative;
  z-index: 2;
}

.ce-upcoming-nav {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  background-color: #ef9023;
  color: #ffffff;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto 0;
  z-index: 3;
}

.ce-upcoming-next {
  right: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='15' height='15' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m21.71 11.29-7-7a1 1 0 0 0-1.42 1.42l5.3 5.29H3a1 1 0 0 0 0 2h15.59l-5.3 5.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l7-7a1 1 0 0 0 0-1.42Z' style='fill:%23FFF'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 50% 50%;
}

.ce-upcoming-prev {
  right: 65px;
  background-image: url("data:image/svg+xml,%3Csvg width='15' height='15' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.29 12.71a1 1 0 0 1 0-1.42l7-7a1 1 0 1 1 1.42 1.42L5.41 11H21a1 1 0 1 1 0 2H5.41l5.3 5.29a1 1 0 0 1-1.42 1.42l-7-7Z' style='fill:%23FFF'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 50% 50%;
}

@media (max-width: 767px) {
  .ce-upcoming-section {
    padding: 50px 20px;
  }

  .ce-upcoming-events-wrap {
    display: block;
  }

  .ce-upcoming-header {
    text-align: center;
    align-items: center;
    margin-bottom: 30px;
  }

  .ce-upcoming-header h3 {
    font-size: 50px;
    margin-bottom: 30px;
  }

  .ce-upcoming-link {
    display: none;
  }

  .ce-upcoming-events-scroll {
    width: 100%;
    gap: 25px;
  }

  .ce-upcoming-card {
    min-width: 100%;
    flex-basis: 100%;
  }

  .ce-upcoming-nav {
    display: none;
  }
}

/* Mirrored structure for [church_events_upcoming] */
.ce-upcoming-root .event_section {
  background-color: #000;
  margin-top: 50px;
  margin-bottom: 50px;
  padding: 50px;
  gap: 50px;
  flex-wrap: nowrap;
  width: 100%;
  position: relative;
  display: flex;
}

.ce-upcoming-root .header {
  flex-basis: max-content;
  flex-shrink: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-width: fit-content;
}

.ce-upcoming-root .header h5 {
  font-weight: 200;
  text-transform: uppercase;
  margin: 0 0 10px;
  font-size: 20px;
  color: #fff;
}

.ce-upcoming-root .header h3 {
  text-transform: uppercase;
  font-weight: 600;
  margin: 0;
  font-size: 36px;
  color: #fff;
  padding-bottom: 15px;
  line-height: 1em;
}

.ce-upcoming-root .slant.hidden-m-down {
  font-weight: 200;
  color: #fff;
  font-size: 24px;
  text-decoration: none;
}

.ce-upcoming-root .slant.hidden-m-down:hover {
  font-weight: 600;
  border-bottom: 1px solid #fff;
}

.ce-upcoming-root .events {
  display: flex;
  flex-shrink: 1;
  gap: 25px;
  flex-grow: 1;
  position: relative;
  overflow: hidden;
}

.ce-upcoming-root .events_scroll {
  position: absolute;
  top: 0;
  bottom: 0;
  right: auto;
  left: 0;
  display: inline-block;
  transition: 0.8s;
  gap: 30px;
}

.ce-upcoming-root .events_scroll .event {
  margin-bottom: 0;
  flex-basis: 33%;
}

.ce-upcoming-root .scroll_events {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 25px;
  left: auto;
  display: flex;
  align-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.ce-upcoming-root .scroll_events .reverse {
  display: none;
}

.ce-upcoming-root .scroll_events .forward.icon,
.ce-upcoming-root .scroll_events .reverse.icon {
  width: 50px;
  height: 50px;
  border-radius: 500px;
  background-color: #ef9023;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  cursor: pointer;
}

.ce-upcoming-root .scroll_events .forward.icon {
  background-image: url("data:image/svg+xml,%3Csvg width='15' height='15' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m21.71 11.29-7-7a1 1 0 0 0-1.42 1.42l5.3 5.29H3a1 1 0 0 0 0 2h15.59l-5.3 5.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l7-7a1 1 0 0 0 0-1.42Z' style='fill:%23FFF'/%3E%3C/svg%3E");
}

.ce-upcoming-root .scroll_events .reverse.icon {
  background-image: url("data:image/svg+xml,%3Csvg width='15' height='15' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.29 12.71a1 1 0 0 1 0-1.42l7-7a1 1 0 1 1 1.42 1.42L5.41 11H21a1 1 0 1 1 0 2H5.41l5.3 5.29a1 1 0 0 1-1.42 1.42l-7-7Z' style='fill:%23FFF'/%3E%3C/svg%3E");
}

.ce-upcoming-root .ce-upcoming-more-card .more,
.ce-upcoming-root .ce-upcoming-more-card .more-hover {
  position: absolute;
  top: 0;
  left: 0;
}

.ce-upcoming-root .ce-upcoming-more-card .more-hover {
  opacity: 0;
}

.ce-upcoming-root .ce-upcoming-more-card .more-hover:hover {
  opacity: 1;
}

.ce-upcoming-root .ce-upcoming-more-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  font-weight: 700;
  background: #ef9023;
  color: #ffffff;
}

.ce-upcoming-root .ce-upcoming-more-text:hover .ce-upcoming-more-fallback {
  background: #ffffff;
  color: #000000;
}

@media (max-width: 850px) {
  .ce-upcoming-root .event_section {
    flex-direction: column;
    align-content: center;
    gap: 30px;
    overflow: hidden;
    text-align: center;
  }

  .ce-upcoming-root .events {
    overflow: visible;
  }

  .ce-upcoming-root .scroll_events {
    position: relative;
    right: auto;
    justify-content: center;
  }

  .ce-upcoming-root .scroll_events .reverse {
    display: block;
    left: auto !important;
  }

  .ce-upcoming-root .header {
    align-self: center;
  }

  .ce-upcoming-root .header h3 {
    font-size: 50px;
    line-height: 1em;
    margin-bottom: 30px;
  }

  .ce-upcoming-root a.slant.hidden-m-down {
    display: none;
  }
}
