/**
 * @file
 * Newsletter section styling for frontpage.
 */

.newsletter-section {
  background-color: #FFE6CC;
  padding: 60px 0;
  overflow: hidden;
}

.newsletter-section__container {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 768px) {
  .newsletter-section__container {
    padding: 0 40px;
  }
}

@media (min-width: 1024px) {
  .newsletter-section__container {
    flex-direction: row;
    align-items: center;
    padding: 0 96px;
    gap: 60px;
  }
}

.newsletter-section__content {
  flex: 0 0 40%;
  max-width: 100%;
}

@media (min-width: 1024px) {
  .newsletter-section__content {
    max-width: 40%;
  }
}

.newsletter-section__title {
  font-size: 1.75rem; /* 28px for mobile */
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

@media (min-width: 1024px) {
  .newsletter-section__title {
    font-size: 2.5rem;
  }
}

.newsletter-section__description {
  font-size: 1rem;
  color: #1A1A1A;
  margin: 0 0 32px 0;
  line-height: 1.6;
}

@media (min-width: 1024px) {
  .newsletter-section__description {
    font-size: 1.125rem;
  }
}

.newsletter-section__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 640px) {
  .newsletter-section__form {
    flex-direction: row;
    align-items: center;
  }
}

/* Input wrapper that looks like an input field */
/* Mobile: Input and button are separated */
.newsletter-section__input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: transparent;
  border: none;
  padding: 0;
  min-width: auto;
}

/* Desktop: Input and button are together in a pill shape */
@media (min-width: 768px) {
  .newsletter-section__input-wrapper {
    flex-direction: row;
    align-items: center;
    flex: 1;
    background-color: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 360px;
    padding: 4px;
    min-width: 250px;
    gap: 0;
  }

  .newsletter-section__input-wrapper:focus-within {
    border-color: #FF8200;
    box-shadow: 0 0 0 3px rgba(255, 130, 0, 0.2);
  }
}

.newsletter-section__input {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid #E0E0E0;
  border-radius: 360px;
  font-size: 1rem;
  background-color: #fff;
  color: #1A1A1A;
  outline: none;
  width: 100%;
}

@media (min-width: 768px) {
  .newsletter-section__input {
    padding: 10px 16px;
    border: none;
    background-color: transparent;
    width: auto;
    min-width: 0;
  }
}

.newsletter-section__input::placeholder {
  color: #878A97;
}

.newsletter-section__button {
  flex-shrink: 0;
  padding: 12px 24px;
  background-color: #FF8200;
  border: none;
  border-radius: 360px;
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

@media (min-width: 768px) {
  .newsletter-section__button {
    padding: 10px 24px;
    margin-left: 4px;
    width: auto;
  }
}

.newsletter-section__button:hover {
  background-color: #E67500;
}

.newsletter-section__button:active {
  background-color: #CC6600;
}

.newsletter-section__button:focus {
  box-shadow: 0 0 0 3px rgba(255, 130, 0, 0.4);
}

.newsletter-section__image-wrapper {
  flex: 0 0 60%;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  /* Mobile image sizing */
  height: 200px;
  align-self: stretch;
  aspect-ratio: 36/25;
}

@media (min-width: 1024px) {
  .newsletter-section__image-wrapper {
    max-width: 60%;
    height: auto;
    aspect-ratio: auto;
  }
}

.newsletter-section__image-wrapper img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hide the field label wrapper */
.newsletter-section__image .field__label {
  display: none;
}

/* Modal styling for newsletter */
.modal__overlay[data-modal="newsletter-modal"] .modal {
  max-width: 500px;
}

.modal__overlay[data-modal="newsletter-modal"] .modal__body h2 {
  margin-bottom: 20px;
  font-size: 1.5rem;
}

/* Smaily form adjustments in modal */
.modal__overlay[data-modal="newsletter-modal"] .smaily-for-drupal-form {
  margin-top: 0;
}

.modal__overlay[data-modal="newsletter-modal"] .smaily-for-drupal-form form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal__overlay[data-modal="newsletter-modal"] .smaily-for-drupal-form .form-item {
  margin: 0;
}

.modal__overlay[data-modal="newsletter-modal"] .smaily-for-drupal-form input[type="email"] {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 1rem;
}

.modal__overlay[data-modal="newsletter-modal"] .smaily-for-drupal-form .form-submit {
  width: 100%;
  padding: 14px 32px;
  background-color: #FF8200;
  border: none;
  border-radius: 360px;
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.modal__overlay[data-modal="newsletter-modal"] .smaily-for-drupal-form .form-submit:hover {
  background-color: #E67500;
}
