/* Shared styles for the Payyup website. */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: italic;
  font-display: swap;
  font-weight: 100 1000;
  src: url("../fonts/dm-sans-latin-wght-italic.woff2") format("woff2");
}

:root {
  --color-accent: #28aae1;
  /* The brand accent is too light for body-size text on white, so links use a darker shade. */
  --color-link: #0b6fa0;
  --color-text: #333333;
  --color-heading: #272727;
  --color-section: #f6f6f6;
  --color-footer: #000000;
  --color-footer-text: #ffffff;
  --color-footer-muted: #bdbdbd;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --page-width: 1440px;
  --text-width: 46rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: #ffffff;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-link);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--color-heading);
  color: #ffffff;
  font-weight: 600;
  border-radius: 6px;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Header */

.site-header {
  border-bottom: 1px solid #e6e6e6;
}

.site-header__inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__logo {
  display: inline-block;
  line-height: 0;
}

.site-header__logo img {
  width: 132px;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.site-nav a {
  color: var(--color-heading);
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-link);
  text-decoration: underline;
}

/* Main content */

main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--text-width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--gutter) clamp(3rem, 8vw, 5rem);
}

main:focus {
  outline: none;
}

h1,
h2,
h3,
h4 {
  color: var(--color-heading);
  line-height: 1.25;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.875rem, 5vw, 2.5rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.375rem, 3.5vw, 1.625rem);
  margin: 2.25rem 0 0.75rem;
}

h3 {
  font-size: 1.1875rem;
  margin: 1.5rem 0 0.5rem;
}

h4 {
  font-size: 1.0625rem;
  margin: 1.25rem 0 0.5rem;
}

p,
ul,
ol,
blockquote {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.5rem;
}

main li + li {
  margin-top: 0.25rem;
}

blockquote {
  padding-left: 1rem;
  border-left: 4px solid var(--color-accent);
}

.lead {
  font-size: 1.1875rem;
  color: var(--color-heading);
}

.steps {
  padding-left: 1.75rem;
}

.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--color-section);
  border-radius: 10px;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Footer */

.site-footer {
  background: var(--color-footer);
  color: var(--color-footer-text);
  font-size: 0.9375rem;
}

.site-footer__inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 3rem var(--gutter) 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2.5rem;
}

.site-footer__logo {
  width: 132px;
}

.site-footer__about p {
  max-width: 28rem;
  margin: 1.25rem 0 1rem;
  color: var(--color-footer-text);
  line-height: 1.8;
}

.site-footer a {
  color: var(--color-footer-text);
}

.site-footer a:hover {
  color: var(--color-accent);
}

.site-footer__heading {
  margin: 0 0 1rem;
  color: var(--color-footer-text);
  font-size: 1rem;
  font-weight: 600;
}

.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__links li + li {
  margin-top: 0.5rem;
}

.site-footer__links a {
  text-decoration: none;
}

.site-footer__links a:hover {
  text-decoration: underline;
}

.site-footer__legal {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1.25rem var(--gutter) 2rem;
  border-top: 1px solid #333333;
  color: var(--color-footer-muted);
}

.site-footer__legal p {
  margin: 0;
}

@media (max-width: 640px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
