/* The search results page (Figma 5940-14): what the catalogue's look (catalogue-pages/assets/) does not
   already draw -- the result groups and their heads, the people and places row, the
   searches to try, the closing line. Logical properties and the brand's tokens, as the catalogue's. */

.cil-spage .cil-ctl-summary { margin-bottom: 40px; }
.cil-spage .cil-ctl-chips { margin-bottom: 40px; }

/* ---- Result groups ---- */
.cil-spage-group--courses { display: flex; flex-direction: column; gap: 16px; }
.cil-spage-people + .cil-spage-group, .cil-spage-group + .cil-spage-people { margin-top: 40px; }

/* A group one card wide has no room for a long name and its link side by side: the link goes under it. */
.cil-spage-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; min-height: 48px; }
.cil-spage-head__title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--cil-black); font-size: 40px; font-weight: 700; line-height: 1.2; }
.cil-spage-head__count { color: var(--cil-black-regular-7); font-size: 14px; font-weight: 400; }
.cil-spage-head__link { min-height: 0; }

/* The people and places row: one grid of four, each group as wide as its cards and its head over them. */
.cil-spage-people { align-items: start; row-gap: 40px; }
.cil-spage-people .cil-spage-group { display: grid; grid-template-columns: subgrid; row-gap: 16px; }
.cil-spage-people .cil-spage-head { grid-column: 1 / -1; }
.cil-spage-people .cil-spage-group[data-span="1"] { grid-column: span 1; }
.cil-spage-people .cil-spage-group[data-span="2"] { grid-column: span 2; }
.cil-spage-people .cil-spage-group[data-span="3"] { grid-column: span 3; }
.cil-spage-people .cil-spage-group[data-span="4"] { grid-column: 1 / -1; }
/* In the list, two cards to a row: a group of one shares its row, a larger one takes the row. */
.cil-spage-people.cil-ctl-grid--list .cil-spage-group:not([data-span="1"]) { grid-column: 1 / -1; }

/* ---- Searches to try ---- */
.cil-spage-similar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 24px; }
.cil-ctl-empty + .cil-spage-similar { margin-top: 24px; }
.cil-spage-similar__label { color: var(--cil-black-regular-7); font-size: 16px; font-weight: 700; }
.cil-spage-similar ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cil-spage-similar__pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px; border: 1px solid var(--cil-black-regular-5); border-radius: 20px;
    background: var(--cil-white); color: var(--cil-black); font-size: 16px;
    transition: border-color .2s ease;
}
.cil-spage-similar__pill img { display: block; }
/* Pointed at: the outline darkens and the chevron steps forward -- the words keep their colour. */
.cil-ctl .cil-spage-similar__pill:is(:hover, :focus-visible) { border-color: var(--cil-black); color: var(--cil-black); }
.cil-spage-similar__pill .cil-ctl-forward { transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.cil-spage-similar__pill:is(:hover, :focus-visible) .cil-ctl-forward { transform: translateX(-3px); }
.lang-to-css-ltr .cil-spage-similar__pill:is(:hover, :focus-visible) .cil-ctl-forward { transform: scaleX(-1) translateX(-3px); }

.cil-spage-end { margin: 24px 0 0; color: var(--cil-black-regular-7); font-size: 14px; text-align: center; }
.cil-spage-start { margin-bottom: 24px; }

.cil-spage-related .cil-ctl-catCards--row { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---- Narrower screens ---- */
@media (max-width: 1360px) {
    .cil-spage-people.cil-ctl-grid--grid .cil-spage-group:is([data-span="3"], [data-span="4"]) { grid-column: 1 / -1; }
}
@media (max-width: 1079px) {
    .cil-spage .cil-ctl-summary, .cil-spage .cil-ctl-chips { margin-bottom: 24px; }
    .cil-spage-head { min-height: 0; }
    .cil-spage-head__title { font-size: 24px; }
    .cil-spage-head__count { font-size: 12px; }
    .cil-spage-people.cil-ctl-grid--grid .cil-spage-group:not([data-span="1"]) { grid-column: 1 / -1; }
    .cil-spage-people + .cil-spage-group, .cil-spage-group + .cil-spage-people { margin-top: 28px; }
    .cil-spage-related .cil-ctl-catCards--row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .cil-spage-people { row-gap: 28px; }
    .cil-spage-people .cil-spage-group { grid-column: 1 / -1 !important; row-gap: 12px; }
    .cil-spage-group--courses { gap: 12px; }
    /* A phone's "all" view: three courses, the rest one tap away under "all of them". */
    .cil-spage-group--courses .cil-ctl-grid > :nth-child(n+4) { display: none; }
    .cil-spage-similar__pill { font-size: 14px; padding: 7px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .cil-spage-similar__pill, .cil-spage-similar__pill .cil-ctl-forward { transition: none; }
}
