/*
 * Responsive marketing typography, measured against the CoMinVi reference.
 * Its em scale is reproduced with a local unit so rem-based cards, gutters,
 * navigation and controls retain their existing dimensions.
 * Load after styles.css and feature-carousel.css, on public pages only.
 */
body {
  --type-unit: calc(clamp(992px, 100vw, 1920px) / 90);
  --type-hero: calc(3.5 * var(--type-unit));
  --type-statement: calc(3 * var(--type-unit));
  --type-section: calc(3 * var(--type-unit));
  --type-subheading: calc(2 * var(--type-unit));
  --type-card: clamp(1.125rem, calc(1.5 * var(--type-unit)), 1.75rem);
  --type-lede: clamp(1.25rem, calc(1.5 * var(--type-unit)), 1.875rem);
  --type-copy: clamp(1rem, calc(1.25 * var(--type-unit)), 1.375rem);
  --type-small: clamp(.875rem, var(--type-unit), 1.0625rem);
  --type-control: clamp(.875rem, calc(1.125 * var(--type-unit)), 1.125rem);
  --type-label: clamp(.6875rem, calc(.75 * var(--type-unit)), .8125rem);
}

/* Display, statement and section roles keep their existing font families,
 * weights, animation wrappers and alignment. */
.service-hero__title,
.page-hero .service-hero__title,
.hp-hero .hp-hero__title {
  font-size: var(--type-hero);
  line-height: 1.1;
}

.page-statement .about-statement__text {
  font-size: var(--type-statement);
}

.page-statement .about-statement__tag {
  font-size: clamp(.6rem, calc(.7 * var(--type-unit)), .9375rem);
}

.pop-services__title,
.showcase__heading,
.testm__title,
.values__title,
.page-content__heading,
.proj-archive .page-content__heading,
.contact-section__title,
.cfaq__title,
.site-visit__title,
.svc-work__title,
.svc-cta h2 {
  font-size: var(--type-section);
}

/* Standard banners retain the reference's headline scale. */
.edit-header__title,
.blueprint-title,
.lp-hero h1 {
  font-size: var(--type-hero);
}

.pop-info__title,
.showcase__project-label,
.mailing__title,
.site-visit__mailing-left .mailing__title,
.about-modern__cta-text h3,
.blog-card__title,
.lp-form-wrapper h2,
.premium-cta h2 {
  font-size: var(--type-subheading);
}

.value-card__title,
.about-story__card-title,
.news-card__title,
.privacy-content h2,
.ts-title {
  font-size: var(--type-card);
}

.value-card--feature .value-card__title,
.about-story__lede {
  font-size: var(--type-lede);
}

/* Copy receives a reading-size floor rather than shrinking with the unit. */
.about__paragraph,
.values__lede,
.page-content__intro .about__paragraph,
.contact-section__desc,
.site-visit__desc,
.service-hero__desc,
.lp-hero__desc,
.privacy-content p,
.privacy-content li,
.svc-cta p,
.blog-card__body,
.premium-cta p {
  font-size: var(--type-copy);
}

/* Service intro copy still carries saved inline sizes from the dashboard.
 * Override that size alone; every other saved style remains intact. */
.page-content__intro .about__paragraph[style*="font-size"] {
  font-size: var(--type-copy) !important;
}

.page-content__intro .about__paragraph:first-child,
.page-content__intro .about__paragraph:first-child[style*="font-size"] {
  font-size: var(--type-lede) !important;
}

.pop-info__desc,
.showcase__project-location,
.testm__subtitle,
.testm__text,
.value-card__body,
.about-story__card-text,
.mailing__desc,
.site-visit__mailing-left .mailing__desc,
.about-modern__cta-text p,
.contact-section__detail,
.cfaq__a,
.svc-work__sub,
.news-card__excerpt,
.ts-desc,
.edit-header__desc,
.blueprint-desc,
.footer__desc,
.footer__link {
  font-size: var(--type-small);
}

.lp-form-wrapper p,
.lp-photos__caption {
  font-size: var(--type-small);
}

/* Landing-page introductions predate named copy classes. */
.lp-trust + div > p[style*="font-size"] {
  font-size: var(--type-copy) !important;
}

.cfaq__q {
  font-size: var(--type-card);
}

.contact-form__input,
.contact-form__select,
.contact-form__textarea,
.mailing__input,
.lp-form input,
.lp-form select,
.lp-form textarea {
  font-size: max(1rem, var(--type-control));
}

.contact-form__submit,
.lp-form__submit,
.mailing__submit,
.site-visit__btn-label,
.site-visit__link,
.svc-cta__btn,
.svc-cta__phone,
.premium-cta .hero__cta,
.pop-services__see-all,
.showcase__see-all,
.pop-tab,
.filter-btn,
.proj-filter-bar .filter-btn {
  font-size: var(--type-control);
}

/* These cards retain their original widths. Their short pills need a bounded
 * type scale independent of large display text. */
.pop-card__pill--name {
  font-size: clamp(.875rem, var(--type-unit), 1rem);
}

.pop-card__pill--tag,
.pop-card__badge,
.showcase__project-tag,
.showcase__cat-item,
.project-gallery__cat-tag,
.project-gallery__location,
.project-gallery__meta .project-gallery__location,
.testm__meta strong,
.testm__meta span,
.news-card__readmore,
.blog-card__body ul li,
.footer__link-col h3 {
  font-size: clamp(.8125rem, var(--type-unit), 1rem);
}

.section-eyebrow,
.pop-services__label,
.showcase__tag,
.testm__pill,
.site-visit__eyebrow,
.contact-form__label,
.cfaq__kick,
.cfaq__label,
.cfaq__num,
.value-card__index,
.value-card__label,
.about-story__corner-label,
.about-story__certs-label,
.news-card__badge,
.news-card__date,
.blog-card__category,
.blog-card__date,
.blueprint-pill,
.lp-hero__pill,
.lp-form label,
.privacy-content .privacy-updated,
.ts-badge {
  font-size: var(--type-label);
}

.footer__copyright-row {
  font-size: clamp(.75rem, calc(.875 * var(--type-unit)), .875rem);
}

.page-hero__scroll,
.hp-hero__stats .hp-hero__stat-label,
.hp-hero__stats .hp-hero__stat-desc,
.page-hero__link-label {
  font-size: clamp(.6rem, calc(.7 * var(--type-unit)), .8125rem);
}

.hp-hero__stats .hp-hero__stat-num {
  font-size: clamp(2rem, calc(3 * var(--type-unit)), 3.25rem);
}

/* The picker rows are deliberately fixed at 40px / 46px by the carousel.
 * Cap type inside those rows while keeping the reference's body-l role. */
.svc-fc-section .fc-btn {
  font-size: clamp(1.25rem, var(--type-subheading), 2.25rem);
}

.svc-fc-section .svc-fc-desc {
  font-size: clamp(.875rem, var(--type-unit), 1rem);
}

.svc-fc-tag,
.svc-work__tag,
.svc-work__job {
  font-size: clamp(.625rem, calc(.75 * var(--type-unit)), .8125rem);
}

.svc-fc-page,
.svc-work__num {
  font-size: clamp(.625rem, calc(.7 * var(--type-unit)), .75rem);
}

.svc-work__town {
  font-size: calc(2.5 * var(--type-unit));
}

.project-gallery__title {
  font-size: var(--type-subheading);
}

/* Reference breakpoints: tablet, landscape phone, portrait phone. */
@media (max-width: 991px) {
  body {
    --type-unit: calc(clamp(768px, 100vw, 991px) / 52.125);
    --type-hero: calc(2 * var(--type-unit));
    --type-statement: calc(2 * var(--type-unit));
    --type-section: calc(2 * var(--type-unit));
    --type-subheading: calc(1.5 * var(--type-unit));
  }

  .hp-hero__stats .hp-hero__stat-num {
    font-size: clamp(2rem, calc(2.5 * var(--type-unit)), 2.5rem);
  }
}

@media (max-width: 1023px) {
  .svc-fc-section .fc-btn {
    font-size: clamp(1.25rem, var(--type-subheading), 2rem);
  }

  .svc-fc-section .svc-fc-desc {
    font-size: 1rem;
  }
}

@media (max-width: 767px) {
  body {
    --type-unit: calc(clamp(480px, 100vw, 767px) / 34.375);
    --type-small: 1rem;
    --type-control: clamp(.875rem, var(--type-unit), 1rem);
  }

  /* Keep the longest CMS name inside the existing phone picker gutters. */
  .svc-fc-section .fc-btn {
    font-size: clamp(1.125rem, min(var(--type-subheading), calc((100vw - 5.625rem) / 12.6)), 2rem);
  }

  .svc-work__town {
    font-size: calc(2 * var(--type-unit));
  }
}

@media (max-width: 479px) {
  body {
    --type-unit: calc(clamp(320px, 100vw, 479px) / 24.375);
  }
}
