/* Posts Section Styles */
@import "../modules/preLoader.css";

.posts {
  padding: var(--section-spacing) 0;
  min-height: calc(100vh - 56px);
  background-color: rgb(var(--bg2-color));
}

/* Posts Grid */
.posts-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
  opacity: 0;
}

/* Post Card */
.post-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.post-card p {
  display: -webkit-box;
  text-overflow: ellipsis;
  overflow: hidden;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
}

.post-card:hover {
  box-shadow: var(--hover-shadow);
  transform: translateY(-5px);
  -webkit-transform: translateY(-5px);
  -moz-transform: translateY(-5px);
  -ms-transform: translateY(-5px);
  -o-transform: translateY(-5px);
}

.post-image {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
}

.post-image img {
  object-fit: cover;
  height: 200px;
}

.post-card:hover .post-image img {
  transform: scale(1.05);
}

.post-header {
  margin-bottom: 15px;
  font-family: var(--Roboto-font);
}

.post-date {
  font-size: 14px;
  color: rgb(var(--p-color));
  opacity: 0.8;
}

.post-content {
  flex-grow: 1;
  margin-bottom: 20px;
}

/* Post Tags */
.post-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 12px;
  background: rgba(var(--h1-color), 0.1);
  color: rgb(var(--h1-color));
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--Poppinsin-font);
}

.tag:hover {
  background: rgba(var(--h1-color), 0.2);
}

/* Read More Link */
.read-more {
  position: relative;
  font-weight: 500;
}

.read-more::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: rgb(var(--h1-color));
}

.read-more:hover::after {
  width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }

  .filter-btn {
    padding: 6px 15px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .post-card {
    max-width: 100%;
  }
}

/* Dark Mode Adjustments */
.dark-mode .post-card {
  background: rgb(var(--bg-color));
}

.dark-mode .tag {
  background: rgba(var(--h1-color), 0.15);
}

.dark-mode .tag:hover {
  background: rgba(var(--h1-color), 0.25);
}
/* Lightbox Styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
}

.lightbox.active {
  visibility: visible;
  opacity: 1;
}

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  cursor: pointer;
  z-index: 1;
}

.lightbox-content {
  position: relative;
  max-width: 900px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  background: rgb(var(--bg-color, 255, 255, 255));
  border-radius: var(--border-radius, 12px);
  padding: 30px;
  box-shadow: var(--standard-shadow, 0 4px 15px rgba(0, 0, 0, 0.3));
  transform: scale(0.9);
  opacity: 0;
  z-index: 2;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
  opacity: 1;
}

.close-lightbox {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: rgb(var(--bg-color, 255, 255, 255));
  border-radius: 50%;
  border: none;
  font-size: 24px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  color: rgb(var(--p-color, 0, 0, 0));
  box-shadow: var(--standard-shadow, 0 2px 10px rgba(0, 0, 0, 0.2));
  z-index: 3;
}

.close-lightbox:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.lightbox-image-container {
  text-align: center;
  margin-bottom: 20px;
}

.lightbox-image-container img {
  max-width: 100%;
  max-height: 60vh;
  border-radius: var(--border-radius, 12px);
  display: block;
  margin: 0 auto 20px;
  box-shadow: var(--standard-shadow, 0 4px 15px rgba(0, 0, 0, 0.3));
}

.post-title {
  font-family: "Roboto", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: rgb(var(--h1-color, 0, 0, 0));
  margin-bottom: 8px;
  padding-right: 50px;
}

.post-date#lightbox-date {
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  color: #888;
  display: block;
  margin-bottom: 15px;
}

#lightbox-content {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  color: rgb(var(--p-color, 0, 0, 0));
  line-height: 1.8;
}

.post-tags#lightbox-tags {
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  color: rgb(var(--primary-color, 0, 102, 204));
  margin-top: 15px;
}
