/* Compact ranking card (js/ranking-card.js), shared by ranking-experts.html and
   ranking-students.html. Matte and flat: the glow exception of 2026-10-04
   covers the hero background only. */

.rk-grid.rkc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

/* Five rows — name, role, tags, chart, foot. With subgrid they are rows of the
   whole grid, so every part lines up across the cards of a row whatever the
   text length (a two-line name moves the role of its neighbours too), and an
   unused tags row collapses for the whole row. */
.rkc {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; color: #505050;
  font-family: 'Inter', Arial, sans-serif; text-align: left;
  transition: border-color .2s, box-shadow .2s;
}
@supports (grid-template-rows: subgrid) {
  .rkc { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; }
  /* Name and role become rows of their own; the photo is taken out of the flow
     so it does not size them. The role reserves the rest of the photo's height. */
  .rkc .rkc-head, .rkc .rkc-id { display: contents; } /* .rkc prefix: must beat the fallback .rkc-head rule below */
  .rkc .rkc-photo { position: absolute; top: 20px; left: 20px; }
  .rkc .rkc-name { grid-row: 1; align-self: start; margin: 20px 20px 6px 124px; }
  .rkc .rkc-role { grid-row: 2; align-self: start; margin: 0 20px 0 124px; min-height: 59px; }
  .rkc-tags { grid-row: 3; }
  .rkc-chart { grid-row: 4; }
  .rkc-foot { grid-row: 5; }
}
.rkc:hover { border-color: #C0A582; box-shadow: 0 8px 24px rgba(54,17,99,.1); }
.rkc--top1 { border-color: #C0A582; }

/* ── Head: photo left, name and role right ── */
.rkc-head { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; align-items: start; padding: 20px 20px 0; }
.rkc-photo { position: relative; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; background: #ebebeb; }
.rkc-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.rkc-initials { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #361163; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.rkc-rank { position: absolute; top: 0; left: 0; min-width: 30px; padding: 4px 7px; border-radius: 8px 0 8px 0; background: #361163; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; }
.rkc-rank--top { background: #C0A582; color: #361163; }
.rkc-name { margin: 0 0 6px; color: #361163; font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.rkc-link { color: inherit; text-decoration: none; }
/* Stretched link: the whole card opens the profile. */
.rkc-link::after { content: ''; position: absolute; inset: 0; z-index: 0; border-radius: 8px; }
.rkc-link:focus-visible { outline: none; }
.rkc-link:focus-visible::after { outline: 3px solid #C0A582; outline-offset: 3px; }
.rkc-role { margin: 0; color: #505050; font-size: 14px; line-height: 1.4;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* ── Tags: one line; a tag that does not fit wraps out of the fixed height and is hidden whole ── */
.rkc-tags { padding: 14px 20px 0; }
.rkc-tags:empty { padding: 0; }
.rkc-tags-row { display: flex; flex-wrap: wrap; gap: 6px; height: 28px; overflow: hidden; }
.rkc-tag { flex: none; display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid #d9d2e3; border-radius: 6px; color: #361163; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; }
.rkc-tag--accent { border-color: #C0A582; background: #f6f1ea; }
/* A profile that illustrates the ranking rather than describes a real person. */
.rkc-tag--sample { border-style: dashed; border-color: #505050; background: #ebebeb; color: #505050; }

/* ── Chart: ring left, explanation right ── */
.rkc-chart { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 18px; padding: 18px 20px; border-top: 1px solid #ebebeb; }
/* Above the stretched link, so a tap on a segment never navigates. */
.rkc-donut { position: relative; z-index: 1; width: 148px; height: 148px; }
.rkc-donut svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.rkc-donut circle { fill: none; }
.rkc-seg-track { stroke: #e7e2ee; stroke-width: 16; transition: stroke .2s, stroke-width .2s; }
.rkc-seg-fill { stroke: #361163; stroke-width: 16; transition: stroke-dasharray .9s cubic-bezier(.22,.8,.3,1), stroke .2s, stroke-width .2s; }
.rkc-seg-hit { stroke: transparent; stroke-width: 34; pointer-events: stroke; cursor: pointer; }
/* Each fill carries its own brand colour inline (COLORS in js/ranking-card.js); the active segment only grows. */
.rkc-seg.is-active .rkc-seg-track { stroke: #d6cfe0; stroke-width: 22; }
.rkc-seg.is-active .rkc-seg-fill { stroke-width: 22; }
.rkc-dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; }
.rkc-total { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.rkc-total b { color: #361163; font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rkc-total span { margin-top: 2px; color: #505050; font-size: 12px; line-height: 1.3; }

.rkc-info { min-width: 0; height: 148px; display: flex; flex-direction: column; justify-content: center; }
.rkc-info p { margin: 0; }
.rkc-info .rkc-info-eyebrow { margin-bottom: 6px; color: #361163; font-size: 12px; font-weight: 700; line-height: 1.35; letter-spacing: .06em; text-transform: uppercase; }
.rkc-info-text { color: #505050; font-size: 13px; line-height: 1.45; }
.rkc-info-text b { color: #361163; }
.rkc-info .rkc-info-hint { margin-top: 8px; color: #505050; font-size: 12px; line-height: 1.4; }
.rkc-info .rkc-info-value { margin-bottom: 6px; color: #505050; font-size: 13px; line-height: 1.2; }
.rkc-info-value b { color: #361163; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rkc-hint-touch { display: none; }
@media (hover: none) {
  .rkc-hint-hover { display: none; }
  .rkc-hint-touch { display: inline; }
}

/* ── Foot ── */
.rkc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 14px 20px; border-top: 1px solid #ebebeb; color: #361163; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.rkc-foot svg { width: 18px; height: 18px; flex: none; transition: transform .2s; }
.rkc:hover .rkc-foot svg { transform: translateX(3px); }

.rk-grid.rkc-grid .rk-skel-card { height: 400px; }

/* ── Responsive ── */
@media (max-width: 1199px) and (min-width: 1025px) {
  .rkc-head { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
  .rkc-photo { width: 72px; height: 72px; }
  .rkc-chart { grid-template-columns: 124px minmax(0, 1fr); gap: 14px; }
  .rkc-donut { width: 124px; height: 124px; }
  .rkc-info { height: 124px; }
  .rkc-total b { font-size: 26px; }
  @supports (grid-template-rows: subgrid) {
    .rkc .rkc-name { margin-left: 106px; }
    .rkc .rkc-role { margin-left: 106px; min-height: 43px; }
  }
}
@media (max-width: 1024px) {
  .rk-grid.rkc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* One per row on phones: the ring and its explanation need the full width. */
@media (max-width: 767px) {
  .rk-grid.rkc-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 389px) {
  .rkc-head { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 16px 16px 0; }
  .rkc-photo { width: 72px; height: 72px; }
  .rkc-tags { padding: 12px 16px 0; }
  .rkc-chart { grid-template-columns: 124px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .rkc-donut { width: 124px; height: 124px; }
  .rkc-info { height: 124px; }
  .rkc-total b { font-size: 26px; }
  .rkc-foot { padding: 14px 16px; }
  @supports (grid-template-rows: subgrid) {
    .rkc .rkc-photo { top: 16px; left: 16px; }
    .rkc .rkc-name { margin: 16px 16px 6px 102px; }
    .rkc .rkc-role { margin: 0 16px 0 102px; min-height: 43px; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .rkc, .rkc-seg-track, .rkc-seg-fill, .rkc-foot svg { transition: none; }
}
