/* Template slider (home page) + /cv-templates grid. Prefix tpl- */
.tpl-showcase { padding: 3rem 0 2.5rem; background: linear-gradient(180deg, #f6f5fb 0%, #ffffff 100%); }
.tpl-slider { position: relative; }
.tpl-track {
  display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: .5rem .25rem 1.25rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; outline: none;
}
.tpl-track::-webkit-scrollbar { display: none; }
.tpl-track.dragging { scroll-behavior: auto; scroll-snap-type: none; cursor: grabbing; }
.tpl-card { flex: 0 0 auto; width: 232px; scroll-snap-align: start; text-align: center; }
.tpl-card h3 { font-size: 1rem; font-weight: 800; margin: .8rem 0 .15rem; font-family: var(--font-heading, inherit); }
.tpl-card p { font-size: .82rem; color: var(--muted, #837e93); margin: 0; min-height: 2.4em; }
.tpl-thumb {
  position: relative; display: block; border-radius: 6px; overflow: hidden; background: #fff; aspect-ratio: 210 / 297;
  box-shadow: 0 1px 2px rgba(20,18,50,.08), 0 10px 24px rgba(20,18,50,.14); transition: transform .2s ease, box-shadow .2s ease;
}
.tpl-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; user-select: none; }
.tpl-card:hover .tpl-thumb, .tpl-thumb:focus-visible { transform: translateY(-5px); box-shadow: 0 2px 4px rgba(20,18,50,.1), 0 18px 36px rgba(91,79,224,.28); }
.tpl-hover {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .85rem .5rem; background: linear-gradient(0deg, rgba(40,30,120,.92), rgba(40,30,120,.0));
  color: #fff; font-weight: 700; font-size: .88rem; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.tpl-card:hover .tpl-hover, .tpl-thumb:focus-visible .tpl-hover { opacity: 1; transform: none; }
@media (hover: none) { .tpl-hover { opacity: 1; transform: none; padding: .6rem .5rem; font-size: .8rem; } }
.tpl-nav {
  position: absolute; top: 38%; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; color: var(--primary, #5b4fe0);
  box-shadow: 0 4px 16px rgba(20,18,50,.22); display: grid; place-items: center; font-size: 1.15rem; cursor: pointer; transition: opacity .2s, transform .15s;
}
.tpl-nav:hover { transform: scale(1.08); }
.tpl-prev { left: -14px; } .tpl-next { right: -14px; }
.tpl-nav[disabled] { opacity: 0; pointer-events: none; }
@media (max-width: 767px) { .tpl-nav { display: none; } .tpl-card { width: 200px; } }

/* /cv-templates */
.tpl-hero { padding: 2.6rem 0 1.2rem; text-align: center; }
.tpl-hero h1 { font-family: var(--font-heading, inherit); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.tpl-filters { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 1.2rem 0 1.8rem; }
.tpl-chip { border: 1px solid #cfcde0; background: #fff; border-radius: 999px; padding: .38rem .95rem; font-size: .85rem; font-weight: 600; cursor: pointer; color: #2b2940; }
.tpl-chip:hover { border-color: var(--primary, #5b4fe0); color: var(--primary, #5b4fe0); }
.tpl-chip.active { background: var(--primary, #5b4fe0); border-color: var(--primary, #5b4fe0); color: #fff; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.8rem 1.4rem; }
.tpl-grid .tpl-card { width: auto; }
.tpl-tags { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin: .5rem 0 .7rem; }
.tpl-tags span { font-size: .7rem; font-weight: 700; color: #5b5873; background: #efeef7; border-radius: 999px; padding: .12rem .6rem; }
.tpl-card .btn { font-size: .85rem; }
.tpl-card[hidden] { display: none; }
