/* Sakura AI Art - 補完スタイル */

* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* sr-only (アクセシビリティ) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* スクロールバー非表示(モバイルフィルタ用) */
.scroll-hide::-webkit-scrollbar { display: none; }
.scroll-hide { scrollbar-width: none; }

/* 装飾背景 — やわらかいグラデと粒子 */
#bg-deco::before,
#bg-deco::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(224,170,191,0.16) 0, transparent 9%),
    radial-gradient(circle at 82% 70%, rgba(204,126,156,0.12) 0, transparent 8%),
    radial-gradient(circle at 60% 30%, rgba(247,238,223,0.06) 0, transparent 5%),
    radial-gradient(circle at 30% 80%, rgba(224,170,191,0.14) 0, transparent 9%);
  pointer-events: none;
  animation: drift 80s linear infinite;
}
#bg-deco::after { animation-direction: reverse; animation-duration: 100s; opacity: 0.6; }
@keyframes drift {
  0% { transform: translate(0,0); }
  50% { transform: translate(20px,-20px); }
  100% { transform: translate(0,0); }
}

/* ヒーロー fade-in */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s ease-out forwards;
}
.fade-in.delay-200 { animation-delay: 0.2s; }
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* h1 シマーアニメ */
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.shimmer-text {
  background-size: 200% auto;
  animation: shimmer 8s linear infinite;
}

/* メイソンリーグリッド */
.masonry-grid {
  column-count: 1;
  column-gap: 1rem;
}
@media (min-width: 640px) { .masonry-grid { column-count: 2; column-gap: 1.25rem; } }
@media (min-width: 1024px) { .masonry-grid { column-count: 3; column-gap: 1.5rem; } }
@media (min-width: 1280px) { .masonry-grid { column-count: 4; column-gap: 1.5rem; } }

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s, border-color 0.3s;
  /* button reset */
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
}
.masonry-item:hover,
.masonry-item:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -15px rgba(204,126,156,0.4);
  border-color: rgba(224,170,191,0.45);
}
.masonry-item:focus-visible {
  outline: 2px solid #e0aabf;
  outline-offset: 4px;
}
.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.masonry-item:hover img { transform: scale(1.04); }

.masonry-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(21,19,26,0.85) 0%, rgba(21,19,26,0) 55%);
  opacity: 0;
  transition: opacity 0.4s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
}
.masonry-item:hover .overlay,
.masonry-item:focus-visible .overlay {
  opacity: 1;
}
.masonry-item .overlay .title {
  font-family: 'Shippori Mincho', serif;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.4;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.masonry-item .overlay .meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.4rem;
  letter-spacing: 0.05em;
}
.masonry-item .badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.3rem 0.75rem;
  background: rgba(21,19,26,0.7);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: #f0d2dd;
  border: 1px solid rgba(224,170,191,0.25);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.masonry-item:hover .badge,
.masonry-item:focus-visible .badge {
  opacity: 1;
}

/* フィルターピル(タッチ44px) */
.filter-pill {
  padding: 0.6rem 1.1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  color: rgba(255,250,243,0.7);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}
.filter-pill:hover {
  background: rgba(255,255,255,0.08);
  color: #fffaf3;
  border-color: rgba(224,170,191,0.4);
}
.filter-pill:focus-visible {
  outline: 2px solid #e0aabf;
  outline-offset: 2px;
}
.filter-pill.active {
  background: linear-gradient(135deg, #cc7e9c, #b35d80);
  color: #fffaf3;
  border-color: #b35d80;
  box-shadow: 0 4px 14px rgba(179,93,128,0.35);
}
.filter-pill .count {
  margin-left: 0.4rem;
  opacity: 0.6;
  font-size: 0.7rem;
}

/* ライトボックス */
#lightbox {
  animation: lightboxIn 0.3s ease-out;
}
@keyframes lightboxIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
#lightbox-image {
  animation: imageIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes imageIn {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* スクロールで現れる */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s, transform 0.8s;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
/* reduce-motion 利用者は最初から見える状態に */
.reduce-motion .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* 検索 input の検索アイコン取り消し(Webkit) */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
