/* Portfolio Grid Container */
.portfolio-grid-container {
  max-width: 1225px;
  margin: 0 auto;
  padding: 0 24px;
  padding-bottom: 100px;
}

/* Portfolio Card */
.portfolio-card {
  border: none !important;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 550px;
  position: relative;
}

.portfolio-card:hover {
  border: none !important;
}
.portfolio-card .card-link:hover {
  border: none !important;
}
.portfolio-card > a {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
  padding: 0;
  position: relative;
}

/* Portfolio Card Image */
.portfolio-card-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background-color: rgb(0 0 0 / 0.4);
}

.portfolio-card-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgb(0 0 0 / 0.4);
  z-index: 5;
}

.portfolio-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease-in-out;
  position: relative;
  z-index: 1;
}

.portfolio-card:hover .portfolio-card-image img {
  transform: scale(1.05);
}

/* Portfolio Card Title */
.portfolio-card-title {
  position: absolute;
  bottom: 90px; /* Отступ от низа для описания */
  left: 0;
  right: 0;
  padding: 1.5rem 1.5rem 0 1.5rem;
  z-index: 10;
}

.portfolio-card-title h3 {
  font-size: 60px; /* text-2xl */
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  text-align: right;
  direction: rtl;
}

/* Portfolio Card Description */
.portfolio-card-description {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 1.5rem 1.5rem 1.5rem;
  color: #e5e7eb; /* gray-400 */
  font-size: 18px; /* text-lg */
  line-height: 1.6;
  text-align: right;
  direction: rtl;
  z-index: 10;
}

/* Grid Layout */
.portfolio-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

/* Alternating layout: 1st row = 1 item, 2nd row = 2 items, 3rd row = 1 item, etc. */
.portfolio-card:nth-child(3n + 1) {
  grid-column: 1 / -1; /* Span full width for 1st, 4th, 7th, etc. items */
}

.portfolio-card:nth-child(3n + 2),
.portfolio-card:nth-child(3n + 3) {
  grid-column: auto; /* Normal positioning for 2nd, 3rd, 5th, 6th, etc. items */
}

/* Responsive Design */
@media (max-width: 1024px) {
  .portfolio-grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .portfolio-card {
    height: 350px;
  }

  .portfolio-card-title h3 {
    font-size: 1.25rem;
  }

  .portfolio-card-description {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .portfolio-grid-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .portfolio-card {
    height: 300px;
  }

  .portfolio-card-description {
    padding: 0.75rem 1rem 1rem 1rem;
  }
}

@media (max-width: 480px) {
  .portfolio-card {
    height: 250px;
  }

  .portfolio-card-title h3 {
    font-size: 1.125rem;
  }

  .portfolio-card-description {
    font-size: 0.875rem;
  }
}

/* Portfolio Intro Section */
.portfolio-intro {
  text-align: right;
  margin-bottom: 3rem;
  padding: 8rem 24px 0 24px;
}

.portfolio-intro h2 {
  font-size: 72px; /* text-5xl */
  font-weight: 900; /* font-black */
  color: #ffffff;
  margin-bottom: 1rem;
  letter-spacing: -0.025em; /* tracking-tighter */
  line-height: 1;
}

@media (max-width: 768px) {
  .portfolio-intro h2 {
    font-size: 2.25rem; /* text-4xl */
  }
}

@media (max-width: 480px) {
  .portfolio-intro h2 {
    font-size: 1.875rem; /* text-3xl */
  }
}
