/**
 * World Law Directory universal design system.
 * Aligns every frontend surface with the homepage typography and fluid frame.
 * Loaded last so legacy/reference templates inherit the same readable scale.
 */
:root {
  --wld-screen-gutter: clamp(12px, 1.45vw, 28px);
  --wld-type-body: 15px;
  --wld-type-small: 12px;
  --wld-type-label: 13px;
  --wld-type-card-title: 18px;
  --wld-type-h4: clamp(16px, 1.05vw, 18px);
  --wld-type-h3: clamp(18px, 1.35vw, 22px);
  --wld-type-h2: clamp(25px, 2.05vw, 34px);
  --wld-type-h1: clamp(34px, 3.2vw, 48px);
  --wld-line-body: 1.58;
  --wld-line-heading: 1.15;
  --wld-font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wld-font-serif: Georgia, "Times New Roman", serif;
}

html,
body {
  width: 100%;
  max-width: 100%;
}

body {
  font-family: var(--wld-font-sans);
  font-size: var(--wld-type-body);
  line-height: var(--wld-line-body);
}

/* One edge-to-edge frame everywhere. Small safe gutters remain for readability. */
body .wld-shell,
body .wld-page-shell,
body .wld-ref-shell,
body .wld-firms-ref-shell,
body .wp-site-blocks,
body main > .wp-block-group.alignfull > .wp-block-group__inner-container {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-left: max(var(--wld-screen-gutter), env(safe-area-inset-left));
  padding-right: max(var(--wld-screen-gutter), env(safe-area-inset-right));
}

body .wld-page-layout,
body .wld-article-layout,
body .wld-directory,
body .wld-dashboard,
body .wld-auth-layout,
body .wld-registration-shell {
  max-width: none;
}

body .wld-auth-layout,
body .wld-registration-shell {
  width: calc(100% - (var(--wld-screen-gutter) * 2));
  margin-inline: var(--wld-screen-gutter);
}

/* Global text hierarchy, matching the homepage visual language. */
main h1,
main .wld-page-header h1 {
  font-family: var(--wld-font-serif);
  font-size: var(--wld-type-h1);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -.02em;
}

main h2,
.wld-theme-widget h2,
.wld-dashboard-panel h2 {
  font-family: var(--wld-font-serif);
  font-size: var(--wld-type-h2);
  line-height: var(--wld-line-heading);
  font-weight: 700;
}

main h3,
.wld-theme-widget h3,
.wld-dashboard-panel h3 {
  font-size: var(--wld-type-h3);
  line-height: 1.25;
  font-weight: 700;
}

main h4,
.wld-theme-widget h4,
.wld-dashboard-panel h4 {
  font-size: var(--wld-type-h4);
  line-height: 1.3;
  font-weight: 700;
}

.wld-entry-content,
.wld-page-article,
.wld-content-card,
.wld-dashboard-panel,
.wld-form,
.wld-auth-layout,
.wld-registration-shell {
  font-size: var(--wld-type-body);
}

.wld-entry-content p,
.wld-entry-content li,
.wld-page-article p,
.wld-page-article li,
.wld-content-card p,
.wld-content-card li,
.wld-dashboard-panel p,
.wld-dashboard-panel li {
  font-size: inherit;
  line-height: var(--wld-line-body);
}

/* Forms and buttons use the same compact, readable homepage scale. */
body :where(input, select, textarea, button, .wld-button) {
  font-family: var(--wld-font-sans);
  font-size: var(--wld-type-label);
}

body :where(.wld-button, button, input[type="submit"], input[type="button"]) {
  font-weight: 800;
}

body :where(label, .wld-filter-form label, .wld-form label) {
  font-size: var(--wld-type-label);
}

body :where(.wld-badge, .wld-tags span, small, .wld-muted, .wld-eyebrow) {
  font-size: var(--wld-type-small);
}

/* Core directory cards. */
body .wld-listing-card h3,
body .wld-listing-card--compact h3 {
  font-family: var(--wld-font-serif);
  font-size: var(--wld-type-card-title);
  line-height: 1.2;
}

body .wld-listing-card__subtitle,
body .wld-listing-card__meta,
body .wld-listing-card__excerpt {
  font-size: var(--wld-type-label);
}

body .wld-listing-card__actions .wld-button,
body .wld-record-actions .wld-button {
  font-size: var(--wld-type-small);
}

/* Dashboard and account surfaces. */
body .wld-dashboard__header h1 { font-size: var(--wld-type-h1); }
body .wld-dashboard-stats strong { font-size: clamp(20px, 1.8vw, 26px); }
body .wld-dashboard-stats span,
body .wld-dashboard-stats small,
body .wld-dashboard-nav a,
body .wld-panel-heading p,
body .wld-profile-manager-main p,
body .wld-record-card header p,
body .wld-review-manager-list header p,
body .wld-verification-list header p,
body .wld-record-contact,
body .wld-membership-current ul,
body .wld-auth-layout #loginform label,
body .wld-registration-form small,
body .wld-profile-form small {
  font-size: var(--wld-type-label);
}

body .wld-profile-manager-metrics span,
body .wld-status-pill,
body .wld-record-card time {
  font-size: var(--wld-type-small);
}

/* Reference lawyer and law-firm profiles: remove the old 7px-10px micro typography. */
.wld-reference-profile {
  font-family: var(--wld-font-sans);
  font-size: var(--wld-type-body);
  line-height: var(--wld-line-body);
}

.wld-reference-profile .wld-ref-breadcrumb .wld-ref-shell { font-size: var(--wld-type-small); }
.wld-reference-profile .wld-ref-summary h1 { font-size: var(--wld-type-h1); }
.wld-reference-profile .wld-ref-subtitle { font-size: clamp(17px, 1.25vw, 20px); }
.wld-reference-profile .wld-ref-firm-name { font-size: clamp(16px, 1.1vw, 19px); }
.wld-reference-profile .wld-ref-verified-label,
.wld-reference-profile .wld-ref-rating-trust,
.wld-reference-profile .wld-ref-meta-list,
.wld-reference-profile .wld-firm-ref-excerpt,
.wld-reference-profile .wld-ref-contact-card p,
.wld-reference-profile .wld-ref-contact-card a,
.wld-reference-profile .wld-ref-action,
.wld-reference-profile .wld-ref-tabs a,
.wld-reference-profile .wld-ref-prose,
.wld-reference-profile .wld-ref-empty,
.wld-reference-profile .wld-sidebar-kicker,
.wld-reference-profile .wld-ref-mini-details div {
  font-size: var(--wld-type-label);
}

.wld-reference-profile .wld-ref-contact-card h2,
.wld-reference-profile .wld-ref-section-heading h2,
.wld-reference-profile .wld-content-card h2,
.wld-reference-profile .wld-sidebar-card h2 {
  font-family: var(--wld-font-serif);
  font-size: var(--wld-type-h3);
  line-height: 1.2;
}

.wld-reference-profile .wld-ref-stats strong { font-size: clamp(14px, 1vw, 16px); }
.wld-reference-profile .wld-ref-stats small { font-size: var(--wld-type-small); }
.wld-reference-profile .wld-ref-practice-grid h3,
.wld-reference-profile .wld-education-grid h3,
.wld-reference-profile .wld-experience-title h3,
.wld-reference-profile .wld-firm-attorney-ref-grid h3,
.wld-reference-profile .wld-related-lawyer-list h3,
.wld-reference-profile .wld-firm-location-ref-list strong {
  font-size: clamp(14px, .95vw, 16px);
}

.wld-reference-profile .wld-ref-practice-grid p,
.wld-reference-profile .wld-education-grid small,
.wld-reference-profile .wld-experience-title small,
.wld-reference-profile .wld-experience-desc,
.wld-reference-profile .wld-firm-rating-ref-box > p,
.wld-reference-profile .wld-ref-review-list header strong,
.wld-reference-profile .wld-ref-review-list header time,
.wld-reference-profile .wld-ref-review-list p,
.wld-reference-profile .wld-review-note,
.wld-reference-profile .wld-ref-rating-bars > div,
.wld-reference-profile .wld-sidebar-promo p,
.wld-reference-profile .wld-sidebar-promo li,
.wld-reference-profile .wld-sidebar-promo > a,
.wld-reference-profile .wld-firm-attorney-ref-grid p,
.wld-reference-profile .wld-firm-attorney-ref-grid small,
.wld-reference-profile .wld-firm-attorney-ref-grid .wld-rating,
.wld-reference-profile .wld-firm-location-ref-list p,
.wld-reference-profile .wld-related-lawyer-list p,
.wld-reference-profile .wld-related-firm-ref-list .wld-rating,
.wld-reference-profile .wld-related-firm-ref-list .wld-rating-number,
.wld-reference-profile .wld-related-lawyer-list .wld-rating {
  font-size: var(--wld-type-small);
}

.wld-reference-profile .wld-ref-review-list header span,
.wld-reference-profile .wld-rating-stars-big,
.wld-reference-profile .wld-stars { font-size: 15px; }

.wld-reference-profile .wld-sidebar-promo h2 { font-size: clamp(20px, 1.45vw, 24px); }
.wld-reference-profile .wld-sidebar-promo h3 { font-size: clamp(15px, 1vw, 17px); }

/* /law-firms/ reference directory, aligned to the same sitewide scale. */
.wld-firms-reference-directory {
  font-family: var(--wld-font-sans);
  font-size: var(--wld-type-body);
}

.wld-firms-reference-directory .wld-firms-ref-breadcrumb > div,
.wld-firms-reference-directory .wld-firms-ref-trustbar,
.wld-firms-reference-directory .wld-firms-ref-heading p,
.wld-firms-reference-directory .wld-firms-ref-filter > label,
.wld-firms-reference-directory .wld-firms-ref-filter select,
.wld-firms-reference-directory .wld-firms-ref-filter input,
.wld-firms-reference-directory .wld-firms-more-filters,
.wld-firms-reference-directory .wld-firms-reset,
.wld-firms-reference-directory .wld-firms-ref-apply,
.wld-firms-reference-directory .wld-firms-ref-toolbar p,
.wld-firms-reference-directory .wld-firms-ref-sort,
.wld-firms-reference-directory .wld-firms-ref-sort select {
  font-size: var(--wld-type-label);
}

.wld-firms-reference-directory .wld-firms-ref-heading h2 { font-size: var(--wld-type-h2); }
.wld-firms-reference-directory .wld-firms-ref-card h3 {
  font-family: var(--wld-font-serif);
  font-size: var(--wld-type-card-title);
}
.wld-firms-reference-directory .wld-firms-ref-subtitle,
.wld-firms-reference-directory .wld-firms-ref-location,
.wld-firms-reference-directory .wld-firms-ref-rating,
.wld-firms-reference-directory .wld-firms-ref-rating strong,
.wld-firms-reference-directory .wld-firms-ref-rating small,
.wld-firms-reference-directory .wld-firms-ref-card-stats p,
.wld-firms-reference-directory .wld-firms-ref-view,
.wld-firms-reference-directory .wld-firms-ref-premium p,
.wld-firms-reference-directory .wld-firms-ref-premium > a,
.wld-firms-reference-directory .wld-firms-ref-sidecard ul,
.wld-firms-reference-directory .wld-firms-ref-outline,
.wld-firms-reference-directory .wld-firms-ref-textlink,
.wld-firms-reference-directory .wld-firms-ref-pagination .page-numbers,
.wld-firms-reference-directory .wld-firms-ref-bottom-ad p,
.wld-firms-reference-directory .wld-firms-ref-bottom-ad > a {
  font-size: var(--wld-type-small);
}
.wld-firms-reference-directory .wld-firms-ref-tags span { font-size: 11px; }
.wld-firms-reference-directory .wld-firms-ref-premium h3,
.wld-firms-reference-directory .wld-firms-ref-sidecard h3 { font-size: var(--wld-type-h3); }
.wld-firms-reference-directory .wld-firms-ref-bottom-ad h3 { font-size: clamp(20px, 1.55vw, 25px); }

/* Keep the compact visual rhythm while letting larger screens use their width. */
.wld-reference-profile .wld-ref-hero,
.wld-reference-profile .wld-ref-profile-body,
.wld-firms-reference-directory .wld-firms-ref-main {
  padding-top: clamp(16px, 1.5vw, 24px);
  padding-bottom: clamp(16px, 1.5vw, 28px);
}

@media (min-width: 1700px) {
  :root { --wld-screen-gutter: 30px; }
  body { font-size: 15px; }
}

@media (max-width: 1100px) {
  :root { --wld-screen-gutter: 16px; }

  .wld-reference-profile .wld-ref-summary h1,
  body .wld-dashboard__header h1 { font-size: clamp(30px, 4.5vw, 40px); }
}

@media (max-width: 700px) {
  :root {
    --wld-screen-gutter: 12px;
    --wld-type-body: 14px;
    --wld-type-small: 12px;
    --wld-type-label: 13px;
    --wld-type-h1: clamp(29px, 8.5vw, 36px);
    --wld-type-h2: clamp(23px, 6.8vw, 30px);
    --wld-type-h3: 18px;
  }

  body .wld-auth-layout,
  body .wld-registration-shell {
    width: calc(100% - 16px);
    margin-inline: 8px;
  }

  /* 16px form controls prevent iOS zoom while body copy remains compact. */
  body :where(input, select, textarea) { font-size: 16px; }

  .wld-reference-profile .wld-ref-breadcrumb .wld-ref-shell,
  .wld-firms-reference-directory .wld-firms-ref-breadcrumb > div { font-size: 12px; }

  .wld-firms-reference-directory .wld-firms-ref-tags span { font-size: 11px; }
}

@media (max-width: 420px) {
  :root { --wld-screen-gutter: 10px; }

  .wld-reference-profile .wld-ref-summary h1,
  .wld-firms-reference-directory .wld-firms-ref-card h3 { font-size: 17px; }

  .wld-reference-profile .wld-ref-summary h1 { font-size: 29px; }
}

/* Final minimum-readable-size normalisation for compact reference components. */
.wld-reference-profile .wld-top-rated-badge,
.wld-reference-profile .wld-ref-tags a,
.wld-reference-profile .wld-ref-facts,
.wld-reference-profile .wld-firm-photo-count,
.wld-reference-profile .wld-ref-section-heading > a,
.wld-reference-profile .wld-ref-sidebar-heading > a,
.wld-reference-profile .wld-ref-outline-btn,
.wld-reference-profile .wld-ref-review-avatar,
.wld-reference-profile .wld-related-firm-ref-list .wld-review-count {
  font-size: var(--wld-type-small);
}

.wld-reference-profile .wld-related-firm-ref-list h3,
.wld-reference-profile .wld-related-lawyer-list h3 {
  font-size: clamp(14px, .95vw, 16px);
}

.wld-reference-profile .wld-related-firm-ref-list p,
.wld-reference-profile .wld-related-lawyer-list p {
  font-size: var(--wld-type-small);
}

.wld-firms-reference-directory .wld-firms-ref-verified { font-size: 11px; }
