.yps-projects-wrap,
.yps-projects-wrap * {
  box-sizing: border-box;
}

.yps-projects-wrap {
  font-family: inherit;
  width: 100%;
}

.yps-carousel {
  position: relative;
}

.yps-carousel-head {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 18px;
}

.yps-carousel-btn {
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: .9;
  transition: opacity .2s ease, transform .2s ease, background-color .2s ease;
}

.yps-carousel-btn:hover,
.yps-carousel-btn:focus {
  opacity: 1;
  transform: translateY(-1px);
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.yps-carousel-viewport {
  overflow: hidden;
  width: 100%;
}

.yps-carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(360px, calc((100% - 56px) / 3));
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 8px 4px 26px;
}

.yps-carousel-track::-webkit-scrollbar {
  display: none;
}

.yps-grid {
  display: grid;
  gap: 30px;
}

.yps-grid-1 { grid-template-columns: 1fr; }
.yps-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.yps-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.yps-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.yps-project-card {
  --yps-card-bg: linear-gradient(135deg, rgba(0,0,0,.72), rgba(0,0,0,.35));
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 540px;
  overflow: hidden;
  border-radius: 24px;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
  scroll-snap-align: start;
  isolation: isolate;
  transition: transform .25s ease, box-shadow .25s ease;
}

.yps-project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 70px rgba(0,0,0,.24);
}

.yps-project-bg,
.yps-project-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.yps-project-bg {
  background-image: var(--yps-card-bg);
  background-size: cover;
  background-position: center;
  transform: scale(1.01);
  transition: transform .55s ease;
}

.yps-project-card:hover .yps-project-bg {
  transform: scale(1.07);
}

.yps-project-shade {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0,0,0,.20) 0%, rgba(0,0,0,.48) 43%, rgba(0,0,0,.88) 100%),
    linear-gradient(90deg, rgba(0,0,0,.58) 0%, rgba(0,0,0,.14) 55%, rgba(0,0,0,.44) 100%);
}

.yps-project-body {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  width: 100%;
  padding: 28px;
}

.yps-project-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.yps-project-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--wp--preset--color--primary, rgba(255,255,255,.18));
  color: var(--wp--preset--color--base, #fff);
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: .78em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .02em;
}

.yps-project-title {
  margin: 0;
  font-family: inherit;
  color: #fff;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.15;
  font-weight: 800;
  text-wrap: balance;
}

.yps-project-desc {
  margin: 0;
  color: rgba(255,255,255,.86);
  line-height: 1.75;
  font-size: .98rem;
}

.yps-project-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.yps-project-meta div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.12);
}

.yps-project-meta dt,
.yps-project-meta dd {
  margin: 0;
}

.yps-project-meta dt {
  color: rgba(255,255,255,.68);
  font-weight: 700;
  font-size: .72em;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.yps-project-meta dd {
  color: #fff;
  font-weight: 700;
  font-size: .93em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.yps-no-projects {
  margin: 0;
}

@media (max-width: 1100px) {
  .yps-carousel-track {
    grid-auto-columns: calc((100% - 24px) / 2);
  }
  .yps-grid-4,
  .yps-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 782px) {
  .yps-project-card {
    min-height: 500px;
    border-radius: 20px;
  }
  .yps-project-body {
    padding: 22px;
  }
  .yps-project-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .yps-carousel-head {
    justify-content: center;
  }
  .yps-carousel-track {
    grid-auto-columns: 88%;
    gap: 16px;
  }
  .yps-grid-4,
  .yps-grid-3,
  .yps-grid-2 {
    grid-template-columns: 1fr;
  }
}
