:root {
  --projeto1-img: url('https://images.unsplash.com/photo-1464983953574-0892a716854b?auto=format&fit=crop&w=900&q=80');
  --projeto2-img: url('https://images.unsplash.com/photo-1512918728675-ed5a9ecdebfd?auto=format&fit=crop&w=900&q=80');
  --projeto3-img: url('https://images.unsplash.com/photo-1454023492550-5696f8ff10e1?auto=format&fit=crop&w=900&q=80');
  --projeto4-img: url('https://images.unsplash.com/photo-1429041966141-44d228a42775?auto=format&fit=crop&w=900&q=80');
}

.cont {
  position: relative;
  overflow: hidden;
  height: 450px;
  min-height: 320px;
  margin: 40px 0 0 0;
  padding: 0;
  width: 100%;
  transition: height .3s;
}

@media (min-width: 950px) {
  .cont__inner {
    gap: 2vw;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: stretch;
    align-items: stretch;
  }
  .el,
  .el.s--active {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    margin: 0;
    height: 100%;
    border-radius: 26px;
    transition:
      flex-basis 0.6s cubic-bezier(.42,1.41,.43,.89),
      box-shadow 0.33s,
      z-index 0.18s,
      height .4s cubic-bezier(.3,1.2,.3,.89);
  }
  .el.s--active {
    flex: 5 1 50vw !important;
    box-shadow: 0 18px 45px #a9b79e75;
    z-index: 10;
  }
}

@media (max-width: 950px) {
  .cont { height: 340px; }
}
@media (max-width: 800px) {
  .cont { height: 550px; min-height: 290px; }
}
@media (max-width: 700px) {
  .cont {
    height: auto;
    min-height: 0;
    margin-top: 19px;
    margin-bottom: 19px;
    padding-bottom: 4vw;
  }
}

.cont__inner {
  display: flex;
  height: 100%;
  gap: 2vw;
  position: relative;
  width: 100%;
  transition: flex-direction .26s;
}
@media (max-width: 700px) {
  .cont__inner {
    flex-direction: column;
    gap: 18px 0;
    height: auto;
    width: 100%;
  }
}

/* Card base style */
.el {
  background: #fff;
  border-radius: 26px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: visible;
  box-shadow: 0 7px 22px #A9B79E33;
  position: relative;
  margin: 0;
  transition: 
    flex-basis 0.6s cubic-bezier(.42,1.41,.43,.89),
    box-shadow 0.33s,
    z-index 0.18s,
    height .4s cubic-bezier(.3,1.2,.3,.89);
  cursor: pointer;
  z-index: 1;
  outline: none;
}

.el:focus {
  box-shadow: 0 7px 22px #79947188, 0 0 0 2.5px #A9B79E;
}

.el.s--active {
  flex: 5 1 50vw !important;
  box-shadow: 0 18px 45px #a9b79e75;
  z-index: 10;
}

@media (max-width: 700px) {
  .el,
  .el.s--active {
    flex: 1 0 100%;
    width: 100%;
    min-height: 120px;
    max-height: none;
    height: 135px;
    margin-bottom: 0;
    margin-top: 0;
    border-radius: 18px;
    transition: height .36s cubic-bezier(.4,1.22,.35,.92), box-shadow 0.2s;
  }
  .el.s--active {
    height: 340px;
    z-index: 14;
    box-shadow: 0 10px 32px #A9B79E60;
  }
}

@media (max-width: 495px) {
  .el, .el.s--active { height: 96px; }
  .el.s--active { height: 294px; }
}

/* El Overflow & Inner */
.el__overflow {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  overflow: hidden;
  height: 100%;
  width: 100%;
  transition: border-radius .12s;
}
@media (max-width: 700px) {
  .el__overflow {
    border-radius: 18px;
  }
}
.el__inner {
  position: relative;
  height: 100%;
  width: 100%;
}

/* Bg for each card - now works via --bg-projeto inline */
.el__bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--bg-projeto) center center/cover, #d3e5da;
  transition: filter 0.34s, transform 0.6s;
  filter: brightness(0.97) contrast(1.06);
}

.el__bg:after {
  /* subtle gradient overlay for readability */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,rgba(44,68,63,0.16) 0%,rgba(169,183,158,0.13) 99%);
  pointer-events: none;
}

/* Overlay effect when card is ACTIVE */
.el .el__content .el__overlay-color {
  display:none;
}
.el.s--active .el__content .el__overlay-color {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(44,68,63,0.5); /* verde-folha-claro, 50% */
  border-radius: inherit;
  pointer-events: none;
  /* Fade in overlay with card */
  opacity: 1;
  transition: opacity 0.44s;
}

/* Top-Left heading */
.el__preview-cont {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 35px;
  pointer-events: none;
  transition: opacity 0.28s;
}
.el__heading {
  font-family: 'Familjen Grotesk', 'Montserrat', Arial, sans-serif;
  font-size: 2em;
  color: #fff;
  text-shadow: 0 4px 16px #2C443F77, 0 1px 2px #fff3;
  letter-spacing: 0.03em;
  font-weight: 700;
  background: rgba(44,68,63,0.32);
  border-radius: 16px;
  padding: 0.13em 1.2em 0.09em 1.2em;
  box-shadow: 0 1px 8px #a9b79e3e;
  pointer-events: auto;
}
@media (max-width: 950px) {
  .el__heading { font-size: 1.3em; }
  .el__preview-cont { padding: 24px 22px 18px 17px; }
}
@media (max-width: 700px) {
  .el__heading { font-size: 1.05em; padding: 0.11em 0.7em 0.08em 1em;}
  .el__preview-cont { padding: 18px 11px 11px 13px; }
}

/* Text over image and overlay */
.el__content {
  position: absolute;
  inset: 0;
  /* remove bg, because overlay will show on top */
  background: transparent;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.39s;
  padding: 32px 18px 32px 18px;
  border-radius: 26px;
}
.el.s--active .el__content {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 700px) {
  .el__content {
    /* Full absolute cover, overlay and text vertically/horizontally centered */
    border-radius: 18px;
    left: 0; right: 0; top: 0; bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8vw 5vw;
    box-shadow: 0 9px 22px #A9B79E30;
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.36s, top 0.5s, height 0.5s;
    background: none;
  }
  .el.s--active .el__content {
    opacity: 1 !important;
    pointer-events: auto !important;
    top: 0;
    left: 0;
    height: 100%;
    min-height: 120px;
    display: flex;
    border-radius: 18px;
  }

  /* Overlay covers all on mobile */
  .el.s--active .el__content .el__overlay-color {
    border-radius: 18px;
    opacity: 1;
    background: rgba(44,68,63,0.5);
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
  }

  .el__text {
    font-size: 1.07em;
    padding: 0 3vw;
    margin-bottom: 0.7em;
    z-index: 2;
    color: #fff;
    text-align: center;
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .el__close-btn { 
    top: 7px; right: 7px; width: 30px; height: 30px;
    z-index: 10;
  }
}

/* TEXTO EXIBIDO NO CARD ABERTO */
.el__text {
  position: relative;
  color: #fff;
  font-size: 1.25em;
  font-weight: 500;
  text-align: center;
  padding: 0 8vw;
  margin-bottom: 2em;
  letter-spacing: 0.01em;
  z-index: 2;
  font-family: 'Montserrat', 'Arial', sans-serif;
  /* on overlay */
}
@media (max-width: 700px) {
  .el__text { 
    font-size: 1.07em; 
    padding: 0 3vw; 
    margin-bottom: 0.7em;
  }
}

/* Fechar btn */
.el__close-btn {
  position: absolute;
  top: 21px;
  right: 24px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  transition: background 0.17s;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
}
.el__close-btn:before,
.el__close-btn:after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 4px;
  border-radius: 2px;
  background: #fffafa;
  transition: background 0.17s;
}
.el__close-btn:before { top: 20px; transform: rotate(45deg);}
.el__close-btn:after  { top: 20px; transform: rotate(-45deg);}
.el__close-btn:hover,
.el__close-btn:focus {
  background: rgba(169,183,158,0.34);
  outline: 2px solid #A9B79E;
}
@media (max-width: 700px) {
  .el__close-btn { 
    top: 7px; right: 7px; width: 30px; height: 30px;
  }
  .el__close-btn:before, .el__close-btn:after { 
    left: 8px; right: 8px; height:2.5px; top: 13px;
  }
}

/* Index number circle */
.el__index {
  position: absolute;
  left: 15px;
  bottom: 14px;
  z-index: 9;
  width: 48px;
  height: 48px;
  pointer-events:none;
}
.el__index-back,
.el__index-front,
.el__index-overlay {
  width: 100%;
  height: 100%;
  text-align: center;
  line-height: 48px;
  font-weight: bold;
  position: absolute;
  left: 0; top: 0;
  color: #fff;
  font-size: 1.4em;
  border-radius: 50%;
}
.el__index-front {
  z-index: 2;
  background: rgba(169,183,158,0.81);
  border: 2px solid #fff;
  box-shadow: 0 2px 12px #a9b79e28;
}
.el__index-overlay {
  z-index: 3;
  background: transparent;
}
.el__index-back {
  z-index: 1;
  color: #A9B79E;
  font-size: 2.1em;
  opacity: 0.44;
  top: 2px;
  left: 2px;
}
@media (max-width: 700px) {
  .el__index { left: 11px; bottom: 8px; width: 30px; height: 30px;}
  .el__index-front,
  .el__index-overlay,
  .el__index-back { line-height: 30px; font-size: 1em;}
}

/* Animations for entry effect */
.cont.s--inactive .el__inner {
  transform: translateY(30%);
  opacity: 0.07;
  transition: transform 0.7s, opacity 0.7s;
}
.cont:not(.s--inactive) .el__inner {
  transform: none;
  opacity: 1;
}

/* Ajuste: apenas um .el.s--active com z-index no mobile, evite sobreposições */
@media (max-width:700px){
  .el { z-index: 1; }
  .el.s--active { z-index: 20; }
}

/* Responsivo para evitar sobreposição de cards */
@media (max-width: 700px) {
  .cont__inner { flex-direction: column; gap: 22px;}
  .el { margin: 0 0 0 0 !important; }
  .el:not(:last-child) { margin-bottom: 23px;}
}