/* Shared Core managed-form presentation primitives. */

.boc-managed-form {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #dcdcde;
}
.boc-managed-route__inner {
  padding-block: 32px 48px;
}
.boc-managed-form--embedded-route {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  --boc-infokits-accent: #2271b1;
  --boc-infokits-secondary: #20344d;
  --boc-infokits-neutral: #f6f7f7;
  --boc-infokits-text: #eef4fb;
  --boc-infokits-radius: 12px;
  --boc-ui-surface-bg: var(--boc-ui-form-section-bg, #ffffff);
  --boc-ui-surface-text: var(--boc-ui-form-section-text, #1f2937);
  --boc-ui-surface-border: var(--boc-ui-form-section-border, #dcdcde);
  --boc-ui-surface-title: var(--boc-ui-box-title-color, #154a93);
  --boc-ui-surface-muted: var(--boc-ui-form-description, #4b5563);
  --boc-ui-form-input-bg: var(--boc-ui-surface-bg, #ffffff);
  --boc-ui-form-input-text: var(--boc-ui-surface-text, #1f2937);
  --boc-ui-form-input-border: var(--boc-ui-surface-border, #dcdcde);
  --boc-ui-form-input-placeholder: rgba(75, 85, 99, 0.7);
  --boc-ui-form-label: #1f2937;
  --boc-ui-form-label-size: 1rem;
  --boc-ui-form-label-weight: 600;
  --boc-ui-form-label-line-height: 1.4;
  --boc-ui-box-title-color: #154a93;
  --boc-ui-box-title-size: 1.28rem;
  --boc-ui-box-title-gap: 18px;
  --boc-ui-box-title-weight: 700;
  --boc-ui-box-title-line-height: 1.25;
  --boc-ui-box-bg: var(--boc-ui-surface-bg, #ffffff);
  --boc-ui-box-text: var(--boc-ui-surface-text, #1f2937);
  --boc-ui-box-border: var(--boc-ui-surface-border, #dcdcde);
  --boc-ui-box-radius: var(--boc-infokits-radius, 12px);
  --boc-ui-box-padding: 20px;
  --boc-ui-box-gap: 16px;
  --boc-ui-box-shadow: none;
  --boc-ui-panel-title: var(--boc-ui-surface-title);
  --boc-ui-single-section-title: var(--boc-ui-box-title-color);
  --boc-ui-form-section-title-color: var(--boc-ui-box-title-color);
  --boc-ui-form-section-title-size: var(--boc-ui-box-title-size);
  --boc-ui-form-section-title-gap: var(--boc-ui-box-title-gap);
  --boc-ui-standalone-form-header-gap: 28px;
  --boc-ui-table-row-gap: 4px;
  --boc-ui-table-cell-padding-x: 18px;
  --boc-ui-table-header-padding-y: 8px;
  --boc-ui-table-group-padding-y: 8px;
  --boc-ui-table-item-padding-y: 1px;
  box-sizing: border-box;
  margin-bottom: clamp(32px, 5vw, 72px);
}

:where(.boc-managed-form) .boc-ui-panel--section,
:where(.boc-managed-form) .boc-ui-panel__body {
  align-content: start;
}
.boc-managed-form__header {
  display: grid;
  gap: 8px;
  margin-bottom: var(--boc-ui-standalone-form-header-gap, 16px);
}
.boc-managed-form__header h1,
.boc-managed-form__header .description {
  margin: 0;
}
.boc-managed-form__record-title {
  margin-bottom: 0;
}
.boc-managed-form__record-title-panel {
  display: grid;
  gap: 16px;
  padding: 15px 24px;
  border: 1px solid var(--boc-ui-primary, #2977b9);
  border-left: 5px solid var(--boc-ui-primary, #2977b9);
  border-radius: var(--boc-ui-box-radius, 12px);
  background: #f7fbff;
  box-shadow: 0 6px 18px rgba(35, 61, 94, 0.06);
}
.boc-managed-form__record-title-heading {
  display: grid;
  gap: 4px;
}
.boc-managed-form__record-title-heading h3 {
  margin: 0;
  color: var(--boc-ui-box-title-color, #154a93);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
}
.boc-managed-form__record-title-heading p {
  margin: 0;
  color: var(--boc-ui-form-description, #718198);
  font-size: 0.875rem;
  line-height: 1.5;
}
.boc-managed-form__record-title .boc-managed-form__field {
  display: block;
  margin-bottom: 0;
}
.boc-managed-form__record-title .boc-managed-form__field input {
  min-height: 58px;
  padding: 12px 15px;
  font-size: 1.35rem;
  line-height: 1.4;
}
.boc-managed-form__record-title input[type="text"] {
  color: var(--boc-ui-form-input-text, var(--boc-infokits-text));
  background: var(--boc-ui-form-input-bg, var(--boc-infokits-secondary));
  border: 1px solid var(--boc-ui-form-input-border, rgba(255, 255, 255, 0.28));
}
.boc-managed-form__record-title input[type="text"]:focus {
  color: var(--boc-ui-form-input-text, #20344d) !important;
  background: #ffffff !important;
  border-color: rgba(29, 78, 216, 0.58) !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
  caret-color: var(--boc-ui-form-input-text, #20344d);
  outline: none;
}
.boc-managed-form__sidebar-panel--manage {
  align-content: start;
}
.boc-managed-form__manage-copy {
  margin: 0;
  color: var(--boc-ui-single-support-text, #4b5563);
  line-height: 1.6;
}
.boc-managed-form__manage-actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}
.boc-managed-form__manage-actions > .button {
  width: 100%;
  margin: 0;
  text-align: center;
}
.boc-managed-form__body .boc-ui-panel {
  padding: var(--boc-ui-box-padding, 20px);
  border-color: var(--boc-ui-box-border, #dcdcde);
  border-radius: var(--boc-ui-box-radius, 12px);
  background: var(--boc-ui-box-bg, #fff);
  color: var(--boc-ui-box-text, #1f2937);
  box-shadow: var(--boc-ui-box-shadow, none);
}
.boc-managed-form__field {
  margin-bottom: 16px;
  min-width: 0;
}
.boc-managed-form__field label {
  display: block;
  margin-bottom: 6px;
}
.boc-managed-form__field .description {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--boc-ui-form-description, rgba(50, 71, 95, 0.78));
}
.boc-managed-form__field--error input,
.boc-managed-form__field--error select,
.boc-managed-form__field--error textarea {
  border-color: var(--boc-ui-button-destructive-bg, #b42318);
  box-shadow: 0 0 0 1px
    color-mix(
      in srgb,
      var(--boc-ui-button-destructive-bg, #b42318) 12%,
      transparent
    );
}
.boc-managed-form__error {
  margin: 6px 0 0;
  color: var(--boc-ui-button-destructive-bg, #b42318);
  font-size: 0.9rem;
  font-weight: 600;
}
.boc-managed-form__form-control .description {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--boc-ui-form-description, #4b5563);
}
.boc-managed-form__field input,
.boc-managed-form__field textarea,
.boc-managed-form__field select,
.boc-managed-form__form-control input,
.boc-managed-form__form-control select,
.boc-managed-form__form-control textarea {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}
.boc-managed-form__field select[multiple],
.boc-managed-form__form-control select[multiple] {
  min-height: 132px;
}
.boc-managed-form__field input[type="file"] {
  width: auto !important;
  max-width: 100%;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.boc-managed-form__field .quicktags-toolbar input,
.boc-managed-form__field .wp-editor-tools input,
.boc-managed-form__field .wp-editor-tools button,
.boc-managed-form__field .mce-toolbar button,
.boc-managed-form__field .mce-toolbar input {
  width: auto !important;
  max-width: none;
}
.boc-managed-form__form-row {
  display: grid;
  gap: 8px;
}
.boc-managed-form__form-row--labelled,
.boc-managed-form__form-rows--labelled .boc-managed-form__form-row {
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.boc-managed-form__form-rows--labelled {
  display: grid;
  gap: var(--boc-managed-form-labelled-row-gap, var(--boc-ui-box-gap, 16px));
  container-type: inline-size;
  container-name: boc-managed-form-labelled-rows;
}
.boc-managed-form__labelled-row-container {
  min-width: 0;
  container-type: inline-size;
  container-name: boc-managed-form-labelled-rows;
}
.boc-managed-form__form-rows--labelled[hidden] {
  display: none;
}
.boc-managed-form__form-label {
  margin: 0;
  color: var(--boc-ui-form-label, #1f2937);
  font-size: var(--boc-ui-form-label-size, 1rem);
  font-weight: var(--boc-ui-form-label-weight, 600);
  line-height: var(--boc-ui-form-label-line-height, 1.4);
}
.boc-managed-form__field
  > .boc-managed-form__form-row--labelled
  .boc-managed-form__form-label {
  margin: 0;
}
.boc-managed-form__form-control {
  min-width: 0;
}
.boc-managed-form__checkbox-control {
  display: flex;
  align-items: center;
  min-height: 1.4em;
}
.boc-managed-form__checkbox-control input[type="checkbox"] {
  width: auto !important;
  max-width: none;
  margin: 0;
}
.boc-managed-form__radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  width: 100%;
}
.boc-managed-form__radio-option {
  display: flex;
  flex: 1 1 max-content;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
}
.boc-managed-form__radio-option input[type="radio"] {
  width: auto !important;
  max-width: none;
  margin: 0;
}
.boc-managed-form__form-row--labelled .boc-managed-form__form-label,
.boc-managed-form__form-rows--labelled .boc-managed-form__form-label {
  padding-top: 10px;
}
.boc-managed-form__form-row--radio-group .boc-managed-form__form-label {
  padding-top: 0;
}
.boc-managed-form__form-row--checkbox .boc-managed-form__form-label {
  padding-top: 0;
}
.boc-managed-form--stack-labelled-rows
  .boc-managed-form__form-rows--labelled
  .boc-managed-form__form-row {
  grid-template-columns: minmax(0, 1fr);
}

.boc-managed-form--stack-labelled-rows
  .boc-managed-form__form-rows--labelled
  .boc-managed-form__form-label {
  padding-top: 0;
}
@container boc-managed-form-labelled-rows (max-width: 420px) {
  .boc-managed-form__form-rows--labelled .boc-managed-form__form-row,
  .boc-managed-form__labelled-row-container
    > .boc-managed-form__form-row--labelled {
    grid-template-columns: minmax(0, 1fr);
  }

  .boc-managed-form__form-rows--labelled .boc-managed-form__form-label,
  .boc-managed-form__labelled-row-container
    > .boc-managed-form__form-row--labelled
    .boc-managed-form__form-label {
    padding-top: 0;
  }
}
@media (max-width: 782px) {
  .boc-managed-form__form-row--labelled,
  .boc-managed-form__form-rows--labelled .boc-managed-form__form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .boc-managed-form__form-row--labelled .boc-managed-form__form-label,
  .boc-managed-form__form-rows--labelled .boc-managed-form__form-label {
    padding-top: 0;
  }
}
/* Keep the established later-source generic error colour without leaving the
 * managed-form error primitive in an Infokits stylesheet. */
.boc-managed-form__error {
  color: #b32d2e;
  margin-top: 6px;
}

/* Shared featured-image form presentation. Modules supply only image data,
 * labels, authorised controls and their own media/save behaviour. */
.boc-ui-feature-image {
  display: grid;
  gap: 0;
  height: 100%;
  margin-bottom: 0;
  padding: 2px !important;
  container-type: inline-size;
  container-name: boc-feature-image-panel;
}
.boc-ui-feature-image__layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: center;
}
.boc-ui-feature-image--layout-thirds .boc-ui-feature-image__layout {
  grid-template-columns: minmax(0, 1fr);
}
.boc-ui-feature-image__stage {
  min-height: 0;
  padding: 8px;
  display: grid;
  place-items: center;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.boc-ui-feature-image__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--boc-ui-single-info-separator, #e5e7eb);
  border-radius: calc(var(--boc-ui-box-radius, 12px) - 2px);
  background: var(--boc-ui-surface-bg, #f8fafc);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.boc-ui-feature-image__media.has-image {
  background: #f8fafc;
}
.boc-ui-feature-image__media:not(.has-image) {
  border-color: transparent;
  background: transparent;
}
.boc-ui-feature-image__media.is-dragging {
  border-color: var(--boc-ui-accent, #2563eb);
  box-shadow: 0 0 0 4px
    color-mix(in srgb, var(--boc-ui-accent, #2563eb) 16%, transparent);
  transform: scale(1.01);
}
.boc-ui-feature-image__stage .boc-ui-feature-image__media img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}
.boc-ui-feature-image--fit-contain .boc-ui-feature-image__stage {
  aspect-ratio: auto;
}
.boc-ui-feature-image--fit-contain
  .boc-ui-feature-image__stage
  .boc-ui-feature-image__media
  img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}
.boc-ui-feature-image__placeholder {
  margin-inline: auto;
}
.boc-ui-feature-image__media .boc-ui-feature-image__placeholder {
  width: 100%;
  min-height: 0;
  height: 100%;
  gap: 8px;
  padding: 14px;
}
.boc-ui-feature-image__media .boc-ui-image-dropzone__icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}
.boc-ui-feature-image__media .boc-ui-image-dropzone__copy {
  font-size: 0.875rem;
  line-height: 1.4;
}
.boc-ui-feature-image__upload {
  display: grid;
  align-content: center;
  gap: 18px;
  min-width: 0;
  padding: 16px 18px;
}
.boc-ui-feature-image__heading {
  display: grid;
  gap: 6px;
}
.boc-ui-feature-image__heading label {
  color: var(--boc-ui-box-title-color, #154a93);
  font-size: 1.05rem;
}
.boc-ui-feature-image__heading .description,
.boc-ui-feature-image__remove-note {
  margin: 0;
}
.boc-ui-feature-image__field {
  margin-bottom: 0;
}
.boc-ui-feature-image__actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.boc-ui-feature-image__actions[hidden] {
  display: none;
}
.boc-ui-feature-image__remove-button {
  width: 100%;
}
.boc-ui-feature-image__remove-button.is-active {
  border-color: var(--boc-ui-button-destructive-bg, #b42318);
  background: var(--boc-ui-button-destructive-soft-bg, rgba(180, 35, 24, 0.08));
  color: var(--boc-ui-button-destructive-bg, #b42318);
}
.boc-ui-image-dropzone {
  width: min(100%, 460px);
  min-height: 280px;
  display: grid;
  gap: 14px;
  justify-items: center;
  align-content: center;
  padding: 24px;
  border: 1px dashed rgba(29, 78, 216, 0.24);
  border-radius: calc(var(--boc-ui-box-radius, 12px) - 4px);
  background: linear-gradient(
    180deg,
    rgba(237, 245, 255, 0.82),
    rgba(255, 255, 255, 0.92)
  );
  text-align: center;
  box-sizing: border-box;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.boc-ui-image-dropzone:hover,
.boc-ui-image-dropzone:focus-visible {
  border-color: rgba(29, 78, 216, 0.4);
  box-shadow: 0 12px 30px rgba(29, 78, 216, 0.08);
  transform: translateY(-1px);
  outline: none;
}
.boc-ui-image-dropzone[hidden] {
  display: none !important;
}
.boc-ui-image-dropzone__icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(
    180deg,
    rgba(29, 78, 216, 0.14),
    rgba(29, 78, 216, 0.04)
  );
  position: relative;
}
.boc-ui-image-dropzone__icon::before,
.boc-ui-image-dropzone__icon::after {
  content: "";
  position: absolute;
  inset: 50%;
  background: rgba(29, 78, 216, 0.72);
  transform: translate(-50%, -50%);
  border-radius: 999px;
}
.boc-ui-image-dropzone__icon::before {
  width: 28px;
  height: 4px;
}
.boc-ui-image-dropzone__icon::after {
  width: 4px;
  height: 28px;
}
.boc-ui-image-dropzone__title {
  color: var(--boc-ui-single-title-shared, #1d4ed8);
  font-size: 1.1rem;
  font-weight: 700;
}
.boc-ui-image-dropzone__copy {
  color: var(--boc-ui-single-support-text, #4b5563);
  line-height: 1.6;
}
@container boc-feature-image-panel (max-width: 700px) {
  .boc-ui-feature-image__layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 782px) {
  .boc-ui-feature-image__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .boc-ui-image-dropzone {
    min-height: 220px;
    padding: 18px;
  }
  .boc-ui-feature-image__stage {
    min-height: 0;
    padding: 0;
  }
  .boc-ui-feature-image__media {
    min-height: 220px;
  }
  .boc-ui-feature-image__placeholder {
    min-height: 0;
  }
}
