/* ═══════════════════════════════════════════════════════════════════════
   /templates — Zenrows scraping templates. A recipe library: filter by
   category, copy a working Python snippet, open the matching guide.
   Directory language: hairline cards on transparent ground (never card
   fill), code panels as border-only mono blocks, left-anchored hero.
   ═══════════════════════════════════════════════════════════════════════ */
@import "../_ds/fonts.css";
@import "../_ds/theme.css";
@import "../_shared/chrome.css";
@import "../_shared/components.css";
@import "../_shared/audience-switcher.css";

.tm-main { background: var(--background); }
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 620ms cubic-bezier(0.22,1,0.36,1), transform 620ms cubic-bezier(0.22,1,0.36,1); }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } }

/* ── ACT 1 — hero ──────────────────────────────────────────── */
.tm-hero {
  max-width: 1120px; margin-inline: auto;
  padding: clamp(120px, 16vh, 190px) clamp(20px, 5vw, 72px) clamp(56px, 8vh, 96px);
}
.tm-hero-h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--mkt-hero-xl); line-height: 0.97; letter-spacing: -0.03em;
  color: var(--text-primary); margin: 0;
}
.tm-hero-sub {
  font-family: var(--font-base); font-size: var(--mkt-body);
  line-height: 1.5; color: var(--text-secondary); margin: 22px 0 0; max-width: 52ch;
}
.tm-hero-cta { margin-top: clamp(26px, 4vh, 40px); }
.tm-hero-cta .link-cta { align-self: center; padding-top: 4px; }

/* ── ACT 2 — recipe library ────────────────────────────────── */
.tm-lib {
  max-width: 1120px; margin-inline: auto;
  padding: clamp(40px, 6vh, 72px) clamp(20px, 5vw, 72px) clamp(64px, 10vh, 120px);
}
.tm-lib-head { max-width: 720px; margin-bottom: clamp(28px, 4vh, 40px); }
.tm-lib-h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--mkt-h2); line-height: 1.02; letter-spacing: -0.028em;
  color: var(--text-primary); margin: 0;
}
.tm-lib-h2 em { font-style: normal; color: var(--text-primary); }
.tm-lib-lead {
  font-family: var(--font-base); font-size: var(--mkt-body);
  line-height: 1.5; color: var(--text-secondary); margin: 16px 0 0; max-width: 52ch;
}

/* filter uses the DS seg-control atom (--underline); only layout is set here */
.tm-filter { flex-wrap: wrap; margin-bottom: clamp(26px, 4vh, 38px); }

/* recipe grid */
.tm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.tm-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--border-subtle); border-radius: 16px;
  padding: 20px 22px; min-width: 0;
}
.tm-card.is-hidden { display: none; }
.tm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tm-copy.btn-marketing--sm { flex: none; }
.tm-copy.is-copied { color: #12484F; }
.tm-card-t {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(20px, 1.9vw, 25px); letter-spacing: -0.02em;
  color: var(--text-primary); margin: 16px 0 0;
}
.tm-card-d {
  font-family: var(--font-base); font-size: 14px; line-height: 1.5;
  color: var(--text-secondary); margin: 8px 0 0;
}
/* code block: border-top separator, no fill */
.tm-code {
  margin: 16px -22px 0; padding: 16px 22px 4px;
  border-top: 1px solid var(--border-subtle);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tm-code code {
  font-family: var(--font-code); font-size: 12.5px; line-height: 1.65;
  color: var(--text-secondary); white-space: pre; display: block;
}
.tm-card-more.link-cta { margin-top: 18px; display: inline-flex; }

/* ── ACT 3 — closer ────────────────────────────────────────── */
.tm-closer { padding: clamp(88px, 14vh, 190px) clamp(20px, 5vw, 72px); text-align: center; }
.tm-closer-h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--mkt-hero); line-height: 0.99; letter-spacing: -0.03em;
  color: var(--text-primary); margin: 0;
}
.tm-closer-lead {
  font-family: var(--font-base); font-size: var(--mkt-body);
  line-height: 1.5; color: var(--text-secondary); margin: 18px auto 0; max-width: 52ch;
}
.tm-closer-cta { margin-top: clamp(28px, 4vh, 44px); }

/* ── wide ──────────────────────────────────────────────────── */
@media (min-width: 1600px) {
  .tm-hero, .tm-lib { max-width: 1280px; }
  
}

/* ── responsive ────────────────────────────────────────────── */
@media (max-width: 980px) { .tm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .tm-grid { grid-template-columns: 1fr; }
  /* filter scrolls in one row instead of wrapping */
  .tm-filter { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tm-filter::-webkit-scrollbar { display: none; }
  .tm-filter .seg-control-opt { flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 600px) {
  .tm-hero-cta .link-cta { align-self: flex-start; padding-top: 0; }
}
