/* Figures for "Teaching small models to design: inside Gamma's template factory". Requires base.css and research.css. */

/* The title is a little longer than the gold standard's, so it sets at 68px to keep two lines at 1440. */
.tf .post-title { font-size: clamp(36px, 5.9vw, 68px); }

/* ---------- Fig. 1: a wall of templates, each a link that pages through a few slides ---------- */
.tf-gallery-band { padding: 64px 0 60px; }
.tf-gallery-band .fig-head, .tf-gallery-band .fig-sub { max-width: 860px; }
.tf-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 22px; margin-top: 6px; }
.tf-tile { display: block; min-width: 0; color: inherit; text-decoration: none; }
.tf-frame { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(0,34,83,.08), 0 16px 32px -18px rgba(0,34,83,.45); transition: transform .25s, box-shadow .25s; }
.tf-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s ease; }
.tf-frame img.on { opacity: 1; }
.tf-tile:hover .tf-frame, .tf-tile:focus-visible .tf-frame { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--ultramarine), 0 22px 38px -20px rgba(24,98,212,.55); }
.tf-tile:focus-visible { outline: none; }
.tf-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; margin-top: 11px; }
.tf-name { font: 600 15.5px/1.3 var(--font-text); color: var(--deep-ocean); }
.tf-tile:hover .tf-name { color: var(--ultramarine); }
.tf-dots { align-self: center; display: flex; gap: 5px; }
.tf-dots i { display: block; width: 6px; height: 6px; border-radius: 50%; background: rgba(0,34,83,.18); transition: background .4s; }
.tf-dots i.on { background: var(--ultramarine); }
.tf-line { grid-column: 1 / -1; font: 400 14px/1.4 var(--font-text); color: var(--ink-2); }
/* Four columns down to 900px, then two, so the wall always ends on a full row. */
@media (max-width: 900px) { .tf-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tf-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; } .tf-name { font-size: 14.5px; } .tf-line { font-size: 13px; } }

/* ---------- Fig. 2: one slide's journey ---------- */
.tf-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 24px; }
.tf-step { margin: 0; min-width: 0; }
.tf-shot { display: block; width: 100%; padding: 0; border: 0; border-radius: 8px; background: none; cursor: zoom-in; }
.tf-shot img { transition: transform .2s, box-shadow .2s; }
.tf-shot:hover img, .tf-shot:focus-visible img { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--ultramarine), 0 18px 36px -18px rgba(24,98,212,.5); }
.tf-shot:focus-visible { outline: none; }
.tf-step-h { display: flex; align-items: center; gap: 10px; margin: 13px 0 6px; }
.tf-num { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ultramarine); color: #fff; font: 600 12.5px/1 var(--font-display); }
.tf-step-h b { min-width: 0; font: 600 15.5px/1.3 var(--font-text); color: var(--deep-ocean); }
.tf-who { flex: none; margin-left: auto; padding: 5px 9px 5px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px rgba(0,34,83,.12); font: 500 12.5px/1 var(--font-text); color: var(--ink-2); white-space: nowrap; }
.tf-note { margin: 0; font: 400 14.5px/1.5 var(--font-text); color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 1000px) { .tf-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tf-steps { grid-template-columns: 1fr; gap: 26px; } }

.tf-lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 4vw; background: rgba(0, 14, 33, .94); cursor: zoom-out; }
.tf-lightbox[hidden] { display: none; }
.tf-lightbox figure { margin: 0; display: grid; justify-items: center; gap: 16px; }
.tf-lightbox img { max-width: min(1400px, 92vw); max-height: 78vh; width: auto; height: auto; border-radius: 8px; background: #fff; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); }
.tf-lightbox figcaption { max-width: min(860px, 92vw); font: 400 15.5px/1.5 var(--font-text); color: rgba(232, 238, 252, .88); text-align: center; text-wrap: balance; }
.tf-lb-close { position: absolute; top: 18px; right: 22px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font: 400 26px/1 var(--font-text); cursor: pointer; }

/* ---------- Fig. 3: shop for a look ---------- */
.tf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 18px; padding: 4px 0; }
.tf-cover { position: relative; display: block; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.tf-cover img { aspect-ratio: 16 / 9; object-fit: cover; transition: transform .2s, box-shadow .2s; }
.tf-cover:hover img, .tf-cover:focus-visible img { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--ultramarine), 0 22px 40px -20px rgba(24,98,212,.55); }
.tf-cover:focus-visible { outline: none; }
.tf-result { margin: 4px 0 18px; font: 500 30px/1.15 var(--font-display); letter-spacing: -0.015em; color: var(--deep-ocean); text-wrap: balance; }
.tf-result b { font-weight: 500; color: var(--ultramarine); }
.tf-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.tf-strip button { min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.tf-strip img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 1px rgba(0,34,83,.14); opacity: .78; transition: opacity .2s, box-shadow .2s; }
.tf-strip button:hover img { opacity: 1; }
.tf-strip button[aria-selected="true"] img { opacity: 1; box-shadow: 0 0 0 2.5px var(--ultramarine); }
.tf-strip-n { display: block; margin-top: 7px; font: 500 13px/1.25 var(--font-text); color: var(--ink-2); }
.tf-strip button[aria-selected="true"] .tf-strip-n { font-weight: 600; color: var(--deep-ocean); }
.tf-strip button.mine .tf-strip-n::after { content: "Your pick"; display: block; margin-top: 3px; font: 500 12px/1.2 var(--font-text); color: var(--ultramarine); }
.tf-deck { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 20px; }
.tf-look { font: 400 16px/1.4 var(--font-text); color: var(--ink-2); }
.tf-look b { font-weight: 600; color: var(--deep-ocean); }
.tf-open { font: 500 15px/1.3 var(--font-text); color: var(--ultramarine); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(24,98,212,.35); }
.tf-open:hover { text-decoration-color: currentColor; }
.tf-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tf-tools .qz-again { margin-left: 0; }
@media (max-width: 760px) {
  .tf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .tf-result { font-size: 24px; }
  .tf-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .tf-deck { grid-template-columns: 1fr; gap: 12px; }
  .tf-tools { margin-left: 0; }
}
