/* style.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  padding: 20px;
}

header {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

h1 {
  font-size: 24px;
  color: #333;
}

#fileInput {
  display: none;
}

.upload-btn {
  background: #a10115;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.upload-btn:hover {
  background: #c91428;
}

.upload-btn svg {
  width: 20px;
  height: 20px;
}

/* 保留枠 */
#reserve-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

#reserve-section h2 {
  font-size: 18px;
  color: #666;
  margin-bottom: 10px;
}

.horizontal-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
}

.horizontal-scroll::-webkit-scrollbar {
  height: 8px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* 投稿グループ */
.post-group {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* 投稿グループのカードコンテナ */
.post-group .card-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
  align-items: flex-start; /* 高さが違うカードを上揃え */
}

.post-group .card-container::-webkit-scrollbar {
  height: 8px;
}

.post-group .card-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* カードのサイズ */
.post-group .photo-card {
  min-width: 400px;
  max-width: 4cap;
  flex-shrink: 0;
  aspect-ratio: auto; /* 正方形強制しない */
  height: auto; /* 高さは自動 */
}

.post-group .photo-card img {
  width: 100%;
  height: auto; /* 画像の比率を保つ */
  object-fit: contain; /* coverじゃなくてcontain */
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.post-count {
  font-size: 16px;
  color: #666;
}

.download-btn {
  background: #a10115;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.download-btn:hover {
  background: #c91428;
}

.download-btn svg {
  width: 20px;
  height: 20px;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

/* カード */
.photo-card {
  position: relative;
  border: 2px dashed #ddd;
  box-sizing: border-box;
  border-radius: 8px;
  overflow: hidden;
  cursor: move;
  background: #fafafa;
}

.photo-card img {
  width: 100%;
}

.photo-card.filled {
  border: 2px solid #ddd;
}

/* 空き枠 */
.photo-card.empty::after {
  content: "+";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: #ccc;
}

/* 保留枠の空き枠 */
.photo-card.empty {
  min-width: 150px;
  min-height: 150px;
  flex-shrink: 0; /* 横スクロール時に潰れないように */
}

/* バツボタン */
.delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 30px;
  height: 30px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

.photo-card:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  background: rgba(255, 0, 0, 0.8);
}
