:root {
  --smol-grant-ink: #172033;
  --smol-grant-muted: #5b6678;
  --smol-grant-line: #d9e1eb;
  --smol-grant-soft: #f4f8fc;
  --smol-grant-shadow: 0 18px 45px rgba(24, 50, 82, 0.1);
}

.smol-grants-main {
  margin-top: 0;
}

/*
 * The legacy theme stylesheet constrains every post-content block to 1100px
 * and gives it a white background. The grants template is intentionally a
 * full-width canvas, so reset those global article styles only here.
 */
.smol-grants-main > .wp-block-post-content {
  background: transparent;
  margin: 0;
  max-width: none;
  width: 100%;
}

.smol-grants-page-shell {
  background: linear-gradient(180deg, #eef6fb 0, #f8fafc 340px, #f8fafc 100%);
  color: var(--smol-grant-ink);
  margin-top: 0;
  padding: clamp(48px, 7vw, 88px) max(24px, calc((100vw - 1180px) / 2)) clamp(68px, 8vw, 108px);
}

.smol-grants-page-shell > * {
  width: 100%;
}

/* Avoid the legacy alignwide padding stacking with the page-shell padding. */
.smol-grants-page-shell > .alignwide:not(.smol-grants-notice) {
  padding-left: 0;
  padding-right: 0;
}

.smol-grants-intro {
  margin-left: 0 !important;
  max-width: 760px !important;
}

.smol-grants-eyebrow {
  color: var(--wp--preset--color--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.smol-grants-title {
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 0 0 18px;
}

.smol-grants-lead {
  color: var(--smol-grant-muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  margin-bottom: 0;
  max-width: 700px;
}

.smol-grants-notice {
  align-items: flex-start !important;
  background: #e8f3fb;
  border: 1px solid #c3dfef;
  border-radius: 14px;
  gap: 14px;
  margin-block: 34px !important;
  padding: 18px 20px;
}

.smol-grants-notice p {
  color: #36536b;
  margin: 0;
}

.smol-grants-notice p + p {
  margin-top: 4px;
}

.smol-grants-notice-icon {
  align-items: center;
  background: var(--wp--preset--color--primary);
  border-radius: 50%;
  color: #fff !important;
  display: flex;
  flex: 0 0 26px;
  font-family: Georgia, serif;
  font-weight: 700;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.smol-grants-grid {
  align-items: stretch !important;
  gap: 22px;
}

.smol-grants-grid > .wp-block-column {
  display: flex;
}

.smol-grant-card {
  background: #fff;
  border: 1px solid var(--smol-grant-line);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(24, 50, 82, 0.06);
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 420px;
  padding: 26px;
}

.smol-grant-card.is-muted {
  background: #fbfcfd;
}

.smol-grant-card-top {
  margin-bottom: 24px;
  width: 100%;
}

.smol-grant-card-top p {
  margin: 0;
}

.smol-grant-number {
  color: #8b9bad;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.smol-grant-status {
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 10px;
  text-transform: uppercase;
}

.smol-grant-status.is-open {
  background: #eaf7f0;
  color: #176b45;
}

.smol-grant-status.is-upcoming {
  background: #fff7dd;
  color: #805d0b;
}

.smol-grant-card h2 {
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0 0 12px;
}

.smol-grant-card > p:not(.smol-grant-disabled),
.smol-grant-facts {
  color: var(--smol-grant-muted);
}

.smol-grant-facts {
  font-size: 0.92rem;
  margin: 8px 0 26px;
  padding-left: 20px;
}

.smol-grant-facts li + li {
  margin-top: 7px;
}

.smol-grant-card-action,
.smol-grant-disabled {
  margin-top: auto !important;
}

.smol-grant-card-action {
  width: 100%;
}

.smol-grant-card-action .wp-block-button,
.smol-grant-card-action .wp-block-button__link {
  width: 100%;
}

.smol-grant-button .wp-block-button__link {
  background: var(--wp--preset--color--primary);
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  min-height: 48px;
  padding: 12px 18px;
}

.smol-grant-button .wp-block-button__link:hover {
  background: #07356f;
  color: #fff;
}

.smol-grant-disabled {
  background: #eef1f5;
  border-radius: 10px;
  color: #727c8b !important;
  font-weight: 700;
  min-height: 48px;
  padding: 12px 18px;
  text-align: center;
}

.smol-form-page-main {
  box-sizing: border-box;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: clamp(28px, 4vw, 52px) !important;
  padding-bottom: clamp(36px, 5vw, 64px) !important;
  width: min(1180px, calc(100% - 36px));
}

/* Reset the legacy article canvas so the rounded embed card remains visible. */
.smol-form-page-main > .wp-block-post-content {
  background: transparent;
  margin: 0;
  max-width: none;
  width: 100%;
}

.smol-form-embed-wrapper {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 1100px !important;
  padding-left: 0;
  padding-right: 0;
  width: 100%;
}

/* WordPress constrained layout otherwise limits this direct child to 900px. */
.smol-form-embed-wrapper > .smol-form-embed-card {
  max-width: none !important;
  width: 100%;
}

.smol-form-embed-card {
  background: #fff;
  border: 1px solid var(--smol-grant-line);
  border-radius: 18px;
  box-shadow: var(--smol-grant-shadow);
  overflow: hidden;
  padding: 0;
}

.smol-grant-iframe {
  border: 0;
  display: block;
  min-height: 1000px;
  width: 100%;
}

.smol-form-embed-note {
  color: var(--smol-grant-muted);
  font-size: 0.88rem;
  margin: 14px 4px 0;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .smol-grant-card,
  .smol-grant-button .wp-block-button__link {
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  }

  .smol-grant-card:hover {
    box-shadow: var(--smol-grant-shadow);
    transform: translateY(-4px);
  }
}

@media (max-width: 900px) {
  .smol-grants-grid {
    flex-wrap: wrap !important;
  }

  .smol-grants-grid > .wp-block-column {
    flex-basis: 100% !important;
  }

  .smol-grant-card,
  .smol-grant-card.is-featured {
    min-height: 0;
    transform: none;
  }
}

@media (max-width: 620px) {
  .smol-grants-page-shell {
    padding-inline: 18px;
  }

  .smol-grant-card {
    padding: 22px;
  }

  .smol-form-page-main {
    width: calc(100% - 20px);
  }
}
