/* Template gallery, structured (Daniel, 18 Nov.: "never stack like this").
   - All templates: the featured card spans the full height of the list beside it.
   - A filter with two results or more: a grid of upright cards (large preview on top, title,
     line, outline button), two or three per row, instead of full-width stacked rows.
   - Buttons follow the Rylio system: outline for "View full template", primary for sign-up. */
.mv-template-gallery .template-gallery-grid:not([data-filtered=true]) .template-card.is-featured{grid-row:1/span var(--gallery-rows,4)}

@media(min-width:810px){
  .mv-template-gallery .template-gallery-grid[data-filtered=true][data-many]{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:24px;align-items:stretch}
  .mv-template-gallery .template-gallery-grid[data-filtered=true][data-many] .template-card:not(.is-featured){grid-column:auto;display:flex;flex-direction:column;align-items:stretch;gap:0;min-height:0;padding:0;border-radius:20px}
  .mv-template-gallery .template-gallery-grid[data-filtered=true][data-many] .template-card:not(.is-featured) .template-preview{display:block;height:clamp(240px,22vw,340px);margin:0;padding:28px 0 0;border-radius:0;background:var(--gallery-tint);overflow:hidden}
  .mv-template-gallery .template-gallery-grid[data-filtered=true][data-many] .template-card:not(.is-featured) .template-paper{width:min(62%,300px);height:100%;margin-inline:auto;box-shadow:0 18px 38px rgb(0 0 0 / 22%);border-radius:6px 6px 0 0;overflow:hidden}
  .mv-template-gallery .template-gallery-grid[data-filtered=true][data-many] .template-card:not(.is-featured) .template-card-body{display:flex;flex-direction:column;flex:1;gap:0;padding:24px 28px 28px}
  .mv-template-gallery .template-gallery-grid[data-filtered=true][data-many] .template-card:not(.is-featured) .template-card-body h3{font-size:clamp(22px,1.7vw,28px);line-height:1.15;text-wrap:balance}
  .mv-template-gallery .template-gallery-grid[data-filtered=true][data-many] .template-card:not(.is-featured) .template-card-actions{margin-top:auto;padding-top:8px}
  .mv-template-gallery .template-gallery-grid[data-filtered=true][data-many] .template-card:not(.is-featured) .template-open{width:100%}
}

/* "View full template" outside the featured card: the Rylio outline button. */
:root:root .mv-template-gallery .template-gallery-grid[data-many] .template-card:not(.is-featured) .template-open{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:48px;padding:12px 22px;
  border:2px solid transparent;border-radius:10px;color:var(--ui-text,#171717)!important;font:500 15px/20px Geist,sans-serif;
  background:linear-gradient(var(--ui-surface,#fff),var(--ui-surface,#fff)) padding-box,linear-gradient(100deg,#c9d2f5 0%,#4648ff 35%,#fadcf5 65%,#c9d2f5 100%) border-box;
  background-size:100% 100%,300% 100%;background-position:0 0,0% 50%;box-shadow:none;transition:background-position .9s cubic-bezier(.2,.8,.2,1),box-shadow .2s ease
}
:root:root .mv-template-gallery .template-gallery-grid[data-many] .template-card:not(.is-featured) .template-open::after{content:"";flex:none;width:1.05em;height:1.05em;background:currentColor;-webkit-mask:var(--rb-arrow) center/contain no-repeat;mask:var(--rb-arrow) center/contain no-repeat;transition:transform .22s cubic-bezier(.2,.8,.2,1)}
@media(hover:hover) and (pointer:fine){
  :root:root .mv-template-gallery .template-gallery-grid[data-many] .template-card:not(.is-featured) .template-open:hover{animation:rylio-frame 2.4s linear infinite;box-shadow:0 4px 14px rgb(70 72 255 / 14%)}
  :root:root .mv-template-gallery .template-gallery-grid[data-many] .template-card:not(.is-featured):hover .template-open::after{transform:translateX(4px)}
}

/* The sign-up action under the gallery: the Rylio primary button. */
:root:root .mv-template-gallery .template-gallery-footer>a{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:48px;padding:12px 22px;border:0;border-radius:10px;
  background:var(--rb-blue,#4c6ac4);color:var(--rb-yellow,#fffb56);font:500 15px/20px Geist,sans-serif;text-decoration:none;box-shadow:none;transition:background-color .2s ease
}
:root:root .mv-template-gallery .template-gallery-footer>a::after{content:"";width:1.05em;height:1.05em;background:currentColor;-webkit-mask:var(--rb-arrow) center/contain no-repeat;mask:var(--rb-arrow) center/contain no-repeat;transition:transform .22s cubic-bezier(.2,.8,.2,1)}
@media(hover:hover) and (pointer:fine){
  :root:root .mv-template-gallery .template-gallery-footer>a:hover{background:var(--rb-blue-deep,#3351ab);color:var(--rb-yellow,#fffb56)}
  :root:root .mv-template-gallery .template-gallery-footer>a:hover::after{transform:translateX(4px)}
}
@media(prefers-reduced-motion:reduce){
  :root:root .mv-template-gallery :is(.template-gallery-grid[data-many] .template-open,.template-gallery-footer>a),:root:root .mv-template-gallery :is(.template-gallery-grid[data-many] .template-open,.template-gallery-footer>a)::after{transition:none;animation:none!important}
}
