:root {
  --springthorpe-color-heading: var(--wp--preset--color--springthorpe-charcoal, #22201d);
  --springthorpe-color-text: var(--wp--preset--color--springthorpe-ink, #2d2a25);
  --springthorpe-color-muted: var(--wp--preset--color--springthorpe-muted, #625b52);
  --springthorpe-color-surface: #ffffff;
  --springthorpe-color-soft: var(--wp--preset--color--springthorpe-mist, #eef3ee);
  --springthorpe-color-primary: var(--wp--preset--color--springthorpe-green, #4f6f52);
  --springthorpe-color-accent: var(--wp--preset--color--springthorpe-gold, #b58a2b);
  --springthorpe-color-border: rgba(34, 32, 29, 0.13);
  --springthorpe-shell-max: var(--wp--style--global--wide-size, 1120px);
}

.springthorpe-resources-library {
  display: grid;
  gap: 1.5rem;
  max-width: var(--springthorpe-shell-max);
  min-width: 0;
  width: 100%;
}

.springthorpe-resources-library *,
.springthorpe-resources-library *::before,
.springthorpe-resources-library *::after {
  box-sizing: border-box;
}

.springthorpe-resources-index__header,
.springthorpe-resources-library__header {
  align-items: end;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.springthorpe-resources-index__header h2,
.springthorpe-resources-library__header h1,
.springthorpe-resources-library__header h2,
.springthorpe-resources-library__theme-title {
  color: var(--springthorpe-color-heading);
  font-size: clamp(1.8rem, 3.8vw, 3.2rem);
  line-height: 1.04;
  margin: 0;
}

.springthorpe-resources-library__eyebrow {
  color: var(--springthorpe-color-primary);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

.springthorpe-resources-index__header p:last-child,
.springthorpe-resources-library__title p:last-child,
.springthorpe-resources-library__summary,
.springthorpe-resources-library__empty {
  color: var(--springthorpe-color-muted);
  line-height: 1.55;
  margin: 0;
}

.springthorpe-resources-index__list {
  border-bottom: 1px solid var(--springthorpe-color-border);
  display: grid;
}

.springthorpe-resources-index__row {
  border-top: 1px solid var(--springthorpe-color-border);
  color: var(--springthorpe-color-heading);
  display: grid;
  gap: 0.35rem 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-block: 1rem;
  text-decoration: none;
}

.springthorpe-resources-index__main,
.springthorpe-resources-index__meta {
  display: grid;
  gap: 0.25rem;
}

.springthorpe-resources-index__main strong {
  color: var(--springthorpe-color-heading);
  font-size: 1.08rem;
}

.springthorpe-resources-index__main span,
.springthorpe-resources-index__meta span {
  color: var(--springthorpe-color-muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.springthorpe-resources-index__meta {
  align-self: center;
  color: var(--springthorpe-color-primary);
  font-size: 0.9rem;
  font-weight: 760;
  justify-items: end;
}

.springthorpe-resources-index__row:hover strong,
.springthorpe-resources-index__row:focus strong {
  color: var(--springthorpe-color-primary);
  text-decoration: underline;
}

.springthorpe-resources-library__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.springthorpe-resources-library__switcher,
.springthorpe-resources-theme-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.springthorpe-resources-theme-nav {
  border-block: 1px solid var(--springthorpe-color-border);
  padding-block: 0.75rem;
}

.springthorpe-resources-library__switcher a,
.springthorpe-resources-theme-nav a {
  border: 1px solid var(--springthorpe-color-border);
  border-radius: 4px;
  color: var(--springthorpe-color-text);
  font-size: 0.92rem;
  font-weight: 650;
  padding: 0.45rem 0.65rem;
  text-decoration: none;
}

.springthorpe-resources-library__switcher a.is-active,
.springthorpe-resources-theme-nav a.is-active,
.springthorpe-resources-library__switcher a:hover,
.springthorpe-resources-theme-nav a:hover,
.springthorpe-resources-library__switcher a:focus,
.springthorpe-resources-theme-nav a:focus {
  background: var(--springthorpe-color-soft);
  border-color: var(--springthorpe-color-primary);
  color: var(--springthorpe-color-primary);
}

.springthorpe-resources-admin-primary,
.springthorpe-resources-filter button {
  background: var(--springthorpe-color-heading);
  border: 0;
  border-radius: 4px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 0.7rem 0.9rem;
  text-decoration: none;
}

.springthorpe-resources-admin-primary:hover,
.springthorpe-resources-admin-primary:focus,
.springthorpe-resources-filter button:hover,
.springthorpe-resources-filter button:focus {
  background: var(--springthorpe-color-primary);
  color: #ffffff;
  text-decoration: none;
}

.springthorpe-resources-filter {
  align-items: end;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(13rem, 1.1fr) repeat(2, minmax(9rem, 0.7fr)) auto;
}

.springthorpe-resources-filter label {
  color: var(--springthorpe-color-heading);
  display: grid;
  font-weight: 650;
  gap: 0.35rem;
}

.springthorpe-resources-filter label span {
  color: var(--springthorpe-color-muted);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.springthorpe-resources-filter select,
.springthorpe-resources-filter input {
  border: 1px solid var(--springthorpe-color-border);
  border-radius: 4px;
  box-sizing: border-box;
  font: inherit;
  min-height: 2.6rem;
  padding: 0.55rem 0.65rem;
  width: 100%;
}

.springthorpe-resources-library__subsection {
  border-top: 1px solid var(--springthorpe-color-border);
  padding-top: 1.25rem;
}

.springthorpe-resources-library__subsection-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  justify-content: space-between;
}

.springthorpe-resources-library__subsection-head h3,
.springthorpe-resources-library__subsection h3 {
  color: var(--springthorpe-color-heading);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  margin: 0;
}

.springthorpe-resources-library__upload-link {
  color: var(--springthorpe-color-primary);
  font-weight: 700;
}

.springthorpe-resources-table {
  display: grid;
  margin-top: 0.75rem;
  min-width: 0;
}

.springthorpe-resources-table__head,
.springthorpe-resources-table__row {
  align-items: start;
  border-top: 1px solid var(--springthorpe-color-border);
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(15rem, 1.4fr) minmax(7rem, 0.55fr) minmax(12rem, 1fr) minmax(6rem, 0.4fr);
  padding-block: 0.85rem;
}

.springthorpe-resources-table:not(.has-admin-actions) .springthorpe-resources-table__head,
.springthorpe-resources-table:not(.has-admin-actions) .springthorpe-resources-table__row {
  grid-template-columns: minmax(15rem, 1.4fr) minmax(7rem, 0.55fr) minmax(12rem, 1fr);
}

.springthorpe-resources-table__head {
  color: var(--springthorpe-color-muted);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.springthorpe-resources-table__file a {
  color: var(--springthorpe-color-heading);
  font-weight: 760;
}

.springthorpe-resources-table__file span,
.springthorpe-resources-table__date,
.springthorpe-resources-table__description {
  color: var(--springthorpe-color-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.springthorpe-resources-table__admin a {
  color: var(--springthorpe-color-primary);
  font-size: 0.9rem;
  font-weight: 700;
}

.springthorpe-resources-table__admin {
  align-items: start;
  display: grid !important;
  gap: 0.35rem !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: start;
  min-width: 0;
}

.springthorpe-resources-table__archive {
  max-width: 100%;
  white-space: nowrap;
}

.springthorpe-resources-table__head > *,
.springthorpe-resources-table__row > * {
  min-width: 0;
}

@media (max-width: 860px) {
  .springthorpe-resources-index__header,
  .springthorpe-resources-library__header,
  .springthorpe-resources-filter {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .springthorpe-resources-library__actions {
    justify-content: flex-start;
  }

  .springthorpe-resources-table__head {
    display: none;
  }

  .springthorpe-resources-table__row,
  .springthorpe-resources-table.has-admin-actions .springthorpe-resources-table__row,
  .springthorpe-resources-table:not(.has-admin-actions) .springthorpe-resources-table__row {
    grid-template-columns: 1fr;
  }

  .springthorpe-resources-table__date::before {
    content: "Date: ";
    font-weight: 700;
  }
}
