/* =========================================================
   Chinese Library for Children
   Footer Newsletter / Brevo Form
   ========================================================= */


/* ---------------------------------------------------------
   Newsletter section
   This section already sits inside the footer's third column,
   so it should be a simple vertical block.
   --------------------------------------------------------- */

.footer-newsletter {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}


/* ---------------------------------------------------------
   Newsletter heading and supporting text
   --------------------------------------------------------- */

.newsletter-copy {
  margin: 0 0 16px;
  text-align: left;
}

.newsletter-copy h2 {
  margin: 0 0 4px;
  color: #3f4549;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.newsletter-copy p {
  margin: 0;
  color: #55745d;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}


/* ---------------------------------------------------------
   Remove Brevo's default container spacing and backgrounds
   --------------------------------------------------------- */

.newsletter-form-wrap {
  width: 100%;
  min-width: 0;
}

.footer-newsletter .sib-form,
.footer-newsletter .sib-form-container,
.footer-newsletter #sib-form-container,
.footer-newsletter #sib-container,
.footer-newsletter #sib-form {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}


/* ---------------------------------------------------------
   Email field and Join button
   --------------------------------------------------------- */

.newsletter-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: start;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.newsletter-email-field {
  width: 100%;
  min-width: 0;
}

.footer-newsletter #EMAIL {
  display: block;
  width: 100% !important;
  min-width: 0;
  height: 44px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 14px;

  border: 1px solid rgba(63, 71, 75, 0.2);
  border-radius: 7px;
  background: #ffffff;

  color: #374147;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;

  appearance: none;
  -webkit-appearance: none;
}

.footer-newsletter #EMAIL::placeholder {
  color: #778289;
  opacity: 1;
}

.footer-newsletter #EMAIL:focus {
  outline: none;
  border-color: #4b9358;
  box-shadow: 0 0 0 3px rgba(75, 147, 88, 0.12);
}


/* ---------------------------------------------------------
   Submit button
   --------------------------------------------------------- */

.footer-newsletter .sib-form-block__button {
  display: flex !important;
  align-items: center;
  justify-content: center;

  width: 92px !important;
  min-width: 92px;
  height: 44px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 !important;

  border: 0 !important;
  border-radius: 7px !important;
  background: #4b9358 !important;
  box-shadow: none !important;

  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-align: center !important;
  white-space: nowrap;

  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.footer-newsletter .sib-form-block__button:hover {
  background: #3f824c !important;
  transform: translateY(-1px);
}

.footer-newsletter .sib-form-block__button:active {
  transform: translateY(0);
}

.footer-newsletter .sib-form-block__button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}


/* Brevo loading spinner inside the button */

.footer-newsletter .progress-indicator__icon {
  width: 16px;
  height: 16px;
  margin-right: 7px;
  fill: currentColor;
}


/* ---------------------------------------------------------
   Field validation message
   --------------------------------------------------------- */

.footer-newsletter .entry__error {
  display: block;
  min-height: 0;
  margin: 6px 0 0;
  padding: 0 !important;

  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;

  color: #8a2f2f !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.4;
  text-align: left !important;
}


/* ---------------------------------------------------------
   Brevo success and error panels
   Brevo's script changes their visibility after submission.
   --------------------------------------------------------- */

.footer-newsletter .sib-form-message-panel {
  display: none;
  width: 100%;
  max-width: none !important;
  box-sizing: border-box;
  margin: 0 0 12px;
  padding: 9px 12px;

  border-radius: 6px;
  box-shadow: none;

  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
}

.footer-newsletter .newsletter-message--success {
  color: #085229;
  border: 1px solid #b8e8ca;
  background: #e7faf0;
}

.footer-newsletter .newsletter-message--error {
  color: #661d1d;
  border: 1px solid #efbcbc;
  background: #ffeded;
}

.footer-newsletter .sib-form-message-panel__text {
  display: block;
  margin: 0;
  padding: 0;
}

.footer-newsletter .sib-form-message-panel__inner-text {
  display: block;
}


/* ---------------------------------------------------------
   Hidden anti-spam field supplied by Brevo
   --------------------------------------------------------- */

.footer-newsletter .input--hidden {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}


/* ---------------------------------------------------------
   Screen-reader-only label
   --------------------------------------------------------- */

.sr-only {
  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;
  white-space: nowrap !important;
  border: 0 !important;
}


/* ---------------------------------------------------------
   Fix conflicts coming from the existing footer row styles
   Your current main.css applies both column widths and a 60px gap,
   which squeezes the third column.
   --------------------------------------------------------- */

#footer .footer-middle {
  gap: 0 !important;
  align-items: center;
}

#footer .footer-middle > div {
  min-width: 0;
}


/* ---------------------------------------------------------
   Medium screens
   The existing HTML5 UP layout changes the footer columns at 980px.
   --------------------------------------------------------- */

@media screen and (max-width: 980px) {
  .footer-newsletter {
    max-width: 620px;
    margin-right: auto;
    margin-left: auto;
  }

  .newsletter-copy {
    text-align: center;
  }

  .newsletter-form-row {
    grid-template-columns: minmax(0, 1fr) 100px;
  }

  .footer-newsletter .sib-form-block__button {
    width: 100px !important;
    min-width: 100px;
  }
}


/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media screen and (max-width: 736px) {
  .footer-newsletter {
    width: 100%;
    max-width: 100%;
  }

  .newsletter-copy {
    margin-bottom: 13px;
    text-align: center;
  }

  .newsletter-copy h2 {
    font-size: 18px;
    line-height: 1.35;
  }

  .newsletter-copy p {
    font-size: 13px;
  }

  .newsletter-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .footer-newsletter #EMAIL {
    height: 44px;
    font-size: 14px;
  }

  .footer-newsletter .sib-form-block__button {
    width: 100% !important;
    min-width: 0;
    height: 44px;
  }

  .footer-newsletter .entry__error {
    text-align: center !important;
  }

  .footer-newsletter .sib-form-message-panel {
    text-align: center;
  }
}