/* Forum index: board cards grouped by category.
   Colours follow the parchment theme of style.css (forum_sprite_btn.png). */
.board-index .board-category {
  margin: 0 0 22px;
}

.board-index .board-category h3 {
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(160, 110, 40, 0.35);
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.board-card {
  position: relative;
  display: grid;
  grid-template-columns: 53px 1fr;
  grid-template-rows: 1fr auto;
  column-gap: 12px;
  row-gap: 8px;
  padding: 12px 12px 10px;
  background: linear-gradient(to bottom, #f8f0d4, #ecd9a0);
  border: 1px solid #c8913a;
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(80, 50, 10, 0.25);
  font-family: Arial, Helvetica, sans-serif;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.board-card:hover,
.board-card:focus-within {
  background: linear-gradient(to bottom, #fbf6e6, #f1e3b8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 4px 10px rgba(80, 50, 10, 0.3);
  transform: translateY(-1px);
}

.board-card--staff {
  border-color: #8f2b1e;
  background: linear-gradient(to bottom, #f6e6d8, #e6c6a8);
}

.board-card__icon {
  width: 53px;
  height: 53px;
  object-fit: cover;
  border: 1px solid #a57a36;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.board-card__body {
  min-width: 0;
}

.board-card__title {
  margin: 0 0 3px;
  font-size: 16px;
  line-height: 1.2;
}

.board-card__title a {
  color: #063677;
  text-decoration: none;
}

/* the whole card is clickable through the title link */
.board-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 5px;
}

.board-card:hover .board-card__title a {
  color: #0058c6;
}

.board-card__title a:focus-visible {
  outline: none;
}

.board-card:has(.board-card__title a:focus-visible) {
  outline: 2px solid #0058c6;
  outline-offset: 2px;
}

.board-card__title .fa-lock {
  margin-left: 4px;
  color: #8f2b1e;
  font-size: 12px;
}

.board-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: #4a3a22;
  font-size: 11px;
  line-height: 1.35;
}

.board-card__meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-top: 7px;
  border-top: 1px dashed rgba(160, 110, 40, 0.45);
  font-size: 11px;
  color: #6b5430;
}

.board-card__counts {
  display: flex;
  gap: 9px;
  flex-shrink: 0;
  font-weight: bold;
}

.board-card__counts i {
  color: #a57a36;
}

.board-card__last {
  position: relative;
  z-index: 1; /* above the stretched title link */
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: auto;
  text-align: right;
  color: #6b5430;
  text-decoration: none;
}

.board-card__last-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #063677;
  font-weight: bold;
}

a.board-card__last:hover .board-card__last-title {
  color: #0058c6;
  text-decoration: underline;
}

.board-card__last-when {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
}

.board-card__last--empty {
  font-style: italic;
}

/* Board page: header, toolbar, thread table */
.board-view {
  font-family: Arial, Helvetica, sans-serif;
  color: #3b2e1a;
}

.board-view a {
  color: #063677;
  text-decoration: none;
}

.board-view a:hover {
  color: #0058c6;
}

.board-view__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(160, 110, 40, 0.35);
}

.board-view__icon {
  flex-shrink: 0;
  width: 53px;
  height: 53px;
  object-fit: cover;
  border: 1px solid #a57a36;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.board-view__intro {
  flex: 1;
  min-width: 0;
}

#forum_body h3.board-view__title {
  margin: 0 0 3px;
  padding: 0;
  background: none;
  color: #660000;
  font-size: 24px;
  line-height: 1.1;
}

.board-view__desc {
  margin: 0;
  color: #5c4726;
  font-size: 12px;
}

.board-view__toolbar,
.board-view__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.board-view__footer {
  margin: 10px 0 20px;
}

/* The classic orange search bar (was images/search/search_bar.png), drawn in CSS */
.forum-search {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 687px;
  height: 54px;
  margin: 0;
  padding: 0 0 0 9px;
  box-sizing: border-box;
  border: 1px solid #d45f00;
  border-radius: 4px;
  background: linear-gradient(to bottom, #ffa53a 0%, #ff8a14 45%, #f57300 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 2px rgba(80, 40, 0, 0.3);
}

.board-view .forum-search__input {
  flex: 1;
  min-width: 0;
  height: 36px;
  margin: 0;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid #c65a00;
  border-radius: 3px;
  background: linear-gradient(to bottom, #ffffff, #ebebeb);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
  color: #333;
  font: 18px Arial, Helvetica, sans-serif;
}

.board-view .forum-search__input::placeholder {
  color: #8a8a8a;
}

.board-view .forum-search__input:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.forum-search__submit {
  flex-shrink: 0;
  align-self: stretch;
  width: 70px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0 3px 3px 0;
  background: none;
  color: #4a2200;
  font-size: 26px;
  /* light bevel on the magnifier, like the original icon */
  text-shadow: 0 1px 0 rgba(255, 220, 170, 0.8);
  cursor: pointer;
}

.forum-search__submit:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #2e1500;
}

.forum-search__submit:active {
  background: rgba(0, 0, 0, 0.06);
}

.forum-search__submit:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: -4px;
}

.board-pager {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 12px;
  font-weight: bold;
}

.board-pager__info {
  margin-right: 6px;
  color: #6b5430;
  font-weight: normal;
}

.board-pager a,
.board-pager__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  box-sizing: border-box;
  border: 1px solid #c8913a;
  border-radius: 4px;
  background: #f8f0d4;
}

.board-view .board-pager a:hover {
  background: #fff;
}

.board-pager__current {
  border-color: #1b3550;
  background: #1b3550;
  color: #fff;
}

.thread-list {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #c8913a;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(80, 50, 10, 0.25);
  font-size: 12px;
}

.thread-list th {
  padding: 9px 12px;
  background: linear-gradient(to bottom, #24425f, #16293d);
  color: #f2f4f3;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-align: left;
  text-transform: uppercase;
}

.thread-list td {
  padding: 10px 12px;
  border-top: 1px solid rgba(160, 110, 40, 0.3);
  background: #f8efd2;
  vertical-align: middle;
}

.thread-list tbody tr:nth-child(even) td {
  background: #f3e6bf;
}

.thread-list tbody tr:hover td {
  background: #fdf7e6;
}

.thread-list tbody tr.is-sticky td {
  background: #f6e2a8;
}

.thread-list tbody tr.is-sticky:hover td {
  background: #faecc4;
}

.thread-list td.thread-list__thread {
  display: flex;
  align-items: center;
  gap: 12px;
}

.thread-list__status {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  line-height: 30px;
  border-radius: 50%;
  background: #e2cd8f;
  color: #7a5a22;
  font-size: 13px;
  text-align: center;
}

.is-sticky .thread-list__status {
  background: #c9a227;
  color: #fff;
}

.is-closed .thread-list__status {
  background: #b9b1a0;
  color: #fff;
}

.thread-list__main {
  min-width: 0;
}

.board-view .thread-list__title {
  font-size: 14px;
  font-weight: bold;
  overflow-wrap: anywhere;
}

.is-closed .thread-list__title {
  color: #5d5a52;
}

.thread-list__meta {
  display: block;
  margin-top: 3px;
  color: #6b5430;
  font-size: 11px;
}

.thread-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  vertical-align: 2px;
}

.thread-tag--sticky {
  background: #a67f14;
}

.thread-tag--closed {
  background: #7d766a;
}

.thread-list th.thread-list__num,
.thread-list td.thread-list__num {
  width: 70px;
  text-align: center;
}

.thread-list td.thread-list__num {
  color: #3b2e1a;
  font-size: 13px;
  font-weight: bold;
}

.thread-list .thread-list__last {
  width: 150px;
}

.thread-list td.thread-list__last a {
  display: block;
  overflow: hidden;
  font-weight: bold;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.thread-list td.thread-list__last span {
  color: #6b5430;
  font-size: 11px;
}

.thread-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 40px 20px;
  border: 1px dashed #c8913a;
  border-radius: 5px;
  background: rgba(248, 240, 212, 0.6);
  color: #6b5430;
  font-size: 13px;
}

.thread-empty i {
  color: #c8913a;
  font-size: 28px;
}

.thread-empty strong {
  color: #660000;
  font-size: 16px;
}

.thread-legend {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #6b5430;
  font-size: 11px;
}

.thread-legend i {
  margin-right: 4px;
  color: #a57a36;
}

/* Search page: form, tips, results */
.search-page__badge {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 53px;
  height: 53px;
  border: 1px solid #a57a36;
  border-radius: 4px;
  background: linear-gradient(to bottom, #24425f, #16293d);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  color: #e8c46a;
  font-size: 22px;
}

.search-page__form {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #c8913a;
  border-radius: 5px;
  background: linear-gradient(to bottom, #f8f0d4, #ecd9a0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(80, 50, 10, 0.25);
}

.search-page__bar {
  display: flex;
  gap: 10px;
}

.search-page__query {
  position: relative;
  flex: 1;
}

.search-page__query i {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #a57a36;
  font-size: 15px;
  pointer-events: none;
}

.search-page__form input,
.search-page__form select {
  width: 100%;
  height: 34px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid #c8913a;
  border-radius: 4px;
  background: #fffaf0;
  box-shadow: inset 0 1px 2px rgba(80, 50, 10, 0.15);
  color: #3b2e1a;
  font: 13px Arial, Helvetica, sans-serif;
}

.search-page__query input[type="search"] {
  height: 42px;
  padding-left: 38px;
  font-size: 15px;
}

.search-page__form input:focus,
.search-page__form select:focus {
  outline: none;
  border-color: #0058c6;
  box-shadow: 0 0 0 3px rgba(0, 88, 198, 0.18);
}

.search-page__bar .ui-btn {
  height: 42px;
  padding: 0 26px;
}

.search-page__filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(160, 110, 40, 0.45);
}

.search-page__filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.search-page__filter > span,
.search-page__filter legend {
  padding: 0;
  margin-bottom: 4px;
  color: #6b5430;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.search-page__filter > span {
  margin-bottom: 0;
}

.search-page__toggle {
  display: flex;
  height: 34px;
  box-sizing: border-box;
  border: 1px solid #c8913a;
  border-radius: 4px;
  overflow: hidden;
  background: #fffaf0;
}

.search-page__toggle label {
  flex: 1;
  display: flex;
  cursor: pointer;
}

.search-page__toggle label + label {
  border-left: 1px solid #c8913a;
}

.search-page__toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.search-page__toggle span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: #6b5430;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

.search-page__toggle label:hover span {
  background: #fff;
}

.search-page__toggle input:checked + span {
  background: #1b3550;
  color: #fff;
}

.search-page__toggle input:focus-visible + span {
  outline: 2px solid #0058c6;
  outline-offset: -2px;
}

.search-page__error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #b45a3c;
  border-radius: 4px;
  background: #f6ddcc;
  color: #7a2412;
  font-size: 13px;
  font-weight: bold;
}

.search-page__tips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.search-page__tips li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px dashed #c8913a;
  border-radius: 5px;
  background: rgba(248, 240, 212, 0.6);
  color: #5c4726;
  font-size: 12px;
  line-height: 1.4;
}

.search-page__tips i {
  margin-bottom: 2px;
  color: #c8913a;
  font-size: 18px;
}

.search-page__tips strong {
  color: #660000;
  font-size: 13px;
}

.search-page__tips code {
  padding: 0 3px;
  border-radius: 3px;
  background: #f3e6bf;
  font-size: 12px;
}

.search-page__summary p {
  margin: 0;
  color: #5c4726;
  font-size: 13px;
}

.search-page__summary strong {
  color: #3b2e1a;
}

.board-view .search-page__clear {
  margin-left: 6px;
  font-size: 12px;
  text-decoration: underline;
}

.search-results {
  margin: 0;
  padding: 0;
  border: 1px solid #c8913a;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(80, 50, 10, 0.25);
  list-style: none;
}

.search-result {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 150px;
  gap: 12px;
  padding: 12px;
  background: #f8efd2;
  font-size: 12px;
}

.search-result + .search-result {
  border-top: 1px solid rgba(160, 110, 40, 0.3);
}

.search-result:nth-child(even) {
  background: #f3e6bf;
}

.search-result:hover {
  background: #fdf7e6;
}

.board-view .search-result__title {
  font-size: 14px;
  font-weight: bold;
  overflow-wrap: anywhere;
}

.is-closed .search-result__title {
  color: #5d5a52;
}

.search-result__meta {
  display: block;
  margin-top: 3px;
  color: #6b5430;
  font-size: 11px;
}

.board-view .search-result__board {
  display: inline-block;
  margin-right: 4px;
  padding: 0 6px;
  border: 1px solid #c8913a;
  border-radius: 3px;
  background: #fffaf0;
  color: #6b5430;
  font-weight: bold;
}

.board-view .search-result__board:hover {
  border-color: #0058c6;
}

.search-result__snippet {
  margin: 7px 0 0;
  padding-left: 9px;
  border-left: 3px solid rgba(200, 145, 58, 0.55);
  color: #4a3a22;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.search-results mark,
mark.search-highlight {
  padding: 0 1px;
  border-radius: 2px;
  background: #f5d76e;
  color: inherit;
}

.search-result__stats {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 12px;
  border-left: 1px solid rgba(160, 110, 40, 0.3);
  color: #6b5430;
  font-size: 11px;
}

.search-result__stats span:not(.search-result__last) {
  color: #3b2e1a;
  font-weight: bold;
}

.search-result__stats i {
  width: 14px;
  color: #a57a36;
}

.search-result__last {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result__last a {
  font-weight: bold;
}

@media (max-width: 760px) {
  .search-page__filters,
  .search-page__tips {
    grid-template-columns: 1fr 1fr;
  }

  .search-result {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .search-result__stats {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 0;
    border: 0;
  }
}
