/* Newsletter Section - Isolated CSS with Grid Technology */

/* CSS Variables for Newsletter Section */
:root {
  --newsletter-color-background: #f6f4f5;
  --newsletter-color-text-primary: #ffffff;
  --newsletter-color-text-secondary: #b1b1b1;
  --newsletter-color-text-dark: #232228;
  --newsletter-color-accent: #e3c37a;
  --newsletter-color-accent-border: #e3c37a;
  --newsletter-color-input-bg: #ffffff;
  --newsletter-font-primary: 'Montserrat', sans-serif;
  --newsletter-font-heading: 'Cormorant Garamond', serif;
  --newsletter-font-button: 'Cormorant Garamond', serif;
}

/* Reset and Base Styles for Newsletter Section */
#newsletter * {
  box-sizing: border-box;
}

#newsletter input,
#newsletter button {
  font-family: inherit;
}

/* Main Newsletter Section - CSS Grid Layout */
.newsletter-section {
  display: grid;
  grid-template-areas: "container";
  justify-content: center;
  align-items: center;
  padding: 80px 20px;
  background-color: #f6f4f5;
  color: var(--newsletter-color-text-primary);
  font-family: var(--newsletter-font-primary);
}

.newsletter-container {
  grid-area: container;
  max-width: 743px;
  width: 100%;
  display: grid;
  grid-template-rows: auto auto;
  grid-template-areas: 
    "header"
    "form";
  gap: 40px;
  justify-items: center;
}

/* Newsletter Header - Grid Layout */
.newsletter-header {
  grid-area: header;
  text-align: center;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 32px 40px;
  justify-items: center;
}

.pre-title {
  margin: 0;
  color: var(--newsletter-color-text-secondary);
  font-family: var(--newsletter-font-primary);
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.32px;
}

.newsletter-section .main-title {
  margin: 0;
  font-family: var(--newsletter-font-heading);
  font-weight: 400;
  font-size: 32px !important;
  line-height: 52px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #000000 !important;
}

.newsletter-section .main-title .highlight {
  color: var(--newsletter-color-accent);
}

.subtitle {
  margin: 0;
  max-width: 575px;
  color: var(--newsletter-color-text-secondary);
  font-family: var(--newsletter-font-primary);
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.32px;
}

/* Newsletter Form - Grid Layout */
.newsletter-form {
  grid-area: form;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  width: 100%;
  max-width: 500px;
}

.email-input {
  background-color: var(--newsletter-color-input-bg);
  border: none;
  padding: 11px 24px;
  font-family: var(--newsletter-font-primary);
  font-weight: 300;
  font-size: 14px;
  line-height: 21px;
  color: var(--newsletter-color-text-dark);
  transition: box-shadow 0.3s ease, border 0.3s ease;
}

.email-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--newsletter-color-accent);
}

.email-input::placeholder {
  color: var(--newsletter-color-text-secondary);
  opacity: 1;
}

.newsletter-section .submit-button {
  display: grid;
  place-items: center;
  padding: 12px 24px;
  background-color: transparent;
  border: 1px solid var(--newsletter-color-accent-border);
  color: #000000 !important;
  font-family: var(--newsletter-font-button);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.1;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.3s, color 0.3s, transform 0.3s;
  min-width: 140px;
}

.submit-button:hover {
  background-color: var(--newsletter-color-accent-border);
  color: var(--newsletter-color-text-dark);
  transform: translateY(-2px);
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button:focus {
  outline: 2px solid var(--newsletter-color-accent);
  outline-offset: 2px;
}

/* Responsive Design with Grid */
@media (max-width: 768px) {
  .newsletter-section {
    padding: 60px 20px;
  }
  
  .newsletter-container {
    gap: 30px;
  }
  
  .newsletter-section .main-title {
    font-size: 32px !important;
    line-height: 42px;
    color: #000000 !important;
  }
  
  .newsletter-form {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
    max-width: 100%;
  }
  
  .email-input {
    order: 1;
  }
  
  .submit-button {
    order: 2;
    width: 100%;
  }
}

@media (max-width: 576px) {
  .newsletter-section {
    padding: 40px 15px;
  }
  
  .newsletter-container {
    gap: 25px;
  }
  
  .newsletter-section .main-title {
    font-size: 32px !important;
    line-height: 1.3;
    color: #000000 !important;
  }
  
  .subtitle {
    font-size: 14px;
  }
  
  .newsletter-header {
    gap: 20px 25px;
  }
}

@media (max-width: 480px) {
  .newsletter-section {
    padding: 30px 10px;
  }
  
  .newsletter-section .main-title {
    font-size: 32px !important;
    color: #000000 !important;
  }
  
  .pre-title,
  .subtitle {
    font-size: 14px;
  }
  
  .email-input,
  .submit-button {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Grid Animation Support */
.newsletter-container {
  transition: grid-template-rows 0.3s ease;
}

.newsletter-form {
  transition: grid-template-columns 0.3s ease;
}

.newsletter-header {
  transition: grid-template-rows 0.3s ease;
}

/* Additional Grid Enhancements */
.newsletter-container {
  align-items: center;
}

.newsletter-header {
  align-items: center;
}

/* Focus and Accessibility */
.email-input:focus-visible {
  outline: 2px solid var(--newsletter-color-accent);
  outline-offset: 2px;
}

.submit-button:focus-visible {
  outline: 2px solid var(--newsletter-color-accent);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .newsletter-section {
    background-color: #000000;
    color: #ffffff;
  }
  
  .email-input {
    background-color: #ffffff;
    color: #000000;
    border: 2px solid #ffffff;
  }
  
  .submit-button {
    border-color: #ffffff;
    color: #ffffff;
  }
  
  .submit-button:hover {
    background-color: #ffffff;
    color: #000000;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .submit-button,
  .email-input {
    transition: none;
  }
  
  .submit-button:hover {
    transform: none;
  }
}

/* Print Styles */
@media print {
  .newsletter-section {
    background: white;
    color: black;
  }
  
  .email-input {
    background: white;
    border: 1px solid black;
  }
  
  .submit-button {
    border: 1px solid black;
    background: white;
    color: black;
  }
}

/* Form Validation Styles */
.email-input:invalid {
  border: none;
}

.email-input:valid {
  border: none;
}

/* Loading State */
.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.submit-button:disabled:hover {
  background-color: transparent;
  color: var(--newsletter-color-accent-border);
  transform: none;
}
