/*
 * WordPress-only additions. Everything else in assets/css is the original Next.js styling.
 */

/* Smooth cross-page transitions (Chrome/Edge 126+, Safari 18.2+). Other browsers keep the route-enter fade. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 220ms;
  }
}

.site-header {
  view-transition-name: site-header;
}

.screen-reader-text {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

[hidden],
.mobile-menu-group-items[hidden],
[data-show-for][hidden] {
  display: none !important;
}

/* Contact Form 7: let the original form CSS see the same structure as the React forms. */
.wpcf7,
.wpcf7-form-control-wrap {
  display: contents;
}

.wpcf7-spinner {
  display: none !important;
}

/* Field errors show under the field (field wrappers are flex columns). */
.wpcf7-not-valid-tip {
  color: #ff8a8a;
  display: block;
  font-size: 13px;
  line-height: 1.4;
}

/* The newsletter row has one field; its error goes in the message below the form. */
.newsletter-form .wpcf7-not-valid-tip {
  display: none !important;
}

.skip-link:focus {
  background: var(--color-primary-500, #8a4fc2);
  border-radius: 8px;
  clip-path: none;
  color: #fff;
  height: auto;
  left: 16px;
  margin: 0;
  padding: 12px 16px;
  top: 16px;
  width: auto;
  z-index: 100;
}

.wpcf7-form.submitting [type="submit"] {
  opacity: 0.6;
  pointer-events: none;
}

.input.wpcf7-not-valid,
.select.wpcf7-not-valid {
  border-color: #e5484d !important;
}

.wpcf7 form .wpcf7-response-output {
  border: 1px solid var(--color-primary-500, #8a4fc2);
  border-radius: 8px;
  color: var(--color-secondary-50, #f0f0f0);
  font-size: 14px;
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 16px;
  width: 100%;
  flex-basis: 100%;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
  border-color: #e5484d;
}

.newsletter-form {
  position: relative;
}

.wpcf7 form.newsletter-form .wpcf7-response-output {
  left: 0;
  position: absolute;
  top: calc(100% + 12px);
}

/* Admin bar offset for the fixed header when logged in. */
.admin-bar .site-header {
  top: var(--wp-admin--admin-bar--height, 0);
}
