/* ============================================================
   TEMPLATE PAIRS — routine templates and the custom Routine (TemplatePairs.astro; /routines, Liliya 18–23.11.2026)
   Requires: tokens.css, page.css, patterns.css (.block-head, .grid), surface.css (.card), reveal-card.css, side-tabs.css
   The templates as reveal cards (reveal-card.css) four a row, three columns each, on the row's two subgrid rows so the
   strips line up; the connectors under them (SideTabs in filter mode, its marks here); the custom Routine's button.
   ============================================================ */
.template-pairs__grid { row-gap: var(--grid-gap); } /* rows as far apart as the columns (Liliya, 18.11.2026; was the block gap) */
.template-pairs__grid > .reveal-card { grid-column: span 3; }
@media (min-width: 48rem) and (max-width: 61.9375rem) { .template-pairs__grid > .reveal-card { grid-column: span 6; } } /* tablets: two a row — four left a title 5 lines of ~11 characters at 768 (Liliya, 24.11.2026) */

/* connectors (Liliya, 23.11.2026): an H2, then the services a custom Routine can use — one-colour marks in grey tiles;
   a service with no mark yet shows its name in a dashed tile (to find) */
/* its H2 on one line on desktop, past the block-head's 8 of 12 (Liliya, 23.11.2026) */
@media (min-width: 48rem) { .template-pairs__connectors .block-head > h2 { max-width: none; justify-self: stretch; } } /* stretch: the H2 takes the block head's width (centred text, the same look), its two lines set by the line break, not by a shrunk box (the layout check's «block heading squeezed», 24.11.2026) */
.template-pairs__connectors > .block-head { justify-self: stretch; } /* as wide as the block, not shrunk to its heading in the centred grid */
.template-pairs__connectors { display: grid; justify-items: center; margin-top: var(--section-space); } /* an H2 of its own in a .block-head (Liliya, 23.11.2026): a section's space above; the block-head keeps the H2 to 8 of 12 columns and a lone heading's 32 to the block */
/* filter (Liliya, 23.11.2026, «a switcher as the comparison, every logo on the right, lighting up by group»): the
   groups are SideTabs in filter mode (side-tabs.css: the wrapper, the tabs, the panel, the dimming); here the marks
   in its panel */
.template-pairs__filter { width: 100%; }
.template-pairs__all { display: grid; grid-template-columns: repeat(auto-fill, 5.5rem); gap: var(--grid-gap); align-content: start; justify-content: center; margin: 0; padding: 0; list-style: none; }
.template-pairs__all .template-pairs__tile--todo { background: none; outline-color: var(--color-bg-grey); } /* the dashed frame shows on the CTA Grey panel */
/* names: with a group chosen, its lit marks show the product's name in the smallest text (the Eyebrow's size), the
   mark moving up to make room; hidden under «All» (Liliya, 23.11.2026) */
.template-pairs__all .template-pairs__tile { position: relative; }
.template-pairs__all .template-pairs__mark { transition: translate var(--duration-toggle) var(--ease-toggle); }
.template-pairs__name {
  position: absolute; left: var(--space-xxs); right: var(--space-xxs); bottom: var(--space-xs);
  font-size: var(--text-eyebrow-size); font-weight: 600; line-height: 1.15; text-align: center; color: var(--color-text-grey); /* Birch/Badge: the Eyebrow's size and weight, no capitals (was 400, off the system) */
  opacity: 0; transition: opacity var(--duration-toggle) var(--ease-toggle);
}
/* …and under «All», a tile under the mouse shows its own name (Liliya, 23.11.2026; a chosen group already shows its names) */
:is(.is-filtered .template-pairs__tile:not(.is-dim), .side-tabs:not(.is-filtered) .template-pairs__tile:hover) .template-pairs__name { opacity: 1; }
:is(.is-filtered .template-pairs__tile:not(.is-dim), .side-tabs:not(.is-filtered) .template-pairs__tile:hover) .template-pairs__mark { translate: 0 calc(-1 * var(--space-xs)); } /* up 8: enough above a one-line name (was 16) */

.template-pairs__tile { display: grid; place-items: center; width: 5.5rem; aspect-ratio: 1; border-radius: var(--radius-lg); background: var(--color-bg-grey); color: var(--color-text); }
.template-pairs__mark { display: block; width: calc(40% * var(--mark-scale, 1)); aspect-ratio: 1; } /* 40% of the tile (50% crowded the names), times each mark's own scale so they weigh the same (data: scale; Liliya 23.11.2026) */
.template-pairs__mark svg { display: block; width: 100%; height: 100%; }
.template-pairs__mark svg :is(path, rect, circle, polygon) { fill: currentColor; } /* one colour, whatever the file's own */
.template-pairs__tile--todo { padding: var(--space-xs); background: none; outline: var(--border-thin) dashed var(--color-bg-cta-grey); outline-offset: calc(-1 * var(--border-thin)); color: var(--color-text-grey); text-align: center; overflow-wrap: anywhere; }

/* the button under the row: the custom Routine (cards → a button, layout-rules «Spacing by role») */
.template-pairs__more { margin: var(--block-gap) 0 0; text-align: center; }

/* phones: the connectors heading runs as one text, its desktop line break goes (Liliya, 23.11.2026) */
@media (max-width: 47.9375rem) { .template-pairs__connectors .block-head h2 br { display: none; } }

/* the connectors on phones (Liliya's pick C, /lab/routines-connectors, 23.11.2026): SideTabs' gallery of group cards
   (side-tabs.css) — the group in Birch/H3, its services as tiles three a row (two under 400), the mark (28, times its
   own scale) and the name (Birch/Badge) 16 in from the tile's top-left and bottom-left */
.template-pairs__set-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: var(--space-xs); margin: 0; padding: 0; list-style: none; }
.template-pairs__set-tile { position: relative; display: grid; place-items: start; aspect-ratio: 1; padding: var(--space-sm); box-sizing: border-box; border-radius: var(--radius-md); background: var(--color-bg-grey); color: var(--color-text); }
.template-pairs__set-tile .template-pairs__mark { width: calc(1.75rem * var(--mark-scale, 1)); }
.template-pairs__set-name { position: absolute; left: var(--space-sm); right: 0; bottom: var(--space-sm); font-size: var(--text-eyebrow-size); font-weight: 600; line-height: 1.15; color: var(--color-text); } /* white: the grey was 4.50 on Background/Grey, under the 4.5 the check asks of a name this small */
/* under 400 Supermetrics no longer fits three a row: two, the tiles lower */
@media (max-width: 24.9375rem) {
  .template-pairs__set-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-pairs__set-tile { aspect-ratio: 3 / 2; }
}
