@charset "UTF-8";

.blog-container {
	max-width: 1200px;
	margin: auto;
	display: flex;
	flex-direction: column;
	gap: 30px;
}

h1 {
  text-align: center;
  margin-bottom: 0;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
}

.filters input,
.filters select,
.filters button {
  padding: 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  box-sizing: border-box;
}

.read-more-btn,
.filters button,
.global-close-btn {
  margin-top: 10px;
  background-color: #f59e42;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  align-self: flex-start;
  user-select: none;
  transition: background-color 0.3s ease;
}

.read-more-btn:hover,
.filters button:hover,
.global-close-btn:hover {
  background-color: #d97f2d;
}

.active-filters {
  font-size: 0.9em;
  color: #555;
  margin-top: 5px;
}

.posts-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#expandedPostContainer {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 40px;
  z-index: 10;
  display: none;
}

#postsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

article.blog-post {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
}

.blog-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.blog-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.blog-title {
  font-size: 1.2em;
  margin-bottom: 10px;
  color: var(--primary);
}

.content-preview {
  max-height: 3.2em;
  overflow: hidden;
  position: relative;
}

.content-preview::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 1.2em;
  background: linear-gradient(transparent, var(--card-bg) 90%);
  pointer-events: none;
}

.content-expanded {
  max-height: none !important;
  overflow: visible !important;
  position: static !important;
}

.content-expanded::after {
  content: none !important;
}

.tags, .category {
  margin-top: auto;
}

.tag, .category {
  display: inline-block;
  background: #e0e0e0;
  color: #333;
  font-size: 0.75em;
  padding: 4px 10px;
  margin-right: 5px;
  margin-top: 5px;
  border-radius: 20px;
}

.hidden {
  display: none !important;
}

.blog-post.expanded {
  max-width: 100%;
  background: white;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  border-radius: var(--border-radius);
  position: relative;
  z-index: 5;
  animation: fadeIn 0.3s ease;
}

.blog-post.expanded .blog-image {
  height: auto;
  max-height: 400px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  #postsGrid {
	grid-template-columns: 1fr;
  }

  .blog-post.expanded .blog-image {
	max-height: 250px;
  }
}
@media (max-width: 400px) {
  .filters {
	flex-direction: column;
  }
}