/* Native Webform content pages: no form IDs, fixed field counts or custom HTML. */
.ip-webform-page {
  --ip-form-accent: #a9480f;
  --ip-form-ink: #3e3f41;
  /* Same side gutter as other content pages; webform nodes use the full-width container. */
  width: min(1404px, 100% - 2 * clamp(16px, 3vw, 48px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 6vw, 72px);
  color: var(--ip-form-ink);
  /* Slightly smaller than the site default: forms are long and dense. */
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* Keep the existing breadcrumb navigation compact on this content type. */
body.node--type-webform .body-page .main-page.has-breadcrumb .container-bg {
  margin-top: 0;
  padding-top: 0;
}

body.node--type-webform .breadcrumbs .breadcrumb-content-inner {
  margin-bottom: 0;
}

body.node--type-webform .breadcrumbs .gva-block-breadcrumb .breadcrumb-style {
  margin-bottom: 0;
  padding: 14px 0;
  /* Override the theme's forced map image and inline background. */
  background-image: none !important;
  background-color: #f3f4f5;
}

body.node--type-webform .breadcrumbs .breadcrumb-content-main {
  padding: 0;
}

body.node--type-webform .breadcrumbs .gva-breadcrumb-content .breadcrumb-links nav.breadcrumb li {
  color: #58595b;
}

body.node--type-webform .gva-breadcrumb-content .page-title {
  display: none;
}

.ip-webform-page .ip-webform-page__title {
  margin: 0;
  color: var(--ip-form-ink);
  font-family: Arial, Helvetica, sans-serif;
  /* The theme's global heading size/line-height rules use !important. */
  font-size: clamp(28px, 2.8vw, 38px) !important;
  line-height: 1.2 !important;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-transform: none;
}

.ip-webform-page__header::after {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  margin: 16px 0 22px;
  background: #d76117;
}

.ip-webform-page .field--name-body {
  margin-bottom: 32px;
}

.ip-webform-page :is(p, ul, ol) {
  margin: 0 0 16px;
}

.ip-webform-page :is(ul, ol) {
  padding-left: 24px;
}

.ip-webform-page li + li {
  margin-top: 6px;
}

body .body-page .ip-webform-page a {
  /* The theme customizer forces the global link colour with !important. */
  color: var(--ip-form-accent) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ip-webform-page .webform-submission-form {
  width: 100%;
  margin: 0;
  color: var(--ip-form-ink);
  font: inherit;
}

.ip-webform-page .webform-submission-form .form-item {
  min-width: 0;
  margin: 0 0 14px;
}

.ip-webform-page .webform-section {
  margin: 0;
  padding: 22px 0 4px;
  border-top: 1px solid #e4e4e4;
}

.ip-webform-page .webform-section-title {
  margin: 0 0 12px;
  padding: 0;
  color: var(--ip-form-ink);
  font-size: 17px !important;
  line-height: 1.4 !important;
  text-transform: none;
}

/* Wide screens: short questions (dropdowns, one-line fields) side by side;
   text areas, option lists and notes keep the full width. */
@media (min-width: 992px) {
  .ip-webform-page .webform-section-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    align-items: start;
  }

  .ip-webform-page .webform-section-wrapper > * {
    grid-column: 1 / -1;
  }

  .ip-webform-page .webform-section-wrapper > :is(.js-form-type-select, .js-form-type-textfield, .js-form-type-email, .js-form-type-number, .js-form-type-date) {
    grid-column: auto;
    /* Share label, control and help-text rows between neighbouring fields.
       Wrapped labels and optional descriptions cannot shift one input. */
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    align-self: stretch;
  }

  .ip-webform-page .webform-section-wrapper > :is(.js-form-type-select, .js-form-type-textfield, .js-form-type-email, .js-form-type-number, .js-form-type-date) > label {
    grid-row: 1;
  }

  .ip-webform-page .webform-section-wrapper > :is(.js-form-type-select, .js-form-type-textfield, .js-form-type-email, .js-form-type-number, .js-form-type-date) > :is(input:not([type="hidden"]), select) {
    grid-row: 2;
    align-self: start;
  }

  .ip-webform-page .webform-section-wrapper > :is(.js-form-type-select, .js-form-type-textfield, .js-form-type-email, .js-form-type-number, .js-form-type-date) > .description {
    grid-row: 3;
  }
}

.ip-webform-page .webform-section-wrapper > :last-child {
  margin-bottom: 0;
}

.ip-webform-page .webform-submission-form fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

.ip-webform-page .webform-submission-form legend {
  float: none;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font: inherit;
}

.ip-webform-page .webform-submission-form :is(label, .fieldset-legend) {
  display: block;
  margin: 0 0 5px;
  color: var(--ip-form-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.ip-webform-page .webform-submission-form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="image"]):not([type="range"]):not([type="color"]), select, textarea) {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  padding: 6px 11px;
  border: 1px solid #b7b7b7;
  border-radius: 8px;
  background: #fff;
  color: var(--ip-form-ink);
  font: inherit;
}

.ip-webform-page .webform-submission-form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea):hover {
  border-color: #898989;
}

.ip-webform-page .webform-submission-form textarea {
  resize: vertical;
}

.ip-webform-page .webform-submission-form select {
  padding-right: 30px;
  text-overflow: ellipsis;
}

.ip-webform-page .webform-submission-form :is(.js-form-type-checkbox, .js-form-type-radio) {
  position: relative;
  margin: 0 0 2px;
}

.ip-webform-page .webform-submission-form :is(.form-checkbox, .form-radio) {
  position: absolute;
  top: 6px;
  left: 0;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--ip-form-accent);
  cursor: pointer;
}

.ip-webform-page .webform-submission-form label.option {
  box-sizing: border-box;
  min-height: 30px;
  margin: 0;
  padding: 3px 0 3px 28px;
  font-weight: 400;
  cursor: pointer;
}

.ip-webform-page .webform-submission-form .webform-options-display-side-by-side {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
  row-gap: 6px;
}

.ip-webform-page :is(a, input, select, textarea, button, summary) {
  scroll-margin-top: 150px;
}

.ip-webform-page .webform-submission-form :is(.description, .webform-element-description, .webform-section-description) {
  margin: 4px 0 8px;
  color: #58595b;
  font-size: 13px;
  line-height: 1.6;
}

.ip-webform-page .webform-submission-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 28px 0 0;
}

.ip-webform-page .webform-submission-form .form-submit {
  min-height: 46px;
  margin: 0;
  padding: 12px 26px;
  border: 1px solid var(--ip-form-accent);
  border-radius: 999px;
  background: var(--ip-form-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
}

.ip-webform-page .webform-submission-form .form-submit:hover {
  background: #87390c;
  border-color: #87390c;
}

.ip-webform-page :is(a, input, select, textarea, button, summary):focus-visible {
  /* Restore keyboard focus over the skin's global outline:none !important. */
  outline: 3px solid #295c63 !important;
  outline-offset: 3px;
}

.ip-webform-page .webform-submission-form :is(input, select, textarea).error {
  border-color: #a12622;
  box-shadow: 0 0 0 1px #a12622;
}

.ip-webform-page .webform-submission-form :disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ip-webform-page .webform-submission-form .webform-flex--container {
  min-width: 0;
}

.ip-webform-page .webform-confirmation {
  padding: 24px;
  border-left: 4px solid #d76117;
  border-radius: 0 12px 12px 0;
  background: #fbe7d9;
}

@media (max-width: 600px) {
  .ip-webform-page .webform-submission-form .webform-flexbox {
    display: block;
    margin: 0;
  }

  .ip-webform-page .webform-submission-form .webform-flex--container {
    margin: 0;
  }
}
