/* ==================================================================
   /tools/youtube-title-generator on the foundation look.
   Loaded ONLY when the 'tools-title-generator-fnd' redesign switch is on
   for this viewer (never in embed mode); the old page keeps its own two
   stylesheets.

   Layout unique to this page only. The first screen, the guide, the
   questions, the links and the close are the shared tool kit
   (foundation-tools.css); the input, the Long video or Short switch
   (.fnd-segment), the picture-free rows (.fnd-rows--nomedia), the count,
   the YouTube card, badges and numbered heads are the foundation's and
   are NOT redrawn here.

   Same shape as the thumbnail downloader page: one centred column at
   every width. Type a topic, then ten ideas right under the bar, the
   checker for the one they pick, and how it looks on YouTube.
   ================================================================== */

/* ------------------------------------------------------------------
   1. THE FIRST SCREEN (copied from the thumbnail downloader page, not
   shared, so no page can move another)
   ------------------------------------------------------------------ */
@media (min-width: 1024px) {
  .tg3-top .fnd-tool-top__in { display: block; }
  .fnd .tg3 .tg3-out { position: relative; top: auto; }
}
.fnd .tg3 .fnd-tool-lead,
.fnd .tg3 .tg3-ask,
.fnd .tg3 .tg3-out { max-width: 760px; margin-left: auto; margin-right: auto; }
@media (min-width: 1024px) {
  .fnd .tg3 .fnd-tool-lead { max-width: 960px; }
  .fnd .tg3 .fnd-tool-lead .fnd-display { max-width: none; }
}
.fnd .tg3 .fnd-tool-lead { text-align: center; }
.fnd .tg3 .fnd-tool-lead .fnd-display,
.fnd .tg3 .fnd-tool-lead__sub { margin-left: auto; margin-right: auto; text-align: center; }
.fnd .tg3 .fnd-tool-lead__sub { text-wrap: balance; }
.fnd .tg3 h1.fnd-display,
.fnd .tg3-qa__list summary,
.fnd.tg3-page .fnd-tool-close .fnd-btn { text-wrap: balance; }
/* "Title Generator" stays on one line (no lonely last word), so on a
   phone the name scales with the screen instead of running off it. */
@media (max-width: 559px) {
  .fnd .tg3 .fnd-tool-lead .fnd-display { font-size: min(2.5rem, 8vw); }
  .fnd .tg3 .fnd-tool-lead { margin-bottom: var(--fnd-s4); }
}

/* The bar sits bare on the page like a search box: no card around it. */
.fnd .tg3 .tg3-ask { background: none; border: 0; border-radius: 0; box-shadow: none; }
.fnd .tg3 .tg3-ask > .fnd-card-body { padding: 0; }
.tg3-ask,
.tg3-out,
.tg3-check { scroll-margin-top: calc(var(--header-height, 61px) + 16px); }

/* Long video or Short, centred over the bar. */
.tg3-kindrow { display: flex; justify-content: center; margin-bottom: var(--fnd-s3); }

.fnd .tg3-bar {
  display: flex; align-items: center; gap: var(--fnd-s2);
  background: var(--fnd-card);
  border: 1px solid var(--fnd-edge);
  border-radius: 999px;
  padding: 5px 5px 5px 20px;
  box-shadow: 0 1px 2px rgba(23, 20, 31, .05), 0 12px 28px -16px rgba(23, 20, 31, .3);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.fnd .tg3-bar:focus-within {
  border-color: var(--fnd-text);
  box-shadow: 0 0 0 1px var(--fnd-text), 0 0 0 5px var(--fnd-accent-soft), 0 12px 28px -16px rgba(23, 20, 31, .3);
}
.tg3-bar > .tg3-mark { flex: 0 0 auto; font-size: 15px; color: var(--fnd-text-faint); }
.fnd .tg3 .tg3-bar .fnd-input {
  flex: 1 1 auto; width: auto; min-width: 0;
  padding: 0 var(--fnd-s1);
  background: transparent; border: 0; border-radius: 0;
}
.fnd .tg3 .tg3-bar .fnd-input:focus { box-shadow: none; }
.fnd .tg3-bar .fnd-btn { flex: 0 0 auto; border-radius: 999px; white-space: nowrap; }
.fnd .tg3-bar:has(.fnd-btn:focus-visible) {
  border-color: var(--fnd-edge);
  box-shadow: 0 1px 2px rgba(23, 20, 31, .05), 0 12px 28px -16px rgba(23, 20, 31, .3);
}
@media (max-width: 559px) {
  .fnd .tg3-bar { padding-left: 16px; }
  .fnd .tg3-bar .fnd-btn { padding: 0 var(--fnd-s2); }
  .fnd .tg3 .tg3-bar .fnd-input { padding: 0 2px; font-size: 16px; }
}
@media (max-width: 399px) {
  .fnd .tg3-bar { padding-left: 14px; }
  .tg3-bar > .tg3-mark { display: none; }
}
.fnd .tg3 .tg3-ask .fnd-error { text-align: center; text-wrap: pretty; }

/* "Try:" and three examples, a dot in each gap. */
.fnd .tg3 .tg3-try {
  justify-content: center; margin: var(--fnd-s1) 0 0;
  column-gap: 21px; row-gap: 0; overflow: hidden;
  color: var(--fnd-text-soft); font-size: var(--fnd-t-meta);
}
.fnd .tg3 .tg3-try > span { position: relative; display: inline-flex; align-items: center; }
.fnd .tg3 .tg3-try span + span::before {
  content: "\00b7"; position: absolute; top: 50%; left: -21px; width: 21px;
  margin: 0; transform: translateY(-50%); text-align: center; opacity: .6;
}
.fnd .tg3 .tg3-try .tg3-try__k + span::before { content: none; }
.fnd .tg3 .tg3-try__k { margin-right: -13px; }
/* The third example drops on the smallest phones so the line stays one. */
@media (max-width: 399px) {
  .fnd .tg3 .tg3-try__x { display: none; }
}
/* The way to check a title they already have, centred under the examples. */
.fnd .tg3 .tg3-mode { margin: var(--fnd-s1) 0 0; text-align: center; }

/* Text buttons grown to a 44px tap, in the accent so they read as things
   to press. */
.fnd .tg3 .tg3-link.fnd-textbtn { --fnd-hit-y: 14px; font-size: var(--fnd-t-meta); color: var(--fnd-accent-deep); white-space: nowrap; }
.fnd .tg3 a.tg3-link { text-decoration: none; }
.fnd .tg3 .tg3-link.fnd-textbtn:hover { color: var(--fnd-text); }
.fnd .tg3 .tg3-link i { margin-right: 4px; }

/* ------------------------------------------------------------------
   2. THE ANSWER: the ideas, the checker, how it looks, the next step.
   ------------------------------------------------------------------ */
.fnd .tg3 .tg3-out { margin-top: var(--fnd-s5); }
.tg3-out.tg3-out--in { animation: tg3-in 320ms cubic-bezier(.22, 1, .36, 1); }
@keyframes tg3-in { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tg3-out.tg3-out--in { animation: none; }
}

/* The example: a badge saying so, and no buttons on its rows, so "Get
   titles" stays the one main button until the ideas are theirs. */
.fnd .tg3-exnote {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px var(--fnd-s2);
  margin: 0 0 var(--fnd-s4);
  font-size: var(--fnd-t-meta); line-height: 1.5; color: var(--fnd-text-soft);
}
.fnd .tg3-exnote > span:last-child { text-wrap: pretty; }
.tg3-out:not(.tg3-out--example) .tg3-exnote,
.tg3-out--example .tg3-rows .fnd-row-end,
.tg3-out--example .tg3-more { display: none; }
/* Checking their own title before any topic: just the checker. */
.tg3-out--check .tg3-exnote,
.tg3-out--check .tg3-head,
.tg3-out--check .tg3-rows,
.tg3-out--check .tg3-more { display: none; }
.fnd .tg3 .tg3-out--check .tg3-check { margin-top: 0; }
.tg3-more[hidden],
.tg3-note[hidden],
.tg3-next[hidden] { display: none; }
/* The card body spaces every child after the first, and a hidden note
   still counts as one, so the answer would sit low. */
.fnd .tg3 .tg3-out .tg3-head { margin-top: 0; }

.tg3-head { min-width: 0; }
.fnd .tg3-head__title {
  margin: 0; min-width: 0;
  font-family: var(--fnd-display-font); font-weight: 700;
  font-size: var(--fnd-t-h3-lg); line-height: 1.3; color: var(--fnd-text);
  overflow-wrap: anywhere; text-wrap: pretty;
}
.tg3-head__title:focus { outline: none; }
.fnd .tg3-head__meta {
  display: flex; flex-wrap: wrap; column-gap: 21px; row-gap: 0; overflow: hidden;
  margin: 2px 0 0; font-size: var(--fnd-t-meta); color: var(--fnd-text-soft);
}
.fnd .tg3-head__meta > span { position: relative; min-width: 0; overflow-wrap: anywhere; }
.fnd .tg3-head__meta > span + span::before {
  content: "\00b7"; position: absolute; top: 0; left: -21px; width: 21px; text-align: center; opacity: .6;
}

/* The ideas: the shared picture-free row, the style and length under
   each title, Copy and Edit and check at its end. */
.fnd .tg3 .tg3-rows { margin-top: var(--fnd-s3); }
.fnd .tg3 .tg3-rows .fnd-row-t { font-size: var(--fnd-t-body, 16px); overflow-wrap: break-word; }
.fnd .tg3 .tg3-rows .fnd-row-meta { gap: 2px 0; column-gap: 21px; overflow: hidden; color: var(--fnd-text-soft); }
.fnd .tg3 .tg3-rows .fnd-row-meta > span { position: relative; min-width: 0; }
.fnd .tg3 .tg3-rows .fnd-row-meta > span + span::before {
  content: "\00b7"; position: absolute; top: 0; left: -21px; width: 21px; text-align: center; opacity: .6;
}
.fnd .tg3 .tg3-rows .fnd-row-end { flex-wrap: wrap; column-gap: var(--fnd-s4); }
.fnd .tg3 .tg3-long { color: var(--fnd-warn); font-weight: 600; }
/* Same width as "Copy" and "Copied", so the row never jumps on a press. */
.fnd .tg3 .tg3-idea__cp { min-width: 7.75em; justify-content: center; }
.fnd .tg3 .tg3-idea__cp[data-copied="true"] { color: var(--fnd-ok); }
@media (max-width: 767px) {
  .fnd .tg3 .tg3-rows .fnd-row { row-gap: var(--fnd-s1); }
}

/* More ideas: under the list, the whole width on a phone. */
.fnd .tg3 .tg3-more { margin-top: var(--fnd-s3); }
@media (max-width: 559px) {
  .fnd .tg3 .tg3-more { width: 100%; justify-content: center; }
}
.fnd .tg3 .tg3-note { margin: var(--fnd-s2) 0 0; color: var(--fnd-text-soft); text-wrap: pretty; }
/* The helpline sits above the ideas, in full ink, so it is read first. */
.fnd .tg3 .tg3-help { margin-top: var(--fnd-s3); color: var(--fnd-text); }
/* The quiet helpline under every answer: small, soft, last. */
.fnd .tg3 .tg3-calm { margin-top: var(--fnd-s5); font-size: var(--fnd-t-meta); }
/* 988 and findahelpline.com: underlined links a thumb can hit (44px). */
.fnd .tg3 .tg3-helplink { --fnd-hit-y: 12px; --fnd-hit-x: 9px; color: inherit; text-decoration: underline; text-underline-offset: 2px; border-radius: 6px; }
.fnd .tg3 .tg3-helplink:hover { color: var(--fnd-accent-deep); }
.fnd .tg3 .tg3-helplink:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--fnd-accent-soft); }

/* The checker, then how it looks: each its own band inside the answer,
   so their headings are a step smaller than the title. */
.tg3-box { margin-top: var(--fnd-s6); }
.fnd .tg3 .tg3-box .fnd-tool-h3 { margin: 0; font-size: var(--fnd-t-h3); text-wrap: balance; }
.fnd .tg3 .tg3-box > .fnd-help { margin: 4px 0 0; text-wrap: pretty; }
.fnd .tg3 .tg3-check__in { margin-top: var(--fnd-s3); }
@media (max-width: 559px) {
  .fnd .tg3 .tg3-check__in { font-size: 16px; }
}

/* Five plain checks, each ticked, flagged or a tip, with what to change
   beside it (same pattern as the chapter generator's rules). */
.tg3-checks { list-style: none; margin: var(--fnd-s3) 0 0; padding: 0; }
.tg3-chk {
  display: flex; align-items: baseline; gap: var(--fnd-s2);
  padding: 3px 0;
  font-size: var(--fnd-t-sm); line-height: 1.5; color: var(--fnd-text);
  text-wrap: pretty;
}
.tg3-chk > i { flex: 0 0 auto; }
.tg3-chk > span { min-width: 0; overflow-wrap: anywhere; }
.tg3-chk--ok > i { color: var(--fnd-ok); }
.tg3-chk--no > i { color: var(--fnd-danger); }
.tg3-chk--tip > i { color: var(--fnd-warn); }
.tg3-chk--wait > i { color: var(--fnd-text-faint); font-size: 8px; transform: translateY(-2px); }
.tg3-chk--ok,
.tg3-chk--wait { color: var(--fnd-text-soft); }
.fnd .tg3 .tg3-chk--ok b { font-weight: 500; }
.fnd .tg3 .tg3-chk__fix { margin-left: 4px; color: var(--fnd-text-soft); }

/* How it looks on YouTube: the home page card, then the card beside a
   video, side by side from tablet up. The light YouTube colours are the
   card's own (.fnd-ytcard--light). */
.tg3-yt { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fnd-s4); margin-top: var(--fnd-s3); }
.fnd .tg3 .tg3-yt__col,
.fnd .tg3 .tg3-yt .fnd-ytcard,
.fnd .tg3 .tg3-yt .fnd-ytcard-meta { min-width: 0; }
@media (min-width: 640px) {
  .tg3-yt { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); align-items: start; }
}
.fnd .tg3 .tg3-yt__k { margin: 0 0 var(--fnd-s1); font-size: var(--fnd-t-meta); font-weight: 600; color: var(--fnd-text-soft); }
.fnd .tg3 .tg3-yt__home { max-width: 360px; }
.fnd .tg3 .tg3-yt__side { --fnd-ytcard-thumb-w: 168px; max-width: 420px; }
@media (max-width: 413px) {
  .fnd .tg3 .tg3-yt__side { --fnd-ytcard-thumb-w: 140px; }
}
.fnd .tg3 .tg3-yt__av { display: flex; align-items: center; justify-content: center; }
.fnd .tg3 .tg3-yt__av .fnd-ytcard-initial { font-size: 16px; }

/* The next step: under the answer, once the ideas are theirs. */
.tg3-next {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--fnd-s3) var(--fnd-s4);
  margin-top: var(--fnd-s6); padding-top: var(--fnd-s4);
  border-top: 1px solid var(--fnd-rule);
}
.tg3-next__t { flex: 1 1 300px; min-width: 0; }
.fnd .tg3 .tg3-next .fnd-tool-h3 { margin: 0; font-size: var(--fnd-t-h3); text-wrap: balance; }
.fnd .tg3 .tg3-next__t .fnd-help { margin: 4px 0 0; text-wrap: pretty; }
.tg3-next__go { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
@media (max-width: 559px) {
  .tg3-next__go { flex: 1 1 100%; }
  .fnd .tg3 .tg3-next__go .fnd-btn { width: 100%; justify-content: center; }
}

/* ------------------------------------------------------------------
   3. THE GUIDE
   ------------------------------------------------------------------ */
.fnd .tg3-guide .fnd-tool-read .fnd-h2 {
  margin-top: var(--fnd-s8);
  max-width: 24ch;
  scroll-margin-top: calc(var(--header-height, 61px) + var(--fnd-s4));
}
.tg3-guide .fnd-tool-read .fnd-h2:focus { outline: none; }
.fnd .tg3-guide .fnd-toc li > a:not(.fnd-btn) { text-wrap: pretty; }
@media (max-width: 767px) {
  .fnd .tg3-guide .fnd-tool-read .fnd-h2 { margin-top: var(--fnd-s7); }
}
/* A link inside a sentence grows to a 45px press without moving the text. */
.fnd .tg3-guide .fnd-tool-read p a:not(.fnd-btn),
.fnd .tg3-guide .fnd-tool-read li a:not(.fnd-btn),
.fnd .tg3-qa__list p a:not(.fnd-btn) { padding-block: 12px; }
.fnd .tg3-guide .tg3-steps-g + p,
.fnd .tg3-guide .fnd-tbl + p { margin-top: var(--fnd-s3); }

/* The formula table: no word left alone at the end of a cell. Its second
   column is a sentence, not a number, so it wraps; on a phone it sits under
   the formula with its "Example:" label instead of squeezed beside it. */
.fnd .tg3-guide .tg3-tbl :is(th, td) { text-wrap: balance; }
.fnd .tg3-guide .tg3-tbl.fnd-tbl--data tbody td:not(:first-child) { white-space: normal; font-variant-numeric: normal; }
@media (max-width: 639px) {
  .fnd .tg3-guide .tg3-tbl.fnd-tbl--data thead th:last-child { display: none; }
  .fnd .tg3-guide .tg3-tbl.fnd-tbl--data tbody td:first-child { flex: 1 1 100%; }
  .fnd .tg3-guide .tg3-tbl.fnd-tbl--data tbody td:last-child {
    order: 4; flex: 1 1 100%; padding: 2px 0 0;
    white-space: normal; text-align: left; text-wrap: pretty;
    font-size: var(--fnd-t-sm); font-weight: 500; color: var(--fnd-text-soft);
  }
  .fnd .tg3-guide .tg3-tbl.fnd-tbl--data tbody td:last-child::before {
    content: attr(data-l) " "; font-weight: 500; color: var(--fnd-text-faint);
  }
}

.tg3-steps-g { list-style: none; margin: var(--fnd-s4) 0 0; padding: 0; }
.tg3-steps-g li + li { margin-top: var(--fnd-s5); }
.tg3-steps-g .fnd-numhead { margin-bottom: var(--fnd-s2); }
.fnd .tg3-steps-g .fnd-numhead__t { font-size: var(--fnd-t-h3); }
.tg3-steps-g p { margin: 0; padding-left: calc(32px + var(--fnd-s3)); }
@media (max-width: 559px) {
  .tg3-steps-g p { padding-left: 0; }
}
