/* ==========================================
   作品一覧ページ（/works/）
   共通部分は base.css、絵葉書カードは postcard.css
   ========================================== */

.works-page {
  max-width: 1360px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 32px;
  padding-bottom: 96px;
}

.works-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
}
.page-title {
  margin: 0;
  font-weight: 400;
  font-size: 44px;
  letter-spacing: 0.1em;
}
.works-count { margin: 0; font-family: var(--font-hand); font-size: 20px; }

/* ---------- 絞り込み（PC） ---------- */
.filter-toggle { display: none; }

.filters {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 28px;
  border: 1px dotted var(--mist);
}
.filters-head,
.filters-foot { display: none; }
.filters-body { display: flex; flex-direction: column; gap: 18px; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}
.filter-row-top { align-items: flex-start; }
.filter-label {
  flex: 0 0 88px;
  min-height: 44px;
  margin: 0;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--paper-soft);
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 10px; }

.filter-tags-wrap {
  flex: 1 1 600px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 18px;
}
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 18px;
}
.filter-tags .tag-link { font-family: var(--font-hand); font-size: 16px; }
.tag-link.is-active {
  padding: 0 12px;
  background: var(--paper);
  color: var(--night);
}
.tags-more {
  min-height: 44px;
  padding: 0 4px;
  background: transparent;
  border: 0;
  color: var(--paper);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.filter-sorts { display: flex; flex-wrap: wrap; }
.sort-btn {
  min-height: 44px;
  padding: 0 18px;
  margin-left: -1px;
  background: transparent;
  border: 1px solid var(--mist);
  color: var(--paper);
  font-size: 14px;
}
.sort-btn:first-child { margin-left: 0; }
.sort-btn[aria-pressed="true"] { background: var(--paper); color: var(--night); }

/* 絞り込み中の条件 */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 14px;
}
.active-filters[hidden] { display: none; }
.active-label { color: var(--paper-soft); }
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px 0 16px;
  border: 1px solid var(--lamp);
}
.active-clear {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- 一覧 ---------- */
.works-page .works-grid { padding-top: 16px; }
.works-grid[hidden] { display: none; }

.works-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 72px 24px;
  border: 1px dotted var(--mist);
  text-align: center;
}
.works-empty-state[hidden] { display: none; }
.works-empty-state img { width: 72px; height: auto; opacity: 0.85; }
.works-empty-title { margin: 0; font-size: 20px; }
.works-empty-text { margin: 0; font-family: var(--font-hand); font-size: 16px; color: var(--paper-soft); }
.works-empty-reset {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 28px;
  background: var(--lamp);
  letter-spacing: 0.08em;
}

.works-more {
  align-self: center;
  margin-top: 24px;
  min-height: 52px;
  padding: 0 32px;
  background: transparent;
  border: 1px solid var(--paper);
  color: var(--paper);
  font-size: 16px;
  letter-spacing: 0.08em;
}
.works-more[hidden] { display: none; }

/* ---------- スマホ（768px以下） ---------- */
@media (max-width: 768px) {
  .page-title { font-size: 30px; }

  .filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 18px;
    background: transparent;
    border: 1px solid var(--mist);
    color: var(--paper);
    font-size: 16px;
  }
  .filter-toggle-side { display: inline-flex; align-items: center; gap: 10px; }
  .filter-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--lamp);
    font-size: 14px;
  }
  .filter-badge[hidden] { display: none; }

  /* パネルは閉じているときは隠し、開くと画面いっぱいに出す */
  .filters { display: none; }
  .filters.is-open {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    gap: 0;
    padding: 0;
    border: 0;
    background: var(--night);
  }
  .filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px dotted var(--mist);
  }
  .filters-title { margin: 0; font-weight: 400; font-size: 20px; letter-spacing: 0.08em; }
  .filters-close {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--mist);
    color: var(--paper);
  }
  .filters-body {
    flex: 1 1 auto;
    overflow-y: auto;
    gap: 26px;
    padding: 20px;
  }
  .filter-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .filter-label { flex: none; min-height: 0; }
  .filter-tags-wrap { flex: none; }
  .filter-chips { gap: 8px; }
  .filter-sorts { flex-wrap: nowrap; }
  .sort-btn { flex: 1 1 0; min-height: 48px; padding: 0 8px; }
  .sort-btn:last-child { flex-grow: 1.4; }

  .filters-foot {
    display: flex;
    gap: 12px;
    padding: 16px 20px 24px;
    border-top: 1px dotted var(--mist);
  }
  .filters-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 18px;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  .filters-apply {
    flex: 1 1 auto;
    min-height: 54px;
    border: 0;
    background: var(--lamp);
    color: var(--paper);
    font-size: 16px;
    letter-spacing: 0.08em;
  }
}
