/*==============================================================
  End Poverty typography system
  Loaded after the theme styles to keep type consistent site-wide.
==============================================================*/

:root {
  --ep-font-sans: "DM Sans", Arial, sans-serif;

  --ep-type-body: 1rem;
  --ep-type-small: .875rem;
  --ep-type-label: .875rem;
  --ep-type-lead: 1.125rem;
  --ep-type-h6: 1rem;
  --ep-type-h5: 1.25rem;
  --ep-type-h4: 1.375rem;
  --ep-type-h3: clamp(1.5rem, 2.2vw, 1.875rem);
  --ep-type-h2: clamp(2.125rem, 3.4vw, 3rem);
  --ep-type-h1: clamp(2.75rem, 5vw, 4rem);
  --ep-type-display: clamp(3rem, 6vw, 4.5rem);

  --ep-weight-regular: 400;
  --ep-weight-medium: 500;
  --ep-weight-semibold: 600;
  --ep-weight-bold: 700;
  --ep-weight-extrabold: 800;

  --ep-leading-body: 1.7;
  --ep-leading-heading: 1.15;
  --ep-leading-compact: 1.35;

  /* Keep the original theme API, but make every family token identical. */
  --givewell-font: var(--ep-font-sans);
  --givewell-font-two: var(--ep-font-sans);
  --givewell-font-three: var(--ep-font-sans);
}

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

body {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-body);
  line-height: var(--ep-leading-body);
  font-weight: var(--ep-weight-regular);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-body);
  font-weight: var(--ep-weight-regular);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ep-font-sans);
  line-height: var(--ep-leading-heading);
  font-weight: var(--ep-weight-bold);
  letter-spacing: -.025em;
  text-wrap: balance;
}

/* Sensible defaults for headings that do not have a component class. */
h1:not([class]) { font-size: var(--ep-type-h1); }
h2:not([class]) { font-size: var(--ep-type-h2); }
h3:not([class]) { font-size: var(--ep-type-h3); }
h4:not([class]) { font-size: var(--ep-type-h4); }
h5:not([class]) { font-size: var(--ep-type-h5); }
h6:not([class]) { font-size: var(--ep-type-h6); }

p {
  font-family: var(--ep-font-sans);
  line-height: var(--ep-leading-body);
  text-align: left;
}

strong,
b {
  font-weight: var(--ep-weight-bold);
}

small,
.small {
  font-size: var(--ep-type-small);
  line-height: 1.55;
}

.ep-type-lead {
  font-size: var(--ep-type-lead);
  line-height: 1.65;
}

/* Shared page-title pattern. */
.section-title__tagline {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-label);
  line-height: var(--ep-leading-compact);
  font-weight: var(--ep-weight-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-title__title {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-h2);
  line-height: var(--ep-leading-heading);
  font-weight: var(--ep-weight-bold);
  letter-spacing: -.03em;
}

.page-header__inner h1 {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-h1);
  line-height: 1.08;
  font-weight: var(--ep-weight-bold);
  letter-spacing: -.035em;
}

/* Navigation and interactive text use one consistent size and weight. */
.main-menu .main-menu__list > li > a,
.stricky-header .main-menu__list > li > a {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-body);
  line-height: 1.25;
  font-weight: var(--ep-weight-semibold);
}

.main-menu .main-menu__list > li > ul > li > a,
.main-menu .main-menu__list > li > ul > li > ul > li > a,
.stricky-header .main-menu__list > li > ul > li > a,
.stricky-header .main-menu__list > li > ul > li > ul > li > a,
.mobile-nav__container .main-menu__list li a {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-body);
  font-weight: var(--ep-weight-medium);
}

.thm-btn,
[class$="__btn"] {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-body);
  font-weight: var(--ep-weight-bold);
}

/* Hero display type is intentionally larger, but follows the same scale. */
.main-slider-two__title,
.main-slider-three__title {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-display);
  line-height: 1.08;
  font-weight: var(--ep-weight-bold);
  letter-spacing: -.04em;
}

.main-slider-three__sub-title {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-h4);
  line-height: var(--ep-leading-compact);
  font-weight: var(--ep-weight-semibold);
}

/* Footer typography mirrors the body scale instead of creating another one. */
.footer-widget-three__title {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-h5);
  line-height: var(--ep-leading-compact);
  font-weight: var(--ep-weight-bold);
}

.footer-widget-three__about-text-2,
.footer-widget-three__links-list li,
.footer-widget-three__links-list li a,
.site-footer-three__copyright-text,
.site-footer-three__bottom-menu li a {
  font-family: var(--ep-font-sans);
  font-size: var(--ep-type-small);
  line-height: 1.7;
  font-weight: var(--ep-weight-regular);
}

@media (max-width: 767px) {
  :root {
    --ep-type-h1: clamp(2.25rem, 10vw, 3rem);
    --ep-type-display: clamp(2.5rem, 11vw, 3.5rem);
    --ep-type-lead: 1.0625rem;
  }
}
