/* WordPress emits menu wrappers that the approved static header does not have. */
.c-header__nav-list,
.c-header__nav-list > li,
.c-drawer__nav-list,
.c-drawer__nav-list > li {
  display: contents;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* WordPress core changes the browser-default figure margins. Restore the
   approved static layout for the representative portrait only. */
.c-message .c-message__photo {
  margin: 1em 40px;
}

/* Fluent Forms exposes its accessibility legend visually unless its helper
   CSS is present. Keep the legend for screen readers without showing it. */
.form-wrap .fluentform .ff_screen_reader_title {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Keep Fluent Forms' live form aligned with the approved contact-page grid. */
.form-wrap .fluentform form fieldset {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-wrap .fluentform .ff-el-group {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
}

.form-wrap .fluentform .ff-el-group::before,
.form-wrap .fluentform .ff-el-group::after {
  display: none !important;
  content: none !important;
}

.form-wrap .fluentform .ff-el-group:nth-of-type(n + 5) {
  grid-column: 1 / -1;
}

.form-wrap .fluentform .ff-el-input--label label,
.form-wrap .fluentform .ff-el-form-check-label {
  color: var(--navy);
  font-weight: 700;
}

.form-wrap .fluentform .ff-el-input--label {
  margin-bottom: 0 !important;
}

.form-wrap .fluentform .ff-el-form-control {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px 16px;
  border-radius: 0;
  font: inherit;
  line-height: inherit;
}

.form-wrap .fluentform textarea.ff-el-form-control {
  min-height: 180px;
  resize: vertical;
}

.form-wrap .fluentform .ff_submit_btn_wrapper {
  margin-top: -6px;
  justify-items: start;
}

.form-wrap .fluentform .kso-form-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.form-wrap .fluentform .ff-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-height: 52px;
  padding: 13px 24px;
  border: 1px solid var(--copper);
  border-radius: 0;
  background: var(--copper);
  color: #fff;
  font: 700 16px/1.85 'Zen Kaku Gothic New', sans-serif;
}

.form-wrap .fluentform .ff-btn-submit::after {
  content: "→";
  margin-left: 12px;
}

@media (max-width: 700px) {
  .form-wrap .fluentform form fieldset {
    grid-template-columns: 1fr;
  }

  .form-wrap .fluentform .ff-el-group:nth-of-type(n + 5) {
    grid-column: auto;
  }

}

@media (max-width: 768px) {
  .post-wrap {
    width: min(100% - 36px, 720px);
  }
}

/* Contact Form 7 uses the same approved contact-page grid as the former form. */
.form-wrap .wpcf7 form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-wrap .wpcf7 .form-field {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
}

.form-wrap .wpcf7 .form-field--wide,
.form-wrap .wpcf7 .cf-turnstile {
  grid-column: 1 / -1;
}

.form-wrap .wpcf7 .wpcf7-form-control-wrap {
  display: block;
}

.form-wrap .wpcf7 input:not([type='checkbox']),
.form-wrap .wpcf7 textarea,
.form-wrap .wpcf7 select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px 16px;
  border-radius: 0;
  font: inherit;
  line-height: inherit;
}

.form-wrap .wpcf7 textarea {
  min-height: 180px;
  resize: vertical;
}

.form-wrap .wpcf7 .wpcf7-list-item {
  margin: 0;
}

.form-wrap .wpcf7 .form-actions {
  grid-column: 1 / -1;
  margin-top: -6px;
}

.form-wrap .wpcf7 .c-btn {
  min-height: 52px;
  border: 1px solid var(--copper);
  border-radius: 0;
  background: var(--copper);
  color: #fff;
  font: 700 16px/1.85 'Zen Kaku Gothic New', sans-serif;
  cursor: pointer;
}

.form-wrap .wpcf7 .wpcf7-not-valid-tip,
.form-wrap .wpcf7 .wpcf7-response-output {
  margin: 8px 0 0;
  border-color: var(--copper);
  color: var(--navy);
}

.form-wrap .wpcf7 .wpcf7-spinner {
  margin-left: 10px;
}

@media (max-width: 700px) {
  .form-wrap .wpcf7 form .form-grid {
    grid-template-columns: 1fr;
  }

  .form-wrap .wpcf7 .form-field--wide,
  .form-wrap .wpcf7 .cf-turnstile,
  .form-wrap .wpcf7 .form-actions {
    grid-column: auto;
  }
}


/* Keep validation specific: identify the missing field before the form summary. */
.form-wrap .wpcf7 input[aria-invalid='true']:not([type='checkbox']),
.form-wrap .wpcf7 textarea[aria-invalid='true'],
.form-wrap .wpcf7 select[aria-invalid='true'] {
  border-color: var(--copper);
  box-shadow: 0 0 0 1px var(--copper);
}

.form-wrap .wpcf7 .wpcf7-acceptance.wpcf7-not-valid {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  outline: 2px solid var(--copper);
  outline-offset: 4px;
}

.form-wrap .wpcf7 .wpcf7-not-valid-tip {
  margin-top: 10px;
  color: var(--copper);
  font-weight: 700;
}

.form-wrap .wpcf7 .wpcf7-response-output {
  padding: 12px 16px;
  border: 1px solid var(--copper);
  background: #fff9f5;
  font-weight: 700;
}


/* The WordPress admin bar overlays fixed headers only while logged in. */
body.admin-bar .c-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .c-header {
    top: 46px;
  }
}
