/*
 * Site-wide form look: no boxed padding around forms, dark copper buttons.
 * Loaded on every front-end page by mu-plugins/site-form-styles.php.
 * Covers CiviCRM forms (events, donations, sign-ups) and Gravity Forms.
 * GiveWP forms draw in their own window; their colour is set in each form's settings.
 */

/* ---------- CiviCRM ---------- */
.crm-container.crm-public {
  --crm-page-padding: 0;
  --crm-form-block-padding: 0;
  --crm-form-block-box-shadow: none;
  --crm-f-fieldset-padding: 0;
  --crm-f-fieldset-margin: 0 0 10px 0;
  --crm-f-fieldset-border: 0;
  --crm-f-fieldset-box-shadow: none;
  --crm-f-fieldset-bg-color: transparent;
  /* compact: labels above their fields, small gaps, normal-height inputs */
  --crm-f-form-layout: block;
  --crm-f-form-padding: 3px;
  --crm-f-label-gap: 2px;
  --crm-f-label-align: left;
  --crm-f-input-padding: 8px 10px;
  --crm-f-input-font-size: 1rem;
  --crm-f-legend-padding: 0 0 6px 0;
  --crm-alert-margin: 0 0 10px;
  --crm-primary-color: #94562a;
  --crm-primary-text-color: #ffffff;
}
#crm-container.crm-public #crm-main-content-wrapper,
#crm-container.crm-public .crm-form-block,
#crm-container.crm-public #crm-profile-block {
  padding: 0;
  box-shadow: none;
  border: 0;
  background: transparent;
}
/* RiverLea makes the form container at least a full screen tall (min-height: 100vh),
   which leaves a big empty gap under short forms embedded in a page. */
#crm-container.crm-public { min-height: 0; }
#crm-container.crm-public form { margin-bottom: 0; }

/* The Customizer adds 18px above every label; keep labels snug to their fields */
#crm-container.crm-public form .label:not(.hiddenElement) {
  padding-top: 0;
  padding-bottom: 2px;
}
#crm-container.crm-public form .crm-section { margin-bottom: 4px; }
#crm-container.crm-public form .crm-section > .label { display: block; width: auto; text-align: left; margin: 0; }
#crm-container.crm-public form .crm-section > .content { margin: 0; }
#crm-container.crm-public form .crm-section .description { margin: 2px 0 0; }
#crm-container.crm-public fieldset legend { margin-bottom: 4px; }
#crm-container.crm-public .crm-submit-buttons { margin: 8px 0 0; padding: 0; }
#crm-container.crm-public .crm-public-form-item, #crm-container.crm-public .crm-public-footer { margin: 0; padding: 0; }

/* Buttons: dark copper, darker on hover */
#crm-container.crm-public .crm-submit-buttons button,
#crm-container.crm-public .crm-submit-buttons input[type="submit"],
#crm-container.crm-public .crm-submit-buttons .crm-button,
#crm-container.crm-public a.button.crm-register-button,
#crm-container.crm-public .action-link a.button {
  background: #94562a;
  border-color: #94562a;
  color: #ffffff;
}
#crm-container.crm-public .crm-submit-buttons button:hover,
#crm-container.crm-public .crm-submit-buttons button:focus,
#crm-container.crm-public .crm-submit-buttons input[type="submit"]:hover,
#crm-container.crm-public .crm-submit-buttons .crm-button:hover,
#crm-container.crm-public a.button.crm-register-button:hover,
#crm-container.crm-public .action-link a.button:hover {
  background: #7a4622;
  border-color: #7a4622;
  color: #ffffff;
}
#crm-container.crm-public .crm-submit-buttons button i { color: inherit; }

/* ---------- Gravity Forms ---------- */
.gform_wrapper,
.gform_wrapper.gform_legacy_markup_wrapper {
  margin: 0 0 16px;
  padding: 0;
}
.gform_wrapper.gform_legacy_markup_wrapper .gform_footer,
.gform_wrapper.gform_legacy_markup_wrapper .gform_page_footer {
  margin: 10px 0 0;
  padding: 0;
}
.gform_wrapper .gform_footer input[type="submit"],
.gform_wrapper .gform_footer button,
.gform_wrapper .gform_page_footer input[type="button"],
.gform_wrapper .gform_page_footer input[type="submit"],
.gform_wrapper .gform_page_footer button,
.gform_wrapper .gform_button {
  background: #94562a;
  border: 1px solid #94562a;
  color: #ffffff;
}
.gform_wrapper .gform_footer input[type="submit"]:hover,
.gform_wrapper .gform_footer button:hover,
.gform_wrapper .gform_page_footer input[type="button"]:hover,
.gform_wrapper .gform_page_footer input[type="submit"]:hover,
.gform_wrapper .gform_page_footer button:hover,
.gform_wrapper .gform_button:hover {
  background: #7a4622;
  border-color: #7a4622;
  color: #ffffff;
}

/* ---------- Button text and icons centred in every form button ----------
   CiviCRM's theme (RiverLea) fixes buttons at 28px tall, so the larger padding our forms use pushed the label and
   its check icon down past the bottom of the button. Let buttons size to their content, centred. */
#crm-container.crm-public .crm-submit-buttons button,
#crm-container.crm-public .crm-submit-buttons .crm-button,
#crm-container.crm-public .crm-submit-buttons input[type="submit"],
#crm-container.crm-public a.button.crm-register-button,
#crm-container.crm-public .action-link a.button {
  height: auto !important;
  min-height: 40px;
  line-height: 1.25 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  gap: 8px;
  vertical-align: middle;
  box-sizing: border-box;
}
#crm-container.crm-public .crm-submit-buttons button .crm-i,
#crm-container.crm-public a.button .crm-i {
  line-height: 1 !important;
  margin: 0 !important;
  position: static !important;
  top: auto !important;
  vertical-align: middle;
}
.gform_wrapper .gform_footer input[type="submit"],
.gform_wrapper .gform_footer button,
.gform_wrapper .gform_page_footer input[type="button"],
.gform_wrapper .gform_page_footer input[type="submit"],
.gform_wrapper .gform_page_footer button,
.gform_wrapper .gform_button {
  height: auto !important;
  min-height: 40px;
  line-height: 1.25 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  vertical-align: middle;
  box-sizing: border-box;
}

/* Section headings inside the CiviCRM registration forms (hall-data/forms/civi-build.php). */
.crm-container .jo-reg-h { margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #ecdcc4; font-family: Lora, Georgia, serif; font-weight: 600; font-size: 1.25rem; color: #1f1b16; }
.crm-container .crm-section:first-child .jo-reg-h { margin-top: 6px; }

/* Website forms (CiviCRM profiles) inside pages: a light box, and the thank-you note after sending. */
.jo-civi-form { margin: 10px 0 24px; padding: 20px 22px; background: #fff; border: 1px solid #ecdcc4; border-top: 4px solid #94562a; border-radius: 12px; box-shadow: 0 2px 10px rgba(31, 27, 22, .06); }
.jo-civi-form .crm-container legend { font-family: Lora, Georgia, serif; font-weight: 600; font-size: 1.2rem; color: #1f1b16; }
.jo-sent { margin: 0 0 16px; padding: 12px 14px; border-radius: 8px; background: #e3f1e7; color: #24543a; font-weight: 600; }

/* ---------- Compact public CiviCRM forms ----------
   The Customizer's Additional CSS (loaded after this file) styles CiviCRM forms Bootstrap-style: forms centred at
   600px, inputs with 1.5em padding on grey, 15px under every row, uppercase labels. These win over it ("html body"). */
html body #crm-container.crm-public form { max-width: none; margin: 0; }
html body #crm-container.crm-public,
html body #crm-container.crm-public #crm-main-content-wrapper,
html body #crm-container.crm-public #crm-profile-block { background: transparent; padding: 0; margin: 0; }
html body #crm-container.crm-public form .crm-section,
html body #crm-container.crm-public form .form-item { margin: 0 0 8px; padding: 0; }
html body #crm-container.crm-public form .label:not(.hiddenElement),
html body #crm-container.crm-public form label {
  font-family: inherit; text-transform: none; letter-spacing: normal; font-size: .92rem; font-weight: 600;
  padding: 0; margin: 0 0 3px;
  white-space: normal; /* long labels wrap instead of being cut off */
}
html body #crm-container.crm-public form .crm-option-label-pair label,
html body #crm-container.crm-public form .price-set-option-content label { font-weight: 400; margin: 0; }
html body #crm-container.crm-public form input:not([type="checkbox"]):not([type="submit"]):not([type="radio"]):not([type="hidden"]),
html body #crm-container.crm-public form select,
html body #crm-container.crm-public form textarea {
  padding: 8px 10px; background-color: #fff; border: 1px solid #d8cbb9; border-radius: 6px; min-height: 0; height: auto; line-height: 1.4;
}
html body #crm-container.crm-public form input.big:not([type="checkbox"]):not([type="radio"]),
html body #crm-container.crm-public form textarea { width: 100%; max-width: 480px; box-sizing: border-box; }
html body #crm-container.crm-public form fieldset legend { padding: 0; margin: 4px 0 6px; }
html body #crm-container.crm-public .crm-title h2 { margin: 0 0 10px; }

/* the website forms: one box, not a card inside a panel */
.ae-form { padding: 16px 18px 10px; }
.ae-form > p { margin: 0 0 8px; }
.ae-form .jo-civi-form, .jo-ev-register-body .jo-civi-form { margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; }
.jo-civi-form { padding: 16px 18px; }

/* ---------- Hebrew site (right to left) ----------
   The rules above align labels left, for English. On the Hebrew site (html dir="rtl") labels and options belong on
   the right, each checkbox next to its own text, and the text fields one width, like the comment box. The donation
   form keeps its own layout (civi-donate.css). */
html[dir="rtl"] body #crm-container.crm-public { direction: rtl; text-align: right; --crm-f-label-align: right; }
html[dir="rtl"] body #crm-container.crm-public form .crm-section > .label,
html[dir="rtl"] body #crm-container.crm-public form .label:not(.hiddenElement),
html[dir="rtl"] body #crm-container.crm-public form label,
html[dir="rtl"] body #crm-container.crm-public form .content,
html[dir="rtl"] body #crm-container.crm-public form legend,
html[dir="rtl"] body #crm-container.crm-public .crm-title { text-align: right; }
html[dir="rtl"] body #crm-container.crm-public form .crm-multiple-checkbox-radio-options .crm-option-label-pair {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin: 0 0 4px; text-align: right;
}
html[dir="rtl"] body #crm-container.crm-public form .crm-multiple-checkbox-radio-options .crm-option-label-pair input { margin: 0; flex: 0 0 auto; }
html[dir="rtl"] body #crm-container.crm-public form .crm-multiple-checkbox-radio-options .crm-option-label-pair label { margin: 0; flex: 0 1 auto; }
html[dir="rtl"] body #crm-container.crm-public form .crm-marker { margin: 0 3px 0 0; }
html[dir="rtl"] body #crm-container.crm-public form:not(.CRM_Contribute_Form_Contribution_Main) input[type="text"],
html[dir="rtl"] body #crm-container.crm-public form:not(.CRM_Contribute_Form_Contribution_Main) input[type="email"],
html[dir="rtl"] body #crm-container.crm-public form:not(.CRM_Contribute_Form_Contribution_Main) input[type="tel"],
html[dir="rtl"] body #crm-container.crm-public form:not(.CRM_Contribute_Form_Contribution_Main) input[type="number"],
html[dir="rtl"] body #crm-container.crm-public form:not(.CRM_Contribute_Form_Contribution_Main) select,
html[dir="rtl"] body #crm-container.crm-public form:not(.CRM_Contribute_Form_Contribution_Main) textarea {
  width: 100%; max-width: 480px; box-sizing: border-box; margin-left: auto; margin-right: 0;
}
/* email addresses and phone numbers are typed left to right, even on the Hebrew site */
html[dir="rtl"] body #crm-container.crm-public form input[type="email"],
html[dir="rtl"] body #crm-container.crm-public form input[name^="email"],
html[dir="rtl"] body #crm-container.crm-public form input[name^="phone"] { direction: ltr; text-align: right; }
html[dir="rtl"] body #crm-container.crm-public .crm-submit-buttons { text-align: right; }
html[dir="rtl"] body #crm-container.crm-public form #billing-payment-block fieldset legend,
html[dir="rtl"] body #crm-container.crm-public form .crm-group.payment_options-group fieldset legend { text-align: right; }
