/* TikTok Banner Templates — curated photo-first gallery. */
.tg-page { position: relative; z-index: 1; }
.tg-page h1 { font-size: clamp(2.25rem, 4.5vw, 3.6rem); letter-spacing: -0.048em; line-height: 1.07; }
.tg-page h2 { font-size: clamp(1.65rem, 3.6vw, 2.6rem); line-height: 1.15; }
.tg-page h3 { font-size: 1.12rem; }
.tg-page p { color: var(--muted); }
.tg-page a { text-underline-offset: 3px; }
.tg-page .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: normal; }
.tg-page .btn--primary, .tg-dialog .btn--primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--cyan-ink); background: var(--cyan); border: 1px solid var(--cyan);
  border-radius: 999px; padding: 12px 20px; font-weight: 800;
  text-decoration: none; box-shadow: 0 10px 30px -18px rgba(70,219,214,.55);
}
.tg-page .btn--primary:hover, .tg-dialog .btn--primary:hover {
  background: #86eee6; border-color: #86eee6; color: var(--cyan-ink);
}
.tg-page .btn--ghost, .tg-dialog .btn--ghost {
  color: var(--text); background: rgba(255,255,255,.055); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 12px 18px; font-weight: 700; text-decoration: none;
}
.tg-page .btn--ghost:hover, .tg-dialog .btn--ghost:hover { background: rgba(255,255,255,.11); color: white; }
.tg-page .eyebrow { color: var(--muted); font-weight: 600; font-size: .78rem; letter-spacing: .03em; }
/* The chooser is the whole page: no intro screen sits in front of it. What is
   left above it is a masthead — a title line and the count — so the search
   box and the first row of designs are in the opening viewport. */
.tg-masthead { padding-top: 24px; }
.tg-masthead .crumbs { margin: 0 0 12px; }
.tg-masthead__row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap;
  padding-bottom: 15px; border-bottom: 1px solid var(--line);
}
.tg-masthead h1 { max-width: 46ch; font-size: clamp(1.18rem, 1.8vw, 1.45rem); letter-spacing: -.015em; line-height: 1.25; }
.tg-gallery-section.tg-gallery-section--first { padding-top: 22px; border-top: 0; }
.tg-gallery-section--first .tg-section-heading h2 { margin-top: 8px; }
.tg-split-preview { display: block; position: relative; width: 100%; overflow: hidden; border-radius: 10px; background: #252936; aspect-ratio: 9 / 4; }
.tg-split-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tg-split-preview::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to right, transparent 33.22%, rgba(8,11,20,.75) 33.24%, rgba(255,255,255,.85) 33.36%, transparent 33.48%, transparent 66.5%, rgba(8,11,20,.75) 66.55%, rgba(255,255,255,.85) 66.67%, transparent 66.8%);
}

.tg-gallery-section { padding: 70px 0 90px; background: linear-gradient(180deg, #111720 0%, #0e131b 65%, var(--bg) 100%); border-top: 1px solid var(--line); }
.tg-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.tg-section-heading h2 { margin: 10px 0 13px; }
.tg-section-heading p { max-width: 670px; }
.tg-gallery-count { flex: 0 0 auto; color: var(--cyan); border: 1px solid rgba(70,219,214,.22); background: var(--cyan-soft); border-radius: 999px; padding: 7px 12px; font-size: .75rem; font-weight: 750; }
.tg-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tg-search { position: relative; display: flex; align-items: center; width: min(100%, 580px); }
.tg-search svg { position: absolute; left: 17px; pointer-events: none; color: #9baebd; }
.tg-search input { width: 100%; height: 50px; padding: 11px 18px 11px 47px; color: var(--text); background: #1a222e; border: 1px solid var(--line-strong); border-radius: 14px; font: inherit; font-size: .94rem; }
.tg-search input:focus { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tg-search input::placeholder { color: #9aacba; }
.tg-clear { border: none; background: transparent; color: var(--cyan); font: inherit; font-size: .83rem; font-weight: 650; cursor: pointer; }
.tg-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tg-filters button { cursor: pointer; color: var(--muted); background: #181f2a; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font: inherit; font-size: .83rem; font-weight: 650; transition: color .15s, background .15s, border-color .15s; }
.tg-filters button[aria-pressed="true"] { color: var(--cyan-ink); background: var(--cyan); border-color: var(--cyan); }
.tg-filters button:not([aria-pressed="true"]):hover { color: #fff; border-color: rgba(255,255,255,.4); }
.tg-filters button span { opacity: .8; margin-left: 2px; }
.tg-results { font-size: .82rem; color: var(--faint); margin: 17px 0 24px; }
.tg-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.tg-card { background: #19212c; border: 1px solid rgba(255,255,255,.12); border-radius: 17px; overflow: hidden; box-shadow: 0 12px 30px -26px #000; display: flex; flex-direction: column; min-width: 0; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.tg-card:hover { transform: translateY(-3px); border-color: rgba(70,219,214,.42); box-shadow: 0 24px 44px -30px #000; }
.tg-card[hidden] { display: none !important; }
.tg-card__media { display: block; border: 0; padding: 0; width: 100%; text-align: left; position: relative; background: #11151d; cursor: zoom-in; color: inherit; }
.tg-card__media .tg-split-preview { border-radius: 0; }
.tg-card__media:hover img { filter: brightness(.93); }
.tg-card__media img { transition: filter .2s ease; }
.tg-card__zoom { position: absolute; right: 12px; bottom: 12px; z-index: 2; color: #fff; background: rgba(9,13,20,.87); border: 1px solid rgba(255,255,255,.24); border-radius: 999px; padding: 6px 11px; font: 700 .72rem/1.4 var(--font); }
.tg-card__body { padding: 17px 17px 18px; display: flex; flex-direction: column; flex: 1; gap: 11px; }
.tg-card__meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--faint); font-size: .72rem; line-height: 1.5; }
.tg-card__tag { color: #e9d9ff; background: rgba(167,139,250,.16); border: 1px solid rgba(167,139,250,.2); padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.tg-card__body h3 { color: var(--text); margin: 0; font-size: 1.08rem; line-height: 1.27; }
.tg-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: auto; padding-top: 3px; }
.tg-card__actions :is(a, button) { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 7px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--text); font-size: .79rem; font-weight: 750; line-height: 1.25; text-align: center; text-decoration: none; }
.tg-card__actions :first-child { color: var(--cyan-ink); border-color: var(--cyan); background: var(--cyan); }
.tg-card__actions :is(a, button):hover { filter: brightness(1.09); }
.tg-empty { padding: 50px 20px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 17px; }
.tg-empty h3 { font-size: 1.2rem; margin-bottom: 7px; }
.tg-empty p { margin-bottom: 18px; }

.tg-section { padding: clamp(65px, 8vw, 100px) 0; border-bottom: 1px solid var(--line); }
.tg-section .kicker, .tg-bottom .kicker { margin-bottom: 13px; }
.tg-section h2 { margin-bottom: 19px; }
.tg-section p + p { margin-top: 15px; }
.tg-section p { max-width: 760px; }
.tg-use { background: linear-gradient(135deg, rgba(70,219,214,.035), transparent 55%); }
.tg-steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-top: 20px; }
.tg-steps article { padding: 24px 22px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 17px; }
.tg-step-number { color: var(--cyan); font: 750 .82rem var(--mono); }
.tg-steps article h3 { margin: 16px 0 10px; }
.tg-steps article p { font-size: .91rem; }
.tg-tip { font-size: .85rem; padding: 17px 19px; border-left: 3px solid var(--cyan); background: rgba(70,219,214,.05); border-radius: 0 12px 12px 0; margin-top: 25px; }
.tg-tip strong { color: var(--text); }
.tg-info-grid { display: grid; grid-template-columns: 1.03fr .97fr; align-items: center; gap: clamp(26px, 5vw, 65px); }
.tg-info-grid p { max-width: 580px; }
.tg-size-figure { background: #151d27; border: 1px solid var(--line-strong); padding: 20px; border-radius: 18px; }
.tg-size-banner { background: linear-gradient(120deg, #6c466c, #2c5066, #543759); border-radius: 11px; min-height: 210px; padding: 22px 10px 15px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; text-align: center; }
.tg-size-banner > span { font-size: .8rem; letter-spacing: .07em; font-weight: 750; }
.tg-size-banner > div { display: grid; grid-template-columns: repeat(3,1fr); }
.tg-size-banner > div span { border: 1px dashed rgba(255,255,255,.75); display: grid; place-items: center; min-height: 90px; font-size: .72rem; letter-spacing: .04em; font-weight: 750; }
.tg-size-figure p { margin-top: 12px; text-align: center; font-size: .75rem; }
.tg-style-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 22px; }
.tg-style-grid > div { padding: 21px; background: var(--surface); border-radius: 15px; border: 1px solid var(--line); }
.tg-style-grid h3 { margin-bottom: 12px; }
.tg-style-grid p { font-size: .88rem; }
.tg-difference { background: rgba(255,106,134,.025); }
.tg-difference__links { display: grid; gap: 12px; }
.tg-difference__links a { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; }
.tg-difference__links a:hover { border-color: var(--cyan); color: var(--cyan); }
.tg-faq { max-width: 940px; }
.tg-faq details { border-bottom: 1px solid var(--line-strong); }
.tg-faq details:first-of-type { border-top: 1px solid var(--line-strong); }
.tg-faq summary { color: var(--text); cursor: pointer; font-weight: 700; padding: 19px 16px 19px 2px; }
.tg-faq details p { padding: 0 28px 19px 2px; font-size: .93rem; }
.tg-bottom { padding: 75px 0; background: linear-gradient(115deg, #14282c, #1e1b2a 58%, #271b26); }
.tg-bottom__inner { display: flex; align-items: center; justify-content: space-between; gap: 35px; }
.tg-bottom h2 { max-width: 660px; margin-bottom: 14px; }
.tg-bottom p { max-width: 640px; }
.tg-bottom .btn { flex-shrink: 0; }
.tg-credit { padding-block: 22px; }
.tg-credit p { font-size: .76rem; color: var(--faint); }

.tg-dialog { width: min(960px, calc(100vw - 32px)); max-height: min(90vh, 940px); overflow-y: auto; background: #141b25; color: var(--text); padding: clamp(18px,3vw,30px); border: 1px solid rgba(255,255,255,.2); border-radius: 22px; box-shadow: 0 36px 120px #000; }
.tg-dialog::backdrop { background: rgba(3,8,14,.85); backdrop-filter: blur(5px); }
.tg-dialog__top { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.tg-dialog__top h2 { font-size: clamp(1.4rem,2.5vw,2.1rem); margin-top: 5px; }
.tg-dialog .kicker { color: var(--cyan); font-size: .72rem; }
.tg-dialog__close { width: 37px; height: 37px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-3); color: var(--text); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.tg-dialog__tag { font-size: .8rem; color: var(--muted); margin: 7px 0 18px; }
.tg-dialog__image { border: 1px solid var(--line-strong); }
.tg-dialog__hint { color: var(--muted); font-size: .8rem; margin: 12px 0 18px; }
.tg-dialog__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tg-dialog__actions .btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; padding: 12px 18px; }
.tg-dialog__footer { font-size: .8rem; color: var(--faint); margin-top: 20px; }

@media(max-width: 920px) {
  .tg-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tg-info-grid { grid-template-columns: 1fr; }
  .tg-info-grid > * { max-width: 720px; }
}
@media(max-width: 650px) {
  .tg-gallery-section.tg-gallery-section--first { padding-top: 16px; }
  /* the count is repeated under the filters as "Showing 21 of 21 templates";
     in the masthead it only pushes the chooser down a line */
  .tg-masthead__row .tg-gallery-count { display: none; }
  .tg-section-heading { display: block; }
  .tg-gallery-count { display: inline-block; margin-top: 16px; }
  .tg-gallery-section { padding: 48px 0 60px; }
  .tg-controls { align-items: stretch; }
  .tg-grid { grid-template-columns: 1fr; gap: 17px; }
  .tg-filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 12px; scrollbar-width: thin; }
  .tg-filters button { flex: 0 0 auto; }
  .tg-steps, .tg-style-grid { grid-template-columns: 1fr; }
  .tg-bottom__inner { display: block; }
  .tg-bottom .btn { margin-top: 23px; }
  .tg-dialog__actions .btn { width: 100%; }
  .tg-card__actions :is(a, button) { min-height: 45px; }
}
@media(prefers-reduced-motion:reduce) {
  .tg-card,.tg-card__media img { transition: none; }
  .tg-card:hover { transform: none; }
}

.tg-card__actions button { cursor: pointer; font-family: inherit; }
.tg-card__actions button:disabled, .tg-dialog__actions button:disabled { opacity: .6; cursor: progress; }
.tg-download-status { color: var(--cyan); font-size: .82rem; margin: 0 0 12px; }
.tg-download-status:empty { display: none; }
