html,
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background-color: white;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
}

.nav-header {
  display: flex;
  flex-direction: row;
  text-align: center;
  margin-bottom: 0.5rem;
  width: 100%;
  height: fit-content;
  align-items: center;
  padding: 0.75rem 2rem;
  box-shadow: 0 2px 6px lightgray;
  box-sizing: border-box;
}

nav {
  display: flex;
  flex-direction: row-reverse;
  width: 100%;
  height: fit-content;
  align-items: center;
  gap: 1.5rem
}

nav a {
  color: white;
  text-decoration: none;
  border: 1px solid orange;
  background-color: orange;
  padding: 0.5rem 0.75rem;
  border-radius: 3rem;
}

.container {
  display: flex;
  flex-direction: column;
  width: 90%;
  /* height: 100%; */
  max-width: 800px;
  max-height: calc(100vh - 12rem);
  padding: 2rem;
  margin: 2rem;
  margin-top: 1rem !important;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 6px lightgray;
  color: black;
  overflow: hidden; /* keep internal scrolling inside the card */
}

header h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.5px;
  color: black;
}

h2,
h3 {
  margin: 0;
}

main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1 1 auto; /* allow main to grow/shrink inside the card */
  min-height: 0; /* important for children to scroll properly */
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.post {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid lightgray;
  box-shadow: 0 2px 6px lightgray;
  font-size: 0.98rem;
  color: black;
}

.post-body {
  overflow: hidden;
  line-height: 1.25rem;
  max-height: 8rem;
  word-wrap: break-word;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;

  textarea,
  input {
    display: flex;
  }
}

input, textarea {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid lightgray;
  outline: none;
  font-size: 0.95rem;
}

input:focus, textarea:focus {
  border-color: black;
  box-shadow: 0 0 0 4px lightgray;
}

input[type="button"], input[type="submit"] {
  background: orange;
  color: white;
  border: 0;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

#no-posts-disclaimer {
  font-style: italic;
  display: flex;
  width: 100%;
  justify-content: center;
  color: gray;
}

.form {
  display: flex;
  flex-direction: column;
  width: 100%;
  justify-content: center;
}

.form-note {
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin-top: 0.75em;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

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

.new-post-input {
  resize: none;
}
