body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #fefefe;
  color: #633;
}

.container {
  max-width: 50rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}

.credit {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  font-size: 0.75rem;
  color: #999;
  opacity: 0.7;
  letter-spacing: .0313rem;
}

h1 {
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #595959;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.toggle-row {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: flex-start;
  gap: 0.75rem;
}

button {
  background: #2a2a2a;
  background-image: linear-gradient(to bottom, #966, #633, #300); /* Taken from the Wiki Search Button */
  color: #fff;
  border: 1px solid #444;
  border-radius: 0.625rem;
  padding: 0.75rem 1.125rem;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  background: #633;
}

.status {
  color: #595959;
  margin-bottom: 1.25rem;
}

.card { /* Results. Styled Similarly to Wiki Sidebar */
  background: #e3e3e3; /* "Notice Box" Gray, to have Result Stick Out From the Page */
  border: 0.06rem solid #600;
  border-radius: 0.635rem;
  padding: 0.635rem;
  box-shadow: 0 0.125rem .375rem rgba(102, 0, 0, .5);
}

.menu-btn {
  position: fixed;
  top: .75rem;
  right: 1rem;
  z-index: 1000;
  font-size: 1.5rem;
  padding: .5rem .75rem;
  border-radius: .5rem;
}

.menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: auto;

  background: #f4f4f4;
  border: 0.125rem solid #633;

  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;

  z-index: 999;
  box-sizing: border-box;
}

.menu-panel {
  width: 100vw;
  max-width: 100vw;
  min-height: 6.5rem;
  padding: 0.875rem 1rem;
  align-items: flex-start;
  gap: 0.5rem;
}

.menu-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.menu-field label,
.menu-field .field-label {
  order: 2;
  font-size: 0.8rem;
  line-height: 1.2;
  color: #633;
  text-align: center;
}

.menu-field input,
.menu-field select,
.menu-field button {
  order: 1;
}

.menu-panel.hidden {
  display: none;
}

.menu-close-btn {
  flex: 0 0 auto;
  align-self: end;
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
  background: #fff;
  background-image: none;
  color: #633;
  border: 1px solid #999;
}

.hidden,
[hidden] {
  display: none !important;
}

.type {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #600;
  margin: 0 0 0.625rem 0;
  font-weight: bold;
}

h2 {
  color: #b01;
  margin-top: 0;
  margin-bottom: 0.67rem;
}

h2 a {
  color: #b01;
  text-decoration: none;
}

h2 a:hover {
  text-decoration: underline;
}

.meta p {
  margin: 6px 0;
}

.tags {
  color: #595959;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.tag {
  background: #633;
  border: 1px solid #444;
  border-radius: 62.5rem;
  padding: 6px 0.64rem;
  font-size: 0.875rem;
  color: #ddd;

  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;

  display: inline-block;
}

.tag:hover {
  background: #744; /* Highlights Selected Tag */
}

.tag:focus {
  outline: 2px solid #b01;
  outline-offset: 2px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.result-main {
  flex: 1;
  min-width: 0;
}

.alt-title {
  margin-top: -10px;
  margin-bottom: 15px;
  font-size: 16px;
  color: #a4241e;
  font-weight: bold;
}

.preview {
  margin-top: 14px;
  margin-bottom: 1px;
  line-height: 1.5;
  color: #444;
  font-style: italic;
}

.thumbnail {
  width: 200px;
  max-width: 30%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #600;
  object-fit: cover;
  flex-shrink: 0;
}

#custom-search-kind-select,
#custom-search-tags-input,
#custom-search-author-input {
  box-sizing: border-box;
  width: auto;
  min-width: stretch;
  min-height: fit-content;
  padding: 0.5rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1.2;
  border: 1px solid #999;
  border-radius: .5rem;
  color: #333;
  background: #fff;
}

#custom-search-kind-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
  height: fit-content;
  line-height: normal;
}

.custom-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-checkbox {
  width: 2rem;
  height: 1.75rem;
  min-width: 1.75rem;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #999;
  background: #fff;
  background-image: none;
  color: #333;
  font-size: 1.125rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.custom-checkbox[aria-pressed="true"]::before {
  content: "✓";
}

.custom-checkbox:hover {
  background: #f3f3f3;
  background-image: none;
}

.toggle-btn[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px #fff;
}

.toggle-btn.is-active {
  background: #633;
}

.licensebox {
  margin-top: 1rem;
}

.licensebox-details {
  border: 1px dashed #999;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: #333;
}

a:-webkit-any-link {
    color: #b01;
    cursor: pointer;
    text-decoration: underline;
}

.licensebox-summary {
  cursor: pointer;
  font-weight: 700;
  color: #7a7a7a;
}

.licensebox-entry {
  margin-top: 0.75rem;
  overflow-wrap: break-word;
}

.licensebox-entry p {
  margin: 0.25rem 0;
}

.wikidot-user {
  font-weight: 600;
}

.licensebox-entry + .licensebox-entry {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 0.08333333333333333em dashed #7a7a7a;
}

::marker {
    content: "‡";
}

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

body {
  overflow-x: hidden;
}

.container {
  width: min(100%, 50rem);
}

button,
select,
input {
  max-width: 100%;
}

.button-row,
.toggle-row {
  align-items: stretch;
}

.button-row button,
.toggle-row button {
  min-height: 2.75rem;
}

.menu-panel {
  width: 100vw;
  max-width: 100vw;
}

/* Mobile */
@media (max-width: 700px) {
  .container {
    padding: 4.25rem 1rem 3rem;
  }

  .credit {
    position: static;
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
  }

  h1 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
    line-height: 1.1;
    margin-top: 0;
  }

  .subtitle {
    font-size: 1rem;
    line-height: 1.4;
  }

  .button-row,
  .toggle-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.625rem;
  }

  button {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }

  .menu-btn {
    width: auto;
    min-width: stretch;
    right: 0.75rem;
    top: 0.75rem;
  }

  .menu-panel {
    left: 0;
    right: 0;
    width: 100vw;
    height: auto;
    max-height: 120dvh;
    padding: 1rem;
  }

  .menu-close-btn {
    width: auto;
  }

  .custom-checkbox-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 0.75rem;
    align-items: center;
  }

  .custom-checkbox {
    width: 2.25rem;
    height: 2.25rem;
  }

  .result-header {
    flex-direction: column;
  }

  .thumbnail {
    order: -1;
    width: 100%;
    max-width: 100%;
    max-height: 16rem;
    object-fit: cover;
  }

  .card {
    padding: 1rem;
  }

  h2 {
    font-size: 1.35rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .alt-title,
  .preview,
  .meta p,
  .licensebox-entry {
    overflow-wrap: anywhere;
  }

  .tags {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.4rem;
  }

  .tag {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    flex: 0 1 auto;
    padding: 0.35rem 0.55rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
}

/* Tablets */
@media (min-width: 701px) and (max-width: 950px) {
  .button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-row button {
    width: 100%;
  }

  .toggle-row {
    flex-wrap: wrap;
  }

  .thumbnail {
    max-width: 35%;
  }
}
