/* Downloads (/facilities/downloads): one card per document. URLs and the Admin/HOD Delete condition are unchanged.
   Prefix dl-. The entrance is CSS only and ends visible, so nothing depends on script. */
.dl-page {
  --dl-navy: var(--kc-navy, #0d2847);
  --dl-blue: var(--kc-blue, #285690);
  --dl-blue-dark: var(--kc-blue-dark, #1e4475);
  --dl-gold: var(--kc-gold, #e0a526);
  --dl-ink: var(--kc-ink, #1b2a3d);
  --dl-muted: var(--kc-muted, #5d6b80);
  --dl-line: var(--kc-line, #e3e8f0);
  --dl-tint: var(--kc-chip-notice-bg, #e1ecfa);
  --dl-tint-ink: var(--kc-chip-notice-ink, #1d4f91);
  --dl-danger: var(--kc-danger, #b42318);
  --dl-danger-deep: var(--kc-danger-deep, #8f1c13);
  --dl-ease: var(--kc-ease, cubic-bezier(.2, .7, .2, 1));
  box-sizing: border-box;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  color: var(--dl-ink);
  font-family: Inter, 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.dl-page *, .dl-page *::before, .dl-page *::after { box-sizing: border-box; }
.dl-page ::selection { background: var(--dl-gold); color: var(--dl-navy); }

.dl-page h2.dl-title { margin: 0; color: var(--dl-navy); font-family: Lora, Georgia, 'Times New Roman', serif; font-size: clamp(24px, 2vw, 30px); font-weight: 600; line-height: 1.2; }
.dl-count { margin: 4px 0 24px; color: var(--dl-muted); font-variant-numeric: tabular-nums; }

.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px 24px; margin: 0; padding: 0; list-style: none; }
.dl-card {
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; min-height: 96px; margin: 0; padding: 18px 20px; overflow: hidden;
  border: 1px solid var(--dl-line); border-radius: 14px; background: #fff; box-shadow: 0 10px 28px rgba(13, 40, 71, .08);
  transition: transform .3s var(--dl-ease), box-shadow .3s var(--dl-ease);
  animation: dl-rise .6s var(--dl-ease) backwards; animation-delay: calc(var(--dl-i, 0) * 60ms + 60ms);
}
.dl-card:nth-child(2) { --dl-i: 1; } .dl-card:nth-child(3) { --dl-i: 2; } .dl-card:nth-child(4) { --dl-i: 3; }
.dl-card:nth-child(5) { --dl-i: 4; } .dl-card:nth-child(n+6) { --dl-i: 5; }
/* the system's hover mark, drawn from the left along the foot of the card */
.dl-card::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--dl-gold); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--dl-ease); }
@keyframes dl-rise { from { opacity: 0; transform: translateY(14px); } }

.dl-icon { display: grid; width: 56px; height: 56px; place-items: center; border-radius: 10px; background: var(--dl-tint); color: var(--dl-tint-ink); transition: background-color .25s var(--dl-ease), color .25s var(--dl-ease); }
.dl-icon svg { width: 26px; height: 26px; }
.dl-info { min-width: 0; }
.dl-page h3.dl-name { margin: 0; color: var(--dl-navy); font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.dl-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dl-meta:empty { display: none; }
.dl-chip { padding: 1px 7px; border-radius: 4px; background: var(--kc-soft, #f3f6fb); color: var(--dl-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; text-transform: uppercase; }

.dl-actions { display: flex; align-items: center; gap: 10px; }
.dl-page a.dl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 999px;
  background: var(--dl-blue); color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: background-color .2s var(--dl-ease);
}
.dl-btn i { transition: transform .3s var(--dl-ease); }
/* the whole card opens the document; Delete sits above this layer */
.dl-btn::before { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.dl-page a.dl-del {
  position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--dl-danger); color: #fff; font-size: 11.5px; font-weight: 600; text-decoration: none; transition: background-color .2s var(--dl-ease);
}
.dl-page a.dl-del:hover { background: var(--dl-danger-deep); }
.dl-page a:focus-visible { outline: 2px solid var(--dl-gold); outline-offset: 2px; }
.dl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dl-empty { padding: 32px; border: 1px solid var(--dl-line); border-radius: 14px; background: #fff; color: var(--dl-muted); text-align: center; }

@media (hover: hover) {
  .dl-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(13, 40, 71, .14); }
  .dl-card:hover::after { transform: scaleX(1); }
  .dl-card:hover .dl-icon { background: var(--dl-blue); color: #fff; }
  .dl-card:hover .dl-btn { background: var(--dl-blue-dark); }
  .dl-card:hover .dl-btn i { transform: translateY(2px); }
}
@media (max-width: 767.98px) {
  .dl-page { padding: 24px 16px 40px; }
}
@media (max-width: 479.98px) {
  .dl-card { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .dl-icon { width: 44px; height: 44px; }
  .dl-icon svg { width: 22px; height: 22px; }
  .dl-actions { grid-column: 1 / -1; justify-content: space-between; }
  .dl-page a.dl-btn { flex: 1 1 auto; min-height: 44px; }
  .dl-page a.dl-del { min-height: 44px; padding: 0 14px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .dl-card { animation: none; transition-property: box-shadow; }
  .dl-card::after, .dl-btn i { transition: none; }
  .dl-card:hover, .dl-card:hover .dl-btn i { transform: none; }
}
