/**
 * @file
 * glightbox-newsletter.css
 *
 * Styles for the Mailchimp newsletter signup popup.
 * Mailchimp's own embed CSS is NOT loaded — this file replaces it entirely.
 *
 * Tokens map to the site's existing Tailwind/CSS custom properties.
 * Adjust the variables block below to match your palette if needed.
 *
 * Asset path: assets/css/parts/components/glightbox-newsletter.css
 */

/* ── Tokens ─────────────────────────────────────────────────────────── */
/* These intentionally mirror the site's existing colour vocabulary.    */
:root {
  --mc-bg:           var(--color-background, #fff);
  --mc-text:         var(--color-text, #1a1a1a);
  --mc-muted:        var(--color-muted, #6b6b6b);
  --mc-border:       var(--color-border, #d4d4d4);
  --mc-accent:       var(--color-brand, #1a1a1a);
  --mc-accent-fg:    var(--color-background, #fff);
  --mc-success:      #1a6b3c;
  --mc-error:        #b91c1c;
  --mc-radius:       2px;   /* keep it tight — matches the site's angular feel */
  --mc-popup-width:  460px;
}

/* ── GLightbox panel sizing ──────────────────────────────────────────── */

.glightbox-container .gslide-inline {
  width: 100%;
  max-width: var(--mc-popup-width);
  overflow: hidden;
  border-radius: var(--mc-radius);
  background: var(--mc-bg);
}

.glightbox-container .ginlined-content {
  padding: 0;
}

/* ── Popup shell ─────────────────────────────────────────────────────── */

.mc-newsletter-popup {
  padding: 2.5rem 2.25rem 2rem;
  background: var(--mc-bg);
  color: var(--mc-text);
  font-family: var(--font-franklin, inherit); /* Libre Franklin — already loaded */
}

/* ── Header ──────────────────────────────────────────────────────────── */

.mc-newsletter-popup__eyebrow {
  margin: 0 0 0.5rem;
  color: var(--mc-muted);
  font-size: 0.7rem;
  font-family: var(--font-brand, inherit); /* Gilda Display */
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.mc-newsletter-popup__title {
  margin: 0 0 0.5rem;
  font-weight: 400; /* Gilda is elegant at regular weight */
  font-size: 1.6rem;
  line-height: 1.15;
  font-family: var(--font-brand, inherit); /* Gilda Display */
}

.mc-newsletter-popup__subtitle {
  margin: 0 0 1.75rem;
  color: var(--mc-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ── Field groups ────────────────────────────────────────────────────── */

.mc-field-group {
  margin-bottom: 1.25rem;
}

.mc-field-group label,
.mc-field-group legend {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--mc-text);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mc-field-group fieldset {
  margin: 0;
  padding: 0;
  border: none;
}

.mc-required {
  margin-left: 2px;
  color: var(--mc-error);
}

/* ── Email input ─────────────────────────────────────────────────────── */

#mc-newsletter-email {
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  outline: none;
  background: var(--mc-bg);
  color: var(--mc-text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

#mc-newsletter-email:focus {
  border-color: var(--mc-accent);
}

#mc-newsletter-email::placeholder {
  color: var(--mc-border);
}

/* ── GDPR block ──────────────────────────────────────────────────────── */

.mc-field-group--gdpr {
  padding: 1rem;
  border-radius: var(--mc-radius);
  background: color-mix(in srgb, var(--mc-text) 4%, var(--mc-bg));
}

.mc-gdpr__intro {
  margin: 0 0 0.75rem;
  color: var(--mc-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Custom checkbox */
.mc-checkbox-label {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.6rem;
  color: var(--mc-text);
  font-size: 0.875rem;
  cursor: pointer;
}

.mc-checkbox-label input[type="checkbox"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.mc-checkbox-custom {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid var(--mc-border);
  border-radius: 1px;
  background: var(--mc-bg);
  transition: background 0.15s, border-color 0.15s;
}

.mc-checkbox-label input[type="checkbox"]:checked + .mc-checkbox-custom {
  border-color: var(--mc-accent);
  background: var(--mc-accent);
}

.mc-checkbox-label input[type="checkbox"]:checked + .mc-checkbox-custom::after {
  display: block;
  width: 5px;
  height: 3px;
  transform: rotate(-45deg) translate(0.5px, -0.5px);
  border-bottom: 1.5px solid var(--mc-accent-fg);
  border-left: 1.5px solid var(--mc-accent-fg);
  content: "";
}

.mc-checkbox-label input[type="checkbox"]:focus-visible + .mc-checkbox-custom {
  outline: 2px solid var(--mc-accent);
  outline-offset: 2px;
}

.mc-gdpr__legal {
  margin: 0;
  color: var(--mc-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.mc-mailchimp-notice {
  margin: 0.75rem 0 0;
  color: var(--mc-muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.mc-mailchimp-notice a {
  color: var(--mc-muted);
  text-decoration: underline;
}

.mc-mailchimp-notice a:hover {
  color: var(--mc-text);
}

/* ── Response messages ───────────────────────────────────────────────── */

#mc-newsletter-responses {
  margin-bottom: 0.5rem;
}

.mc-response {
  display: none;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--mc-radius);
  font-size: 0.85rem;
  line-height: 1.4;
}

.mc-response--error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--mc-error);
}

.mc-response--success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: var(--mc-success);
}

/* ── Submit button ───────────────────────────────────────────────────── */

.mc-submit-wrap {
  margin-top: 0.25rem;
}

.mc-submit-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--mc-radius);
  background: var(--mc-accent);
  color: var(--mc-accent-fg);
  font-weight: 600;
  font-size: 0.72rem;
  font-family: var(--font-franklin, inherit);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
}

.mc-submit-btn:hover {
  opacity: 0.8;
}

.mc-submit-btn:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 3px;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 520px) {
  .mc-newsletter-popup {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  .mc-newsletter-popup__title {
    font-size: 1.3rem;
  }

  .glightbox-container .gslide-inline {
    max-width: 100%;
    border-radius: 0;
  }
}

/* Custom */
.glightbox-newsletter .ginner-container {
  width: 100%;
  padding: var(--spacing);
}

.glightbox-newsletter .goverlay {
  background-color: rgba(0,0,0,0.75);
}

.glightbox-newsletter .gclose {
  position: absolute;
  top: 15px;
  right: 10px;
  width: 35px;
  height: 35px;
}

.glightbox-newsletter .gclose svg {
  width: 18px;
  height: auto;
  fill: white;
}

@media (min-width: 992px) {
  .glightbox-newsletter .gclose {
    right: 20px;
    opacity: .7;
  }
}