/* cards module styles — filter bar + site cards. "Hanji & Celadon" theme. */

/* ============================ filter bar ================================== */
.filter-field {
  display: inline-flex;
  align-items: center;
}
.filter-select,
.filter-input {
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
  box-shadow: var(--shadow-sm);
}
.filter-select {
  /* custom celadon chevron, no native arrow */
  -webkit-appearance: none;
  appearance: none;
  /* reserve space for the custom chevron; UA select styles fight padding-right,
     so the right inset is enforced as a wider gap on the text side too */
  padding-right: 32px !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%232f6b5e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.filter-field { min-width: 0; }
.filter-select:hover,
.filter-input:hover { border-color: var(--accent-2); }
.filter-input { cursor: text; }
.filter-search {
  flex: 1 1 220px;
  min-width: 150px;
}
.filter-search .filter-input { width: 100%; }
.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: var(--ring);
}
.filter-clear {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}
.filter-clear:hover {
  color: var(--warm);
  border-color: var(--warm);
  background: var(--warm-wash);
}
.filter-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: .01em;
}

@media (max-width: 680px) {
  /* compact two-up grid of selects, then a full-width search row */
  .filter-bar { gap: 7px 8px; }
  .filter-field {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  .filter-select { width: 100%; }
  .filter-select, .filter-input, .filter-clear { font-size: 13px; padding: 7px 12px; }
  .filter-search { flex: 1 1 100%; order: 5; }
  .filter-clear { order: 6; flex: 0 0 auto; }
  .filter-count {
    order: 7;
    margin-left: auto;
    align-self: center;
    text-align: right;
  }
}

/* ============================ site cards ================================== */
.cards .card {
  /* staggered entrance on first paint */
  animation: card-in .42s var(--ease) both;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 15px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
/* a thin cluster-tinted seam down the left edge, lit on hover/selection */
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--line);
  opacity: .6;
  transition: opacity .2s var(--ease), background .2s var(--ease);
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2);
  box-shadow: var(--shadow-lg);
}
.card:hover::before { opacity: 1; background: var(--accent-2); }
.card.selected {
  border-color: var(--accent);
  box-shadow: var(--ring), var(--shadow-lg);
}
.card.selected::before { opacity: 1; background: var(--accent); }

/* header: code badge + cluster dot + titles */
.card-head {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 9px;
}
.card-code {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 23px;
  padding: 0 7px;
  border-radius: 7px;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fbf7ee;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
}
.cluster-dot {
  width: 11px;
  height: 11px;
  margin-top: 6px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line-soft);
}
.card-titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--ink);
}
.card-name-kr {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: .01em;
}

/* meta lines */
.card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-2);
}
.card-meta .meta-line:empty { display: none; }
/* first meta line (place) reads as a quiet eyebrow */
.card-meta .meta-line:first-child {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .045em;
  font-size: 10.5px;
  color: var(--accent);
}

.card-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* full-bleed photo banner at the top of the card */
.card-photo {
  margin: -16px -16px 3px;          /* break out of the card's 16px padding */
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);           /* paper tone while the image loads */
  border-bottom: 1px solid var(--line-soft);
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s var(--ease);
}
.card:hover .card-photo img { transform: scale(1.045); }

/* a subtle paper-edge divider before the vote controls */
.card .vote-controls {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* stagger the first dozen cards; later ones share the last delay */
.cards .card:nth-child(1)  { animation-delay: .00s; }
.cards .card:nth-child(2)  { animation-delay: .03s; }
.cards .card:nth-child(3)  { animation-delay: .06s; }
.cards .card:nth-child(4)  { animation-delay: .09s; }
.cards .card:nth-child(5)  { animation-delay: .12s; }
.cards .card:nth-child(6)  { animation-delay: .15s; }
.cards .card:nth-child(7)  { animation-delay: .18s; }
.cards .card:nth-child(8)  { animation-delay: .21s; }
.cards .card:nth-child(9)  { animation-delay: .24s; }
.cards .card:nth-child(n+10) { animation-delay: .27s; }
