/* LIVE 1.3 — Community typography and controls, without replacing RED's
   landscape, logo, page rails, responsive galleries or application behavior.
   Source: Community 0.9.20 community.css final cascade (including compact
   rules at 750 and mobile controls at 801). Pixel tokens deliberately preserve
   the existing 16px root/rem geometry. Load after every legacy stylesheet.
   html:root provides one stable specificity tier over legacy component rules. */
html:root body.red-ui-community-live {
  --red-ui-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --red-ui-heading: Georgia, "Times New Roman", serif;
  --red-ui-ink: #493525;
  --red-ui-muted: #513823;
  --red-ui-green: #27482c;
  --red-ui-deep: #17351f;
  --red-ui-line: #c5a577;
  --red-ui-field: #fff9ed;
  --red-ui-danger: #8c332d;
  font-family: var(--red-ui-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--red-ui-ink);
}

/* Preserve the header's already verified dimensions and logo. Only its text
   face follows the Community; the root sizing, insets and mobile logic do not. */
html:root body.red-ui-community-live :is(button, input, select, textarea) {
  font-family: var(--red-ui-font);
}
html:root body.red-ui-community-live :is(h1, h2, h3) {
  font-family: var(--red-ui-heading);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}
html:root body.red-ui-community-live :is(main, article, .hero, .member-hero, .report-hero, .red-content-hero, .science-hero, .red-search-hero, .wrap) h1 {
  font-size: clamp(25.2px, 4vw, 50.4px);
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
html:root body.red-ui-community-live :is(.member-hero, .red-content-hero, .report-hero, .red-search-hero, .red-profile-card, .red-account-end-card) h1 {
  font-size: clamp(23.8px, 3.2vw, 37.8px);
}
html:root body.red-ui-community-live :is(main, article, .hero, .member-hero, .report-hero, .red-content-hero, .science-hero, .red-search-hero, .wrap) h2 {
  font-size: clamp(18.9px, 2.4vw, 28px);
  overflow-wrap: anywhere;
}
html:root body.red-ui-community-live :is(main, article, .hero, .member-hero, .report-hero, .red-content-hero, .science-hero, .red-search-hero, .wrap) h3 {
  font-size: 16.1px;
  overflow-wrap: anywhere;
}
html:root body.red-ui-community-live :is(main, article, .hero, .member-hero, .report-hero, .red-content-hero, .science-hero, .red-search-hero, .wrap) :is(p, li, .lead, .member-lead, .report-lead) {
  font-family: var(--red-ui-font);
  font-size: 14px;
  line-height: 1.5;
}
/* Retain meaningful colors on dark panels, warnings and error states. */
html:root body.red-ui-community-live :is(main, article, .wrap) .muted { color: var(--red-ui-muted); }

/* Explicit interactive controls, not every anchor/button: header icon tools,
   gallery/lightbox controls, ratings, map/diagram elements stay specialized. */
html:root body.red-ui-community-live :is(main, article, .hero, .member-hero, .report-hero, .red-content-hero, .science-hero, .wrap)
  :is(.btn, .button, .back, .home-button, .red-footer-button, .red-project-submit, .red-record-button, .red-solid-button, .red-outline-button, .safe, button.danger, a.danger) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 36px;
  max-width: 100%;
  padding: 8.4px 13.3px;
  border: 1px solid var(--red-ui-green);
  border-radius: 999px;
  background: var(--red-ui-green);
  color: #fff;
  font: 750 14px/1.2 var(--red-ui-font);
  text-decoration: none;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
html:root body.red-ui-community-live :is(main, article, .hero, .member-hero, .report-hero, .red-content-hero, .science-hero, .wrap)
  :is(.btn, .button, .back, .home-button, .red-footer-button, .red-project-submit, .red-record-button, .red-solid-button, .red-outline-button, .safe, button.danger, a.danger):hover {
  background: var(--red-ui-deep);
  color: #fff;
}
html:root body.red-ui-community-live :is(main, article, .hero, .member-hero, .report-hero, .red-content-hero, .science-hero, .wrap)
  :is(.btn.secondary, .button.secondary, .red-outline-button, .safe) {
  background: transparent;
  color: var(--red-ui-green);
}
html:root body.red-ui-community-live :is(main, article, .hero, .member-hero, .report-hero, .red-content-hero, .science-hero, .wrap)
  :is(.btn.secondary, .button.secondary, .red-outline-button, .safe):hover {
  background: var(--red-ui-green);
  color: #fff;
}
/* These two navigation rows sit directly on the landscape, not inside a
   light card. An opaque cream surface keeps secondary links readable. */
html:root body.red-ui-community-live :is(.red-settings-nav, .member-dashboard-nav) .btn.secondary {
  background: var(--red-ui-field);
  color: var(--red-ui-green);
}
html:root body.red-ui-community-live :is(main, article, .wrap) :is(.btn.danger, .button.danger, button.danger, a.danger) {
  border-color: var(--red-ui-danger);
  background: var(--red-ui-danger);
  color: #fff;
}
html:root body.red-ui-community-live :is(main, article, .wrap) :is(.btn, .button):disabled {
  cursor: not-allowed;
  opacity: .6;
}
html:root body.red-ui-community-live :is(main, article, .wrap) :is(.btn, .button, .safe, button.danger, a.danger):focus-visible {
  outline: 3px solid rgba(113,139,69,.5);
  outline-offset: 3px;
}

/* Existing field structures are supported without renaming form identifiers,
   changing values, validation, CSRF fields, checkboxes or upload behavior.
   :where keeps input exclusions specificity-neutral, so the textarea and
   mobile rules below can actually override the shared control declaration. */
html:root body.red-ui-community-live :is(main, article, .wrap) .field {
  min-width: 0;
  gap: 5.32px;
  margin-bottom: 11.9px;
}
html:root body.red-ui-community-live :is(.field, .red-project-card, .red-contact-form, .subscription-login) label,
html:root body.red-ui-community-live .subscription-login label span {
  font-family: var(--red-ui-font);
  font-size: 12.6px;
  font-weight: 750;
  line-height: 1.5;
}
html:root body.red-ui-community-live :is(.field, .red-project-card, .red-contact-form, .subscription-login, .newsletter-admin)
  :is(input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="image"]):not([type="file"]):not([type="submit"]):not([type="button"])), select, textarea) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  padding: 7.7px 9.8px;
  border: 1px solid var(--red-ui-line);
  border-radius: 8.4px;
  background: var(--red-ui-field);
  color: var(--red-ui-ink);
  font: 14px/1.5 var(--red-ui-font);
}
html:root body.red-ui-community-live :is(.field, .red-project-card, .red-contact-form, .subscription-login, .newsletter-admin) textarea {
  min-height: 95px;
  padding-block: 8.4px;
  resize: vertical;
}
html:root body.red-ui-community-live :is(.field, .red-project-card, .red-contact-form, .subscription-login, .newsletter-admin) :is(input, select, textarea):focus-visible {
  outline: 3px solid rgba(113,139,69,.24);
  outline-offset: 1px;
  border-color: var(--red-ui-green);
}
html:root body.red-ui-community-live :is(.field, .red-project-card, .red-contact-form, .subscription-login, .newsletter-admin) :is(input, textarea)::placeholder {
  color: var(--red-ui-muted);
  opacity: 1;
}
/* A password toggle must never cover text. The old shell also protects this
   with !important; preserve that existing specialized right inset. */
html:root body.red-ui-community-live .red-password-control input { padding-right: 3.15rem !important; }

@media (max-width: 760px) {
  html:root body.red-ui-community-live :is(.field, .red-project-card, .red-contact-form, .subscription-login, .newsletter-admin)
    :is(input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="image"]):not([type="file"]):not([type="submit"]):not([type="button"])), select, textarea) { font-size: 16px; }
  html:root body.red-ui-community-live :is(main, article, .hero, .member-hero, .report-hero, .red-content-hero, .science-hero, .wrap)
    :is(.btn, .button, .back, .home-button, .red-footer-button, .red-project-submit, .red-record-button, .red-solid-button, .red-outline-button, .safe, button.danger, a.danger) { min-height: 42px; }
}
