/* ==========================================================================
   Folio — "Choose a template" page. Colours come from colors.css; the
   CV previews use cv-templates.css, the same styles as the editor.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% 0%, rgba(76, 201, 255, 0.18), transparent 40%),
    var(--bg-canvas);
  color: var(--text-primary);
  font: 400 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
ul {
  margin: 0;
}

a {
  color: var(--action-primary);
  font-weight: 500;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--action-primary);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--bg-surface);
}

.skip-link:focus {
  top: 12px;
}

/* Top bar (same look as the editor) */
/* Top bar: the same header as My resumes (pages.css), without the space under it */
.tp-shell {
  padding-bottom: 0;
}

/* Buttons */
.tp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.tp-button--primary {
  width: 100%;
  background: var(--action-gradient);
  color: var(--text-on-action);
  box-shadow: var(--shadow-action);
}

.tp-button--primary:hover {
  background: var(--action-primary-hover);
}

.tp-button--primary:active {
  background: var(--action-primary-active);
}

/* Page */
.tp-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.tp-eyebrow {
  margin-bottom: 4px;
  color: var(--action-primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tp-title {
  color: var(--text-strong);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.tp-sub {
  max-width: 40em;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 15px;
}

.tp-error {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
}

/* Template cards */
.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
  padding: 0;
  list-style: none;
}

.tp-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: var(--bg-surface);
  box-shadow: 0 0 0 1px var(--border-decorative), 0 24px 56px -32px var(--shadow-tint);
}

.tp-card.is-current {
  box-shadow: 0 0 0 2px var(--action-primary), 0 24px 56px -32px var(--shadow-tint);
}

.tp-preview {
  padding: 20px 20px 0;
  background: var(--bg-selected);
}

.tp-preview__stage {
  position: relative;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
}

.tp-preview .cv-page {
  box-shadow: 0 0 0 1px var(--border-decorative);
  pointer-events: none;
}

.tp-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.tp-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tp-card__name {
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 700;
}

.tp-badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg-selected);
  color: var(--action-primary);
  font-size: 12px;
  font-weight: 600;
}

.tp-card__desc {
  color: var(--text-primary);
}

.tp-card__best {
  color: var(--text-secondary);
  font-size: 13px;
}

.tp-card__best strong {
  color: var(--text-primary);
  font-weight: 600;
}

.tp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  padding: 0;
  list-style: none;
}

.tp-tag {
  padding: 2px 10px;
  border: 1px solid var(--border-decorative);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 12px;
}

.tp-card__body .tp-button {
  margin-top: auto;
}

@media (max-width: 767px) {
  .tp-main {
    padding: 24px 16px 48px;
  }

  .tp-title {
    font-size: 26px;
  }
}
