body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #1C1C1C;
  color: #FFFFFF;
  overflow-x: hidden; 
}

.navbar {
  background-color: #2C2C2C;
  max-width: 100vw;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.logo img {
  width: 150px;
  height: auto;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 25px;
}

nav ul li a {
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  padding: 10px 20px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

nav ul li a:hover {
  background-color: #ffcc00;
  color: #2C2C2C;
}

.hero {
  position: relative;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #FFFFFF;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../img/blogmain.png');
  background-size: cover;
  background-position: top;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: 1;
}

.hero-text {
  font-size: 30px;
  position: relative;
  z-index: 2;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
  width: 100%;
}

.header-container h1 {
  margin: 0;
  flex-grow: 1;
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.sort-dropdown {
  display: flex;
  justify-content: right;
  align-items: center;
  padding-top: 40px;
  padding-right: 55px;
  z-index: 10;
  position: relative;
}

.sort-dropdown::after {
  content: '▼';
  color: #FFCC00;
  font-size: 10px;
  padding-right: 10px;
  position: absolute;
  pointer-events: none;
  z-index: 11;
}

.sort-dropdown select {
  width: 125px;
  outline: none;
  appearance: none;
  background-color: #333;
  color: #FFCC00;
  font-size: small;
  position: relative;
  padding-left: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
  z-index: 10;
}

select:focus {
  outline: none; 
  border-color: #FFCC00; 
}

select:hover {
  background-color: #FFCC00;
  color: #2C2C2C;
}
select::after {
  color: aqua;
}

h1 {
  font-family: 'Montserrat', sans-serif;
  text-align: center;
  color: #FFCC00;
  padding: 50px;
}


#posts-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px;
  padding-top: 20px;
  padding-left: 50px;
  padding-right: 50px;
  padding-bottom: 40px;
  overflow: visible !important;
  background-color: #1C1C1C;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  height: 400px; 
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.image-overlay {
  position: relative;
  overflow: hidden;
  height: 100%;
}

.image-overlay img {
  width: 100%;
  height: 100%; 
  object-fit: cover; 
  border-radius: 10px;
  transition: transform 0.4s ease;
}

.card:hover img {
  transform: scale(1.1);
}

.card-content {
  position: absolute;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  width: 100%;
  padding: 20px;
  color: #FFFFFF;
  overflow: hidden; 
  text-overflow: ellipsis;
  white-space: nowrap; 
}

.card h2 {
  margin: 0;
  font-size: 24px;
  white-space: nowrap;
  overflow: hidden; 
  text-overflow: ellipsis; 
}

.card p {
  margin: 10px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card a {
  color: #FFCC00;
  font-weight: bold;
  text-decoration: none;
}

.card a:hover {
  color: #FFFFFF;
}


.modal {
  display: none; 
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); 
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.modal-content h2 {
  color: #FFCC00;
  margin-bottom: 10px;
}

.modal-content p {
  color: #2C2C2C;
  margin-bottom: 20px;
}

.modal-content button {
  padding: 10px 20px;
  background-color: #FFCC00;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

.modal-content button:hover {
  background-color: #333;
  color: #fff;
}

.button-group {
  display: flex; 
  justify-content: flex-end; 
  gap: 10px; 
  padding-top: 25px; 
  padding-right: 55px;
}

.option-button {
  background-color: transparent; 
  color: #FFCC00; 
  border: 1px solid #FFCC00; 
  border-radius: 20px;
  padding: 5px 10px; 
  font-size: 12px; 
  cursor: pointer;
  opacity: 0.7;
  transition: box-shadow 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.option-button:hover {
  box-shadow: 0 0 10px #FFCC00; 
  color: #FFCC00;
  opacity: 1; 
}

.option-button:focus {
  outline: none;
  box-shadow: 0 0 10px #FFCC00;
  opacity: 1;
}

footer {
  color: #959595;
  background: transparent;
  display: flex; 
  justify-content: center;
  align-items: center; 
  padding: 50px 0 0 0;
  text-align: center; 
}

.footer-copyright {
  font-size: 14px;
  color: #4b4b4b;
  padding: 0;
  margin: 0;
}

@media screen and (max-width: 1024px) {
  .hero {
      height: 180px;
  }

  .hero-text {
      font-size: 24px;
  }

  .header-container {
      flex-direction: column;
      text-align: center;
  }

  .header-container h1 {
      font-size: 28px;
      position: static;
      transform: none;
  }

  .sort-dropdown {
      justify-content: center;
      padding-top: 20px;
      padding-right: 0;
  }

  .button-group {
      justify-content: center;
      padding-right: 0;
  }

  #posts-container {
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 20px;
      padding-left: 20px;
      padding-right: 20px;
  }

  .card {
      height: 350px;
  }

  .card h2 {
      font-size: 20px;
  }

  .card p {
      font-size: 14px;
  }

  footer {
      padding: 30px 0;
  }
}

@media screen and (max-width: 768px) {
  .hero {
      height: 140px;
  }

  .hero-text {
      font-size: 20px;
  }

  .header-container h1 {
      font-size: 24px;
  }

  .sort-dropdown select {
      width: 100px;
      font-size: 14px;
  }

  .button-group {
      gap: 5px;
  }

  #posts-container {
      grid-template-columns: 1fr;
      padding-left: 10px;
      padding-right: 10px;
  }

  .card {
      height: auto;
  }

  .card-content {
      padding: 10px;
  }

  .card h2 {
      font-size: 18px;
  }

  .card p {
      font-size: 12px;
  }

  footer {
      padding: 20px 0;
  }
}
