: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;
  gap: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.springthorpe-resources-index__row {
  background: color-mix(in srgb, var(--springthorpe-color-soft) 68%, #ffffff);
  box-shadow: inset 0 0 0 1px var(--springthorpe-color-border);
  color: var(--springthorpe-color-heading);
  display: grid;
  gap: 0.45rem 1rem;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 12.6rem;
  padding: clamp(1rem, 1.6vw, 1.25rem);
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.springthorpe-resources-index__row--faq {
  grid-column: 2;
}

.springthorpe-resources-index__row:hover,
.springthorpe-resources-index__row:focus {
  background: #ffffff;
  transform: translateY(-0.16rem);
}

.springthorpe-resources-index__icon {
  align-items: center;
  background: var(--springthorpe-color-primary);
  color: #ffffff;
  display: inline-flex;
  font-size: 1.1rem;
  font-weight: 780;
  height: 3.7rem;
  justify-content: center;
  line-height: 1;
  width: 3.7rem;
}

.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 .springthorpe-resources-index__title {
  align-items: center;
  color: var(--springthorpe-color-heading);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  line-height: 1.2;
}

.springthorpe-resources-index__main .springthorpe-resources-index__access-pill {
  background: color-mix(in srgb, var(--springthorpe-color-accent) 18%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--springthorpe-color-accent) 62%, #ffffff);
  color: var(--springthorpe-color-heading);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 0.34rem 0.46rem;
  text-transform: uppercase;
}

/* Committee-only pill — gold palette to distinguish from owner (green) */
.springthorpe-resources-index__main .springthorpe-resources-index__access-pill--committee {
  background: color-mix(in srgb, var(--springthorpe-gold, #b58a2b) 14%, #ffffff);
  border-color: color-mix(in srgb, var(--springthorpe-gold, #b58a2b) 55%, #ffffff);
  color: #6b4e10;
}

.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: end;
  border-left: 2px solid color-mix(in srgb, var(--springthorpe-color-primary) 28%, transparent);
  color: var(--springthorpe-color-muted);
  font-size: 0.9rem;
  font-weight: 760;
  grid-column: 2;
  justify-items: start;
  margin-left: clamp(2rem, 16%, 5.5rem);
  margin-top: 0.45rem;
  padding-left: clamp(0.9rem, 1.8vw, 1.25rem);
}

.springthorpe-resources-index__meta .springthorpe-resources-index__meta-number {
  color: var(--springthorpe-color-primary);
  font-size: 1.04em;
  font-weight: 850;
  margin-right: 0.28rem;
}

.springthorpe-resources-index__meta .springthorpe-resources-index__meta-period {
  color: var(--springthorpe-color-text);
  font-weight: 780;
}

.springthorpe-resources-index__meta--faq {
  border-left-color: color-mix(in srgb, var(--springthorpe-color-accent) 34%, transparent);
}

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

.springthorpe-resources-spotlight {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--springthorpe-color-border);
  border-left: 5px solid var(--springthorpe-color-accent);
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: clamp(1rem, 2vw, 1.35rem);
}

.springthorpe-resources-spotlight__mark {
  align-items: center;
  background: color-mix(in srgb, var(--springthorpe-color-accent) 18%, #ffffff);
  color: var(--springthorpe-color-heading);
  display: inline-flex;
  font-size: 1.1rem;
  font-weight: 850;
  height: 3rem;
  justify-content: center;
  width: 3rem;
}

.springthorpe-resources-spotlight__body {
  display: grid;
  gap: 0.25rem;
}

.springthorpe-resources-spotlight__body h2,
.springthorpe-resources-spotlight__body p {
  margin: 0;
}

.springthorpe-resources-spotlight__body h2 {
  color: var(--springthorpe-color-heading);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.15;
}

.springthorpe-resources-spotlight__body p:last-child {
  color: var(--springthorpe-color-muted);
  line-height: 1.5;
}

.springthorpe-resources-spotlight__link {
  background: var(--springthorpe-color-primary);
  color: #ffffff;
  display: inline-flex;
  font-weight: 780;
  justify-content: center;
  line-height: 1;
  padding: 0.85rem 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.springthorpe-resources-spotlight__link:hover,
.springthorpe-resources-spotlight__link:focus {
  background: var(--springthorpe-color-heading);
  color: #ffffff;
}

.springthorpe-resources-index__feature-image {
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  overflow: hidden;
  width: 100%;
}

.springthorpe-resources-index__feature-image img {
  display: block;
  height: auto;
  width: 100%;
}

.springthorpe-faq-accordion {
  display: grid;
  gap: 0;
  margin-inline: auto;
  max-width: 58rem;
}

.springthorpe-faq-item {
  border-top: 1px solid var(--springthorpe-color-border);
}

.springthorpe-faq-item:last-child {
  border-bottom: 1px solid var(--springthorpe-color-border);
}

.springthorpe-faq-item summary {
  align-items: center;
  color: var(--springthorpe-color-heading);
  cursor: pointer;
  display: grid;
  font-weight: 760;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  line-height: 1.3;
  list-style: none;
  padding: 1rem 0;
}

.springthorpe-faq-item summary::-webkit-details-marker {
  display: none;
}

.springthorpe-faq-item summary::after {
  align-items: center;
  background: var(--springthorpe-color-primary);
  color: #ffffff;
  content: "+";
  display: inline-flex;
  font-size: 1.15rem;
  font-weight: 780;
  height: 1.9rem;
  justify-content: center;
  line-height: 1;
  width: 1.9rem;
}

.springthorpe-faq-item[open] summary::after {
  content: "-";
}

.springthorpe-faq-item summary:hover,
.springthorpe-faq-item summary:focus {
  color: var(--springthorpe-color-primary);
}

.springthorpe-faq-item summary:focus-visible {
  outline: 2px solid var(--springthorpe-color-primary);
  outline-offset: 0.25rem;
}

.springthorpe-faq-item > div {
  color: var(--springthorpe-color-muted);
  line-height: 1.6;
  max-width: 48rem;
  padding: 0 3.2rem 1.1rem 0;
}

.springthorpe-faq-item a {
  color: var(--springthorpe-color-heading);
  font-weight: 650;
  text-decoration-color: var(--springthorpe-color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.springthorpe-faq-item a:hover,
.springthorpe-faq-item a:focus {
  color: var(--springthorpe-color-primary);
}

.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-title {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  max-width: 100%;
}

/* External-link indicator — small arrow-in-box SVG icon beside download link. */
.springthorpe-resources-table__ext-icon {
  color: var(--springthorpe-color-muted);
  display: inline-flex;
  flex: 0 0 auto;
  line-height: 0;
  opacity: 0.65;
}

.springthorpe-resources-table__ext-icon svg {
  display: block;
}

.springthorpe-resources-table__edit-details {
  align-items: center;
  color: var(--springthorpe-color-primary) !important;
  display: inline-flex;
  flex: 0 0 auto;
  height: 1rem;
  justify-content: center;
  line-height: 1;
  text-decoration: none;
  vertical-align: -0.1em;
  width: 1rem;
}

.springthorpe-resources-table__edit-details:hover,
.springthorpe-resources-table__edit-details:focus {
  color: var(--springthorpe-color-heading) !important;
}

.springthorpe-resources-table__edit-details svg {
  display: block;
  fill: currentColor;
  height: 1rem;
  max-height: 1rem;
  max-width: 1rem;
  width: 1rem;
}

.springthorpe-resources-table__edit-details .springthorpe-screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.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-index__list {
    grid-template-columns: 1fr;
  }

  .springthorpe-resources-index__row--faq {
    grid-column: auto;
  }

  .springthorpe-resources-index__meta {
    border-left: 0;
    margin-left: 0;
    padding-left: 0;
  }

  .springthorpe-resources-spotlight {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .springthorpe-resources-spotlight__link {
    grid-column: 1 / -1;
    width: 100%;
  }

  .springthorpe-faq-accordion {
    max-width: none;
  }

  .springthorpe-faq-item summary {
    gap: 0.75rem;
  }

  .springthorpe-faq-item > div {
    padding-right: 0;
  }

  .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;
  }
}
