/* ─── สไตล์ชีทหน้าแคตตาล็อกแสดงผลเทมเพลตทั้งหมด: templates.css ─── */

.tmpl-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  box-sizing: border-box;
  min-height: 80vh;
}

.tmpl-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.tmpl-header .section-eyebrow {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #15519d;
  margin-bottom: 0.75rem;
}

.tmpl-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1rem 0;
  letter-spacing: -0.025em;
}

.tmpl-header p {
  color: #64748b;
  font-size: 1.1rem;
  margin: 0;
}

/* Templates Grid Layout */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.template-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.template-card:hover .card-thumb img {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.template-card:hover .card-overlay {
  opacity: 1;
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-meta {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.card-meta .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.card-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.card-body p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
}

.card-footer .btn {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* Button style adjustments */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.btn-full {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: #15519d;
  color: #ffffff;
  border-color: #15519d;
}

.btn-primary:hover {
  background: #113f7a;
  border-color: #113f7a;
}

.btn-outline {
  background: transparent;
  color: #475569;
  border-color: #cbd5e1;
}

.btn-outline:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.8rem;
}

.juristic-session-banner {
  background: #eff6ff;
  border-left: 4px solid #1d4ed8;
  color: #1e40af;
  padding: 1.25rem;
  margin-bottom: 2.5rem;
  font-family: 'Prompt', sans-serif;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
  .templates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .tmpl-page-container {
    padding-top: 6rem;
  }

  .templates-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}