/* ALL THE CSS IS DONE WITH AN LLM */

/* Make element widths include their padding and borders. */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 40px 16px;
  font-family: Arial, sans-serif;
  background-color: #f3f4f6;
  color: #222222;
}

/* Center the application and limit its width. */
.page {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

h1,
h2 {
  text-align: center;
}

/* Display the form as a card. */
#post-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border: 1px solid #dddddd;
  border-radius: 10px;
  background-color: white;
  box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
}

/* Keep each label directly above its input. */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-weight: bold;
}

/* Give all inputs the same size and style. */
input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #aaaaaa;
  border-radius: 6px;
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: #2563eb;
  outline: 2px solid rgb(37 99 235 / 20%);
}

/* Style the submit button. */
button {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background-color: #2563eb;
  color: white;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background-color: #1d4ed8;
}

#error-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: none;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgb(0 0 0 / 25%);
}

#error-dialog::backdrop {
  background-color: rgb(0 0 0 / 45%);
}

.error-dialog-content {
  padding: 24px;
}

.error-dialog-content h2 {
  margin-top: 0;
  color: #b91c1c;
  text-align: left;
}

#error-message {
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Add space between the form and posts. */
.posts-section {
  margin-top: 32px;
}

/* Display every post in its own box. */
#posts article {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid #dddddd;
  border-radius: 10px;
  background-color: white;
  box-shadow: 0 2px 6px rgb(0 0 0 / 8%);
}

#posts article h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

#posts article button {
  margin-right: 8px;
}
