@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;800;900&display=swap');

*{
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

:root {
  --d: 700ms;
  --e: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ----------------------------------------
   CARD STRUCTURE
-------------------------------------------*/

.card1 {  
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  color: whitesmoke;
  cursor: pointer;
  overflow: hidden;
  z-index: 10;
}

/* Wrapper with animated border */
.card-border1 {
  position: relative;
  width: 320px;
  height: 300px;
  z-index: 9;
  pointer-events: none;
}

.card-border1::after,
.card-border1::before {
  content: "";
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  transition: transform 0.3s ease-in-out;
}

/* Default collapsed borders */
.card-border1::before { transform: scaleY(0); }
.card-border1::after  { transform: scaleX(0); }

/* ----------------------------------------
   CARD IMAGES (BACKGROUND)
-------------------------------------------*/

.card-border1:nth-child(1) .card1 {
  background-image: url(https://source.unsplash.com/HgxVSzUHDRY/320x460);
}
.card-border1:nth-child(2) .card1 {
  background-image: url(https://source.unsplash.com/St08jKkPVHw/320x460);
}
.card-border1:nth-child(3) .card1 {
  background-image: url(https://source.unsplash.com/bK8Wlaq7NaA/320x460);
}

/* ----------------------------------------
   BORDER COLORS PER CARD
-------------------------------------------*/

.card-border1:nth-child(1)::before,
.card-border1:nth-child(1)::after {
  border-color: #241f57;
  border-style: solid;
  border-width: 6px;
}

.card-border1:nth-child(2)::before,
.card-border1:nth-child(2)::after {
  border-color: #6aa6d8;
  border-style: solid;
  border-width: 6px;
}

.card-border1:nth-child(3)::before,
.card-border1:nth-child(3)::after {
  border-color: #759554;
  border-style: solid;
  border-width: 6px;
}

/* Border animation */
.card-border1:hover::before {
  transform: scaleY(1);
}
.card-border1:hover::after {
  transform: scaleX(1);
}

/* ----------------------------------------
   CONTENT INSIDE CARD
-------------------------------------------*/

.content1 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 1rem;
  transition: transform var(--d) var(--e);
  z-index: 2;
  transform: translateY(calc(100% - 4.5rem));
}

/* Slightly taller slide for cards 2 and 3 */
.card-border1:nth-child(2) .content1,
.card-border1:nth-child(3) .content1 {
  transform: translateY(calc(100% - 6.5rem));
}

/* Content fade overlay */
.content1::after{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200%;
  pointer-events: none;
  opacity: 0;
  background-image: linear-gradient(
    to bottom,
    hsla(0,0%,0%,0) 0%,
    hsla(0,0%,0%,0.79) 100%
  );
  transform: translateY(-50%);
  transition: opacity calc(var(--d) * 2) var(--e);
}

/* Hover animation */
.card1:hover .content1 {
  transform: translateY(0);
}
.card1:hover .content1::after {
  opacity: 1;
}

/* Child elements fade in */
.content1 > *:not(.title1) {
  opacity: 0;
  transform: translateY(1rem);
  transition: transform var(--d) var(--e), opacity var(--d) var(--e);
}

/* Reveal children on hover */
.card1:hover .content1 > *:not(.title1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--d) / 8);
}

/* ----------------------------------------
   CONTENT TYPOGRAPHY
-------------------------------------------*/

.title1 {
  width: 100%;
  font-size: 1.6rem;
  z-index: 3;
  margin-bottom: 1rem;
}

.text1 {
  font-size: 1rem;
  line-height: 1.8rem;
  z-index: 3;
}

/* ----------------------------------------
   LAYOUT SECTION
-------------------------------------------*/

.nowsection {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 1100px;
}

/* Heading overrides */
.nowsection h1,
.h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.25;
  color: #161c26;
  font-size: 1.6rem !important;
}

h2.maptitle {
  font-size: 2.5rem !important;
  padding: 40px 20px 20px;
  text-align: center;
}
