/* Compact link cards for top/category pages.
   Search, pagination, left navigation, and outer content boxes are intentionally untouched. */

:root {
  --compact-card-accent: #336ca6;
  --compact-card-panel: #ffffff;
  --compact-card-line: #dce5ef;
  --compact-card-text: #182536;
  --compact-card-muted: #5d6a7a;
}

.compact-card-section .row {
  row-gap: 14px;
}

.compact-card-section [class*="col-"] {
  display: flex;
}

.compact-link-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  width: 100%;
  min-height: 116px;
  padding: 12px;
  color: var(--compact-card-text);
  background: var(--compact-card-panel);
  border: 1px solid var(--compact-card-line);
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(31, 75, 117, 0.075);
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.compact-link-card:hover {
  color: var(--compact-card-text);
  background: #fbfdff;
  border-color: rgba(51, 108, 166, 0.34);
  box-shadow: 0 18px 32px rgba(31, 75, 117, 0.14);
  text-decoration: none;
  transform: translateY(-3px);
}

.compact-link-card:focus-within {
  outline: 3px solid rgba(51, 108, 166, 0.28);
  outline-offset: 3px;
}

.compact-link-card > a:first-child {
  display: block;
  text-decoration: none;
}

.compact-link-card > a:first-child::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 16px;
}

.compact-link-card > a:first-child:focus {
  outline: 0;
}

.compact-link-card .card-img-top {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid #e1e9f2;
  border-radius: 14px;
  background: #fff;
}

.compact-link-card .card-body {
  min-width: 0;
  padding: 0;
}

.compact-link-card .card-title {
  margin: 0 0 6px;
  padding: 0;
  color: var(--compact-card-text);
  border: 0;
  font-size: 0.98rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.compact-link-card .card-title::before {
  content: none;
}

.compact-link-card .card-text {
  margin: 0;
  padding-left: 0;
  color: var(--compact-card-muted);
  font-size: 0.9rem;
  line-height: 1.62;
}

@media (max-width: 900px) {
  .compact-link-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .compact-link-card .card-img-top {
    width: 58px;
    height: 58px;
  }
}
