.gallery-hero {
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
}
.gallery-hero .section-head {
  margin: 0 auto var(--space-sm);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding-bottom: var(--space-2xl);
}
.template-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition:
    transform var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
  display: flex;
  flex-direction: column;
}
.template-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.template-thumb {
  aspect-ratio: 3 / 3.15;
  background: var(--off-white);
  color: var(--jet-black);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.template-thumb .t-line {
  border-radius: 3px;
  background: var(--gray-200);
  margin-bottom: 6px;
  height: 6px;
}
.template-thumb .t-section-label {
  width: 32%;
  height: 6px;
  border-radius: 3px;
  background: var(--stone-brown);
  opacity: 0.55;
  margin: 12px 0 7px;
}
.template-thumb .t-tag-row {
  display: flex;
  gap: 4px;
  margin-top: 9px;
}
.template-thumb .t-tag-row span {
  display: inline-block;
  flex: 1;
  height: 11px;
  border-radius: 999px;
  background: var(--gray-200);
}
.template-thumb .t-entry {
  margin-bottom: 9px;
}

.template-info {
  padding: var(--space-md);
}
.template-info h3 {
  margin-bottom: var(--space-3xs);
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}
.template-info p {
  font-size: var(--fs-sm);
  margin-bottom: var(--space-sm);
}
.template-tags {
  display: flex;
  gap: var(--space-3xs);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}
.template-tags span {
  font-size: var(--fs-xs);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.template-card .btn {
  width: 100%;
}

/* ---- Thumbnail looks, mirrors builder template styles ---- */
.thumb-modern {
  display: flex;
  flex-direction: column;
}
.thumb-modern .t-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.thumb-modern .t-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--stone-brown);
  flex-shrink: 0;
}
.thumb-modern .t-name {
  height: 10px;
  width: 60%;
  background: var(--jet-black);
  border-radius: 2px;
}
.thumb-modern .t-line.accent {
  background: var(--dusty-taupe);
}

.thumb-minimal {
  padding-top: 1.4rem;
}
.thumb-minimal .t-name {
  height: 9px;
  width: 50%;
  background: var(--jet-black);
  margin: 0 auto 4px;
}
.thumb-minimal .t-line {
  margin-left: auto;
  margin-right: auto;
  width: 70%;
}
.thumb-minimal .t-rule {
  height: 1px;
  background: var(--gray-200);
  margin: 10px 0;
  width: 100%;
}

.thumb-classic {
  border-left: 5px solid var(--stone-brown);
}
.thumb-classic .t-name {
  height: 11px;
  width: 65%;
  background: var(--jet-black);
  margin-bottom: 8px;
}
.thumb-classic .t-line.serif {
  background: var(--gray-400);
}

.thumb-creative {
  background: linear-gradient(160deg, var(--jet-black), var(--stone-brown));
  color: var(--white-smoke);
}
.thumb-creative .t-name {
  height: 11px;
  width: 70%;
  background: var(--white-smoke);
  margin-bottom: 8px;
}
.thumb-creative .t-line {
  background: rgba(242, 244, 243, 0.35);
}
.thumb-creative .t-block {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--dusty-taupe);
  margin-bottom: 10px;
}
.thumb-creative .t-section-label {
  background: var(--dusty-taupe);
  opacity: 0.85;
}
.thumb-creative .t-tag-row span {
  background: rgba(242, 244, 243, 0.18);
}

.thumb-professional {
  display: grid;
  grid-template-columns: 34% 1fr;
  gap: 10px;
  height: 100%;
}
.thumb-professional .t-side {
  background: var(--jet-black);
  border-radius: 4px;
  padding: 8px;
}
.thumb-professional .t-side .t-line {
  background: rgba(242, 244, 243, 0.3);
}
.thumb-professional .t-side .t-section-label {
  background: var(--dusty-taupe);
  opacity: 0.8;
  margin-top: 10px;
}
.thumb-professional .t-main .t-name {
  height: 10px;
  width: 80%;
  background: var(--jet-black);
  margin-bottom: 8px;
}

.thumb-executive {
  padding: 0;
  display: flex;
  flex-direction: column;
}
.thumb-executive .t-banner {
  background: var(--stone-brown);
  padding: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.thumb-executive .t-avatar {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}
.thumb-executive .t-line {
  margin: 0 1.1rem 6px;
}
.thumb-executive .t-section-label,
.thumb-executive .t-entry {
  margin-left: 1.1rem;
  margin-right: 1.1rem;
}

.thumb-corporate .t-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.thumb-corporate .t-rule-thick {
  height: 4px;
  background: var(--stone-brown);
  border-radius: 2px;
  margin: 8px 0;
}
.thumb-corporate .t-avatar {
  border-radius: 50%;
  background: var(--stone-brown);
  flex-shrink: 0;
}
.thumb-corporate .t-chip {
  display: inline-block;
  background: var(--stone-brown);
  width: 45%;
  height: 12px;
  border-radius: 3px;
}

.thumb-elegant {
  text-align: center;
  padding-top: 1.2rem;
}
.thumb-elegant .t-avatar {
  border-radius: 50%;
  background: var(--stone-brown);
}
.thumb-elegant .t-rule {
  height: 1px;
  background: var(--gray-200);
}

@media (max-width: 960px) {
  .template-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .template-grid {
    grid-template-columns: 1fr;
  }
}
