html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  background: var(--samasti-surface);
  color: var(--samasti-text);
  font-family: var(--samasti-font-body);
  font-size: var(--wp--preset--font-size--body, 1rem);
  line-height: 1.65;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  color: var(--samasti-text);
  font-family: var(--samasti-font-heading);
}

h1,
.h1 {
  margin-bottom: 0.5em;
  font-size: var(--wp--preset--font-size--h-1, clamp(2.25rem, 5vw, 3rem));
  font-weight: 700;
  line-height: 1.1;
}

h2,
.h2 {
  margin-bottom: 0.5em;
  font-size: var(--wp--preset--font-size--h-2, clamp(1.75rem, 4vw, 2.5rem));
  font-weight: 700;
  line-height: 1.15;
}

h3,
.h3 {
  margin-bottom: 0.5em;
  font-size: var(--wp--preset--font-size--h-3, clamp(1.375rem, 3vw, 1.75rem));
  font-weight: 650;
  line-height: 1.2;
}

h4,
.h4 {
  margin-bottom: 0.55em;
  font-size: var(--wp--preset--font-size--h-4, clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem));
  font-weight: 650;
  line-height: 1.3;
}

h5,
.h5 {
  margin-bottom: 0.55em;
  font-size: var(--wp--preset--font-size--h-5, 1.0625rem);
  font-weight: 650;
  line-height: 1.35;
}

h6,
.h6 {
  margin-bottom: 0.55em;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
}

small,
.small {
  font-size: var(--wp--preset--font-size--small, 0.875rem);
}

p {
  margin-top: 0;
  margin-bottom: var(--samasti-stack-gap);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--samasti-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--samasti-dark);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--samasti-focus);
  outline-offset: 3px;
}

label {
  display: inline-block;
  margin-bottom: var(--samasti-space-xs);
  color: var(--samasti-text);
  font-weight: 600;
}

:where(
  input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]),
  select,
  textarea
) {
  display: block;
  width: 100%;
  min-height: var(--samasti-control-height);
  padding: 0.6875rem 0.875rem;
  border: 1px solid var(--samasti-border);
  border-radius: var(--samasti-radius-sm);
  background: var(--samasti-surface);
  color: var(--samasti-text);
  font: inherit;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

select {
  padding-right: 2.5rem;
}

:where(input, textarea)::placeholder {
  color: #6b7280;
  opacity: 1;
}

:where(input[type="checkbox"], input[type="radio"]) {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.15em 0.4rem 0 0;
  accent-color: var(--samasti-primary);
}

:where(input, select, textarea):focus {
  border-color: var(--samasti-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  outline: 0;
}

:where(input, select, textarea):disabled {
  border-color: var(--samasti-border);
  background: var(--samasti-surface-muted);
  color: var(--samasti-text-muted);
  cursor: not-allowed;
  opacity: 1;
}

:where(input, select, textarea)[aria-invalid="true"],
:where(input, select, textarea).is-invalid,
.wpcf7-not-valid {
  border-color: var(--samasti-error);
}

.form-text,
.form-help,
.description,
.samasti-form-help {
  margin-top: var(--samasti-space-xs);
  color: var(--samasti-text-muted);
  font-size: var(--wp--preset--font-size--small, 0.875rem);
}

.invalid-feedback,
.form-error,
.wpcf7-not-valid-tip,
.samasti-form-message--error {
  margin-top: var(--samasti-space-xs);
  color: var(--samasti-error);
  font-size: var(--wp--preset--font-size--small, 0.875rem);
}

.form-success,
.samasti-form-message--success,
.wpcf7 form.sent .wpcf7-response-output {
  color: var(--samasti-success);
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn,
.wp-element-button,
.wp-block-button__link,
body .samasti-posts-list__cta,
body .samasti-schedule__cta,
body .samasti-steps__cta,
body .contact-card__form .wpcf7-submit {
  display: inline-flex;
  min-height: var(--samasti-control-height);
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.125rem;
  border: 1px solid transparent;
  border-radius: var(--samasti-radius);
  font-family: var(--samasti-font-ui);
  font-size: var(--wp--preset--font-size--ui, 1rem);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.entry-content form > :where(div, p, fieldset):not(:last-child) {
  margin-bottom: var(--samasti-space-md);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: var(--samasti-space-sm);
  color: var(--samasti-text);
  font-weight: 600;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn-primary,
:where(.wp-element-button, .wp-block-button__link),
body .samasti-posts-list__cta,
body .samasti-schedule__cta,
body .samasti-steps__cta,
body .contact-card__form .wpcf7-submit {
  border-color: var(--samasti-primary);
  background: var(--samasti-primary);
  color: var(--samasti-text-inverse);
}

:where(button, input[type="button"], input[type="submit"], input[type="reset"]):not(:disabled):hover,
:where(button, input[type="button"], input[type="submit"], input[type="reset"]):not(:disabled):focus-visible,
.btn-primary:hover,
.btn-primary:focus-visible,
:where(.wp-element-button, .wp-block-button__link):hover,
:where(.wp-element-button, .wp-block-button__link):focus-visible,
body .samasti-posts-list__cta:hover,
body .samasti-posts-list__cta:focus-visible,
body .samasti-schedule__cta:hover,
body .samasti-schedule__cta:focus-visible,
body .samasti-steps__cta:hover,
body .samasti-steps__cta:focus-visible,
body .contact-card__form .wpcf7-form-control.wpcf7-submit:hover,
body .contact-card__form .wpcf7-form-control.wpcf7-submit:focus-visible {
  border-color: var(--samasti-primary-hover);
  background: var(--samasti-primary-hover);
  color: var(--samasti-text-inverse);
}

:where(button, input[type="button"], input[type="submit"], input[type="reset"]):not(:disabled):active,
.btn-primary:active,
:where(.wp-element-button, .wp-block-button__link):active {
  border-color: var(--samasti-primary-active);
  background: var(--samasti-primary-active);
}

.btn-secondary,
.button--secondary,
.btn-outline-primary,
.btn-outline-light,
.is-style-outline > .wp-block-button__link {
  border-color: var(--samasti-border-strong);
  background: var(--samasti-surface);
  color: var(--samasti-dark);
}

.btn-secondary:hover,
.btn-secondary:focus-visible,
.button--secondary:hover,
.button--secondary:focus-visible,
.btn-outline-primary:hover,
.btn-outline-primary:focus-visible,
.btn-outline-light:hover,
.btn-outline-light:focus-visible,
.is-style-outline > .wp-block-button__link:hover,
.is-style-outline > .wp-block-button__link:focus-visible {
  border-color: var(--samasti-primary);
  background: var(--samasti-surface-muted);
  color: var(--samasti-primary-hover);
}

:where(button, input[type="button"], input[type="submit"], input[type="reset"], .btn):disabled,
.btn.disabled,
.btn[aria-disabled="true"],
.wpcf7-submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  :where(button, .btn, .wp-element-button, .wp-block-button__link, input, select, textarea) {
    transition-duration: 0.01ms;
  }
}
