body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #f4f4f4;
  color: #333;
  line-height: 1.6;
}

header {
  background-color: #333;
  color: #fff;
  padding: 1em;
  text-align: center;
}

ul {
    list-style-type:square;
}

.posts {
    max-width: 800px;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.post {
    display: flex;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease-in-out;
}

.post:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.post img {
    max-width: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
    flex-shrink: 0;
}

.post-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
}

.post-images img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

.back-link {
    margin: 20px;
}

.line {
    height: 2px;
    background-color: #d8d8d8;
    margin: 20px 0;
}

.content {
    flex: 1;
    white-space: pre-wrap; /* preserves newlines and spaces */
}

.post h2 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.post sub {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 10px;
    display: block;
}

.post p {
    margin: 0;
    line-height: 1.4;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3; /* Show first 3 lines */
    -webkit-box-orient: vertical;
}

.post button {
    margin-top: 15px;
    padding: 8px 12px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease-in-out;
  }

.post button:hover {
    background-color: #555;
}

.post-image {
    margin-top: 10px;
}

.post-form {
    margin-top: 10px;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
}

.post-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.post-form textarea {
    width: 100%;
    height: 300px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
}

.post-form input[type="file"] {
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }

.post-link {
    text-decoration: none;
    color: inherit;
}

header a {
  color: white;
  text-decoration: none;
  cursor: pointer;
}

.post-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.post-content h1 {
  margin-top: 0;
}

.post-content sub {
  color: #888;
  font-size: 0.9em;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2em;
}

form {
  margin-top: 1em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
}

form input {
  padding: 10px;
  font-size: 16px;
  width: 100%;
}

button {
  background-color: #333;
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}

footer {
  margin-top: auto;
  background-color: #333;
  color: #fff;
  padding: 1em;
  text-align: center;
}

footer a {
  color: #fff;
}