/* UST Repository. Everything is scoped under .ustrepo so it does not touch the theme. */

.ustrepo {
  --ur-primary: #1a380d;
  --ur-accent: #c9a227;
  --ur-line: rgba(120, 120, 120, 0.3);
  --ur-soft: rgba(120, 120, 120, 0.08);
  --ur-muted: rgba(100, 100, 100, 0.95);
  max-width: 100%;
  box-sizing: border-box;
}
.ustrepo *, .ustrepo *::before, .ustrepo *::after { box-sizing: border-box; }

.ustrepo .ur-h {
  margin: 0 0 16px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ur-accent);
}
.ustrepo h3 { margin: 22px 0 8px; }
.ustrepo .ur-muted, .ustrepo .ur-meta { color: var(--ur-muted); }
.ustrepo .ur-meta { font-size: 0.9em; margin: 0 0 6px; }

/* Tiles */
.ustrepo .ur-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 0 0 26px;
}
.ustrepo .ur-tile {
  display: block;
  border: 2px solid var(--ur-primary);
  padding: 18px 12px;
  text-align: center;
  text-decoration: none;
  color: inherit;
}
.ustrepo .ur-tile:hover { background: var(--ur-accent); text-decoration: none; }
.ustrepo .ur-tile-count { display: block; font-size: 2.2em; font-weight: 700; line-height: 1.1; }
.ustrepo .ur-tile-label { font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.04em; }

/* Filters */
.ustrepo .ur-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin: 0 0 14px;
}
@media (max-width: 720px) {
  .ustrepo .ur-filters { grid-template-columns: 1fr; }
}
.ustrepo .ur-filters input,
.ustrepo .ur-filters select { min-width: 0; }

/* List */
.ustrepo .ur-item { border-bottom: 1px solid var(--ur-line); padding: 14px 0; }
.ustrepo .ur-item h3 { margin: 0 0 4px; }
.ustrepo .ur-item p { margin: 0 0 6px; }

.ustrepo .ur-pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0; }
.ustrepo .ur-pager a,
.ustrepo .ur-pager span { padding: 4px 11px; border: 1px solid var(--ur-line); text-decoration: none; }
.ustrepo .ur-pager .ur-current { background: var(--ur-primary); color: #fff; border-color: var(--ur-primary); }

/* Item page */
.ustrepo .ur-facts {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 6px 16px;
  margin: 16px 0;
}
.ustrepo .ur-facts dt { font-weight: 700; color: var(--ur-muted); margin: 0; }
.ustrepo .ur-facts dd { margin: 0; overflow-wrap: anywhere; }
.ustrepo .ur-access {
  background: var(--ur-soft);
  border: 1px solid var(--ur-line);
  border-left: 5px solid var(--ur-accent);
  padding: 16px 18px;
  margin: 24px 0;
}
.ustrepo .ur-access p { margin: 0 0 12px; }

/* Forms */
.ustrepo .ur-form label { display: block; font-weight: 700; margin: 18px 0 4px; }
.ustrepo .ur-hint { display: block; font-weight: 400; font-size: 0.86em; color: var(--ur-muted); }
.ustrepo .ur-form input[type="text"],
.ustrepo .ur-form input[type="email"],
.ustrepo .ur-form input[type="file"],
.ustrepo .ur-form select,
.ustrepo .ur-form textarea,
.ustrepo .ur-filters input[type="text"],
.ustrepo .ur-filters select {
  width: 100%;
  padding: 9px;
  border: 1px solid #8c9486;
  border-radius: 0;
  font: inherit;
  background: #fff;
  color: #1d2218;
}
.ustrepo .ur-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.ustrepo .ur-row > div { min-width: 0; }
.ustrepo .ur-form .ur-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
}
.ustrepo .ur-form .ur-check input { margin-top: 5px; flex: none; }
.ustrepo .ur-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.ustrepo .ur-btn {
  display: inline-block;
  background: var(--ur-primary);
  color: #fff;
  border: 0;
  border-bottom: 3px solid var(--ur-accent);
  border-radius: 0;
  padding: 10px 22px;
  font: inherit;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}
.ustrepo .ur-btn:hover { color: #fff; text-decoration: none; filter: brightness(1.15); }

/* Notices */
.ustrepo .ur-notice { padding: 12px 16px; border-left: 5px solid; margin: 14px 0; }
.ustrepo .ur-notice p { margin: 0 0 4px; }
.ustrepo .ur-notice p:last-child { margin-bottom: 0; }
.ustrepo .ur-error { border-color: #a33; background: #fbeeee; color: #5a1a1a; }
.ustrepo .ur-ok { border-color: #4f7f33; background: #eef5e9; color: #1d2d14; }

@media (max-width: 640px) {
  .ustrepo .ur-facts { grid-template-columns: 1fr; gap: 2px; }
  .ustrepo .ur-facts dd { margin-bottom: 10px; }
}

/* Suggested citation */
.ustrepo .ur-cite { margin: 24px 0; }
.ustrepo .ur-cite h3 { margin: 0 0 8px; }
.ustrepo .ur-cite-row { border: 1px solid var(--ur-line); padding: 10px 14px; margin: 0 0 10px; }
.ustrepo .ur-cite-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.ustrepo .ur-cite-text { margin: 0; overflow-wrap: anywhere; padding-left: 2em; text-indent: -2em; }
.ustrepo .ur-copy {
  font: inherit; font-size: 0.85em; cursor: pointer;
  background: transparent; color: var(--ur-primary);
  border: 1px solid var(--ur-primary); padding: 3px 12px;
}
.ustrepo .ur-copy:hover { background: var(--ur-primary); color: #fff; }
