/* WhatsApp templates guide (the "What are WhatsApp message templates?" page). Built on the Flows guide's patterns,
   with one field per chapter where a field earns it: Mint for the building blocks, Sky behind where templates show.
   The categories and the lifecycle sit on the ground as surface cards. Logical properties, so Arabic pages mirror. */
.tg-head { display: grid; gap: 16px; max-width: 780px; margin-bottom: clamp(32px, 4vw, 52px); }
.tg-prose { display: grid; gap: 14px; font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 62ch; }
.tg-prose p { text-wrap: pretty; }
.tg-prose a, .tg-note a {
  font-weight: 700; color: var(--accent-ink);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em;
}
@media not all and (pointer: coarse) {
  :is(.tg-prose, .tg-note) a:hover { text-decoration-thickness: 3px; }
}
.tg-ic {
  flex: none; display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs);
}
.tg-ic .i { width: 19px; height: 19px; }
.tg-source { font-size: 14px; line-height: 1.45; color: var(--ink-soft); text-wrap: pretty; }
.tg-note { font-size: 15px; line-height: 1.5; color: var(--ink-soft); max-width: 70ch; text-wrap: pretty; }

/* What a template is: the definition beside its building blocks */
.tg-intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px clamp(32px, 5vw, 80px); align-items: start; }
.tg-intro-copy { display: grid; gap: 22px; }
.tg-parts { --field: var(--field-mint); gap: 6px; padding: clamp(22px, 2.6vw, 32px); }
.tg-parts-title { font: 800 15px/1.2 var(--text); color: var(--ink); }
.tg-parts-list { display: grid; }
.tg-part { display: grid; gap: 4px; padding-block: 16px; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.tg-part:first-child { border-top: 0; padding-top: 10px; }
.tg-part dt { display: flex; align-items: center; gap: 12px; font: 800 1.12rem/1.3 var(--text); }
.tg-part dd { margin: 0; padding-inline-start: 48px; font-size: 16px; line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }

/* The In Flowella tag: three states that differ in fill, icon and words, never colour alone */
.tg-status { white-space: normal; min-height: 28px; padding: 4px 12px 4px 9px; text-align: start; }
.tg-status .i { flex: none; width: 15px; height: 15px; }
.tg-status.is-yes { background: var(--field-green); color: var(--ink); }
.tg-status.is-partly { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.tg-status.is-no { background: var(--surface); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line); }
.tg-status-note { font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); text-wrap: pretty; }
.tg-tagline { display: grid; justify-items: start; align-content: start; gap: 6px; margin: 0; }

/* Three categories: three surface cards, their rows shared so the tags line up (subgrid) */
.tg-kind-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; }
.tg-kind {
  display: grid; grid-row: span 5; grid-template-rows: subgrid; align-content: start; gap: 12px;
  padding: 24px 22px 26px; border-radius: calc(24px * var(--sq-scale, 1));
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  corner-shape: var(--sq-shape, round);
}
@supports not (grid-template-rows: subgrid) {
  .tg-kind { grid-row: auto; }
}
.tg-kind-ic {
  justify-self: start; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: calc(14px * var(--sq-scale, 1));
  background: var(--coral); color: var(--on-bright); rotate: -4deg;
  corner-shape: var(--sq-shape, round);
}
.tg-kind-ic .i { width: 22px; height: 22px; }
.tg-kind:nth-child(2) .tg-kind-ic { background: var(--sky); rotate: 3deg; }
.tg-kind:nth-child(3) .tg-kind-ic { background: var(--mint); rotate: -3deg; }
.tg-kind h3 { font: 800 1.3rem/1.25 var(--text); }
.tg-kind-text { font-size: 16px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.tg-kind-meta { padding-top: 12px; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }
.tg-kinds-note { margin-top: clamp(24px, 3vw, 36px); max-width: 70ch; }

/* Every type: one real screen each, four across; the rows share heights so the tags line up (subgrid) */
.tg-shot {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: calc(26px * var(--sq-scale, 1));
  background: var(--surface); box-shadow: var(--shadow-sm);
  corner-shape: var(--sq-shape, round);
}
.tg-shot-none { aspect-ratio: 640 / 1387; }
/* No row gap on the list: a subgrid's own 6px gap would be padded out to the list's gap between every inner row.
   The space between rows of screens is the foot's bottom padding instead. */
.tg-gal-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(20px, 2.4vw, 32px); }
.tg-gal-item { display: grid; grid-row: span 5; grid-template-rows: subgrid; align-content: start; gap: 6px; }
@supports not (grid-template-rows: subgrid) {
  .tg-gal-item { grid-row: auto; }
}
.tg-cat { margin-top: 14px; font: 700 12.5px/1.3 var(--text); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.tg-cat:empty { margin-top: 0; }
.tg-gal-title { font: 800 1.12rem/1.3 var(--text); text-wrap: balance; }
.tg-gal-text { font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }
.tg-gal-foot { display: grid; justify-items: start; align-content: start; gap: 8px; padding: 4px 0 clamp(40px, 4.4vw, 60px); }
.tg-limit { font-size: 13.5px; line-height: 1.4; color: var(--ink); font-weight: 600; text-wrap: pretty; }
.tg-more { margin-top: clamp(48px, 5vw, 72px); max-width: 920px; }
.tg-block-title { margin-bottom: 4px; font: 800 1.15rem/1.3 var(--text); }
.tg-gal-note { margin-top: clamp(32px, 4vw, 48px); }

/* Rows: a name, what it means and an optional tag */
.tg-rows { display: grid; }
.tg-rowline {
  display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); align-items: start; gap: 6px 24px;
  padding-block: 16px; border-top: 1px solid var(--line);
}
.tg-rowline:first-child { border-top: 0; }
.tg-rowline dt { font: 700 16px/1.4 var(--text); color: var(--ink); }
.tg-rowline dd { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }
.tg-rowline .tg-rowline-tag { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }

/* The limits and the changes: a sticky head beside the list */
.tg-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 32px clamp(32px, 5vw, 80px); align-items: start; }
.tg-sticky { position: sticky; top: 104px; margin-bottom: 0; }
.tg-lim-rows .tg-rowline { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); }

/* From draft to delivered: four steps in a row, each numbered (the order is the point) */
.tg-step-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.tg-step {
  display: grid; grid-template-rows: subgrid; grid-row: span 3; align-content: start; gap: 12px;
  padding: 24px 22px 26px; border-radius: calc(24px * var(--sq-scale, 1));
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  corner-shape: var(--sq-shape, round);
}
@supports not (grid-template-rows: subgrid) {
  .tg-step { grid-row: auto; }
}
.tg-num {
  justify-self: start; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: calc(14px * var(--sq-scale, 1));
  background: var(--mint); color: var(--on-bright);
  font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums;
  rotate: -4deg;
  corner-shape: var(--sq-shape, round);
}
.tg-step:nth-child(2) .tg-num { background: var(--sky); rotate: 3deg; }
.tg-step:nth-child(3) .tg-num { background: var(--green); rotate: -3deg; }
.tg-step:nth-child(4) .tg-num { background: var(--coral); rotate: 4deg; }
.tg-step h3 { font: 800 1.15rem/1.3 var(--text); text-wrap: balance; }
.tg-step p { font-size: 16px; line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }
.tg-steps-note { margin-top: clamp(24px, 3vw, 36px); max-width: 70ch; }

/* Where templates show: one Sky Field card, the notes two across */
.tg-notes-card { --field: var(--field-sky); padding: clamp(26px, 4vw, 56px); }
.tg-notes-card .tg-head { margin-bottom: clamp(20px, 2.6vw, 32px); }
.tg-note-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(28px, 4vw, 56px); }
.tg-note-item { display: grid; align-content: start; gap: 6px; padding-block: 18px; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.tg-note-item dt { display: flex; align-items: center; gap: 12px; font: 800 1.08rem/1.3 var(--text); }
.tg-note-item dd { margin: 0; padding-inline-start: 48px; font-size: 16px; line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }
.tg-note-item .tg-tagline { padding-top: 4px; }

/* What has changed lately: the changes on a rail */
.tg-time { position: relative; display: grid; padding-inline-start: 36px; }
.tg-time::before {
  content: ""; position: absolute; inset-block: 12px 28px; inset-inline-start: 7px;
  width: 2px; border-radius: 2px; background: var(--line);
}
.tg-time-item { position: relative; display: grid; gap: 4px; padding-bottom: 30px; }
.tg-time-item:last-child { padding-bottom: 0; }
.tg-time-item::before {
  content: ""; position: absolute; inset-inline-start: -36px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;
  background: var(--ground); border: 3px solid var(--mint);
}
.tg-when { font: 700 14px/1.3 var(--text); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tg-time-item h3 { font: 800 1.12rem/1.3 var(--text); text-wrap: balance; }
.tg-time-item p:not(.tg-when) { font-size: 16px; line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; max-width: 58ch; }

/* Where to go next: three whole-card links */
.tg-next-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: clamp(28px, 3.4vw, 44px); }
.tg-next-card { gap: 10px; padding-bottom: 60px; }
.tg-next-card .card-title { font: 800 1.2rem/1.3 var(--text); text-wrap: balance; }
.tg-next-card p { font-size: 16px; line-height: 1.5; color: var(--ink-soft); }
.tg-go {
  position: absolute; inset-inline-start: clamp(20px, 2.4vw, 28px); bottom: 20px;
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--field-sky); color: var(--accent-ink);
}
.tg-go .i { width: 18px; height: 18px; }

@media (max-width: 1179px) {
  .tg-gal-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .tg-intro-grid, .tg-split { grid-template-columns: minmax(0, 1fr); }
  .tg-sticky { position: static; }
  .tg-kind-list { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .tg-kind { grid-row: auto; grid-template-rows: none; }
  .tg-step-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tg-next-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .tg-gal-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tg-note-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 719px) {
  .tg-prose { font-size: 17px; }
  .tg-step-list { grid-template-columns: minmax(0, 1fr); }
  .tg-rowline, .tg-lim-rows .tg-rowline { grid-template-columns: minmax(0, 1fr); }
  .tg-rowline .tg-rowline-tag { grid-column: 1; }
}
/* On a phone the screens become a row to swipe, one and a bit in view, so the next one shows there is more */
@media (max-width: 559px) {
  .tg-gal-list {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 76%; grid-template-rows: repeat(5, auto);
    column-gap: 16px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 16px; scroll-padding-inline: var(--gutter);
    scrollbar-width: thin;
  }
  .tg-gal-item { scroll-snap-align: start; }
  .tg-gal-foot { padding-bottom: 0; }
}
