* {
  box-sizing: border-box;
}

.featured-post {
  background: rgba(255, 255, 255, 0.15); /* lighter glass */
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px;
  margin-top: 40px;
  transition: transform 0.3s ease, background 0.3s ease;
  perspective: 1000px;
  width: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-post:hover,
.featured-post:focus-within {
  transform: translateY(-10px);
}

.featured-post h2 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.featured-post p {
  font-size: 1.2rem;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.card-wrapper {
  perspective: 1000px;
  width: 100%;
  cursor: pointer;
  outline: none;
}

.card-wrapper:focus {
  outline: none;
}

/* Tilt effect on hover + tap (focus-within) */
.card-wrapper:hover .post-card,
.card-wrapper:focus-within .post-card {
  transform: rotateY(5deg) rotateX(5deg);
}

.card-wrapper:nth-child(even):hover .post-card,
.card-wrapper:nth-child(even):focus-within .post-card {
  transform: rotateY(-5deg) rotateX(5deg);
}

.post-card {
  background: rgba(255, 255, 255, 0.15); /* brighter glass on iPhone */
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, background 0.3s ease;
  padding: 15px;
  width: 100%;
  height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.post-card h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.post-card p {
  font-size: 1rem;
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
}

.post-card::after {
  content: attr(data-title);
  position: absolute;
  bottom: -1.6em;
  padding: 4px 4px 4px 8px;
  color: #ffffff;
  margin-left: -20vh;
  white-space: nowrap;
  border-radius: 5px;
  background-color: rgba(201, 203, 216, 0.14);
  opacity: 0;
  z-index: 99999;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.post-card:hover::after,
.post-card:focus-within::after {
  opacity: 1;
  visibility: visible;
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
  .featured-post {
    min-height: 250px;
  }

  .featured-post h2 {
    font-size: 2rem;
  }

  .featured-post p {
    font-size: 1rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    height: 220px;
  }

  .post-card h3 {
    font-size: 1.3rem;
  }

  .post-card p {
    font-size: 0.9rem;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }

  .post-card::after {
    margin-left: -15vh;
  }
}

@media screen and (max-width: 480px) {
  .featured-post {
    min-height: 200px;
  }

  .featured-post h2 {
    font-size: 1.8rem;
  }

  .featured-post p {
    font-size: 0.85rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .post-card {
    height: 200px;
  }

  .post-card h3 {
    font-size: 1.2rem;
  }

  .post-card p {
    font-size: 0.8rem;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }

  .post-card::after {
    margin-left: -10vh;
    font-size: 0.8rem;
    padding: 2px 4px;
  }
}


