/* Global polish pass: spacing, footer, and consistency */

:root {
  --polish-section-y: clamp(2rem, 4vw, 3.5rem);
  --polish-section-y-tight: clamp(1.5rem, 3vw, 2.5rem);
  --polish-card-gap: clamp(1rem, 2.5vw, 1.75rem);
}

/* Consistent page rhythm */
.page-hero {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(2rem, 4vw, 3.25rem);
}

.section {
  padding-top: var(--polish-section-y);
  padding-bottom: var(--polish-section-y);
}

.section + .section {
  margin-top: 0;
}

.section__header {
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

.section__header h2 {
  margin-bottom: clamp(0.5rem, 1.25vw, 0.9rem);
  text-wrap: balance;
}

.section__header p {
  max-width: 72ch;
}

.section__header p + p {
  margin-top: 0.65rem;
}

.card-grid {
  gap: var(--polish-card-gap);
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
}

.card {
  padding: clamp(1.35rem, 2.5vw, 1.9rem);
}

.card__title {
  text-wrap: balance;
}

.lead {
  text-wrap: pretty;
}

/* Footer modernization */
.site-footer,
footer {
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.footer__grid,
.site-footer__grid,
footer .container {
  row-gap: 1.25rem;
}

footer ul,
.site-footer ul,
.footer__links,
.footer-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

footer li,
.site-footer li {
  margin: 0;
}

footer a {
  white-space: nowrap;
}

/* Prevent awkward one-word wrap in short footer taglines */
footer p,
footer small,
.footer__tagline,
.footer-tagline {
  max-width: none;
  text-wrap: balance;
}

footer .copyright,
.footer__copyright,
.footer-copyright {
  white-space: normal;
  text-wrap: balance;
}

/* Empty link cleanup safety */
footer a[href=""] {
  display: none;
}

/* Mobile footer stays clean */
@media (max-width: 640px) {
  footer ul,
  .site-footer ul,
  .footer__links,
  .footer-links {
    gap: 0.5rem 0.85rem;
  }

  footer a {
    white-space: normal;
  }
}

/* Typographic polish: reduce awkward widows/orphans */
h1, h2, h3, .card__title {
  text-wrap: balance;
}

p, .lead, .card__body, .card__takeaway {
  text-wrap: pretty;
}

.page-hero .lead,
.section__header > p,
.form-intro,
.contact-intro {
  max-width: 64ch;
}

@media (min-width: 900px) {
  .page-hero h1 {
    max-width: 13ch;
  }

  .contact-page .page-hero h1,
  .contact-page h1 {
    max-width: 16ch;
  }
}

