/* Hero */
body > header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 448px;
  background: linear-gradient(
    to bottom,
    rgba(1, 60, 142, 0.8) 0%,
    rgba(1, 60, 142, 0.5) 100%
  );
}

body > header img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 448px;
  object-fit: cover;
  object-position: center;
  z-index: -1;
}

body > header h2 {
  font-size: 48px;
  font-weight: 700;
  color: #fff;
}

/* Blog Posts */
#blog-posts {
  display: grid;
  grid-template-columns: 1fr; /* default: 1 column */
  padding: 16px;
  gap: 16px;
}

@media screen and (min-width: 601px) {
  #blog-posts {
    padding: 32px 64px;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 1280px) {
  #blog-posts {
    padding: 32px 120px;
    grid-template-columns: repeat(3, 1fr);
  }
}

#blog-posts .post {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 332px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

#blog-posts .post img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: var(--transition);
}

#blog-posts .post:hover img {
  transform: translate(-50%, -50%) scale(1.1);
}

#blog-posts .post .content {
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  padding: 16px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 100%
  );
}

#blog-posts .post .content span {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

#blog-posts .post .content span time {
  font-weight: 400;
}

#blog-posts .post .content h3 {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
}

#blog-posts .post .content p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Post modal backdrop */
#post-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

#post-modal-backdrop.hidden {
  display: none;
}

/* Post modal box */
.post-modal {
  position: relative;
  background: #fff;
  margin: 0 16px;
  border-radius: 24px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: AUTO;
  padding: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  font-family: "Montserrat", sans-serif;
}

@media screen and (min-width: 600px) {
  .post-modal {
    margin: 0 64px;
  }
}

/* Close button */
.post-modal .close-btn {
  position: absolute;
  top: 8px;
  right: 24px;
  font-size: 48px;
  border: none;
  background: none;
  cursor: pointer;
}

/* Header */
.post-header {
  margin-bottom: 16px;
}

.post-header span {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.post-header h2 {
  padding: 0;
  text-align: left;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
}

.post-header time {
  font-size: 14px;
  color: #666;
}

/* Image */
.post-modal img {
  width: 100%;
  border-radius: 12px;
  margin: 16px 0;
}

/* Content */
.post-body {
  font-size: 16px;
  line-height: 1.6;
  color: #222222;
}
