/* Layout, colors and type follow Apps/Memebooru/Sources/Model/Theme.swift. */
:root {
  color-scheme: light;
  --page: #d5e0d2;
  --sidebar: #dae4d9;
  --ink: #2c3635;
  --muted: #6b8678;
  --link: #337287;
  --hover: #196ba7;
  --rule: #bfcdbd;
  --border: #a6b2a6;
  --header-height: 64px;
  --sidebar-width: 208px;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font:
    13px Verdana,
    Arial,
    sans-serif;
  height: 100dvh;
  overflow: hidden;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  color: var(--hover);
}
button,
input,
select {
  font: inherit;
  min-width: 0;
}
button,
a,
select,
input {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button,
input,
select {
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
}
button {
  min-height: 26px;
  padding: 3px 12px;
  background: linear-gradient(#f4f7f3, #dce4da);
  box-shadow: 0 1px #0002;
  font-size: 12px;
}
button:hover {
  color: var(--hover);
  border-color: #8c9b8c;
}
input,
select {
  background: #fbfcfa;
  min-height: 26px;
  padding: 4px 8px;
  font-size: 12px;
}
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: linear-gradient(#53655b, #738678);
  border-bottom: 1px solid #40504b;
  box-shadow: 0 1px #f2fcf1b3;
  position: relative;
  z-index: 5;
}
/* Keep the existing wordmark and logo requested by the user. */
.brand {
  text-decoration: none;
  color: #e6f2d9;
  font:
    bold 27px "Trebuchet MS",
    sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -1px;
  flex-shrink: 0;
}
.brand:hover {
  color: #e6f2d9;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px 2px;
  background: linear-gradient(135deg, #dbf3a9, #83b46c);
  color: #38583d;
  font: bold italic 30px Georgia;
  border: 1px solid #d5f4ac;
  box-shadow: inset 0 1px #fff;
}
.edition {
  font: 10px Verdana;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #bdcbb7;
  margin: 7px 0 0 10px;
}
#search-form {
  display: flex;
  width: 300px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid #2b3432;
  border-radius: 5px;
  overflow: hidden;
  background: linear-gradient(#b3c1b5, #c9d5ca);
}
#search-form:focus-within {
  background: linear-gradient(#e9f0e8, #fdfffc);
}
#search {
  flex: 1;
  width: 0;
  border: 0;
  background: none;
  min-height: 0;
  padding: 0 8px;
  outline: none;
  border-radius: 0;
}
#search-form button {
  flex: none;
  white-space: nowrap;
  border: 0;
  border-left: 1px solid #2b3432;
  border-radius: 0;
  background: linear-gradient(#5e7064, #46554b);
  color: #bdd023;
  box-shadow: none;
  min-height: 0;
  padding: 0 12px;
}
.header-collection {
  margin-left: auto;
  font-size: 13px;
  color: #bdd023;
  white-space: nowrap;
}
.layout {
  height: calc(100dvh - var(--header-height));
  display: flex;
  position: relative;
}
#filters {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid #aebeb2;
  padding: 24px 16px 32px;
  overflow: auto;
  scrollbar-width: thin;
}
#filters section {
  margin-bottom: 24px;
}
#filters h2 {
  font-size: 12px;
  letter-spacing: 0.6px;
  text-shadow: 0 1px #fff9;
  margin: 0 0 8px;
}
.nav-row,
.category-row,
#tag-list button,
.text-link,
.breadcrumb button {
  border: 0;
  box-shadow: none;
  background: none;
  color: var(--link);
  text-align: left;
  padding: 4px 0;
}
.nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 14px;
  min-height: 26px;
}
.nav-row > span {
  width: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 16px;
}
.nav-row[aria-pressed="true"],
.nav-row[aria-pressed="true"] > span {
  color: #b35e33;
}
.nav-row:hover,
.category-row:hover,
#tag-list button:hover,
.text-link:hover,
.breadcrumb button:hover {
  text-decoration: underline;
  color: var(--hover);
}
small {
  font-size: 11px;
  color: var(--muted);
  font-weight: normal;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.category-row,
#tag-list button {
  display: flex;
  gap: 4px;
  width: 100%;
  padding-left: 26px;
  font-size: 12px;
  min-height: 24px;
}
#tag-list button[aria-pressed="true"] {
  font-weight: bold;
  color: var(--ink);
}
#tag-count {
  font-size: 10px;
  letter-spacing: 0;
  font-weight: normal;
  color: var(--muted);
}
#tag-search {
  width: 100%;
  margin-bottom: 6px;
}
#filters label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin: 12px 0 4px;
}
#filters select {
  width: 100%;
}
.filter-options {
  margin-bottom: 24px;
}
.filter-options summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.6px;
}
.collection-pill {
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid #bfcdbd;
  border-radius: 4px;
  background: #dde6db;
  color: var(--muted);
  line-height: 1.6;
}
.attribution {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
  margin: 16px 0 0;
}
.workspace {
  flex: 1;
  min-width: 0;
  position: relative;
}
#gallery,
#detail {
  height: 100%;
  overflow: auto;
  padding: 24px 24px 32px;
  scrollbar-width: thin;
}
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #bfcdbd;
  box-shadow: 0 1px #edf2ed;
  padding-bottom: 12px;
  margin-bottom: 24px;
}
.title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
h1 {
  font:
    bold 24px "Trebuchet MS",
    sans-serif;
  letter-spacing: -0.6px;
  text-shadow: 0 1px #fffb;
  margin: 0;
}
.title-row p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
#reset {
  flex-shrink: 0;
}
#selected-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#selected-tags:not(:empty) {
  margin-bottom: 24px;
}
#selected-tags button {
  color: var(--link);
  font-size: 12px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 24px 16px;
  align-content: start;
}
.card {
  min-width: 0;
  text-align: center;
}
.card-open {
  border: 0;
  background: none;
  box-shadow: none;
  padding: 0;
  display: block;
  width: 100%;
  text-align: center;
  color: var(--link);
}
.thumb-box {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-box img {
  display: block;
  max-width: 100%;
  max-height: 150px;
  width: auto;
  height: auto;
  box-shadow: 0 1.5px 5px #0005;
}
.card-text {
  padding-top: 8px;
}
.card h3 {
  font:
    bold 12px Verdana,
    Arial,
    sans-serif;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.5;
}
.card-open:hover h3 {
  text-decoration: underline;
  color: var(--hover);
}
.card .meta {
  font-size: 11px;
  margin-top: 2px;
  color: var(--muted);
}
.card .meta span {
  color: var(--ink);
}
#pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  font-size: 11px;
  color: var(--muted);
}
#empty {
  text-align: center;
  padding: 70px 12px;
  color: var(--muted);
}
#empty h2 {
  font:
    24px "Trebuchet MS",
    sans-serif;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #8c9b8c;
}
.breadcrumb button {
  font-size: 12px;
  min-height: 16px;
}
.detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
}
.detail-main {
  min-width: 0;
}
.media-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}
.media-stage img {
  max-width: 100%;
  max-height: min(68dvh, 760px);
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 1.5px 5px #0005;
}
.post-heading {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid #bfcdbd;
  box-shadow: 0 1px #edf2ed;
  padding-bottom: 12px;
  margin-bottom: 24px;
}
.post-heading h1 {
  overflow-wrap: anywhere;
}
.post-heading p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}
.kind-tile {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #dde6db;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
}
.section-block {
  margin-bottom: 24px;
}
.section-block h2 {
  font:
    16px "Trebuchet MS",
    sans-serif;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #bfcdbd;
  box-shadow: 0 1px #edf2ed;
}
.detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#detail-position {
  font-size: 11px;
  color: var(--muted);
}
.detail-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}
.detail-actions a {
  font-size: 12px;
}
#favorite-detail {
  font:
    18px "Trebuchet MS",
    sans-serif;
  color: var(--link);
  width: 100%;
  height: 40px;
  text-align: left;
  padding: 0 16px;
  background: linear-gradient(#e3eddb, #ccdbc2);
  border-color: #9ead9e;
}
#detail-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}
#detail-meta dt {
  color: var(--muted);
}
#detail-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.tag-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.tag-row > span {
  font-size: 12px;
  color: var(--muted);
  min-width: 64px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.chips button {
  border: 0;
  background: none;
  box-shadow: none;
  padding: 0;
  min-height: 20px;
  color: var(--link);
  font-size: 13px;
}
.chips button:hover {
  text-decoration: underline;
}
.tag-note {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 16px;
}
#filters-toggle {
  display: none;
}
.sr-only,
.skip {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip:focus {
  left: 8px;
  top: 8px;
  width: auto;
  height: auto;
  background: #fff;
  padding: 8px;
  z-index: 20;
}
@media (max-width: 1107px) {
  .detail-columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .header-collection {
    display: none;
  }
  .app-header {
    justify-content: space-between;
  }
}
@media (max-width: 760px) {
  :root {
    --header-height: 102px;
  }
  .app-header {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 6px 12px 10px;
  }
  .brand {
    font-size: 24px;
    gap: 8px;
  }
  .edition {
    font-size: 8px;
    letter-spacing: 1.3px;
    margin-left: 4px;
  }
  .brand-mark {
    width: 28px;
    height: 28px;
    font-size: 27px;
  }
  #filters-toggle {
    display: block;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    color: #eaf2ee;
    font-size: 20px;
  }
  #search-form {
    grid-column: 1/-1;
    width: 100%;
  }
  #filters {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 4;
    padding-top: 16px;
    box-shadow: 2px 0 8px #0004;
  }
  #filters.visible {
    display: block;
  }
  #drawer-shade {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #0004;
    border: 0;
    border-radius: 0;
  }
  .workspace {
    width: 100%;
  }
  #gallery,
  #detail {
    padding: 16px 16px 32px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-header {
    flex-wrap: wrap;
  }
  .tag-row {
    flex-direction: column;
    gap: 8px;
  }
  .detail-columns {
    gap: 24px;
  }
  .media-stage img {
    max-height: 60dvh;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

#tag-list button span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#tag-list button small {
  flex-shrink: 0;
}

#gallery:focus-visible,
#detail:focus-visible {
  outline: none;
}
#image-status {
  min-height: 240px;
  display: grid;
  place-items: center;
  color: var(--muted);
  margin: 0;
  text-align: center;
}
@media (max-width: 360px) {
  .edition {
    display: none;
  }
}
