/* Templates: Home showcase, gallery, template pages, live preview, credits. No inline styles anywhere: everything is here. */

/* Home: a moving row of storefronts */
.tpl-strip-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 40px; margin-bottom: 44px; }
.tpl-strip-head > div { max-width: 44rem; }
.tpl-strip-head h2 { margin-bottom: 14px; }
.tpl-strip-head .lede, .tpl-strip-head p { margin: 0; }
.tpl-marquee { position: relative; overflow: hidden; padding-block: 10px 30px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.tpl-track { display: flex; gap: 22px; width: max-content; margin: 0; padding: 0; list-style: none; animation: tpl-marquee 80s linear infinite; }
.tpl-marquee:hover .tpl-track, .tpl-marquee:focus-within .tpl-track { animation-play-state: paused; }
@keyframes tpl-marquee { to { transform: translateX(calc(-50% - 11px)); } }
.tpl-tile { display: block; width: clamp(280px, 30vw, 420px); flex: none; color: var(--text); text-decoration: none; }
.tpl-tile-img { position: relative; display: block; overflow: hidden; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .95); transition: border-color .25s, transform .35s var(--ease); }
.tpl-tile-img img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; object-position: top; transition: transform .6s var(--ease); }
.tpl-tile:hover .tpl-tile-img { border-color: rgba(34, 200, 255, .5); transform: translateY(-4px); }
.tpl-tile:hover .tpl-tile-img img { transform: scale(1.03); }
.tpl-tile-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-inline: 2px; }
.tpl-mini-name { font: 650 1.05rem var(--font-display); letter-spacing: -.01em; }
.tpl-tile:hover .tpl-mini-name { color: var(--cyan-hi); }
.tpl-strip-note { margin: 4px 0 0; color: var(--text-3); font-size: .88rem; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .tpl-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .tpl-track [aria-hidden="true"] { display: none; }
}

/* Mode tags */
.tag--mode { font-size: .64rem; }
.tag--light { color: #0b1630; background: #eef2fa; border-color: #eef2fa; }
.tag--dark { color: var(--text); background: #0b1630; border-color: rgba(148, 172, 224, .4); }

/* Gallery */
.tpl-note { max-width: 46rem; margin: 0 0 36px; }
.tpl-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.tpl-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(22, 36, 68, .55), rgba(10, 19, 40, .55)); border: 1px solid var(--line); transition: border-color .25s, transform .35s var(--ease), box-shadow .35s var(--ease); }
.tpl-card:hover, .tpl-card:focus-within { border-color: rgba(34, 200, 255, .4); transform: translateY(-4px); box-shadow: 0 50px 100px -50px rgba(34, 160, 255, .45); }
.tpl-cover { position: relative; display: block; overflow: hidden; line-height: 0; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.tpl-cover > img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; object-position: top; transition: transform .7s var(--ease); }
.tpl-card:hover .tpl-cover > img { transform: scale(1.035); }
.tpl-cover-phone { position: absolute; right: 5%; bottom: -16%; width: 21%; padding: 4px; border-radius: 16px; background: linear-gradient(155deg, #3a4a70, #0b1226); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .9); transition: transform .5s var(--ease); }
.tpl-cover-phone img { display: block; width: 100%; height: auto; border-radius: 12px; aspect-ratio: 390 / 600; object-fit: cover; object-position: top; }
.tpl-card:hover .tpl-cover-phone { transform: translateY(-8%); }
.tpl-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 24px 26px 26px; }
.tpl-body h3 { margin: 0; font-size: 1.45rem; letter-spacing: -.025em; }
.tpl-body h3 a { color: var(--text); text-decoration: none; }
.tpl-body h3 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.tpl-body p { margin: 0; }
.tpl-tagline { color: var(--text-2); font-size: .97rem; }
.tpl-tags { display: flex; gap: 8px; }
.tpl-niches { color: var(--text-3); font-size: .9rem; }
.tpl-niches strong { color: var(--text-2); font-weight: 600; }
.tpl-links { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: auto; padding-top: 10px; }
.tpl-links .link-arrow { margin: 0; }

/* One template page */
.tpl-hero-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 30px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); }
.tpl-hero-facts div { display: grid; gap: 4px; }
.tpl-hero-facts dt { font: 500 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.tpl-hero-facts dd { margin: 0; font: 600 .95rem var(--font-display); color: var(--text); }
.tpl-intro { max-width: 46rem; }
.tpl-h { margin: 0 0 12px; }
.tpl-sub { margin: 0 0 32px; color: var(--text-2); max-width: 44rem; }
.tpl-pair { display: grid; gap: 32px; align-items: start; grid-template-columns: minmax(0, 1fr); }
.tpl-pair .shot-link { cursor: zoom-in; }
.tpl-desktop .shot-link { max-height: min(76vh, 780px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(148, 172, 224, .35) transparent; }
.tpl-mobile { max-width: 340px; width: 100%; margin-inline: auto; }
.tpl-mobile .shot-link { max-height: min(76vh, 720px); overflow-y: auto; border-radius: 30px; border: 8px solid #1a2441; scrollbar-width: none; }
.tpl-mobile .shot-link::-webkit-scrollbar { display: none; }
@media (min-width: 62rem) { .tpl-pair { grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); } .tpl-mobile { max-width: none; } }
.tpl-pair figcaption, .tpl-other figcaption { font-size: .9rem; }
.tpl-others { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 62rem) { .tpl-others { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tpl-other h3 { font-size: 1.05rem; margin-bottom: 14px; }

/* Try it live: the demo store in an iframe, loaded on request */
.tpl-live { position: relative; overflow: hidden; padding: clamp(18px, 3vw, 28px); border-radius: var(--r-xl); background: radial-gradient(90% 70% at 50% 0%, rgba(34, 200, 255, .12), transparent 70%), var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
.tpl-live-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 18px; }
.tpl-live-note { max-width: 44rem; margin: 0; color: var(--text-2); font-size: .96rem; }
.tpl-live-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.tpl-live-bar .link-arrow { margin: 0; }
.tpl-live-sizes { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(5, 10, 23, .6); border: 1px solid var(--line-2); }
.tpl-live-sizes[hidden] { display: none; }
.tpl-live-sizes .btn { --btn-h: 34px; padding: 0 16px; border: 0; background: transparent; box-shadow: none; font-size: .84rem; }
.tpl-live-sizes .btn[aria-pressed="true"] { color: #03142e; background: var(--grad-btn); }
.tpl-live-poster { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--line-2); line-height: 0; }
.tpl-live-poster img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; object-position: top; filter: saturate(.8) brightness(.55); }
.tpl-live-poster-in { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; padding: 20px; line-height: 1.5; text-align: center; }
.tpl-live-poster-in p { margin: 0; color: var(--text); font: 600 1rem var(--font-display); text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.tpl-live.is-live .tpl-live-poster { display: none; }
.tpl-live-stage { display: none; justify-content: center; padding: 14px; border-radius: 16px; background: rgba(5, 10, 23, .6); border: 1px solid var(--line); }
.tpl-live-stage.is-loaded { display: flex; }
.tpl-live-stage iframe { display: block; width: 100%; height: min(80vh, 56rem); min-height: 30rem; border: 0; border-radius: 10px; background: #fff; transition: width .3s var(--ease); }
.tpl-live-stage[data-width="phone"] iframe { width: 390px; max-width: 100%; border-radius: 26px; box-shadow: 0 0 0 8px #1a2441; }

/* Credits */
.credits-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 0; max-width: 54rem; border-top: 1px solid var(--line); }
.credits-list li { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.credit-title { font: 600 1rem var(--font-display); }
.credit-meta { color: var(--text-3); font-size: .92rem; }

/* Review round 1 */
@media (prefers-reduced-motion: reduce) { .tpl-track { padding-inline: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))); } }

/* Review round 2: a roomier gallery, two across; an odd last card runs full width with its cover beside the text. */
@media (min-width: 52rem) {
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .tpl-grid > .tpl-card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
  .tpl-grid > .tpl-card:last-child:nth-child(odd) .tpl-cover { flex: 0 0 50%; border-bottom: 0; border-right: 1px solid var(--line); }
  .tpl-grid > .tpl-card:last-child:nth-child(odd) .tpl-body { justify-content: center; padding: 36px 40px; }
}
.tpl-body h3 { font-size: 1.6rem; }
.tpl-cover-phone { width: 19%; right: 5%; bottom: -18%; }
.tpl-live-poster img { aspect-ratio: 16 / 7; }
