/* Template index, category, collection, and single-template pages. Inherits marketing_tokens.css and landing_pages.css. */
.marketing .templates-page { padding: 40px 0 112px; }
.marketing .templates-crumbs { color: var(--muted); font-size: 14px; }
.marketing .templates-crumbs span { margin-inline: 8px; }
.marketing .templates-head { margin-top: 18px; }
.marketing .templates-head h1 { max-width: 18ch; color: var(--ink); font-size: clamp(40px, 4.6vw, 64px); line-height: 1.06; text-wrap: balance; }
.marketing .templates-page .lede { max-width: 52ch; margin-top: 18px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.marketing .templates-page .lede p + p { margin-top: 12px; }

/* Thumbnails keep their canvas shape; mixed sizes sit centered on the warm surface. */
.marketing .template-grid { --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 28px 22px; margin-top: 48px; }
.marketing .template-grid.shape-tall { --cols: 6; }
.marketing .template-grid.shape-wide { --cols: 3; }
.marketing .template-grid.shape-panorama { --cols: 2; }
.marketing .template-tile { display: block; aspect-ratio: var(--ratio); overflow: hidden; border-radius: 6px; background: var(--surface); transition: box-shadow .18s, transform .18s; }
.marketing .template-tile img { width: 100%; height: 100%; object-fit: contain; }
.marketing .template-blank { display: flex; align-items: center; justify-content: center; padding: 12px; border: 1px dashed var(--line); background: transparent; color: var(--purple); font-size: 14px; font-weight: 500; text-align: center; }
.marketing .template-blank > span { display: grid; justify-items: center; gap: 4px; }
.marketing .template-blank-plus { font-size: 26px; font-weight: 400; line-height: 1; }
.marketing .template-blank:hover { background: var(--surface); text-decoration: none; }
.marketing .template-tile:hover { box-shadow: 0 10px 26px rgb(48 42 49 / 14%); transform: translateY(-2px); }

.marketing .templates-about { max-width: 62ch; margin-top: 96px; }
.marketing .templates-about h2, .marketing .templates-related h2, .marketing .templates-more h2, .marketing .templates-group h2 { color: var(--ink); font-size: clamp(28px, 2.6vw, 36px); line-height: 1.15; }
.marketing .templates-about p { margin-top: 16px; color: var(--muted); font-size: 16px; line-height: 1.75; }

/* Category cards: one shared 4:3 frame so wide and tall formats line up. */
.marketing .template-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 32px 22px; margin-top: 28px; }
.marketing .template-category { display: block; min-width: 0; color: var(--ink); }
.marketing .template-category:hover { text-decoration: none; }
.marketing .template-category-art { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; padding: 18px; border-radius: 6px; background: var(--surface); transition: box-shadow .18s; }
.marketing .template-category-art img { width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: 3px; box-shadow: 0 6px 16px rgb(48 42 49 / 10%); }
.marketing .template-category:hover .template-category-art { box-shadow: 0 10px 26px rgb(48 42 49 / 12%); }
.marketing .template-category-name { display: block; margin-top: 12px; font-size: 15px; font-weight: 500; line-height: 1.4; }
.marketing .template-category:hover .template-category-name { text-decoration: underline; }
.marketing .template-category-count { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.marketing .templates-related { margin-top: 96px; }
.marketing .templates-related .secondary { margin-top: 36px; }
.marketing .templates-group { margin-top: 80px; }

.marketing .templates-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.marketing .templates-section-head .quiet-link { flex-shrink: 0; }
.marketing .templates-row { margin-top: 72px; }
.marketing .templates-row h2 { color: var(--ink); font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.marketing .templates-row .template-grid { margin-top: 20px; }
.marketing .templates-more { margin-top: 96px; }
.marketing .templates-more .template-grid { margin-top: 28px; }

/* Single template: a large preview on the warm surface, details beside it. */
.marketing .template-hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: center; gap: clamp(40px, 5vw, 72px); margin-top: 28px; }
.marketing .template-hero.shape-panorama { grid-template-columns: 1fr; }
.marketing .template-preview { display: flex; align-items: center; justify-content: center; min-height: 360px; padding: clamp(24px, 4vw, 56px); border-radius: 8px; background: var(--surface); }
.marketing .template-preview img { width: auto; height: auto; max-width: 100%; max-height: min(560px, 64vh); border-radius: 4px; box-shadow: 0 14px 34px rgb(48 42 49 / 14%); }
.marketing .template-info h1 { color: var(--ink); font-size: clamp(34px, 3.4vw, 48px); line-height: 1.1; text-wrap: balance; }
.marketing .template-size { margin-top: 10px; color: var(--muted); font-size: 14px; }
.marketing .template-info .lede { max-width: 34ch; font-size: 17px; }
.marketing .template-edit { margin-top: 28px; }

/* Touch devices can't use the editor, so they see an AI path instead of Edit. */
.marketing .template-touch-note { display: none; max-width: 46ch; margin-top: 24px; }
.marketing .template-touch-note p { color: var(--ink); font-size: 15px; line-height: 1.6; }
.marketing .template-touch-note a { margin-top: 16px; }
@media (hover: none) and (pointer: coarse) {
  .marketing .template-touch-note { display: block; }
  .marketing .template-edit, .marketing .template-blank, .marketing .template-info .lede { display: none; }
}

@media (max-width: 1050px) {
  .marketing .template-grid.shape-tall { --cols: 4; }
  .marketing .template-grid.shape-square { --cols: 3; }
  .marketing .template-grid.shape-wide { --cols: 2; }
  .marketing .template-strip.shape-tall > :nth-child(n+5), .marketing .template-strip.shape-square > :nth-child(n+4), .marketing .template-strip.shape-wide > :nth-child(n+3) { display: none; }
  .marketing .template-hero { grid-template-columns: 1fr; }
  .marketing .template-info .lede { max-width: 46ch; }
}

@media (max-width: 760px) {
  .marketing .templates-page { padding: 28px 0 80px; }
  .marketing .templates-page .wrap { width: calc(100% - 40px); }
  .marketing .templates-page .lede { font-size: 16px; }
  .marketing .template-grid { gap: 20px 14px; margin-top: 32px; }
  .marketing .template-grid.shape-tall { --cols: 3; }
  .marketing .template-grid.shape-square { --cols: 2; }
  .marketing .template-grid.shape-panorama { --cols: 1; }
  .marketing .template-strip.shape-tall > :nth-child(n+4), .marketing .template-strip.shape-square > :nth-child(n+3), .marketing .template-strip.shape-panorama > :nth-child(n+2) { display: none; }
  .marketing .template-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .marketing .template-category-art { padding: 12px; }
  .marketing .templates-about, .marketing .templates-related, .marketing .templates-more { margin-top: 64px; }
  .marketing .templates-group { margin-top: 56px; }
  .marketing .templates-row { margin-top: 52px; }
  .marketing .template-preview { min-height: 0; padding: 20px; }
  .marketing .template-preview img { max-height: 48vh; }
}

@media (max-width: 480px) {
  .marketing .template-grid.shape-wide { --cols: 1; }
  .marketing .template-strip.shape-wide > :nth-child(n+2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .marketing .template-tile, .marketing .template-category-art { transition: none; }
  .marketing .template-tile:hover { transform: none; }
}

.marketing .unsupported-page { padding-bottom: 160px; }
.marketing .unsupported-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
