h3.canva-template-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  border-bottom: dotted 1px #ccc;
  padding-bottom: 5px;
}

.canva-templates-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.canva-search-form {
  margin-bottom: 30px;
  text-align: center;
}

.canva-search-form input {
  padding: 10px;
  width: 300px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.canva-search-form button {
  padding: 10px 20px;
  background: #0073aa;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  margin-left: 10px;
}

.canva-search-form button:hover {
  background: #005a87;
}

/* メイングリッド：デスクトップで3列、間隔を調整 */
.canva-templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.canva-template-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  background: #fffff7;
}

.canva-template-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* サムネイル表示：全体表示に変更 */
.canva-template-thumbnail {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 10px;
  background: #fff;
  border-bottom: solid 1px #7dc832;
}

.canva-template-thumbnail img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s;
}

.canva-template-thumbnail:hover img {
  transform: scale(1.05);
}

/* 分かりやすいズームアイコンに変更 */
.canva-template-thumbnail::after {
  content: "⊕";
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-weight: bold;
}

.canva-template-thumbnail:hover::after {
  opacity: 1;
}

.canva-template-content {
  padding: 10px;
}

.canva-template-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: bold;
  line-height: 1.3;
}

.canva-template-description {
  margin: 0 0 15px 0;
  color: #666;
  font-size: 14px;
  line-height: 1.4;
}

.canva-template-keywords {
  margin-bottom: 20px;
}

.canva-keyword {
  display: inline-block;
  background: #f0f0f0;
  padding: 4px 8px;
  margin: 2px;
  border-radius: 3px;
  font-size: 12px;
  color: #666;
}

.canva-template-buttons {
  display: flex;
  gap: 12px;
}

.canva-btn {
  padding: 10px 14px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
  transition: background-color 0.2s;
  flex: 1;
  white-space: nowrap;
  font-weight: 500;
}

.canva-btn-primary,
.canva-btn-secondary {
  background: #0073aa;
  color: white;
}

.canva-btn-primary:hover,
.canva-btn-secondary:hover {
  background: #005a87;
  color: white;
}

.canva-loading {
  text-align: center;
  padding: 20px;
  font-size: 16px;
  color: #666;
}

.no-templates {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

/* ポップアップ画像表示 */
.canva-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.canva-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.canva-popup-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.canva-popup-overlay.active .canva-popup-content {
  transform: scale(1);
}

.canva-popup-image {
  width: 100%;
  height: auto;
  display: block;
}

.canva-popup-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  background: #000;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  font-weight: bold;
}

.canva-popup-close:hover {
  background: #333;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .canva-templates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .canva-templates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .canva-search-form input {
    width: 100%;
    margin-bottom: 10px;
  }

  .canva-search-form button {
    margin-left: 0;
    width: 100%;
  }

  .canva-template-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .canva-template-title {
    font-size: 16px;
  }

  .canva-template-content {
    padding: 15px;
  }

  .canva-template-thumbnail {
    height: 180px;
  }

  .canva-btn {
    font-size: 14px;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .canva-templates-container {
    padding: 15px;
  }

  .canva-templates-grid {
    grid-template-columns: 1fr; /* 小さなスマホでは1列 */
    gap: 15px;
  }

  .canva-template-thumbnail {
    height: 200px;
  }

  .canva-template-content {
    padding: 12px;
  }
}

.canva-template-pages {
  margin-bottom: 10px;
}

.canva-pages-label {
  background: #e8f4f8;
  color: #0073aa;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #0073aa;
}
