* {
  box-sizing: border-box;
}

body {
  font-family: "Trebuchet MS", Arial, sans-serif;
  margin: 0;
  background-color: #e6f0fa;
  color: #333;
  line-height: 1.4;
}

header {
  background: #3366cc;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #f0d76d;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  gap: 10px;
}

header h1 {
  font-size: 26px;
  margin: 0;
  font-weight: normal;
  text-shadow: 1px 1px 2px #224488;
}

.login-button {
  background-color: #f0d76d;
  color: #3366cc;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 3px;
  font-weight: bold;
  box-shadow: 1px 1px 0 #c1b040;
  transition: background-color 0.3s ease;
  font-size: 14px;
}

#searchInput {
  flex-grow: 1;
  margin: 0 20px;
  padding: 8px 12px;
  font-size: 16px;
  border-radius: 4px;
  border: none;
  max-width: 500px;
  box-shadow: inset 0 0 5px #aaa;
}

.login-button:hover {
  background-color: #e6c94f;
}

.container {
  display: flex;
  gap: 20px;
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

#sidebar {
  flex: 1;
  background: #fffbe6;
  padding: 16px;
  border: 1px solid #f0d76d;
  border-radius: 4px;
  box-shadow: 1px 1px 5px #ddd;
  font-size: 14px;
}

#sidebar h3 {
  margin-top: 0;
  color: #224488;
  font-size: 16px;
  border-bottom: 1px solid #f0d76d;
  padding-bottom: 4px;
}

#sidebar input[type="text"] {
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  border-radius: 4px;
  border: 1px solid #f0d76d;
  font-size: 14px;
}

#sidebar ul {
  list-style: none;
  padding-left: 0;
}

#sidebar ul li {
  margin: 6px 0;
  cursor: pointer;
  color: #3366cc;
  text-decoration: underline;
}

#sidebar ul li:hover {
  color: #224488;
}

main {
  flex: 3;
  background-color: #fff;
  padding: 20px;
  border: 1px solid #c9d7f1;
  border-radius: 4px;
  box-shadow: 2px 2px 6px #d7e2fb;
}

#posts div {
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
}

#posts h3 {
  margin: 0 0 6px 0;
  color: #224488;
  font-size: 20px;
  text-shadow: 1px 1px 0 #d7e2fb;
}

#posts p {
  font-size: 13px;
  font-style: italic;
  color: #666;
  margin: 0 0 10px 0;
}

#posts .post-snippet {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
}

.post-image {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 8px;
  box-shadow: 1px 1px 4px #ccc;
}

.read-more-button {
  background-color: #3366cc;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 1px 1px 0 #224488;
  transition: background-color 0.3s ease;
}

.read-more-button:hover {
  background-color: #224488;
}

#pagination {
  text-align: center;
  margin-top: 20px;
}

#pagination button {
  background-color: #f0d76d;
  border: none;
  padding: 6px 10px;
  margin: 0 4px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  color: #3366cc;
  font-weight: bold;
}

#pagination button:hover {
  background-color: #e6c94f;
}

body.login-page {
  background-color: #e6f0fa;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

form#loginForm {
  background: #fffbe6;
  padding: 24px 32px;
  border: 1px solid #f0d76d;
  border-radius: 6px;
  box-shadow: 2px 2px 8px #ccc;
  width: 320px;
  font-family: "Trebuchet MS", Arial, sans-serif;
}

form#loginForm h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #3366cc;
  text-shadow: 1px 1px 0 #c1b040;
  font-weight: normal;
}

form#loginForm input[type="text"],
form#loginForm input[type="password"] {
  width: 100%;
  padding: 10px 8px;
  margin-bottom: 14px;
  border: 1px solid #f0d76d;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

form#loginForm button {
  width: 100%;
  background-color: #3366cc;
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  font-weight: bold;
  box-shadow: 1px 1px 0 #224488;
  transition: background-color 0.3s ease;
}

form#loginForm button:hover {
  background-color: #224488;
}

.post-content img {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
  display: block;
  margin: 0 auto 1rem;
  border-radius: 8px;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #searchInput {
    margin: 0;
    width: 100%;
    max-width: none;
  }

  .container {
    flex-direction: column;
    padding: 10px;
    max-width: 100%;
  }

  #sidebar {
    width: 100%;
    margin-bottom: 20px;
    box-shadow: none;
    border: none;
    padding: 10px 0;
  }

  main {
    width: 100%;
    padding: 10px 0;
    box-shadow: none;
    border: none;
  }

  #posts div {
    margin-bottom: 20px;
    padding-bottom: 0;
    border-bottom: none;
  }

  #posts h3 {
    font-size: 18px;
  }

  #pagination button {
    padding: 8px 12px;
    margin: 4px 2px;
  }

  .read-more-button {
    padding: 8px 16px;
    font-size: 14px;
  }

  .post-image {
    max-height: 150px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 22px;
  }

  #searchInput {
    font-size: 14px;
  }

  .login-button {
    padding: 6px 10px;
    font-size: 12px;
  }

  #sidebar h3 {
    font-size: 14px;
  }

  #posts h3 {
    font-size: 16px;
  }

  .read-more-button {
    font-size: 12px;
    padding: 6px 12px;
  }
}

