/* tallyreel.com/templates: the gallery, the reel feed (templates.js) and a template's own page. Uses landing.css's tokens. */

.tpl-hero { max-width: 760px; padding: 48px 0 8px; }
.tpl-hero h1 { margin: 6px 0 12px; }
.tpl-hero .lede { color: var(--ink-2); font-size: 18px; line-height: 1.55; }

.tpl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0 18px; }
.tpl-chips { display: flex; gap: 8px; overflow-x: auto; flex: 1 1 auto; padding-bottom: 2px; scrollbar-width: none; }
.tpl-chip {
  flex: none; border: 1px solid var(--line-2); background: var(--sheet); color: var(--ink);
  border-radius: 99px; padding: 8px 15px; font: 600 14px/1 inherit; cursor: pointer;
}
.tpl-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tpl-sort select {
  height: 40px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--sheet); color: var(--ink);
  padding: 0 14px; font: 600 14px inherit;
}

.tpl-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 18px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tpl[hidden] { display: none; }
.tpl-print { margin: 0; }
.tpl-print .print-frame { position: relative; aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--r); cursor: pointer; }
.tpl-print .print-frame img, .tpl-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tpl-preview { opacity: 0; transition: opacity .3s var(--ease); }
.tpl.is-playing .tpl-preview { opacity: 1; z-index: 1; }
.tpl-tag, .tpl-dur { position: absolute; z-index: 2; border-radius: 99px; font-size: 12px; pointer-events: none; }
.tpl-tag { top: 10px; left: 10px; background: var(--media-chip); color: var(--media-ink); font-weight: 600; padding: 3px 10px; }
.tpl-dur { right: 10px; bottom: 10px; background: rgba(0, 0, 0, .6); color: #fff; padding: 2px 8px; transition: opacity .2s; }
.tpl-quick {
  position: absolute; z-index: 3; inset: auto 0 0 0; display: flex; flex-direction: column; gap: 6px; padding: 56px 10px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), transparent); opacity: 0; transform: translateY(6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.tpl-quick .btn { width: 100%; justify-content: center; }
.tpl-watch {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border: 0; border-radius: 99px;
  background: rgba(255, 255, 255, .2); color: #fff; font: 700 13px inherit; cursor: pointer; backdrop-filter: blur(6px);
}
.tpl-watch svg { width: 14px; height: 14px; }
@media (hover: hover) {
  .tpl:hover .tpl-quick, .tpl:focus-within .tpl-quick { opacity: 1; transform: none; }
  .tpl:hover .tpl-dur { opacity: 0; }
}
@media (hover: none) { .tpl-quick { display: none; } }
.tpl-print figcaption { display: flex; flex-direction: column; gap: 2px; padding: 10px 2px 0; }
.tpl-print figcaption a { color: var(--ink); text-decoration: none; }
.tpl-print figcaption a:hover b { text-decoration: underline; }
.tpl-print figcaption span { color: var(--ink-3); font-size: 13px; }
.tpl-new { color: var(--accent); font-style: normal; font-weight: 600; }
.tpl-empty { text-align: center; color: var(--ink-3); font-family: var(--hand); font-size: 18px; padding: 48px 0; }

/* the reel feed */
html.tpl-locked { overflow: hidden; }
.tpl-feed { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; }
.tpl-feed-scroll { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.tpl-feed-scroll section { height: 100dvh; scroll-snap-align: start; display: grid; place-items: center; }
.tpl-reel { position: relative; height: 100%; width: min(100vw, calc(100dvh * 9 / 16)); }
.tpl-reel video, .tpl-reel-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tpl-reel video { z-index: 1; }
.tpl-reel-info {
  position: absolute; z-index: 2; inset: auto 0 0 0; padding: 96px 84px 26px 18px; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, .35) 60%, transparent);
}
.tpl-reel-info h2 { color: #fff; font-size: 21px; margin: 4px 0; }
.tpl-reel-meta { font-size: 12.5px; font-weight: 600; opacity: .75; margin: 0; }
.tpl-reel-look { font-size: 14px; opacity: .88; margin: 0; }
.tpl-reel-actions { position: absolute; z-index: 3; right: 10px; bottom: 26px; display: flex; flex-direction: column; gap: 16px; }
.tpl-act {
  display: flex; flex-direction: column; align-items: center; gap: 5px; width: 64px; color: #fff; text-decoration: none;
  font: 600 11.5px inherit; background: none; border: 0; cursor: pointer; text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.tpl-act span {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-size: 19px;
  background: rgba(255, 255, 255, .2); backdrop-filter: blur(6px);
}
.tpl-act-make span { background: var(--orange-btn); }
.tpl-act b { font-weight: 600; }
.tpl-feed-close {
  position: absolute; z-index: 4; top: 16px; left: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px; cursor: pointer;
}

/* a template's own page */
.tpl-recipe { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 18px 0; padding: 14px 16px; border-radius: var(--r); background: var(--stone); font-size: 14px; }
.tpl-recipe div { display: contents; }
.tpl-recipe dt { color: var(--ink-3); }
.tpl-recipe dd { margin: 0; font-weight: 600; }
.tpl-topics { margin: 56px 0; }
.tpl-topic-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tpl-topic-list a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; height: 100%; }

@media (max-width: 640px) {
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .tpl-hero { padding-top: 28px; }
}

/* Region (apps/web/src/lib/marketing/region.ts): pages are English first; the Worker marks South Asia and the Gulf
   with <html data-region="desi">. data-desi shows only there, data-global everywhere else. */
html:not([data-region="desi"]) [data-desi] { display: none !important; }
html[data-region="desi"] [data-global] { display: none !important; }
html[data-region="desi"] .lang-wall li { order: 1; }
html[data-region="desi"] .lang-wall li:first-child { order: -2; }
html[data-region="desi"] .lang-wall li[data-lead="desi"] { order: -1; }
