/* ════════════════════════════════════════════════════════════════════════
   Real Estate Platform — typography system  (loaded BEFORE every other plugin stylesheet)

   Why this file exists
   --------------------
   Headings, labels and form text inside plugin screens used to take their size from whatever
   the active WordPress theme says for h1–h6 / body / inputs (often 2–3rem headings), while
   individual components hard-coded their own px / rem values. The result: oversized, inconsistent
   text that changed from page to page and theme to theme.

   Now there is ONE scale (the --rp-fs-* tokens below). This file
     1. defines the tokens (fluid, so desktop → tablet → phone needs no per-module overrides),
     2. gives every plugin screen a base size for headings, body copy, labels, forms and buttons
        that the theme can no longer inflate,
   and the component stylesheets (frontend / dashboard / handyman) now reference the tokens instead
   of private numbers. Because this file loads first and uses the same specificity as component rules,
   anything a component sets explicitly still wins — only the unstyled leftovers are normalised.

   To retune the whole platform, change the tokens in :root (or override them from the theme).
   ════════════════════════════════════════════════════════════════════════ */
:root {
  /* Text scale */
  --rp-fs-xs:    12px;                                   /* captions, badges, meta */
  --rp-fs-sm:    13px;                                   /* labels, table text, helper text, small buttons */
  --rp-fs-base:  14px;                                   /* body, inputs, buttons, navigation */
  --rp-fs-md:    15px;                                   /* emphasised body, card titles */

  /* Headings — fluid between phone and desktop */
  --rp-fs-h5:    13.5px;
  --rp-fs-h4:    clamp(14px, 13.4px + .15vw, 15px);      /* sub-heading / card heading */
  --rp-fs-h3:    clamp(15px, 14.2px + .3vw, 17px);       /* section heading */
  --rp-fs-h2:    clamp(17px, 15.6px + .55vw, 21px);      /* page title inside a screen */
  --rp-fs-h1:    clamp(21px, 18px + 1.1vw, 28px);        /* hero / main page title */

  /* Figures (prices, KPIs) */
  --rp-fs-stat:  clamp(19px, 17px + .6vw, 24px);         /* KPI / stat value */
  --rp-fs-price: clamp(20px, 17px + 1vw, 26px);          /* listing & plan prices */
  --rp-fs-display: clamp(28px, 22px + 2vw, 40px);        /* big rating / score numerals */

  --rp-lh-body:    1.5;
  --rp-lh-heading: 1.28;
}

/* Dashboards are data-dense: same scale, one notch tighter. (Tokens are re-pointed, so every rule that uses
   them follows automatically — no per-component overrides.) */
.rp-dash-wrap {
  --rp-fs-xs: 11px; --rp-fs-sm: 12.5px; --rp-fs-base: 13px; --rp-fs-md: 13.5px;
  --rp-fs-h5: 12px; --rp-fs-h4: 13px; --rp-fs-h3: 14px;
  --rp-fs-h2: clamp(16px, 15px + .35vw, 18px);
  --rp-fs-h1: clamp(19px, 17px + .7vw, 22px);
  --rp-fs-stat: clamp(18px, 16px + .5vw, 22px);
}

/* Every screen the plugin renders. Add a wrapper here and it inherits the whole scale. */
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-fc-overlay, .rp-hts, .rp-htg, .rp-fin, .rvb,
    .hm-search-standalone, .hm-pricing-wrap, .hm-carousel-wrap, .hm-section, .hm-dash-overview,
    .hm-admin-plans, .hm-admin-dashboard, .hm-admin-categories, .rp-notif-scope) {
  font-size: var(--rp-fs-base);
  line-height: var(--rp-lh-body);
  -webkit-text-size-adjust: 100%;
}

:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-fc-overlay, .rp-hts, .rp-htg, .rp-fin, .rvb,
    .hm-search-standalone, .hm-pricing-wrap, .hm-carousel-wrap, .hm-section, .hm-dash-overview,
    .hm-admin-plans, .hm-admin-dashboard, .hm-admin-categories, .rp-notif-scope) :is(h1, h2, h3, h4, h5, h6) {
  font-family: inherit; text-transform: none; letter-spacing: normal; line-height: var(--rp-lh-heading);
  font-weight: 700; margin-top: 0; overflow-wrap: anywhere;
}
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-fc-overlay, .rp-hts, .rp-htg, .rp-fin, .rvb,
    .hm-search-standalone, .hm-pricing-wrap, .hm-carousel-wrap, .hm-section, .hm-dash-overview,
    .hm-admin-plans, .hm-admin-dashboard, .hm-admin-categories, .rp-notif-scope) h1 { font-size: var(--rp-fs-h1); }
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-fc-overlay, .rp-hts, .rp-htg, .rp-fin, .rvb,
    .hm-search-standalone, .hm-pricing-wrap, .hm-carousel-wrap, .hm-section, .hm-dash-overview,
    .hm-admin-plans, .hm-admin-dashboard, .hm-admin-categories, .rp-notif-scope) h2 { font-size: var(--rp-fs-h2); }
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-fc-overlay, .rp-hts, .rp-htg, .rp-fin, .rvb,
    .hm-search-standalone, .hm-pricing-wrap, .hm-carousel-wrap, .hm-section, .hm-dash-overview,
    .hm-admin-plans, .hm-admin-dashboard, .hm-admin-categories, .rp-notif-scope) h3 { font-size: var(--rp-fs-h3); }
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-fc-overlay, .rp-hts, .rp-htg, .rp-fin, .rvb,
    .hm-search-standalone, .hm-pricing-wrap, .hm-carousel-wrap, .hm-section, .hm-dash-overview,
    .hm-admin-plans, .hm-admin-dashboard, .hm-admin-categories, .rp-notif-scope) h4 { font-size: var(--rp-fs-h4); }
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-fc-overlay, .rp-hts, .rp-htg, .rp-fin, .rvb,
    .hm-search-standalone, .hm-pricing-wrap, .hm-carousel-wrap, .hm-section, .hm-dash-overview,
    .hm-admin-plans, .hm-admin-dashboard, .hm-admin-categories, .rp-notif-scope) :is(h5, h6) { font-size: var(--rp-fs-h5); }

/* Body copy, labels, helper text */
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-hts, .rp-htg, .rp-fin, .rvb) :is(p, li, td, th, dd, dt, address) {
  font-size: inherit;
}
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-hts, .rp-htg, .rp-fin, .rvb) label {
  font-size: var(--rp-fs-sm); font-weight: 600; line-height: 1.35;
}
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-hts, .rp-htg, .rp-fin, .rvb) :is(small, .rp-muted) {
  font-size: var(--rp-fs-xs);
}

/* Forms — one size for every input, theme can't blow it up */
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-hts, .rp-htg, .rp-fin, .rvb)
  :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea) {
  font-size: var(--rp-fs-base); line-height: 1.4; font-family: inherit;
}

/* Buttons */
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-hts, .rp-htg, .rp-fin, .rvb) :is(button, .rp-btn, .hm-btn) {
  font-family: inherit; line-height: 1.2;
}
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-hts, .rp-htg, .rp-fin, .rvb) .rp-btn { font-size: var(--rp-fs-base); }
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-hts, .rp-htg, .rp-fin, .rvb) .rp-btn-sm { font-size: var(--rp-fs-sm); }
:is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
    .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-hts, .rp-htg, .rp-fin, .rvb) .rp-btn-lg { font-size: var(--rp-fs-md); }

/* Phones: iOS zooms the page when an input is < 16px, so inputs go to 16px there (and only there). */
@media (max-width: 768px) {
  :root { --rp-fs-h5: 13px; }
  :is(.rp-wrap, .rp-dash-wrap, .rp-listing-wrap, .rpd-wrap, .rp-checkout-wrap, .rp-login-wrap, .rp-portal-wrap,
      .rp-detail-wrap, .rp-modal, .rp-alertmodal, .rp-hts, .rp-htg, .rp-fin, .rvb)
    :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea) { font-size: 16px; }
}
