/* ============================================================
   RULE CHEAT SHEETS — /facebook-automated-rules, /google-automated-rules (site/src/components/CheatSheet.astro)
   Requires: tokens.css, page.css, surface.css, course.css, side-menu.css, tabs.css, product-blocks.css (.rule-card)

   The text is the course lesson's (course.css: .course-transcript, .course-text — Liliya, 10.11.2026: «redo all the
   texts by the course, reuse its style»): a rule type is a transcript block, its H3 heading 16 above the lesson's text
   run (Reading M, the topic headings in its H4 role, 12 / 24 rhythm). Here only what a lesson has no notion of:
   .cheats-top        the platform switch above the Hero headline (the headline is word pills, Hero's own)
   .cheats-layout     the contents (4 columns) + the rule types (8), on the course layout, as live /how-to-choose
   .cheats-rule       a rule template card (RuleCard) in the text
   .cheats-figure     a rule picture in the text (Google): the picture on a Card, as in a RuleCard
   ============================================================ */

/* ---------- First screen ---------- */
.cheats-top { display: grid; justify-items: center; gap: var(--space-lg); } /* its section: .section--opens-on-tabs (patterns.css) */
/* The switch: two links between the two pages on the Tabs tray; the current page is the white segment.
   tabs.css marks a choice by aria-selected / aria-pressed; a link to the page you are on is aria-current. */
.cheats-top__switch .tabs__tab { text-decoration: none; }
.cheats-top__switch .tabs__tab[aria-current="page"] { background: var(--color-bg-white); }
/* the other page grey (as live, at every width), black under the mouse */
.cheats-top__switch .tabs__tab:not([aria-current]) { color: var(--color-text-grey-inverted); transition: color var(--duration-hover) var(--ease-hover); }
@media (hover: hover) { .cheats-top__switch .tabs__tab:not([aria-current]):hover { color: var(--color-text-inverted); } }
@media (max-width: 47.9375rem) { .cheats-top__switch { width: 100%; } }
/* the headline right under the switch: the first screen's own steps, not a second section space */
main:has(.cheats-top) .hero--compact { padding-top: var(--space-lg); } /* named by class, not by the sibling's place */

/* ---------- Contents + rule types ---------- */
/* The rule types 80 apart (the course layout's own gap), 48 on phones as on a lesson page (course.css, .course-page). */
@media (max-width: 47.9375rem) { .cheats-layout { --course-gap: var(--space-lg); } }
/* Paragraphs, cards and pictures take the content column: caption text (docs/layout-rules.md, «Two kinds of text»). */
/* a rule card here has no text of its own (live puts the topic's text beside the card): the button follows the picture */
.cheats-rule .rule-card__foot { margin-top: 0; }
/* a topic heading straight over a card or a picture (no text between): the 24 a heading takes to a block («Spacing by
   role»: any heading → a block), not the lesson's 12 to its text — a lesson has no cards (rhythm audit, 10.11.2026) */
.course-text__h:has(+ :is(.cheats-rule, .cheats-figure)) { margin-bottom: var(--gap-heading-block); }

/* ---------- A rule picture without a card's head (Google) ---------- */
.cheats-figure__img { display: block; width: 100%; height: auto; border-radius: calc(var(--radius-lg) - var(--space-xs)); }
/* the same white plate and hairline as a rule card's picture (product-blocks.css, .rule-card__picture) */
.cheats-figure__img { box-sizing: border-box; padding: var(--space-sm); background: var(--color-bg-white); border: var(--border-hairline) solid var(--color-border-hairline); }
@media (max-width: 47.9375rem) { .cheats-figure__img { padding: var(--space-xs); } }
