@use "sass:math";
@use "_breakpoints.scss";

.newsletter {
  background: var(--background);
  padding: var(--spacing);
  margin-bottom: var(--doublespacing);
  text-align: center;
}

.newsletter-heading {
  margin-bottom: var(--halfspacing);
}

.newsletter-details {
  margin-bottom: var(--spacing);
}

.newsletter-form {
  display: flex;
  justify-content: center;
  align-items: center;
  form {
    flex: 1;
    width: 100%;
    margin: 0;

    @include breakpoints.medium-large {
      display: flex;
    }
  }
  .hidden {
    display: none;
  }
}

.newsletter-email {
  display: block;
  padding: var(--halfspacing) var(--halfspacing);
  border: none;
  margin-right: var(--halfspacing);
  flex-grow: 1;
  width: 100%;
  @include breakpoints.small {
    margin-bottom: var(--halfspacing);
  }
  &:focus {
    outline: none;
  }
  .newsletter-loading & {
    background: var(--background-secondary);
  }
}
.newsletter-button {
  min-width: 140px;
  display: block;
  @include breakpoints.small {
    width: 100%;
  }
}
.newsletter-message {
  width: 100%;
  padding: var(--spacing);
  text-align: center;
}
.newsletter-error {
  border-color: var(--red);
  color: var(--red);
  margin-top: var(--spacing);
}
.newsletter-success {
  border-color: var(--border-color);
  color: var(--border-color);
}
