body {
  font-family: Arial, sans-serif;
  margin: 30px;
  line-height: 1.6; /* Makes text more readable */
}

h1 {
  font-size: 2rem;
}

/* Header section styling */
.my-header {
  text-align: center;
  font-size: 2rem;
}

/* General section box styling */
.section {
  margin-top: 15px;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

/* Styling for form fields inside the "New Post" form */
#new-post-form .form-group {
  display: flex;
  flex-direction: column; 
  gap: 10px;
  margin-top: 10px;
}

/* General form-group styles (also used in edit form) */
.form-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

/* Inputs and textarea basic styles */
input[type="text"],
textarea {
  padding: 8px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  flex: 1;
  min-width: 180px;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Container for submit/cancel buttons */
.button-group {
  margin-top: 10px;
}

button {
  padding: 8px 16px;
  font-size: 1rem;
  margin-right: 10px;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background-color: #007BFF;
  color: white;
}

button.cancel {
  background-color: #ccc;
  color: black;
}

/* Remove top margin on headings */
h2, h3, h4 {
  margin-top: 0;
}

/* Utility class to hide sections (like edit form) */
.hidden {
  display: none;
}

#post-list h3:hover {
  text-decoration: underline;
}

/* Styling for the post detail panel */
#post-detail {
  min-height: 100px;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 5px;
}

/* Layout: two side-by-side columns */
.main-container {
  display: flex;
  gap: 20px; 
}

/* Left side for post list & form */
.left-column {
  flex: 1;
}

/* Right side for post details & edit form */
.right-column {
  flex: 1;
}

#post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

/* Individual post item */
#post-list > div {
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f8f9fa;
}

/* Post title style */
#post-list h3 {
  margin: 0;
  color: #007BFF;
  cursor: pointer;
}

/* Image inside post detail */
#post-detail img {
  width: 100%;
  max-width: 350px;
  height: 200px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 10px;
}

/* Post header: title + buttons side-by-side */
.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

/* Post title and author */
.post-info h2 {
  margin: 0 0 5px 0;
}
.post-info p {
  margin: 0;
  color: #666;
}

/* Edit and Delete buttons container */
.post-actions {
  display: flex;
  gap: 10px;
}
