/* =========================================================
   gallery.css - マトリクスギャラリーページ
   テーマ直下 /matrix/gallery.css
   ========================================================= */

.matrix-gallery-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  font-family: "Courier New", monospace;
  color: var(--tg-text-1, #3a332a);
}

.matrix-gallery-header {
  margin-bottom: 20px;
}

.matrix-gallery-title {
  font-family: "Zen Kurenaido", sans-serif;
  font-size: 1.9rem;
  margin: 0 0 6px;
  color: var(--tg-accent, #7a5c3e);
}

.matrix-gallery-lead {
  font-size: 0.85rem;
  opacity: 0.75;
  margin: 0;
}

.matrix-gallery-empty {
  font-size: 0.85rem;
  opacity: 0.6;
  padding: 40px 0;
  text-align: center;
}

.matrix-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.matrix-gallery-card {
  background: var(--tg-panel, #fbf7ee);
  border: 1px solid var(--tg-border, #ddd2bb);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.matrix-gallery-thumb-link {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eee;
}

.matrix-gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.matrix-gallery-card-body {
  padding: 10px 12px 12px;
}

.matrix-gallery-card-title {
  font-family: "Zen Kurenaido", sans-serif;
  font-size: 0.95rem;
  margin: 0 0 4px;
  overflow-wrap: break-word;
}

.matrix-gallery-card-date {
  font-size: 0.72rem;
  opacity: 0.6;
  margin: 0 0 8px;
}

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

.matrix-gallery-download-link {
  display: inline-block;
  font-size: 0.75rem;
  padding: 4px 10px;
  border: 1px solid var(--tg-border, #ddd2bb);
  border-radius: 4px;
  color: var(--tg-accent, #7a5c3e);
  text-decoration: none;
}
.matrix-gallery-download-link:hover {
  background: var(--tg-accent, #7a5c3e);
  color: #fff;
}

.matrix-gallery-card-actions .matrix-gallery-delete-btn,
button.matrix-gallery-delete-btn {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  margin: 0 !important;
  line-height: 1 !important;
  padding: 0 !important;
  font-size: 0.85rem !important;
  font-family: "Courier New", monospace !important;
  border: 1px solid var(--tg-border, #ddd2bb) !important;
  border-radius: 4px !important;
  background: var(--tg-panel, #fbf7ee) !important;
  color: #999 !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}
.matrix-gallery-card-actions .matrix-gallery-delete-btn:hover,
button.matrix-gallery-delete-btn:hover {
  border-color: #c0392b !important;
  color: #c0392b !important;
  background: var(--tg-panel, #fbf7ee) !important;
}
.matrix-gallery-card-actions .matrix-gallery-delete-btn:disabled,
button.matrix-gallery-delete-btn:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

@media (max-width: 600px) {
  .matrix-gallery-page {
    padding: 12px 6px 60px;
  }
  .matrix-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
}
