/* Shared type, layout and controls for public-facing pages. */
:is(.hc-homepage, .hc-public) {
  --hc-type-primary: clamp(1.75rem, 3vw, 2.375rem);
  --hc-type-secondary: clamp(1.25rem, 1.7vw, 1.375rem);
  --hc-type-body: .9375rem;
  --hc-weight-normal: 400;
  --hc-weight-primary: 740;
  --hc-leading-primary: 1.18;
  --hc-leading-secondary: 1.3;
  --hc-leading-body: 1.65;
  --hc-weight-bold: 650;
  --hc-font: Inter, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  --hc-ink: #192637;
  --hc-ink-inverse: #f7f9fb;
  --hc-gutter: 20px;
  --hc-layout-width: min(1280px, calc(100% - 2 * var(--hc-gutter)));
  --hc-grid-gap: 18px;
  --hc-card-padding: 22px;
  --hc-card-radius: 16px;
  --hc-card-line: rgb(25 38 55 / .09);
  --hc-card-shadow: 0 4px 14px rgb(25 38 55 / .055);
  --hc-control-radius: 8px;
  --hc-label-fill: #edf0f2;
  --hc-button-fill: rgb(25 38 55 / .045);
  --hc-button-gradient: linear-gradient(110deg, #0869cf, #007a72);
  color: var(--hc-ink);
  font: var(--hc-weight-normal) var(--hc-type-body)/var(--hc-leading-body) var(--hc-font);
}

:is(.hc-homepage, .hc-public) .hc-brand-name { white-space: normal; }
:is(.hc-homepage, .hc-public) .hc-brand-lockup { max-width: 100%; }
:is(.hc-homepage, .hc-public) .hc-wordmark {
  /* The caption sets the grid width; the wordmark scales to it. */
  contain: inline-size;
  width: 100%;
}
:is(.hc-homepage, .hc-public) :is(.hc-nav-links, .hc-footer-links) a:hover {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
}

:is(.hc-homepage, .hc-public) :is(.container, .hc-container) {
  width: var(--hc-layout-width);
  margin-inline: auto;
}
:is(.hc-homepage, .hc-public) :is(.hc-header, .hc-footer) { font: inherit; }
:is(.hc-homepage, .hc-public) .hc-header { padding: 0; }
:is(.hc-homepage, .hc-public) .hc-nav { gap: 24px; }
:is(.hc-homepage, .hc-public) .hc-nav-menu { margin-inline-start: auto; }
:is(.hc-homepage, .hc-public) .hc-nav-links { gap: clamp(18px, 2.6vw, 36px); }
:is(.hc-homepage, .hc-public) .hc-footer {
  --hc-ink: var(--hc-ink-inverse);
  color: var(--hc-ink);
}
:is(.hc-homepage, .hc-public) :is(.hc-footer-copy, .hc-footer-links, .hc-footer-bottom) {
  color: var(--hc-ink);
  font-size: var(--hc-type-body);
  line-height: var(--hc-leading-body);
}
:is(.hc-homepage, .hc-public) :is(.hc-brand-name, .hc-footer-title, .hc-nav-links) {
  color: var(--hc-ink);
  font-size: var(--hc-type-body);
  font-weight: var(--hc-weight-bold);
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

.hc-public h1 {
  color: var(--hc-ink);
  font-size: var(--hc-type-primary);
  font-weight: var(--hc-weight-primary);
  line-height: var(--hc-leading-primary);
  letter-spacing: -.025em;
}
.hc-public :is(h2, h3, h4, h5, h6) {
  color: var(--hc-ink);
  font-size: var(--hc-type-secondary);
  font-weight: var(--hc-weight-bold);
  line-height: var(--hc-leading-secondary);
  letter-spacing: -.012em;
}
.hc-public :is(p, li, dt, dd, summary, label, small, input, select, textarea) {
  font-family: var(--hc-font);
  font-size: var(--hc-type-body);
  line-height: var(--hc-leading-body);
}
.hc-public :is(p, small) { color: var(--hc-ink); }

@media (max-width: 820px) {
  :is(.hc-homepage, .hc-public) {
    --hc-gutter: 16px;
    --hc-card-padding: 18px;
    --hc-grid-gap: 12px;
  }
  :is(.hc-homepage, .hc-public) .hc-nav { gap: 8px; }
  :is(.hc-homepage, .hc-public) .hc-nav-links { align-items: flex-end; }
}

@media (max-width: 360px) {
  :is(.hc-homepage, .hc-public) .hc-nav-mascot { width: 28px; height: 34px; }
}

/* Shared control surface. Selected filters are styled by their page. */
:is(.hc-homepage, .hc-public) :is(
  .pi-link, .hc-home-profile .actions a, .case-service-link, .tool-card .inline-link,
  .contact-actions .btn, .hc-menu-toggle, .service-cta, .filter-btn, .back-link, .back-to-top
),
.hc-public :is(#project-share-button, #project-share-menu > button),
.public-rental-monitor .toolbar :is(button, .file-btn),
.public-price-trends #housing-root :is(a.action-button, button:not(.explore-legend button, .explore-row-select, [role="combobox"])),
.public-not-found #message a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 7px 13px;
  border: 0;
  border-radius: var(--hc-control-radius);
  background: var(--hc-button-fill);
  box-shadow: none;
  color: var(--hc-ink);
  font: var(--hc-weight-bold) var(--hc-type-body)/1.35 var(--hc-font);
  text-align: center;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
}
.hc-homepage .panel-item:is(:hover, :focus-visible) .pi-link,
:is(.hc-homepage, .hc-public) :is(
  .pi-link, .hc-home-profile .actions a, .case-service-link, .tool-card .inline-link,
  .contact-actions .btn, .hc-menu-toggle, .service-cta, .filter-btn, .back-link, .back-to-top
):not(:disabled):is(:hover, :focus-visible),
.hc-public :is(#project-share-button, #project-share-menu > button):not(:disabled):is(:hover, :focus-visible),
.public-rental-monitor .toolbar :is(button, .file-btn):not(:disabled):is(:hover, :focus-visible),
.public-price-trends #housing-root :is(a.action-button, button:not(.explore-legend button, .explore-row-select, [role="combobox"])):not(:disabled):is(:hover, :focus-visible),
.public-not-found #message a:not(:disabled):is(:hover, :focus-visible) {
  background-image: var(--hc-button-gradient);
  color: var(--hc-ink-inverse);
  text-decoration: none;
}
:is(.hc-homepage, .hc-public) :where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid #2270ba;
  outline-offset: 3px;
}
.hc-public button[hidden] { display: none !important; }
:is(.hc-homepage, .hc-public) .hc-nav button.hc-menu-toggle {
  display: none;
  align-self: center;
  padding: 5px 8px;
}
@media (max-width: 820px) {
  :is(.hc-homepage, .hc-public) .hc-nav button.hc-menu-toggle { display: inline-flex; }
  :is(.hc-homepage, .hc-public) .hc-nav-menu { align-items: flex-end; }
}
/* Map the existing public page components to the design shared with the homepage. */
.hc-public {
  --text: var(--hc-ink);
  --muted: var(--hc-ink);
  --line: var(--hc-card-line);
  --line-strong: var(--hc-card-line);
}
.hc-public :is(.project-card, .gallery-item, .seo-case-card, .case-card, .panel) {
  border: 1px solid var(--hc-card-line);
  border-radius: var(--hc-card-radius);
  box-shadow: var(--hc-card-shadow);
}
.hc-public :is(.project-card, .case-card):hover { box-shadow: var(--hc-card-shadow); }
.hc-public :is(.projects-grid, .case-grid, .gallery-grid, .seo-case-grid) { gap: var(--hc-grid-gap); }
.hc-public .page-header { text-align: start; }
.hc-public .page-header p { margin-inline: 0; }
.hc-public :is(.case-body, .seo-case-card > div) { padding: var(--hc-card-padding); }
.hc-public :is(.project-count, .project-date, .project-desc-cn, .project-meta, .category-badge, .meta-label, .scope-subtitle, .item-en, .item-cn, .section-copy, .category-title .en, .cn) {
  color: var(--hc-ink);
  font-size: var(--hc-type-body);
  line-height: var(--hc-leading-body);
}
.hc-public :is(.category-badge, .tag) {
  border-radius: var(--hc-control-radius);
  background: var(--hc-label-fill);
  color: var(--hc-ink);
  font-size: var(--hc-type-body);
  font-weight: var(--hc-weight-bold);
  text-transform: none;
}
.hc-public .category-title {
  font-size: var(--hc-type-secondary);
  font-weight: var(--hc-weight-bold);
  line-height: var(--hc-leading-secondary);
}
.public-service .service-main {
  width: var(--hc-layout-width);
  max-width: none;
  padding-inline: 0;
  color: var(--hc-ink);
  line-height: var(--hc-leading-body);
}
.public-service .service-main h1 { line-height: var(--hc-leading-primary); }
.public-service .service-main h2 { line-height: var(--hc-leading-secondary); }
.public-service .service-main h1 small {
  font-size: var(--hc-type-secondary);
  line-height: var(--hc-leading-secondary);
}
.public-service .service-main a:not(.service-cta) { color: var(--hc-ink); }
.public-service .service-faq details { border-color: var(--hc-card-line); }

.public-projects .page-header { text-align: center; }
.public-projects .filter-bar { justify-content: center; }
.public-projects .project-count { margin: 0; }
.public-projects .filter-bar button.filter-btn {
  font-weight: var(--hc-weight-normal);
  transition-property: background-color;
}
.public-projects .filter-btn.active {
  --hc-button-fill: var(--hc-label-fill);
  background-color: var(--hc-button-fill);
  color: var(--hc-ink);
}
.public-projects .filter-btn.active:is(:hover, :focus-visible) { color: var(--hc-ink-inverse); }
.public-projects .projects-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.public-projects .project-info { padding: 12px 14px; }
.public-projects .project-info h3 {
  font-size: var(--hc-type-body);
  font-weight: var(--hc-weight-bold);
  line-height: var(--hc-leading-body);
  letter-spacing: normal;
}
.public-projects .project-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-block-start: 4px;
}
.public-projects .construction-status {
  padding: 2px 7px;
  border-radius: var(--hc-control-radius);
  background: #eaf5ee;
  color: #255c3b;
  font-weight: var(--hc-weight-bold);
  line-height: var(--hc-leading-secondary);
}
.hc-public .back-to-top {
  position: fixed;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  background-color: #fff;
  box-shadow: var(--hc-card-shadow);
}
.public-project .project-title small {
  display: block;
  margin-top: 8px;
  font-size: var(--hc-type-secondary);
  line-height: var(--hc-leading-secondary);
}
.public-project .project-introduction { max-width: 80ch; margin-block-end: 30px; }
.public-project .project-introduction p { margin: 0 0 12px; }
.public-project #project-share-menu {
  border: 1px solid var(--hc-card-line);
  border-radius: var(--hc-card-radius);
  box-shadow: var(--hc-card-shadow);
  color: var(--hc-ink);
  font: inherit;
}
.public-project :is(#project-share-title, #project-share-status, #project-share-fallback, #project-share-link, #project-share-menu small, #project-share-button small) {
  color: inherit;
  font-size: var(--hc-type-body);
  line-height: var(--hc-leading-body);
}
.public-project #project-share-title { border-color: var(--hc-card-line); }
.public-project #project-share-menu > button + button { margin-block-start: 6px; }
.public-project #project-share-button { min-height: 34px; padding: 6px 9px; }
.public-project #project-share-menu button { justify-content: space-between; text-align: start; }
.public-project #project-share-menu [hidden] { display: none !important; }

.public-rental-monitor { background: #fff; }
.public-rental-monitor main {
  width: var(--hc-layout-width);
  max-width: none;
  padding-inline: 0;
}
.public-rental-monitor .grid { grid-template-columns: 430px minmax(0, 1fr); }
.public-rental-monitor .grid > * { min-width: 0; }
@media (max-width: 1100px) {
  .public-rental-monitor .grid { grid-template-columns: minmax(0, 1fr); }
}
.public-rental-monitor :is(.panel-header, .table-wrap, .scenario-wrap, .footer-note, .community-caption) {
  border-color: var(--hc-card-line);
}
.public-rental-monitor .panel-header { background: var(--hc-button-fill); }
.public-rental-monitor :is(.hint, .footer-note, .community-caption, .field label, .field small, .summary-box p, .panel-header p, .section-title, .pill, .signal-tag, .priority-badge, .priority-legend, th, td, .kpi .label, .kpi .sub) {
  font-size: var(--hc-type-body);
  line-height: var(--hc-leading-body);
}
.public-rental-monitor .kpi .value {
  font-size: var(--hc-type-secondary);
  line-height: var(--hc-leading-secondary);
}
.public-rental-monitor :is(.field input, .field select, .field textarea, .priority-badge, .pill, .signal-tag) {
  border-radius: var(--hc-control-radius);
}
.public-rental-monitor :is(.kpi, .summary-box, .table-wrap, .scenario-wrap, .focus-field) {
  border-radius: var(--hc-card-radius);
}
.public-rental-monitor .toolbar :is(button, .file-btn):hover { transform: none; }

/* These selectors keep chart markings, values, and alert colors legible. */
.public-price-trends #housing-root {
  font: inherit;
  color: var(--hc-ink);
}
.public-price-trends #housing-root .housing-intro {
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.public-price-trends #housing-root :is(.page-heading h1, .housing-intro h1) {
  color: var(--hc-ink);
  font-size: var(--hc-type-primary);
  font-weight: var(--hc-weight-primary);
  line-height: var(--hc-leading-primary);
}
.public-price-trends #housing-root button[role="combobox"] {
  min-height: 40px;
  border: 0;
  border-radius: var(--hc-control-radius);
  background: var(--hc-button-fill);
  color: var(--hc-ink);
  font: var(--hc-weight-bold) var(--hc-type-body)/1.35 var(--hc-font);
}
.public-price-trends #housing-root :is(h2, h3, .housing-intro h1 span, .metric-value, .market-kpis b) {
  font-size: var(--hc-type-secondary);
  line-height: var(--hc-leading-secondary);
}
.public-price-trends #housing-root :is(
  .section-nav button[aria-current="page"], .expanded-filters button[aria-pressed="true"],
  .focus-shortcuts button[aria-pressed="true"], button[role="tab"][aria-selected="true"]
) {
  --hc-button-fill: var(--hc-label-fill);
}
.public-price-trends #housing-root :is(
  p, small, td, th, .chart-note, .control-label, .page-heading p, .top-meta,
  .eyebrow, .metric-name, .metric-footer, .status-pill, .section-index,
  .chart-heading span, .explore-period, .explore-filter-title, .explore-scope-line,
  .source-links a, .hierarchy-heading span, .hierarchy-chart-foot, .hierarchy-coverage-note
) {
  font-family: var(--hc-font);
  font-size: var(--hc-type-body);
  line-height: var(--hc-leading-body);
}
.public-price-trends #housing-root :is(.chart-card, .source-card, .metric-card, .market-overview, .summary-strip, .explore-filter-panel) {
  border-color: var(--hc-card-line);
  border-radius: var(--hc-card-radius);
  box-shadow: var(--hc-card-shadow);
}

.public-not-found #message {
  border: 1px solid var(--hc-card-line);
  border-radius: var(--hc-card-radius);
  box-shadow: var(--hc-card-shadow);
}
.public-not-found #message h1 {
  color: var(--hc-ink);
  font-size: var(--hc-type-primary);
  line-height: var(--hc-leading-primary);
}
.public-not-found #message :is(p, h2) { color: var(--hc-ink); font-size: var(--hc-type-body); }
