.archive-page {
  min-height: 100vh;
  background: var(--paper-light);
}

.archive-header {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 0 3.2vw;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}

.archive-brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 17px;
  color: var(--ink);
  text-decoration: none;
}

.archive-brand .monogram {
  display: inline-block;
}

.brand-title,
.archive-label,
.home-link {
  font-size: 9px;
  letter-spacing: 0.18em;
}

.archive-label {
  margin: 0;
  color: var(--muted);
}

.home-link {
  justify-self: end;
  color: var(--ink);
  text-decoration: none;
}

.home-link span {
  display: inline-block;
  margin-left: 9px;
  color: var(--wine);
  font-size: 14px;
  transition: transform 200ms ease;
}

.home-link:hover span {
  transform: translate(-2px, 2px);
}

.archive-intro {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr auto;
  align-items: end;
  gap: 5vw;
  padding: clamp(70px, 10vw, 150px) 4vw clamp(44px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.19em;
}

.archive-heading h1 {
  line-height: 0.75;
  white-space: nowrap;
}

.archive-heading h1 {
  font-size: clamp(76px, 10.2vw, 180px);
}

.archive-heading em {
  color: var(--wine);
  font-weight: 400;
  text-transform: none;
}

.archive-description {
  max-width: 380px;
  margin: 0 0 5px;
  color: #514a45;
  font-family: var(--serif);
  font-size: clamp(15px, 1.2vw, 20px);
  line-height: 1.5;
}

.photo-count {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  white-space: nowrap;
}

.photo-count span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 36px;
  letter-spacing: 0;
}

.archive-tools {
  position: sticky;
  z-index: 3;
  top: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.48fr) 1.52fr;
  align-items: center;
  gap: 40px;
  padding: 18px 4vw;
  background: rgba(238, 232, 226, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}

.search-box > span {
  color: var(--wine);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
}

.search-box input {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font: 12px/1.2 var(--sans);
}

.search-box input::placeholder {
  color: #756e68;
}

.tag-list {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tag-list::-webkit-scrollbar {
  display: none;
}

.tag-chip {
  flex: 0 0 auto;
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(33, 31, 30, 0.22);
  border-radius: 999px;
  font: 9px/1 var(--sans);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.tag-chip:hover,
.tag-chip.is-active {
  color: var(--paper-light);
  background: var(--wine);
  border-color: var(--wine);
}

.tag-chip:focus-visible,
.gallery-card:focus-visible,
.like-button:focus-visible,
.dialog-close:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}

.gallery-wrap {
  padding: 4vw;
}

.masonry-gallery {
  column-count: 4;
  column-gap: clamp(13px, 1.6vw, 28px);
}

.gallery-card {
  position: relative;
  width: 100%;
  display: block;
  margin: 0 0 clamp(18px, 2vw, 32px);
  padding: 0;
  break-inside: avoid;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: zoom-in;
}

.card-image-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  background: #d2cac3;
}

.gallery-card:nth-child(5n + 1) .card-image-wrap {
  border-radius: 46% 46% 3px 3px / 18% 18% 3px 3px;
}

.gallery-card:nth-child(7n + 3) .card-image-wrap {
  border-radius: 3px 3px 32% 3px / 3px 3px 18% 3px;
}

.gallery-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 650ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 350ms ease;
}

.gallery-card:hover img {
  transform: scale(1.025);
  filter: saturate(0.9);
}

.card-image-wrap::after {
  content: "View ↗";
  position: absolute;
  right: 13px;
  bottom: 13px;
  padding: 9px 11px;
  color: var(--paper-light);
  background: rgba(33, 31, 30, 0.76);
  border-radius: 999px;
  font: 8px/1 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.gallery-card:hover .card-image-wrap::after {
  opacity: 1;
  transform: translateY(0);
}

.card-caption {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 12px 2px 0;
}

.card-title {
  display: block;
  margin: 0 0 5px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
}

.card-tags {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.card-number {
  color: var(--wine);
  font-family: var(--serif);
  font-size: 12px;
}

.empty-state {
  min-height: 40vh;
  place-content: center;
  text-align: center;
}

.empty-state:not([hidden]) {
  display: grid;
}

.empty-state span {
  color: var(--wine);
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 100px);
  font-style: italic;
}

.empty-state p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.archive-footer {
  display: flex;
  justify-content: space-between;
  padding: 38px 4vw;
  border-top: 1px solid var(--line);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.17em;
}

.archive-footer p {
  margin: 0;
}

.archive-footer p span {
  color: var(--muted);
  margin-left: 10px;
}

.archive-footer a {
  color: var(--ink);
  text-decoration: none;
}

.photo-dialog {
  width: min(1220px, calc(100vw - 48px));
  max-width: none;
  height: min(860px, calc(100svh - 48px));
  max-height: none;
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: var(--paper-light);
  border: 0;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.44);
  overflow: hidden;
}

.photo-dialog::backdrop {
  background: rgba(23, 21, 20, 0.82);
  backdrop-filter: blur(8px);
}

.dialog-close {
  position: absolute;
  z-index: 5;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--paper-light);
  background: rgba(33, 31, 30, 0.82);
  border: 0;
  border-radius: 50%;
  font: 300 28px/1 var(--sans);
  cursor: pointer;
}

.dialog-layout {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
}

.dialog-image-wrap {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 34px;
  background: #262524;
}

.dialog-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.dialog-index {
  position: absolute;
  left: 20px;
  bottom: 17px;
  margin: 0;
  color: rgba(238, 232, 226, 0.7);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.dialog-details {
  min-height: 0;
  padding: clamp(40px, 4vw, 70px) clamp(28px, 3.5vw, 54px);
  overflow-y: auto;
}

.dialog-kicker {
  margin: 0 0 25px;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.dialog-details h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 4.5vw, 76px);
  font-weight: 400;
  line-height: 0.92;
}

.dialog-description {
  margin: 22px 0 0;
  color: #554f4a;
  font-size: 12px;
  line-height: 1.65;
}

.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.dialog-tags span {
  padding: 7px 10px;
  color: var(--wine);
  border: 1px solid rgba(105, 47, 54, 0.28);
  border-radius: 999px;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.like-button {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding: 13px 15px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  font: 9px/1 var(--sans);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.like-button .heart {
  color: var(--wine);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
}

.like-button.is-liked {
  color: var(--paper-light);
  background: var(--wine);
  border-color: var(--wine);
}

.like-button.is-liked .heart {
  color: var(--paper-light);
}

.comments-section {
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.comments-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.comments-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 400;
  font-style: italic;
}

.comments-heading span {
  color: var(--wine);
  font-family: var(--serif);
  font-size: 16px;
}

.comments-list {
  display: grid;
  gap: 15px;
  margin-top: 20px;
}

.comment-item {
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(33, 31, 30, 0.12);
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.comment-meta time {
  color: var(--muted);
}

.comment-item p {
  margin: 0;
  color: #514b46;
  font-size: 12px;
  line-height: 1.5;
}

.no-comments {
  margin: 18px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
}

.comment-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.comment-form label {
  display: grid;
  gap: 7px;
}

.comment-form label > span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 11px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  font: 12px/1.4 var(--sans);
  resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-bottom-color: var(--wine);
}

.comment-form button[type="submit"] {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  padding: 14px 16px;
  color: var(--paper-light);
  background: var(--ink);
  border: 0;
  font: 9px/1 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.prototype-note {
  margin: -7px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

@media (max-width: 1050px) {
  .masonry-gallery {
    column-count: 3;
  }

  .archive-intro {
    grid-template-columns: 1fr auto;
  }

  .archive-description {
    grid-column: 1;
    grid-row: 2;
  }

  .photo-count {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 760px) {
  .archive-header {
    grid-template-columns: 1fr auto;
    min-height: 60px;
    padding: 0 20px;
  }

  .brand-title,
  .archive-label {
    display: none;
  }

  .archive-intro {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 70px 22px 46px;
    overflow: hidden;
  }

  .archive-heading h1 {
    font-size: clamp(65px, 19vw, 105px);
  }

  .archive-description {
    grid-column: auto;
    grid-row: auto;
  }

  .photo-count {
    grid-column: auto;
    grid-row: auto;
    display: flex;
    align-items: baseline;
    gap: 10px;
  }

  .photo-count span {
    margin: 0;
  }

  .archive-tools {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 22px;
  }

  .gallery-wrap {
    padding: 24px 14px;
  }

  .masonry-gallery {
    column-count: 2;
    column-gap: 10px;
  }

  .gallery-card {
    margin-bottom: 17px;
  }

  .card-caption {
    padding-top: 8px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-tags {
    display: none;
  }

  .archive-footer {
    gap: 25px;
    padding: 30px 22px;
    line-height: 1.5;
  }

  .photo-dialog {
    width: 100vw;
    height: 100svh;
    margin: 0;
  }

  .dialog-layout {
    display: block;
    overflow-y: auto;
  }

  .dialog-image-wrap {
    height: 62svh;
    padding: 18px;
  }

  .dialog-details {
    overflow: visible;
    padding: 38px 22px 70px;
  }

  .dialog-close {
    position: fixed;
  }
}

@media (max-width: 420px) {
  .archive-heading h1 {
    font-size: 63px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card img,
  .card-image-wrap::after {
    transition: none;
  }
}
