* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background-color: #e3e0cd;
  color: #1d0b0b;
}

/* Header */

header {
  background-color: #8c1a1a;
  color: white;
  padding: 25px 0;
}

.header-container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.site-title {
  display: flex;
  flex-direction: column;
}

.site-title h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: normal;
  letter-spacing: 0.5px;
}

.site-title p {
  margin: 5px 0 0;
  color: #d19b2f;
  font-size: 14px;
  font-style: italic;
}

header h1 {
  margin: 0;
  font-family: Georgia, serif;
}

nav {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

nav a {
  color: #e3e0cd;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

.welcome {
  color: #d19b2f;
}

/* Main content */

main {
  width: 90%;
  max-width: 1100px;
  margin: 40px auto;
}

.page-title {
  text-align: center;
  margin-bottom: 30px;
}

.page-title h2 {
  font-family: Georgia, serif;
  font-size: 32px;
  margin-bottom: 5px;
}

.page-title p {
  color: #020a01;
}

/* Sorting */

.sorting {
  background: white;
  padding: 20px;
  margin-bottom: 25px;
  border-radius: 8px;
  text-align: center;
}

.sorting h3 {
  margin-top: 0;
}

.sorting a {
  display: inline-block;
  padding: 8px 14px;
  margin: 4px;
  background-color: #ddd3c5;
  color: #1d0b0b;
  text-decoration: none;
  border-radius: 5px;
}

.sorting a:hover,
.sorting .active-sort {
  background-color: #8a6f47;
  color: white;
}

/* Guestbook cards */

.guestbook-container {
  display: grid;
  gap: 20px;
}

.guestbook-card {
  background-color: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.guestbook-name {
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 8px;
}

.guestbook-date {
  color: #777;
  font-size: 14px;
  margin-bottom: 15px;
}

.guestbook-comment {
  line-height: 1.6;
  white-space: normal;
}

.guestbook-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

/* Buttons */
.delete-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  width: 250px;
}

.delete-actions form {
  margin: 0;
  width: 250px;
}

.update-button,
.delete-button,
.cancel-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 250px;
  height: 40px;
  padding: 9px 15px;
  border-radius: 5px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  white-space: nowrap;
}

.update-button {
  background-color: #8a6f47;
  color: white;
}

.delete-button {
  background-color: #8f150a;
  color: white;
}

.cancel-button {
  background-color: #1d0b0b;
  color: white;
}

.update-button:hover {
  background-color: #a38355;
}

.delete-button:hover {
  background-color: #b91b0d;
}

.cancel-button:hover {
  background-color: #5c1f1f;
}

/* Forms */

.form-container {
  background-color: white;
  max-width: 650px;
  margin: auto;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

form {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #bbb;
  border-radius: 5px;
  font-family: inherit;
  font-size: 15px;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

input[type="submit"] {
  margin-top: 20px;
  padding: 12px;
  border: none;
  border-radius: 5px;
  background-color: #1d0b0b;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

input[type="submit"]:hover {
  opacity: 0.9;
}

/* Messages */

.error-message {
  background-color: #f5d6d2;
  border: 1px solid #b85c52;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 5px;
}

.success-message {
  background-color: #dcebd9;
  border: 1px solid #6b9463;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
}

.empty-message {
  text-align: center;
  background-color: white;
  padding: 30px;
  border-radius: 8px;
}

/* Footer */

footer {
  text-align: center;
  padding: 30px;
  margin-top: 50px;
  background-color: #1d0b0b;
  color: white;
}

/* Mobile */

@media (max-width: 700px) {
  .header-container {
    flex-direction: column;
    text-align: center;
  }

  nav {
    justify-content: center;
  }

  main {
    width: 95%;
  }
}
