:root {
  color-scheme: light;
  --paper: #f7f7f7;
  --surface: #ffffff;
  --ink: #050505;
  --muted: #656565;
  --line: #d9d9d9;
  --soft-line: #ededed;
  --danger: #8a1717;
  --display: Didot, 'Bodoni 72', 'Times New Roman', serif;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-width: 20rem;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 2.875rem;
  padding: .8rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  transition: background-color 180ms ease, color 180ms ease;
}

button:hover {
  background: white;
  color: var(--ink);
}

button:disabled {
  cursor: wait;
  opacity: .45;
}

button.secondary {
  background: transparent;
  color: var(--ink);
}

button.secondary:hover {
  background: var(--ink);
  color: white;
}

button.danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

button.danger:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: .25rem;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 5rem);
  letter-spacing: -.025em;
  line-height: .95;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 .85rem;
  color: var(--muted);
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: 3.75rem clamp(1.25rem, 5vw, 5rem) 2.75rem;
  border-bottom: 1px solid var(--ink);
  background: var(--surface);
}

.topbar-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  max-width: 120rem;
  margin: 0 auto;
  padding: 2.75rem clamp(1.25rem, 5vw, 5rem) 6rem;
}

.layout:has(.editor:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) minmax(25rem, 42rem);
}

.search {
  width: min(100%, 32rem);
  color: var(--ink);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.search input {
  margin-top: .35rem;
}

input,
select,
textarea {
  width: 100%;
  padding: .9rem 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  transition: border-color 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #999;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--muted);
}

input[type='file'] {
  padding: .65rem 0;
  font-size: .78rem;
}

input[type='file']::file-selector-button {
  margin-right: 1rem;
  padding: .6rem .8rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: white;
  color: var(--ink);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: .4rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.table-wrap {
  margin-top: 1.75rem;
  overflow-x: auto;
  border-top: 1px solid var(--ink);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
}

tbody tr {
  transition: background-color 160ms ease;
}

tbody tr:hover {
  background: #f5f5f5;
}

td.reference {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
}

td.title {
  font-family: var(--display);
  font-size: 1.05rem;
}

.thumbnail {
  width: 4.25rem;
  height: 4.25rem;
  background: var(--paper);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85);
}

.row-actions {
  display: flex;
  justify-content: end;
  gap: .2rem;
  white-space: nowrap;
}

.row-actions button {
  min-height: 2.35rem;
  padding: .55rem .7rem;
  font-size: .58rem;
}

.editor {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--ink);
  background: var(--surface);
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--soft-line);
}

.icon-button {
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 1.7rem;
  font-weight: 300;
  letter-spacing: 0;
}

.icon-button:hover {
  background: var(--ink);
  color: white;
}

#object-form {
  display: grid;
  gap: 1.4rem;
  margin-top: 2rem;
}

.classification-row,
.price-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.price-row {
  grid-template-columns: 2fr 1fr;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

fieldset {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
  margin: 0;
  padding: 1.35rem;
  border: 1px solid var(--line);
}

legend {
  padding: 0 .55rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.05rem;
}

.photo-preview {
  width: 10rem;
  height: 10rem;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper);
}

.message {
  min-height: 1.4rem;
  color: var(--muted);
  font-size: .78rem;
}

.message.error {
  color: var(--danger);
}

.login-page {
  display: grid;
  min-height: 100vh;
  background: white;
  place-items: center;
}

.login-card {
  width: min(100%, 34rem);
  padding: clamp(2.5rem, 8vw, 7rem);
  background: var(--surface);
}

.login-card h1 {
  font-size: clamp(2.6rem, 5vw, 4.5rem);
}

.login-card form {
  display: grid;
  gap: 1.5rem;
  margin-top: 3.25rem;
}

.login-card form button {
  margin-top: .5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1000px) {
  .layout:has(.editor:not([hidden])) {
    grid-template-columns: 1fr;
  }

  .editor {
    position: static;
    grid-row: 1;
    max-height: none;
  }
}

@media (max-width: 850px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    padding-top: 2.5rem;
  }

  .classification-row,
  .language-grid {
    grid-template-columns: 1fr;
  }

  th:first-child,
  td:first-child {
    display: none;
  }

  .login-card {
    padding: 2.5rem;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 2.75rem;
  }

  .topbar-actions,
  .topbar-actions button {
    width: 100%;
  }

  .layout {
    padding-top: 2rem;
  }

  .price-row {
    grid-template-columns: 1fr;
  }

  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }

  .row-actions {
    align-items: end;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
