/* ==========================================
   作品の絵葉書カード（トップページと作品一覧ページで共用）
   動きは js/postcard.js
   ========================================== */

/* 絞り込みのボタンとタグ */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--mist);
}
.chip.is-active { background: var(--paper); color: var(--night); border-color: var(--paper); }
.tag-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 5px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 44px 36px;
  padding: 24px 8px 0;
}
.works-empty { margin: 0; color: var(--paper-soft); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 18px;
  background: var(--paper);
  color: var(--night);
}
.card a { color: var(--night); }
.card-media {
  position: relative;
  display: block;
  height: 240px;
  overflow: hidden;
  background: var(--sea);
}
.card-media img,
.card-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  color: var(--paper);
  font-size: 14px;
  text-align: center;
}
.card-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--paper);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.card-play svg { margin-left: 3px; }

/* 作品画像の透かし（キルティング風の格子と、マス目の中のロゴ） */
.wm-grid,
.wm {
  position: absolute;
  inset: -60%;
  pointer-events: none;
  transform: rotate(-30deg);
  background-repeat: repeat;
  background-size: 168px 168px;
  background-position: 0 0;
}
.wm-grid {
  z-index: 9;
  background-position: 5px 5px;
  background-image:
    linear-gradient(to right, transparent 0, transparent 118px, rgba(255, 255, 255, 0.1) 163px, transparent 168px),
    linear-gradient(to bottom, transparent 0, transparent 118px, rgba(255, 255, 255, 0.1) 163px, transparent 168px);
}
.wm {
  z-index: 10;
  opacity: 0.15;
  background-image: url("/img/index/logo-watermark.webp");
  filter: brightness(1.05);
}

.card-postmark {
  position: absolute;
  top: 200px;
  right: 2px;
  z-index: 12;
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--lamp);
  border-radius: 50%;
  background: var(--paper);
  color: var(--lamp);
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  transform: rotate(-16deg);
}
.card-meta {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.card-meta time { font-family: var(--font-hand); font-size: 14px; }
.card-title { margin: 0; font-weight: 400; font-size: 20px; }
.card-desc {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-family: var(--font-hand);
  font-size: 15px;
  line-height: 1.7;
}
.card-tags { margin: 0; display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 13px; }
.card-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}
.card-actions { display: flex; gap: 8px; margin-top: 4px; }
.like-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--lamp);
  color: var(--lamp);
  font-size: 14px;
}
.like-btn[aria-pressed="true"] { background: var(--lamp); color: var(--paper); }
.share-btn {
  min-height: 44px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--night);
  color: var(--night);
  font-size: 14px;
}
.heart-pop {
  position: absolute;
  left: 12px;
  top: -6px;
  pointer-events: none;
  animation: heart-pop 0.9s ease-out forwards;
}
@keyframes heart-pop {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-36px) scale(1.4); }
}

/* 画像の拡大表示（作品詳細・お知らせ詳細） */
.zoom {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.92);
}
.zoom::backdrop { background: rgba(0, 0, 0, 0.6); }
.zoom[open] { display: flex; align-items: center; justify-content: center; }
.zoom-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--mist);
  background: var(--night);
  color: var(--paper);
}
.zoom-body {
  position: relative;
  overflow: hidden;
  max-width: 94vw;
  max-height: 90vh;
}
.zoom-body img { display: block; max-width: 94vw; max-height: 90vh; object-fit: contain; }

@media (prefers-reduced-motion: reduce) {
  .heart-pop { animation: none; display: none; }
}
