/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fff;
  color: #111;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  text-align: center;
  padding: 40px 16px 0;
}

.site-title {
  font-size: 28px;
  font-weight: 100;
  letter-spacing: 0.1em;
  color: #111;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  text-align: center;
  padding: 24px 16px 32px;
  border-bottom: 1px solid #f0f0f0;
}

.hero-sub {
  font-size: 14px;
  font-weight: 400;
  color: #666;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.btn-start {
  display: inline-block;
  padding: 16px 32px;
  background: #111;
  color: #fff;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.1em;
  transition: background 0.2s;
}

.btn-start:hover {
  background: #333;
}

/* ============================================================
   Gallery
   ============================================================ */
.work-wrap {
  flex: 1;
  padding: 24px 12px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  background-color: #E4E4E4;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 520px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .work-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .work-wrap { padding: 32px 20px; }
}

@media (min-width: 1024px) {
  .work-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1280px) {
  .work-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ── カード ── */
.work-card {
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}
.work-card.dark {
  background: #000000;
}


.card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease; /* ゆっくり変化させる */
}

.card-preview:hover img {
  transform: scale(1.1);
}



.card-preview .preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top-color: #999;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.card-info {
  padding: 8px 10px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.work-card .card-title {
  font-size: 13px;
  font-weight: 400;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-card .card-text {
  font-size: 10px;
  font-weight: 200;
  color: #666;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-like-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  color: #666;
  -webkit-user-select: none;
  user-select: none;
}

.card-like-icon {
  width: 18px;
  height: 18px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.15s;
}

.card-like-icon img.on  { display: none; }
.card-like-icon img.off { display: block; }

.card-like-icon.liked img.on  { display: block; }
.card-like-icon.liked img.off { display: none; }

.card-like-btn:active .card-like-icon {
  transform: scale(1.3);
}

.work-card .card-like-count {
  font-size: 12px;
  color: #000;
}
.work-card.dark .card-like-count {
  color: #FFF;
}


.card-view-btn:hover {
  background: #ddd;
}

.work-card .card-download-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  border-radius: 12px;
  border: 1px solid #808080;
  border: none;
  cursor: pointer;
  color: #000000;
  font-size: 11px;
  text-decoration: none;
  transition: background 0.15s;
  -webkit-user-select: none;
  user-select: none;
  padding: 0 12px;
  background: #eee;
}
.work-card .card-download-btn:hover {
  background: #ddd;
}
.work-card.dark .card-download-btn {
  color: #ffffff;
  background: #333;
}
.work-card.dark .card-download-btn:hover {
  background: #444;
}

/* ============================================================
   ローディング / 空状態
   ============================================================ */
.work-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 48px 0;
}

.loading-dot {
  width: 7px;
  height: 7px;
  background: #ccc;
  border-radius: 50%;
  animation: dot-bounce 1.2s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%           { transform: scale(1);   opacity: 1; }
}

.work-empty {
  text-align: center;
  padding: 64px 16px;
  font-size: 14px;
  font-weight: 300;
  color: #bbb;
}

/* ============================================================
   ページネーション
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px 0 16px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 7px 14px;
  border: 1px solid #e0e0e0;
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: #444;
  transition: background 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.pagination button:hover:not(:disabled) {
  background: #f5f5f5;
}

.pagination button:disabled {
  opacity: 0.35;
  cursor: default;
}

.pagination button.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid #f0f0f0;
  padding-top: 24px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 0 16px 20px;
  font-size: 12px;
  color: #999;
}

.footer-links a:hover {
  color: #555;
}

.footer-copyright {
  text-align: center;
  padding: 0 16px 20px;
  font-size: 12px;
  color: #999;
}


.footer-ad {
  display: flex;
  justify-content: center;
}

/* ============================================================
   Utility
   ============================================================ */
.hidden { display: none !important; }
