@import url("https://fonts.googleapis.com/css?family=Space+Mono:400,700|Work+Sans&display=swap");
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: 1rem;
  font-family: "Work Sans", sans-serif;
}
body {
  border-left: 10px solid yellow;
  border-right: 10px solid yellow;
  background-color: #f4f4f0;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: black;
  position: relative;
}
body.no-scroll {
  overflow: hidden;
}
h1,
h2,
h3,
h4 {
  font-family: "Space Mono", monospace;
  margin: 1rem 0 1rem 0;
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.25rem;
}
h4 {
  font-size: 1rem;
}
h5 {
  font-size: 0.75rem;
}
a {
  color: black;
  text-decoration: none;
}
li {
  margin: 0.5rem 0 0 2rem;
}
button:not([type="color"]) {
  padding: 10px;
  background: white;
  cursor: pointer;
  color: black;
  border: none;
  border-radius: 25%;
  transition: border-radius 0.3s ease, background 0.3s, color 0.3s;
  height: 75px;
  width: 75px;
}
button:not([type="color"]):hover {
  background: black;
  color: white;
  border-radius: 50%;
}
.wrapper {
  width: 90%;
  max-width: 750px;
  margin: 0 auto;
  padding: 20px 0;
  flex: 1;
}
.latest {
  text-align: center;
  padding: 2rem 0;
  text-transform: uppercase;
  cursor: default;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin: 2rem 0 2rem 0;
  gap: 0.5rem;
}
#search-input {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: "Work Sans", sans-serif;
  font-size: 1rem;
  width: 90%;
  max-width: 500px;
  transition: border-color 0.3s;
}
#search-input:focus {
  border-color: #666;
  outline: none;
}
#status-message {
  margin-top: 10px;
  text-align: center;
  font-size: 1rem;
  color: #28a745;
  display: none;
}
#status-message.error {
  color: #dc3545;
}
.add-page-form {
  display: none;
  background: #fff;
  padding: 20px;
  border: 2px solid black;
  border-radius: 5px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}
.add-page-form h2 {
  margin-bottom: 15px;
  text-align: center;
}
.add-page-form form {
  display: flex;
  flex-direction: column;
}
.add-page-form label {
  margin: 10px 0 5px;
  font-weight: bold;
}
.add-page-form input,
.add-page-form textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: "Work Sans", sans-serif;
}
.add-page-form textarea {
  resize: vertical;
  min-height: 100px;
}
.picture-input {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.picture-input input[type="url"] {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
}
.picture-input input[type="color"] {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  cursor: pointer;
  appearance: none;
  background-color: transparent;
}
.picture-input input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.picture-input input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}
.form-buttons {
  display: flex;
  justify-content: center;
  margin-top: 15px;
  gap: 10px;
}
.form-buttons button {
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  background-color: #28a745;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}
.form-buttons button#close-form-button {
  background-color: #dc3545;
}
.form-buttons button:hover {
  background-color: #218838;
}
.form-buttons button#close-form-button:hover {
  background-color: #c82333;
}
.latest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  justify-items: center;
  position: relative;
}
.latest-grid-item {
  background: #fff;
  border: 3px solid black;
  border-radius: 5px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  width: 100%;
  padding: 0.5rem;
  z-index: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.latest-grid-item:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.latest-grid-item.expanded {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 90%;
  z-index: 100;
  overflow-y: auto;
  padding: 16px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  width: 90%;
  max-width: 90%;
  display: block;
  justify-content: center;
  align-items: center;
}
.latest-grid-item.expanded::-webkit-scrollbar {
  display: none;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  min-height: 190px;
}
.card-header h2 {
  margin-bottom: 10px;
  text-decoration: underline;
  white-space: normal;
  overflow: visible;
}
.image {
  width: 100%;
  align-items: center;
  justify-content: center;
}
.image-container {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffff00;
  padding: 4px;
}
.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.latest-grid-item.expanded .image-container {
  height: 100%;
  margin: 0 0 1rem 0;
  max-width: 70%;
  justify-self: center;
}
.description {
  padding: 8px;
  color: #777;
  font-style: italic;
  letter-spacing: 0.5px;
  line-height: 1.4;
  flex-grow: 1;
  overflow: hidden;
  border-top: 1px solid #e0e0e0;
  margin-top: 5px;
  text-align: center;
  text-overflow: ellipsis;
  justify-content: center;
  white-space: wrap-reverse;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  min-height: 150px;
}
.description:hover::after {
  content: attr(data-full-text);
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  background-color: rgba(51, 51, 51, 0.9);
  color: #fff;
  padding: 8px;
  border-radius: 4px;
  white-space: normal;
  width: max-content;
  max-width: 300px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}
.latest-grid-item.expanded .description {
  display: none;
}
.date {
  text-align: center;
  padding: 5px 10px 10px;
  color: #777;
}
.latest-grid-item.expanded .date {
  display: none;
}
.body-content {
  display: none;
  padding: 15px;
  line-height: 1.5;
  overflow: auto;
  max-width: 90vh;
}
.latest-grid-item.expanded .body-content {
  display: block;
  text-align: left;
  line-height: 1.5;
  padding: 0 5rem 0 5rem;
}
.card-actions {
  display: none;
  padding: 10px;
  text-align: center;
}
.latest-grid-item.expanded .card-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.delete-button,
.edit-button {
  background: none;
  cursor: pointer;
  margin: 0 10px;
  font-size: 1.5rem;
  border: none;
}
.delete-button:hover,
.edit-button:hover {
  color: darkred;
}
.latest-grid p {
  grid-column: 1 / -1;
  color: #555;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  word-break: break-word;
  margin: 20px 0 0 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
th,
td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}
th {
  background-color: #f2f2f2;
  font-weight: bold;
}
tr:nth-child(even) {
  background-color: #f9f9f9;
}
tr:hover {
  background-color: #e9e9e9;
}
hr {
  margin: 2rem 0;
  border: none;
  border-top: 2px solid #ccc;
}
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.pagination button {
  background: white;
  border: 1px solid black;
  border-radius: 3px;
  padding: 8px 12px;
  margin: 5px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.pagination button.active {
  background: black;
  color: white;
}
.pagination button:hover:not(.active) {
  background: black;
  color: white;
}
.storage-info {
  text-align: center;
  margin-top: 10px;
  color: #555;
}
.expanded-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  pointer-events: none;
  display: none;
}
.latest-grid-item.focused {
  pointer-events: none;
}
.suggestion-box {
  position: absolute;
  z-index: 1000;
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 300px;
  width: 90%;
  max-width: 500px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: none;
  font-family: "Work Sans", sans-serif;
  font-size: 1rem;
}
.suggestion-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
}
.suggestion-item:hover,
.suggestion-item.selected {
  background-color: #f0f0f0;
}
.command-name {
  font-weight: bold;
  margin-right: 10px;
  white-space: nowrap;
}
.command-description {
  color: #555;
  font-size: 0.9em;
  flex-grow: 1;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-box.page-suggestion .suggestion-item {
  justify-content: flex-start;
}
.suggestion-box.page-suggestion .suggestion-item.selected,
.suggestion-box.page-suggestion .suggestion-item:hover {
  background-color: #f0f0f0;
}
.suggestion-box.page-suggestion .suggestion-item span {
  flex-grow: 1;
}
.suggestion-box::-webkit-scrollbar {
  width: 8px;
}
.suggestion-box::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}
.suggestion-box::-webkit-scrollbar-thumb:hover {
  background-color: #b3b3b3;
}
.missing-page {
  color: red;
  text-decoration: underline;
  cursor: not-allowed;
  font-weight: bold;
}
.page-link {
  color: #007bff;
  text-decoration: underline;
  font-weight: bold;
}
.page-link:hover {
  color: #0056b3;
  text-decoration: underline;
}
.body-content p {
  text-align: justify;
}
@media (max-width: 600px) {
  body {
    border-left: 5px solid yellow;
    border-right: 5px solid yellow;
    padding: 10px;
  }
  .latest {
    padding: 1.5rem 0;
  }
  .controls button {
    font-size: 1.3rem;
    height: 3rem;
    width: 3rem;
  }
  .form-buttons button {
    padding: 8px 12px;
  }
  .picture-input input[type="color"] {
    width: 30px;
    height: 30px;
  }
  .latest-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .image-container {
    height: 150px;
  }
  .description {
    max-height: 80px;
  }
  .pagination button {
    padding: 6px 10px;
    margin: 3px;
  }
  .suggestion-box {
    width: 90%;
    max-width: none;
  }
}
body.zoom-75 {
  zoom: 75%;
}
body.zoom-100 {
  zoom: 100%;
}
body.zoom-125 {
  zoom: 125%;
}
body.zoom-150 {
  zoom: 150%;
}
.highlight {
  border: 3px solid #007bff;
  transition: border 0.5s ease;
}
