*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: #f6f1e8;
  color: #2c2416;
  line-height: 1.6;
}

a {
  color: #6b4f2a;
}

header {
  background: #2c2416;
  color: #f6f1e8;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

header nav form {
  display: flex;
  align-items: center;
  margin: 0;
}

header nav a,
header nav button,
header button.link {
  color: #f6f1e8;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
  margin: 0;
  line-height: 1.6;
  display: inline-flex;
  align-items: center;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: #fffdf8;
  border: 1px solid #ddd2c0;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.meta {
  color: #7a6a52;
  font-size: 0.95rem;
}

.entry-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.entry-list li {
  margin-bottom: 0.75rem;
}

.entry-list a {
  text-decoration: none;
  font-weight: 600;
}

form label {
  display: block;
  margin-top: 1rem;
  font-weight: 600;
}

form input[type="text"],
form input[type="password"],
form input[type="number"],
form select,
form textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbbda8;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

form textarea {
  min-height: 220px;
  resize: vertical;
}

.date-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.card button,
.auth-box button,
.search-bar button,
a.button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 8px;
  background: #6b4f2a;
  color: #fff;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

button.secondary,
a.button.secondary {
  background: #9a8668;
}

.error {
  background: #fde8e8;
  color: #8a1f1f;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-bar input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbbda8;
  border-radius: 8px;
  font: inherit;
}

.story-entry {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5dccf;
}

.story-entry:last-child {
  border-bottom: none;
}

.story-body {
  white-space: pre-wrap;
}

.attachments {
  list-style: none;
  padding: 0;
}

.attachments li {
  margin-bottom: 0.35rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.auth-box {
  max-width: 420px;
  margin: 4rem auto;
}

@media print {
  header,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
  }

  main {
    max-width: none;
  }
}
