.gw-masthead {
  padding: 8.5rem 0 3.7rem;
  border-bottom: 4px solid var(--gold);
  background: #18232a;
  color: var(--white);
}

.gw-masthead__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 13rem;
  gap: 4rem;
  align-items: end;
}

.gw-kicker {
  margin: 0 0 0.8rem;
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gw-masthead h1 {
  max-width: 43rem;
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 400;
  line-height: 0.98;
}

.gw-lead {
  max-width: 45rem;
  margin: 1.25rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.96rem;
  line-height: 1.7;
}

.gw-source {
  display: grid;
  gap: 0.25rem;
  padding: 1.2rem 0 0 1.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
}

.gw-source span,
.gw-source small {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.gw-source strong {
  color: var(--white);
  font-family: "DM Serif Display", serif;
  font-size: 1.6rem;
  font-weight: 400;
}

.gw-workspace {
  padding: 3.5rem 0 5rem;
  background: var(--white);
}

.gw-controls {
  display: grid;
  grid-template-columns: minmax(20rem, 1fr) minmax(22rem, 0.9fr);
  gap: 3rem;
  align-items: end;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--gray-200);
}

.gw-search label {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--text-dark);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gw-search__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
}

.gw-search input {
  min-width: 0;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  color: var(--text-dark);
  font: inherit;
}

.gw-search input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(45, 92, 229, 0.16);
}

.gw-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.gw-focus button,
.gw-refresh {
  min-height: 2.35rem;
  padding: 0.48rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-mid);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
}

.gw-focus button:hover,
.gw-focus button:focus-visible,
.gw-refresh:hover,
.gw-refresh:focus-visible {
  border-color: var(--blue);
  color: var(--blue-dark);
}

.gw-focus button.is-active {
  border-color: #18232a;
  background: #18232a;
  color: var(--white);
}

.gw-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-height: 4rem;
}

.gw-toolbar p {
  margin: 0;
  color: var(--text-mid);
  font-size: 0.78rem;
}

.gw-list {
  border-top: 1px solid var(--gray-200);
}

.gw-grant {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) 10rem;
  gap: 2rem;
  align-items: start;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--gray-200);
  animation: gwEnter 280ms ease both;
}

.gw-grant__deadline {
  display: grid;
  gap: 0.3rem;
}

.gw-grant__deadline strong {
  color: var(--blue-dark);
  font-family: "DM Serif Display", serif;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.1;
}

.gw-grant__deadline span,
.gw-grant__number {
  color: var(--text-light);
  font-size: 0.65rem;
}

.gw-grant__deadline .gw-urgent {
  color: #a34a30;
  font-weight: 800;
}

.gw-grant h2 {
  margin: 0;
  color: var(--text-dark);
  font-family: "DM Serif Display", serif;
  font-size: 1.28rem;
  font-weight: 400;
  line-height: 1.25;
}

.gw-grant__agency {
  margin: 0.45rem 0 0;
  color: var(--text-mid);
  font-size: 0.76rem;
}

.gw-grant__number {
  margin: 0.3rem 0 0;
}

.gw-grant__link {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 0.35rem;
  color: var(--blue-dark);
  font-size: 0.73rem;
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.gw-empty,
.gw-error {
  padding: 3rem 0;
  color: var(--text-mid);
}

.gw-error strong {
  display: block;
  color: #923d29;
  font-size: 1rem;
}

.gw-error p,
.gw-empty p {
  max-width: 42rem;
  margin: 0.5rem 0 0;
}

.gw-loading {
  display: grid;
  gap: 1rem;
  padding: 2rem 0;
}

.gw-loading span {
  height: 4rem;
  background: linear-gradient(90deg, var(--gray-100), var(--off-white), var(--gray-100));
  background-size: 200% 100%;
  animation: gwLoading 1.2s linear infinite;
}

.gw-pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
}

.gw-pagination span {
  min-width: 5rem;
  color: var(--text-mid);
  font-size: 0.75rem;
  text-align: center;
}

.gw-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gw-scope {
  padding: 4.5rem 0;
  border-top: 4px solid var(--gold);
  background: #eef1ec;
}

.gw-scope__inner {
  display: grid;
  grid-template-columns: minmax(18rem, 0.75fr) minmax(22rem, 1fr);
  gap: 4rem;
  align-items: start;
}

.gw-scope__inner > div:last-child p {
  margin: 0;
  color: var(--text-mid);
  line-height: 1.7;
}

.gw-scope__inner a {
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--blue-dark);
  font-weight: 800;
}

.gw-action {
  padding: 5rem 0;
  background: #2b2221;
  color: var(--white);
}

.gw-action__inner {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  align-items: center;
}

.gw-action h2 {
  max-width: 43rem;
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: 2.35rem;
  font-weight: 400;
  line-height: 1.1;
}

.gw-action p:not(.gw-kicker) {
  max-width: 44rem;
  margin: 0.9rem 0 0;
  color: rgba(255, 255, 255, 0.72);
}

@keyframes gwEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gwLoading {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 900px) {
  .gw-masthead__inner,
  .gw-controls,
  .gw-scope__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .gw-source {
    max-width: 18rem;
  }

  .gw-grant {
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 1.25rem;
  }

  .gw-grant__link {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .gw-masthead {
    padding: 7rem 0 3rem;
  }

  .gw-masthead h1 {
    font-size: 3rem;
  }

  .gw-search__row,
  .gw-grant {
    grid-template-columns: 1fr;
  }

  .gw-search__row .btn-primary {
    justify-content: center;
  }

  .gw-focus {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.35rem;
  }

  .gw-focus button {
    flex: 0 0 auto;
  }

  .gw-grant__link {
    grid-column: 1;
    justify-self: start;
  }

  .gw-toolbar {
    align-items: flex-start;
  }

  .gw-action__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .gw-action h2 {
    font-size: 1.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gw-grant,
  .gw-loading span {
    animation: none;
  }
}
