/* archive.css — the studio's free Archive search sheet.
   Outer shell follows popup_sheet.css (.ps-sheet); each result inside is a tactile pulp-paper
   contact-sheet card with a strip of masking tape and typewriter stamps. */

.modal-card.archive-modal-card.ps-sheet {
  max-width: 680px;
  width: 100%;
  height: min(820px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  padding: 14px 16px 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card.archive-modal-card.ps-sheet > :not(.archive-grid) {
  flex-shrink: 0;
}

.archive-search-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
  min-width: 0;
}

.archive-search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  box-sizing: border-box;
  font: 400 16px/1.25 'Courier Prime', monospace; /* >= 16px stops iOS auto-zoom */
  color: #16161a;
  background: #f4efe6;
  border: 1.5px solid #2a2b2f;
  border-radius: 10px;
  outline: none;
}
.archive-search-input::placeholder {
  color: #6b5e4f;
}
.archive-search-input:focus {
  border-color: var(--ink-yellow, #f6da36);
  box-shadow: 0 0 0 2px rgba(246, 218, 54, 0.28);
}

.archive-search-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--ink-yellow, #f6da36);
  color: var(--ink-black, #16161a);
  font-family: var(--font-display, 'Archivo', sans-serif);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}
.archive-search-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.archive-provider-pills {
  display: flex;
  align-items: center;
  min-height: 36px;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.archive-provider-pills::-webkit-scrollbar {
  display: none;
}
.archive-provider-pill {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--studio-line, #2a2b2f);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  font: 700 11px/1.1 'Courier Prime', monospace;
  cursor: pointer;
  white-space: nowrap;
}
.archive-provider-pill:hover {
  border-color: #64748b;
  color: #f1f5f9;
}
.archive-provider-pill.active {
  background: #f4efe6;
  border-color: #f4efe6;
  color: #16161a;
}

.archive-status {
  margin: 0 0 10px;
  min-height: 18px;
  font: 400 12px/1.35 'Courier Prime', monospace;
  color: #cbd5e1;
  overflow-wrap: anywhere;
}
.archive-status[hidden] {
  display: none;
}

.archive-grid {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 4px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

@media (min-width: 580px) {
  .archive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

.archive-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 8px 7px;
  background: #f4efe6;
  color: #16161a;
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
  transform: rotate(-0.5deg);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.archive-card:nth-child(even) {
  transform: rotate(0.55deg);
}
.archive-card:hover {
  transform: translateY(-2px) rotate(0deg);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.44);
}
.archive-card::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 64px;
  height: 14px;
  transform: translateX(-50%) rotate(-2deg);
  background: url('assets/desk/duct-strip.png') center / 100% 100% no-repeat, rgba(246, 236, 205, 0.9);
  pointer-events: none;
  opacity: 0.92;
}
.archive-card:nth-child(even)::before {
  transform: translateX(-50%) rotate(2.2deg);
}

.archive-card-pick {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.archive-card-pick:disabled {
  opacity: 0.55;
  cursor: wait;
}

.archive-card-well {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #eae4d6;
  border: 1px solid rgba(22, 22, 26, 0.14);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.archive-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.archive-card-title {
  font: 700 12.5px/1.25 'Plus Jakarta Sans', -apple-system, sans-serif;
  color: #16161a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.archive-card-credit {
  font: 400 11px/1.25 'Courier Prime', monospace;
  color: #5c4a38;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-card-foot {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(22, 22, 26, 0.22);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.archive-card-stamp {
  align-self: flex-start;
  max-width: 100%;
  box-sizing: border-box;
  font: 700 10px/1.25 'Courier Prime', monospace;
  color: #16161a;
  background: #eae4d6;
  padding: 2px 5px;
  border-radius: 2px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.archive-card-stamp.is-cc-by {
  background: #f6da36;
}

.archive-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.archive-cutout-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 2px 0;
  font: 700 10.5px/1.1 'Courier Prime', monospace;
  color: #16161a;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  white-space: nowrap;
  cursor: pointer;
}
.archive-cutout-btn:hover {
  text-decoration-style: solid;
}
.archive-cutout-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.archive-source-link {
  flex: 0 0 auto;
  font: 700 10.5px/1.1 'Courier Prime', monospace;
  color: #101e6b;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.archive-source-link:hover {
  text-decoration-style: solid;
}
