
.ec { --ec-pad: 16px; position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font-size: 15px; line-height: 1.45; min-width: 0; }
.ec-list { display: grid; gap: 12px; }
.ec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.ec-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
/* the lists are size containers: a row card follows the width of its column (next to filters or a banner), not the viewport */
.ec-list, .ec-grid, .ec-minis { container-type: inline-size; }

/* stretched link: the <a> is only on the title, ::after covers the card; buttons sit above it */
.ec-link { color: var(--ink); }
.ec-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.ec-link:focus-visible { outline: none; }
.ec--link { transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s, border-color .2s; }
.ec--link:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -24px rgba(20,20,40,.45); border-color: transparent; }
.ec--link:hover .ec-link { color: var(--accent); }
.ec:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.ec-media { grid-area: media; }
.ec-logo { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.ec-mono { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); border-color: transparent; font: 600 19px/1 var(--sans); letter-spacing: .02em; }
.ec-body { grid-area: head; min-width: 0; }
.ec-kicker { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ec-badge { font-size: 12px; font-weight: 600; color: var(--accent-dark); }
.ec-badge--featured::before, .ec-badge--mentor::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-right: 6px; vertical-align: 1px; }
.ec-badge--mentor::before { background: var(--accent); }
.ec-badge--closed { color: var(--muted); }
.ec-title { font: 600 17px/1.3 var(--sans); color: var(--ink); letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; }
/* title rule v3 (19.10): one line clamped on a word, not an ellipsis in the middle of a word; no hyphens (they gave «универ-ситет») */
.ec-sub { color: var(--muted); font-size: 14px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; }
/* the subtitle link (university of a programme) sits above the stretched title link */
.ec-sub-link { position: relative; z-index: 2; color: inherit; text-decoration: underline; text-decoration-color: rgba(120,124,140,.4); text-underline-offset: 3px; }
.ec-sub-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.ec-sub-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ec-facts { grid-area: facts; list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; color: var(--muted); font-size: 14px; min-width: 0; }
.ec-facts li { max-width: 100%; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ec-facts li + li::before { content: "·"; margin: 0 8px; color: #b4b8c2; }
.ec-facts b { font-weight: 600; color: var(--ink); }
.ec-desc { grid-area: facts; margin-top: 8px; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ec-aside { grid-area: aside; display: flex; flex-direction: column; gap: 6px; text-align: right; min-width: 0; }
.ec-price b { display: block; font: 600 17px/1.25 var(--sans); color: var(--ink); white-space: nowrap; }
.ec-price span { display: block; font-size: 13px; color: var(--muted); }
.ec-dl { font-size: 14px; color: var(--text); }
.ec-dl time { display: block; font-weight: 600; }
.ec-dl span { display: block; font-size: 13px; color: var(--muted); }
.ec-dl--urgent, .ec-dl--urgent span { color: var(--accent); }
.ec-dl--urgent span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.ec--closed .ec-body > :not(.ec-kicker), .ec--closed .ec-facts, .ec--closed .ec-desc, .ec--closed .ec-aside, .ec--closed .ec-media { opacity: .7; }

/* heart and share: real buttons, above the stretched link */
.ec-actions { grid-area: actions; position: relative; z-index: 2; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ec-act { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, transform .15s; }
.ec-act:hover { background: var(--accent-soft); color: var(--accent-dark); }
/* the heart is the main action of a card (Vlad 18.10: «не вижу сердечка»): own red colour (5.6:1 on white), a bigger and
   bolder icon; just the heart, no chip around it (Vlad 18.10 23:11: the ring took too much attention). Hover fills it light,
   chosen fills it bright red. Same look in a3-fav, cs-heart, cc-heart, in-fav, sf-heart */
.ec, .ec-fav { --ec-heart: #c8262f; --ec-heart-on: #e3242f; --ec-heart-soft: #fde4e6; }
.ec-fav { color: var(--ec-heart); }
.ec-fav svg { width: 24px; height: 24px; transition: transform .15s; }
.ec-fav svg path { stroke-width: 2.1; transition: fill .15s; }
.ec-fav:hover { background: transparent; color: var(--ec-heart); --ec-heart-fill: var(--ec-heart-soft); }
.ec-fav:hover svg { transform: scale(1.08); }
.ec-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ec-act:active { transform: scale(.92); }
.ec-fav[aria-pressed="true"], .ec-fav[aria-pressed="true"]:hover { color: var(--ec-heart-on); background: transparent; --ec-heart-fill: var(--ec-heart-on); }
.ec-fav.is-pop svg { animation: ec-pop .35s cubic-bezier(.2,.7,.2,1.4); }
/* IA 19.10 wave 2 (№10, №127): heart + share of a full card (v3.partials.page-actions) */
.ec-page-acts { flex: none; display: flex; gap: 4px; align-items: center; }
.ec-page-acts--end { margin-left: auto; }
@keyframes ec-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.ec-foot { grid-area: foot; position: relative; z-index: 2; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.ec-foot .btn { min-height: 44px; padding: 10px 18px; font-size: 14px; }

/* row: plain line in search and lists */
.ec--row { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, max-content) 44px; grid-template-areas: "media head aside actions" "media facts aside actions" "media foot foot foot"; column-gap: 20px; padding: var(--ec-pad) 12px var(--ec-pad) 20px; align-items: start; }
.ec--row.ec--no-aside { grid-template-columns: 56px minmax(0, 1fr) 44px; grid-template-areas: "media head actions" "media facts actions" "media foot foot"; }
.ec--row .ec-aside { padding-top: 2px; max-width: 220px; }
.ec--row .ec-actions { margin-top: -6px; }

/* tile: hub collections, 3-4 in a row */
.ec--tile { display: flex; flex-direction: column; overflow: hidden; }
.ec--tile .ec-media { padding: 18px 18px 0; }
.ec--tile.ec--image .ec-media { padding: 0; aspect-ratio: 16 / 9; background: var(--paper); overflow: hidden; }
.ec--tile .ec-img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.ec--tile.ec--link:hover .ec-img { transform: scale(1.04); }
.ec--tile .ec-body { padding: 14px 18px 0; }
.ec--tile .ec-title { -webkit-line-clamp: 3; }
.ec--tile .ec-facts, .ec--tile .ec-desc { padding: 0 18px; }
.ec--tile .ec-facts, .ec--mini .ec-facts { gap: 2px 14px; }
.ec--tile .ec-facts li + li::before, .ec--mini .ec-facts li + li::before { content: none; }
.ec--tile .ec-aside { flex-direction: row; justify-content: space-between; align-items: flex-end; text-align: left; margin: auto 18px 0; padding: 14px 0 16px; border-top: 1px solid var(--line); margin-top: 14px; }
.ec--tile .ec-aside .ec-dl { text-align: right; }
.ec--tile.ec--no-aside { padding-bottom: 16px; }
.ec--tile .ec-actions { position: absolute; top: 10px; right: 10px; flex-direction: row; }
.ec--tile.ec--image .ec-act { background: rgba(255,255,255,.92); color: var(--ink); box-shadow: 0 4px 14px -8px rgba(20,20,40,.5); }
/* heart on a photo: white outline with a shadow, white fill on hover, red when chosen */
.ec--tile.ec--image .ec-fav { background: transparent; box-shadow: none; color: #fff; filter: drop-shadow(0 1px 3px rgba(10,10,30,.55)); --ec-heart-soft: #fff; }
.ec--tile.ec--image .ec-fav:hover { background: transparent; color: #fff; }
.ec--tile.ec--image .ec-fav[aria-pressed="true"] { background: transparent; color: var(--ec-heart-on); }
.ec--tile .ec-foot { padding: 0 18px 16px; }

/* mini: similar items and favourites */
.ec--mini { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "media head actions" "media facts actions"; column-gap: 14px; padding: 12px 8px 12px 14px; align-items: center; }
.ec--mini { transition: background-color var(--dur-2, .2s), box-shadow var(--dur-2, .2s); border-radius: var(--r-s, 10px); }
.ec--mini:hover { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ec--mini .ec-logo { width: 40px; height: 40px; border-radius: 10px; }
.ec--mini .ec-mono { font-size: 15px; }
.ec--mini .ec-title { font-size: 15px; -webkit-line-clamp: 2; } /* v3 IA 0.1: 2 lines, the full name in title (1 line cut «Морской...») */
.ec--mini .ec-facts { margin-top: 2px; font-size: 13px; }
.ec--mini .ec-actions { flex-direction: row; }

/* toast and share menu of the stubs (v3.partials.entity-actions-js) */
.ec-toast { position: fixed; left: 50%; bottom: 24px; z-index: 10001; transform: translate(-50%, 16px); opacity: 0; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 12px 14px 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 15px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.5); transition: opacity .2s, transform .25s cubic-bezier(.2,.7,.2,1); pointer-events: none; }
.ec-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ec-toast a { color: var(--lime); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; padding: 0 6px; }
.ec-menu { position: absolute; z-index: 130; min-width: 220px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 22px 40px -22px rgba(20,20,40,.45); }
.ec-menu button, .ec-menu a { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 15px var(--sans); text-align: left; cursor: pointer; }
.ec-menu button:hover, .ec-menu a:hover { background: var(--accent-soft); color: var(--accent-dark); }

@media (max-width: 760px) {
  .ec--row { grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-areas: "media head actions" "facts facts facts" "aside aside aside" "foot foot foot"; column-gap: 12px; padding: 14px 6px 14px 14px; }
  .ec--row.ec--no-aside { grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-areas: "media head actions" "facts facts facts" "foot foot foot"; }
  .ec--row .ec-logo { width: 44px; height: 44px; border-radius: 10px; }
  .ec--row .ec-mono { font-size: 16px; }
  .ec--row .ec-title { -webkit-line-clamp: 3; }
  .ec--row .ec-facts, .ec--row .ec-desc { padding-right: 8px; }
  .ec--row .ec-aside { flex-direction: row; justify-content: space-between; align-items: flex-end; text-align: left; max-width: none; margin-top: 10px; padding: 10px 8px 0 0; border-top: 1px solid var(--line); }
  .ec--row .ec-aside .ec-dl { text-align: right; }
  .ec--row .ec-actions { flex-direction: column; margin-top: -8px; }
  .ec-facts { gap: 2px 14px; }
  .ec-facts li + li::before { content: none; }
  .ec-grid { grid-template-columns: 1fr; gap: 14px; }
  .ec-minis { grid-template-columns: 1fr; }
  .ec-toast { bottom: 88px; }
}
/* row in a narrow column (2/3 of a tablet, a sidebar layout): the aside moves under the facts */
@container (max-width: 640px) {
  .ec--row { grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-areas: "media head actions" "facts facts facts" "aside aside aside" "foot foot foot"; column-gap: 12px; padding: 14px 6px 14px 14px; }
  .ec--row.ec--no-aside { grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-areas: "media head actions" "facts facts facts" "foot foot foot"; }
  .ec--row .ec-logo { width: 44px; height: 44px; border-radius: 10px; }
  .ec--row .ec-mono { font-size: 16px; }
  .ec--row .ec-title { -webkit-line-clamp: 3; }
  .ec--row .ec-facts, .ec--row .ec-desc { padding-right: 8px; gap: 2px 14px; }
  .ec--row .ec-facts li + li::before { content: none; }
  .ec--row .ec-aside { flex-direction: row; justify-content: space-between; align-items: flex-end; text-align: left; max-width: none; margin-top: 10px; padding: 10px 8px 0 0; border-top: 1px solid var(--line); }
  .ec--row .ec-aside .ec-dl { text-align: right; }
  .ec--row .ec-actions { flex-direction: column; margin-top: -8px; }
}
/* medium column (about 2/3 of a desktop row): the aside keeps its place but gets narrower */
@container (min-width: 641px) and (max-width: 820px) {
  .ec--row { column-gap: 14px; }
  .ec--row .ec-aside { max-width: 160px; }
  .ec--row .ec-price b { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .ec--link:hover, .ec--tile.ec--link:hover .ec-img { transform: none; }
}
