/* ============================================================
   FEATURE PANEL — one product feature in a filled panel, with a side card (live /features)
   Requires: tokens.css, page.css, surface.css, button.css
   Markup: site/src/components/FeaturePanel.astro. Pieces, all from surface.css:
   .feature__panel  a .card (one padding all round, --pad-card-fluid); its fill is --card-fill (grey by default, Surface +
                    .theme-light, or an accent). Title H3, every text Body; gaps: title → lead 8, head → body and between
                    pieces 24, between consecutive texts 16 (30.10.2026, Liliya on /lab/feature-panel)
   .feature__shot   a picture, rounded; --mat puts a .card-like fill behind it
   .feature__tile   a .media-card: a picture tile, a title and a text under it (Explorer, the ad platforms)
   .feature__promo  a .card.card--side: picture, text, a full-width button (the Rules strategies card)
   .feature__card   the side card, a small .card: icons and a caption; sticks while its panel scrolls by
   Phones: the side card is hidden and its line under the lead (.feature__line) shows instead — one at a time, so
   the link exists once for screen readers.
   ============================================================ */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--feature-side, 10.25rem); /* live: panel 820 + card 164 */
  gap: var(--grid-gap);
  align-items: start;
}
.feature + .feature { margin-top: var(--grid-gap); }
.feature--inline { grid-template-columns: minmax(0, 1fr); } /* the side link is a line in the card: no side column at any width */
/* a card without a side link keeps the empty side slot: every card in a column is one width (Liliya, review 02.11.2026) */

.feature__panel { display: flex; flex-direction: column; gap: var(--gap-heading-block); overflow: clip; container-type: inline-size; }
.feature__panel--accent { color: var(--color-text); --text-grey: var(--color-text); }

.feature__head { display: flex; flex-direction: column; gap: var(--gap-heading-small); }

.feature__body { display: flex; flex-direction: column; gap: var(--gap-heading-block); }
.feature__body > * { max-width: 100%; }
/* every text in the card reads at the lead measure (60ch of its own Body: ≤ 65 characters a line) — on the paragraph
   itself, since ch is the font of the element it is set on; after the body's 100% rule */
.feature__head > p, .feature__body > .feature__text, .feature__step p { max-width: min(100%, var(--measure-lead)); }
.feature__text { color: var(--text-grey); }
.theme-dark .feature__panel:not(.theme-light, .feature__panel--accent) { --text-grey: var(--color-text-grey-on-grey); } /* AA on Background/Grey, as the course menu */
.feature__text strong { font-weight: inherit; color: var(--ink); } /* «Bold.» lead-in: Body is already 600, so the lead-in is told by colour — the text, the rest grey */
.feature__text + .feature__text { margin-top: calc(var(--space-sm) - var(--gap-heading-block)); } /* items read as one list: 16 */

.feature__step { display: flex; flex-direction: column; gap: var(--gap-heading-small); }
.feature__list { list-style: none; padding: 0; }
.feature__list li::before { content: "→ "; }

/* pictures */
.feature__shot img { display: block; width: 100%; height: auto; border-radius: var(--radius-md); }
.feature__shot--mat { display: grid; place-items: center; padding: var(--pad-card-fluid); border-radius: var(--radius-md); background: var(--mat); }
.feature__shot picture { display: contents; } /* the img is the mat's grid item, so it centres */
.feature__shot--mat img { width: min(100%, 30rem, var(--shot-w, 30rem)); border-radius: var(--radius-sm); } /* nested: inside the 12 mat; never wider than half its pixels (--shot-w, FeaturePanel.astro), so a UI crop stays sharp on a 2× screen. A set width, not auto: a lazy picture holds its height before it loads, so the page does not grow under an anchor jump (Liliya, 03.11.2026) */

/* a video in the card (the overview): the light player, rounded as a picture */
.feature__video .course-player { border-radius: var(--radius-md); overflow: clip; }

/* tiles */
.feature__tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--grid-gap); }
.feature__tile { display: flex; flex-direction: column; gap: var(--gap-heading-small); }
.feature__tile-pic { aspect-ratio: 1; border-radius: var(--radius-md); overflow: clip; margin-bottom: var(--space-xs); }
.feature__tile-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.feature__tile-pic--logo { display: grid; place-items: center; background: var(--color-bg-white); }
.feature__tile-pic--logo img { width: 70%; height: auto; } /* the round platform marks of /manage (platform-*.svg), large: their white circle merges with the tile */

/* four tiles need a panel at least 40rem wide (tablet, desktop); narrower — two in a row */
@container (max-width: 40rem) { .feature__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 15rem) { .feature__tiles { grid-template-columns: minmax(0, 1fr); } } /* a narrow column (a tablet beside a menu): one tile a row */

/* logos */
.feature__logos { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: var(--space-xs); } /* the row spans the card, the logos spread evenly */
.feature__logos li { display: grid; place-items: center; justify-self: center; width: min(100%, 4.5rem); aspect-ratio: 1; border-radius: var(--radius-pill); background: var(--color-bg-white); }
.feature__logos img { width: 50%; height: 50%; object-fit: contain; }

/* the strategies card */
/* on a grid (Liliya 02.11.2026): six columns 16 apart — the picture one, the text five, the button all; phones four
   columns, the picture one (a sixth is ~37px there), the text and the button under it */
.feature__promo { --card-fill: var(--color-bg-white); --side-split: repeat(6, minmax(0, 1fr)); grid-template-rows: auto; column-gap: var(--grid-gap); row-gap: var(--space); align-items: center; }
.feature__promo-pic img { display: block; width: 100%; height: auto; }
.feature__promo-text { grid-column: span 5; display: flex; flex-direction: column; gap: var(--gap-heading-small); }
.feature__promo-btn { grid-column: 1 / -1; width: 100%; } /* XS, the in-card size, not the CTA; the block's full width (Liliya 30.10.2026) */
.feature__action { width: 100%; }

/* the side card */
.feature__side { position: sticky; top: calc(var(--nav-height, 0rem) + var(--space-sm)); }
.feature__card { display: flex; flex-direction: column; gap: var(--space-md); padding: var(--space-sm); color: var(--ink); text-decoration: none; transition: background-color var(--duration-hover) var(--ease-hover); }
a.feature__card:hover { background: var(--color-bg-grey-hover); }
.feature__card--note { gap: 0; }
.feature__card-icons { display: flex; align-items: center; height: 2.25rem; } /* one row height and one size per icon, with or without the video icon */
.feature__icon-play { width: 2.25rem; height: 2.25rem; }
.feature__icon-link { --icon: calc(2.25rem * 563 / 800); width: var(--icon); height: var(--icon); margin-left: auto; } /* as high as YouTube's drawn glyph (563 of the play icon's 800 box); the link's 20 box is all drawing, stroke included (Liliya, 03.11.2026) */

/* the side card's line under the lead (phones; every width with .feature--inline) */
.feature__line { display: none; align-items: flex-start; gap: var(--space-xs); color: inherit; text-decoration: none; }
.feature__line-icon { display: flex; align-items: center; height: 1lh; flex: none; } /* the icon on the first line of a long caption */
.feature__line-icon svg { display: block; width: 1.5rem; height: 1.5rem; margin-left: 0; }
a.feature__line { --tap-pad: max(0rem, (2.75rem - 1lh) / 2); padding-block: var(--tap-pad); margin-block: calc(var(--tap-pad) * -1); transition: opacity var(--duration-hover) var(--ease-hover); } /* a 44 touch target, the text in the same place (as .bento-cards__link) */
@media (hover: hover) { a.feature__line:hover { opacity: 0.7; } }
/* the line's looks (/lab/feature-side-link): one fill step from the card for the wrapper, as the picture mats */
.feature__panel { --line-fill: var(--color-bg-grey-hover); }
.feature__panel.theme-light { --line-fill: var(--color-surface-muted); }
.feature__panel--accent { --line-fill: color-mix(in oklab, var(--card-fill), var(--color-bg) 22%); }
.feature--side-line-icons .feature__line-icon { gap: var(--space-xs); }
.feature--side-line-icons .feature__line-icon .feature__icon-link { width: 1.25rem; height: 1.25rem; }
.feature--side-chip a.feature__line {
  /* the line in a wrapper the content's full width, the touch minimum (44) for one line — lower than a chip (Liliya,
     02.11.2026: less air above and below), 8 above and below a longer caption; the icon as high as
     a capital of the text and on its baseline (Liliya, review 02.11.2026): a grid row centred in the height, the
     items on the first line's baseline */
  --line-show: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; align-content: center;
  column-gap: var(--space-xs); min-height: var(--tap-min); margin-block: 0; padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm); background: var(--line-fill);
  transition: background-color var(--duration-hover) var(--ease-hover);
}
.feature--side-chip .feature__line-icon { display: contents; } /* the svg itself is the grid item: no baseline of its own, so its bottom sits on the text's */
.feature--side-chip .feature__line-icon svg { display: block; width: auto; height: 1cap; } /* the glyph's own box (viewBox cut to the drawing): its top = the capital's top */
@media (hover: hover) { .feature--side-chip a.feature__line:hover { opacity: 1; background: color-mix(in oklab, var(--line-fill), var(--color-bg) 25%); } }
.feature--side-button a.feature__line { margin-block: 0; padding-block: 0; width: 100%; align-items: center; } /* .btn sets the height, padding and fill */
.feature--side-button .theme-light a.feature__line { color: var(--color-text); } /* CTA Grey is dark on every card: Text/Base (white) on light cards too — the light theme swaps --ink, not the token */
.feature--side-button .feature__line-icon { height: auto; }
.feature--side-button .feature__line-text { white-space: normal; text-align: left; }
.feature--inline .feature__line { display: var(--line-show, flex); } /* shown as a flex line, or a grid in the wrapper look */
.feature--inline .feature__side { display: none; }

@media (max-width: 47.9375rem) {
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature__side { display: none; }
  .feature__line { display: var(--line-show, flex); }
  /* the strategies card keeps its picture beside the text, small, as live (card--side would stack it full width) */
  .feature__promo.card--side { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto; align-items: start; } /* four columns on phones (card--side would stack it) */
  .feature__promo-text { grid-column: 1 / -1; } /* phones: the picture a quarter wide on top, the text under it full width (Liliya 02.11.2026) */
}
