:root {
  --ink: #211d1a;
  --paper: #f4efe7;
  --accent: #cf553d;
  --line: #d7cec2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, sans-serif;
}
header {
  padding: clamp(3rem, 8vw, 8rem) max(5vw, 24px) 3rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 85% 15%, #f4bd70 0, transparent 28%), var(--paper);
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  font-weight: 800;
  color: var(--accent);
}
h1 {
  font-family: Georgia, serif;
  font-size: clamp(3.2rem, 8vw, 8rem);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.06em;
  margin: 0.35em 0 0.25em;
  max-width: 1000px;
}
header p {
  color: #70665d;
  margin: 0;
}
main {
  padding: 2rem max(5vw, 24px) 5rem;
}
form {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 1.4rem;
}
label {
  display: grid;
  gap: 6px;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}
input,
select,
button {
  font: inherit;
  border: 1px solid var(--line);
  background: #fffaf3;
  border-radius: 0;
  padding: 0.85rem;
  color: var(--ink);
}
button {
  cursor: pointer;
  font-weight: 750;
}
form button {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 1rem;
  color: #70665d;
  font-size: 0.85rem;
}
.result-row button {
  border: 0;
  background: none;
  padding: 0.3rem;
  text-decoration: underline;
}
#gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.card {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e6ddd1;
  border: 0;
  padding: 0;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s;
}
.card:hover img {
  transform: scale(1.025);
}
.badge {
  position: absolute;
  right: 8px;
  top: 8px;
  background: rgba(31, 27, 24, 0.78);
  color: #fff;
  padding: 5px 8px;
  font-size: 0.7rem;
}
.card time {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(244, 239, 231, 0.9);
  padding: 5px 8px;
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.card:hover time {
  opacity: 1;
}
#more {
  display: block;
  margin: 2rem auto 0;
  min-width: 180px;
}
dialog {
  border: 0;
  padding: 0;
  background: var(--paper);
  width: min(920px, 94vw);
  max-height: 94vh;
  box-shadow: 0 24px 80px #0006;
}
dialog::backdrop {
  background: #171411db;
}
dialog img,
dialog video {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #171411;
}
dialog img[hidden],
dialog video[hidden] {
  display: none;
}
.detail {
  padding: 1.2rem 1.5rem;
}
.detail p {
  white-space: pre-wrap;
  max-height: 8rem;
  overflow: auto;
}
.detail a {
  color: var(--accent);
  font-weight: 700;
}
.close {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 0;
  border-radius: 50%;
  background: #f4efe7;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  padding: 0;
  z-index: 2;
}
@media (max-width: 850px) {
  form {
    grid-template-columns: 1fr 1fr;
  }
  .search {
    grid-column: 1/-1;
  }
  #gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 520px) {
  form {
    grid-template-columns: 1fr 1fr;
  }
  form button {
    grid-column: 1/-1;
  }
  #gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  h1 {
    font-size: 3.3rem;
  }
}
