/* handlepilot.com/templates/instagram-carousel: the carousel templates gallery.
   Its cards are written by scripts/template-gallery.mjs; instagram-carousel.js
   adds the filters, the search and the flip-through. Without the script every
   card shows and each preview still swipes. */

.tg-hero{padding:56px 0 0;text-align:center}
.tg-hero h1{margin-top:18px;font-size:56px;line-height:1.12;letter-spacing:-.05em}
.tg-lede{max-width:740px;margin:18px auto 0;font-size:18px;font-weight:500;line-height:1.65;color:#454545}

/* The bar over the grid: the count, the filters and the search. */
/* The grid runs wider than the text (1440 px, six cards across a 1440 screen): it is the page. */
.tg-gallery{padding-top:40px}
.tg-gallery.container{max-width:1440px}
.tg-bar{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;margin-bottom:22px}
.tg-bar h2{font-size:22px;line-height:1.3;letter-spacing:-.03em}
.tg-tools{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;min-width:0}
/* The filters and search need the script. They are in the layout from the first paint, so
   revealing them later can't push the grid down (CLS); without scripting they go. */
@media(scripting:none){.tg-tools{display:none}}
.tg-filters{display:flex;flex-wrap:wrap;gap:8px;min-width:0}
.tg-filters button{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:8px 15px;border:1px solid #dcdcdc;border-radius:99px;background:#fff;font:inherit;font-size:14px;font-weight:500;color:#2e2e2e;cursor:pointer;white-space:nowrap;transition:border-color .15s,background .15s,color .15s}
.tg-filters button span{font-size:12px;color:#666}
.tg-filters button:hover{border-color:#a9a9a9}
.tg-filters button[aria-pressed=true]{border-color:var(--ink);background:var(--ink);color:#fff}
.tg-filters button[aria-pressed=true] span{color:#cfcfcf}
.tg-filters button:focus-visible,.tg-search input:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
.tg-search{position:relative;display:block;flex:1 1 240px;max-width:340px;margin-left:auto}
.tg-search svg{position:absolute;left:14px;top:50%;width:18px;height:18px;transform:translateY(-50%);fill:none;stroke:#7a7a7a;stroke-width:2;stroke-linecap:round;pointer-events:none}
.tg-search input{width:100%;min-height:42px;padding:9px 14px 9px 40px;border:1px solid #dcdcdc;border-radius:99px;background:#fff;font:inherit;font-size:15px;color:var(--ink);-webkit-appearance:none;appearance:none}
.tg-search input::placeholder{color:#737373}
.tg-hint{font-size:13px;color:#6b6b6b}

/* The grid. Each card: the three slides, its name, and the way in. */
.tg-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:34px 20px}
.tg-card{display:flex;flex-direction:column;min-width:0;scroll-margin-top:110px}
.tg-card[hidden]{display:none}
.tg-view{position:relative}
.tg-slides{display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;aspect-ratio:4/5;border-radius:12px;background:#e8e8e4;box-shadow:0 1px 2px #0000000f,0 10px 26px -12px #00000026;scrollbar-width:none;overscroll-behavior-x:contain;cursor:pointer;-webkit-tap-highlight-color:transparent}
.tg-slides::-webkit-scrollbar{display:none}
.tg-slides:focus-visible{outline:3px solid var(--blue);outline-offset:3px}
.tg-slides img{display:block;flex:0 0 100%;width:100%;height:100%;object-fit:cover;scroll-snap-align:start;scroll-snap-stop:always;-webkit-user-drag:none;user-select:none}
/* Dots under the slide, the way Instagram shows a carousel; drawn by the script. */
.tg-dots{position:absolute;left:0;right:0;bottom:-15px;display:flex;justify-content:center;gap:5px;pointer-events:none}
.tg-dots i{width:6px;height:6px;border-radius:50%;background:#cfcfcf;transition:background .2s}
.tg-dots i.on{background:var(--blue)}
.tg-arrow{position:absolute;top:50%;display:grid;place-items:center;width:34px;height:34px;margin-top:-17px;padding:0;border:0;border-radius:50%;background:#ffffffeb;box-shadow:0 2px 8px #00000026;color:var(--ink);cursor:pointer;opacity:0;transition:opacity .15s}
.tg-arrow svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.tg-arrow.prev{left:8px}
.tg-arrow.next{right:8px}
.tg-arrow[disabled]{visibility:hidden}
@media(hover:hover) and (pointer:fine){.tg-view:hover .tg-arrow,.tg-view:focus-within .tg-arrow{opacity:1}}
@media(hover:none){.tg-arrow{display:none}}
.tg-meta{padding:24px 0 10px}
.tg-meta h3{font-size:16px;line-height:1.3;letter-spacing:-.02em}
.tg-meta p{margin-top:2px;font-size:13px;line-height:1.45;color:#6b6b6b}
/* margin-top:auto lines the buttons up across a row when one name or meta line wraps. */
.tg-use{display:inline-flex;align-self:flex-start;align-items:center;justify-content:center;min-height:40px;margin-top:auto;padding:8px 16px;border:1px solid #d6d6d6;border-radius:99px;background:#fff;font-size:14px;font-weight:600;color:var(--ink);text-decoration:none;transition:border-color .15s,color .15s}
.tg-use:hover,.tg-use:focus-visible{border-color:var(--blue);color:var(--blue)}
.tg-use:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
.tg-empty{margin-top:8px;padding:28px;border-radius:16px;background:#fff;text-align:center;font-size:15px;color:#454545}
.tg-empty button{margin-left:6px;padding:0;border:0;background:none;font:inherit;font-weight:600;color:var(--blue);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.tg-note{max-width:880px;margin-top:40px;font-size:13px;line-height:1.7;color:#6b6b6b}
.tg-note a{color:inherit;text-decoration:underline;text-underline-offset:3px}

/* Working in ChatGPT or Claude: the MCP server, before the questions. */
.tg-agents{padding-top:80px}
.tg-agents-card{max-width:820px;margin-inline:auto;padding:40px 44px;border-radius:22px;background:#eaf1fd;text-align:center}
.tg-agents-logos{list-style:none;margin:0 0 20px;padding:0;display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.tg-agents-logos li{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;background:#fff;box-shadow:0 2px 6px #0000000d}
.tg-agents h2{font-size:36px;line-height:1.15}
.tg-agents p{max-width:600px;margin:14px auto 0;font-size:17px;line-height:1.7;color:#3d3d3d}
.tg-agents .button{margin-top:26px}

/* The explainer under the grid, in the articles' card. */
.tg-guide{padding-top:72px}
.tg-guide .guide-body{max-width:820px;margin-inline:auto}
.tg-guide ol li::marker{font-weight:600;color:#6b6b6b}

@media(max-width:900px){.tg-hero h1{font-size:44px}}
@media(max-width:650px){
 .tg-hero{padding-top:26px;text-align:left}
 .tg-hero h1{margin-top:14px;font-size:34px}
 .tg-lede{margin-top:14px;font-size:16px;line-height:1.6}
 .tg-gallery{padding-top:26px}
 .tg-bar{gap:12px;margin-bottom:18px}
 .tg-bar h2{font-size:19px}
 /* One row of filters that scrolls sideways, so the grid starts on the first screen. */
 /* nowrap: a wrapping column takes its widest child's width, here the whole row of chips. */
 .tg-tools{flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:10px}
 .tg-filters{flex-wrap:nowrap;overflow-x:auto;margin-inline:-20px;padding:2px 20px;scrollbar-width:none}
 .tg-filters::-webkit-scrollbar{display:none}
 .tg-search{flex:none;max-width:none;margin-left:0}
 .tg-search input{min-height:44px;font-size:16px}
 .tg-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:26px 12px}
 .tg-slides{border-radius:10px}
 .tg-meta{padding:22px 0 10px}
 .tg-meta h3{font-size:15px}
 .tg-meta p{font-size:12px}
 .tg-use{align-self:stretch;min-height:44px;padding:8px 10px;font-size:13px}
 .tg-guide{padding-top:44px}
 .tg-agents{padding-top:44px}
 .tg-agents-card{padding:28px 20px;border-radius:18px}
 .tg-agents h2{font-size:28px}
 .tg-agents p{font-size:16px}
 .tg-agents .button{width:100%;white-space:normal}
}
@media(prefers-reduced-motion:reduce){
 .tg-slides{scroll-behavior:auto}
 .tg-dots i,.tg-arrow,.tg-filters button,.tg-use{transition:none}
}
