/* Font Face Declaration */
@font-face {
  font-family: "Encorpada Classic";
  src: url("fonts/encorpada/EncorpadaClassic-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Helvetica Neue";
  src: url("fonts/helvetica-neue/HelveticaNeueRoman.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.hovergrid {
  width: 100vw;
  margin: 0;
  padding: 0;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-bottom: 0;
}

.hovergrid__grid {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
  padding: 0;
  align-items: stretch;
}

.hovergrid__item {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
  cursor: pointer;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  width: 50%;
  height: 75vh;
  flex-shrink: 0;
}

.hovergrid__item:nth-child(1),
.hovergrid__item:nth-child(2),
.hovergrid__item:nth-child(3),
.hovergrid__item:nth-child(4) {
  margin-bottom: 0;
}

/* On hover, the item itself expands */
.hovergrid__item:hover {
  width: 80% !important;
  /* height: 50vh !important; */
  z-index: 10;
}

/**
 * MODIFIED: This class will now be added by JavaScript to the sibling element,
 * allowing us to shrink items in either direction.
 */
.hovergrid__item--shrinking {
  width: 20% !important;
  /* height: 50vh !important; */
}

/**
 * REMOVED: The old CSS-only rule is no longer needed because it can't select
 * a previous sibling, causing the bug.
 */
/*
.hovergrid__item:nth-child(1):hover + .hovergrid__item:nth-child(2),
.hovergrid__item:nth-child(3):hover + .hovergrid__item:nth-child(4) {
	width: 20% !important;
	height: 50vh !important;
}
*/

.hovergrid__image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin: 0;
  padding: 0;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hovergrid__item:hover .hovergrid__image {
  transform: scale(1.1);
}

.hovergrid__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(47, 58, 41, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-100%);
}

.hovergrid__item--active .hovergrid__title {
  opacity: 1;
}

.hovergrid__item--active .hovergrid__description {
  opacity: 1;
}

.hovergrid__item:nth-child(1):hover .hovergrid__overlay,
.hovergrid__item:nth-child(3):hover .hovergrid__overlay {
  opacity: 1;
  transform: translateX(0);
}

.hovergrid__item:nth-child(2) .hovergrid__overlay,
.hovergrid__item:nth-child(4) .hovergrid__overlay {
  transform: translateX(100%);
}

.hovergrid__item:nth-child(2):hover .hovergrid__overlay,
.hovergrid__item:nth-child(4):hover .hovergrid__overlay {
  opacity: 1;
  transform: translateX(0);
}

.hovergrid__content {
  text-align: center;
  color: #d99f5b;
  padding: 2rem 4rem;  
}

.hovergrid__title {
  font-size: 2.5rem !important;
  font-weight: 200;
  margin: 0 0 25px 0;
  font-family: "Encorpada Classic", "Times New Roman", Times, serif !important;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  line-height: 1 !important;
  transform: scaleY(1.1);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
  font-stretch: condensed;
}

.hovergrid__description {
  font-size: 1.2rem;
  line-height: 1.7;
  max-width: 100%;
  margin: auto !important;			
  font-family: "DIN Next Level Light" !important;
  font-weight: 300 !important;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.8s;
}

.hovergrid__item:hover .hovergrid__title,
.hovergrid__item:hover .hovergrid__description {
  opacity: 1;
}

/* Tablet Styles - 2x2 Grid with Click */
@media (max-width: 1024px) and (min-width: 769px) {
  .hovergrid__grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(2, auto) !important;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  .hovergrid__item {
    width: 100% !important;
    height: 400px !important;
    position: relative;
    margin: 0;
    padding: 0;
  }

  .hovergrid__item:hover {
    width: 100% !important;
    height: 400px !important;
    transform: none !important;
  }

  .hovergrid__item--shrinking {
    width: 100% !important;
    height: 400px !important;
  }

  .hovergrid__overlay {
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .hovergrid__item--active .hovergrid__overlay {
    opacity: 1;
    transform: translateX(0);
  }

  .hovergrid__title {
    font-size: 1.5rem !important;
    font-weight: 200;
    line-height: 1 !important;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
  }

  .hovergrid__description {
    font-size: 0.9rem;
    font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.8s;
    padding: 0 1rem;
  }

  .hovergrid__title {
    font-size: 1.8rem;
    font-weight: 200;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
  }

  .hovergrid__description {
    font-size: 1rem;
    font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.8s;
  }

  .hovergrid__content {
    padding: 0;
    color: #d99f5b;
  }
}

/* Mobile Styles - 1x4 Grid */
@media (max-width: 768px) {
  .hovergrid__grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(4, auto) !important;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  .hovergrid__item {
    width: 100% !important;
    height: 350px !important;
    margin: 0;
    padding: 0;
  }

  .hovergrid__item:hover {
    width: 100% !important;
    height: 350px !important;
    transform: none !important;
  }

  .hovergrid__item--shrinking {
    width: 100% !important;
    height: 350px !important;
  }

  .hovergrid__overlay {
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .hovergrid__item--active .hovergrid__overlay {
    opacity: 1;
    transform: translateX(0);
  }

  .hovergrid__title {
    font-size: 1.5rem !important;
    font-weight: 200;
    line-height: 1 !important;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
  }

  .hovergrid__description {
    font-size: 0.9rem;
    font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.8s;
    padding: 0 1rem;	
  }

  .hovergrid__content {
    padding: 0;
    color: #d99f5b;
  }
}

@media (min-width: 768px) {
	.hovergrid__description {
		max-width: 80%;	
	}
}

@media (min-width: 1200px) {
	.hovergrid__description {
		max-width: 70%;	
	}
}

@media (min-width: 1400px) {
	.hovergrid__description {
		max-width: 60%;			
	}
}

@media (min-width: 1920px) {
  .hovergrid {
    width: 100%;    
    left: 0;
    right: 0;
    margin-left: 0;
    margin-right: 0;
  }
	
	.hovergrid__description {
		max-width: 50%;	
	}
}
