/* ═══════════════════════════════════════════════════════════════
   brasa — newsletter-modal.css
   Post-cookie newsletter invite — rectangular editorial layout.
   Content left · image right · square (no radius) fields.
   ═══════════════════════════════════════════════════════════════ */

.newsletter-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--page-gutter);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.newsletter-modal[hidden] {
  display: none;
}

.newsletter-modal.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.newsletter-modal__overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: rgba(10, 10, 10, 0.62);
  border: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.newsletter-modal.is-visible .newsletter-modal__overlay {
  opacity: 1;
}

.newsletter-modal__panel {
  position: relative;
  z-index: 1;
  width: min(940px, 100%);
  max-height: calc(100dvh - var(--page-gutter) * 2);
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.newsletter-modal.is-visible .newsletter-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.newsletter-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--color-white);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-shadow: none;
}

.newsletter-modal__close:focus-visible {
  outline: 2px solid var(--color-royal-blue);
  outline-offset: 2px;
}

.newsletter-modal__layout {
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  align-items: stretch;
}

/* ── Content (left) ── */
.newsletter-modal__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 4.5vw, 56px) clamp(30px, 4vw, 52px);
  background: var(--color-white);
}

.newsletter-modal__logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(44px, 5.5vw, 60px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--color-royal-blue);
}

.newsletter-modal__title {
  margin: clamp(18px, 2.4vh, 26px) 0 0;
  font-family: var(--font-body);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--color-black);
}

.newsletter-modal__text {
  margin: clamp(10px, 1.5vh, 14px) 0 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: #5A5A5A;
  max-width: 42ch;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.newsletter-modal__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: clamp(22px, 3vh, 30px);
}

.newsletter-modal__input {
  width: 100%;
  padding: 15px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--color-black);
  background: var(--color-white);
  border: 1px solid #D6D6D6;
  border-radius: 0;
  appearance: none;
}

.newsletter-modal__input::placeholder {
  color: #9A9A9A;
}

.newsletter-modal__input:focus {
  outline: none;
  border-color: var(--color-black);
}

.newsletter-modal__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: #7A7A7A;
  cursor: pointer;
}

.newsletter-modal__check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  border: 1px solid #B8B8B8;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-white);
  cursor: pointer;
}

.newsletter-modal__check:checked {
  background: var(--color-black);
  border-color: var(--color-black);
}

.newsletter-modal__check:checked::after {
  content: '';
  display: block;
  width: 4px;
  height: 8px;
  margin: 2px auto 0;
  border: solid var(--color-white);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.newsletter-modal__check:focus-visible {
  outline: 2px solid var(--color-royal-blue);
  outline-offset: 2px;
}

.newsletter-modal__consent a {
  color: var(--color-black);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.newsletter-modal__submit {
  width: 100%;
  margin-top: 6px;
}

.newsletter-modal__later {
  align-self: flex-start;
  margin-top: clamp(16px, 2vh, 20px);
  padding: 0;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9A9A9A;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.newsletter-modal__later:focus-visible {
  outline: 2px solid var(--color-royal-blue);
  outline-offset: 2px;
}

.newsletter-modal__status {
  margin: clamp(14px, 2vh, 16px) 0 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: #5A5A5A;
}

.newsletter-modal__status.is-success {
  color: var(--color-black);
}

.newsletter-modal__status.is-error {
  color: var(--color-terracotta);
}

/* ── Media (right) ── */
.newsletter-modal__media {
  position: relative;
  background: transparent;
}

.newsletter-modal__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: 0;
}

html.newsletter-modal-open {
  overflow: hidden;
}

html.newsletter-modal-open body {
  overflow: hidden;
}

@media (max-width: 768px) {
  .newsletter-modal {
    --newsletter-mobile-inset: max(
      var(--page-gutter),
      env(safe-area-inset-top, 0px),
      env(safe-area-inset-bottom, 0px)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--newsletter-mobile-inset) var(--page-gutter);
    box-sizing: border-box;
  }

  .newsletter-modal__panel {
    --newsletter-modal-edge: 12px;
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
    max-height: calc(100dvh - var(--newsletter-mobile-inset) * 2);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transform: translateY(24px) scale(0.985);
  }

  .newsletter-modal__panel::-webkit-scrollbar {
    display: none;
  }

  .newsletter-modal.is-visible .newsletter-modal__panel {
    transform: translateY(0) scale(1);
  }

  .newsletter-modal__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .newsletter-modal__media {
    order: -1;
    margin-top: 4px;
    aspect-ratio: 3 / 2;
    height: auto;
    max-height: 46vh;
    min-height: 200px;
  }

  .newsletter-modal__media img {
    object-position: center 48%;
  }

  .newsletter-modal__content {
    --newsletter-content-stack: clamp(20px, 5vw, 24px);
    padding:
      clamp(28px, 6vw, 36px)
      var(--page-gutter)
      clamp(32px, 6vw, 40px);
  }

  .newsletter-modal__logo {
    font-size: clamp(30px, 8.5vw, 36px);
  }

  .newsletter-modal__content .newsletter-modal__title {
    margin-top: var(--newsletter-content-stack);
  }

  .newsletter-modal__close {
    top: var(--newsletter-modal-edge);
    right: var(--newsletter-modal-edge);
    width: 32px;
    height: 32px;
    font-size: 22px;
    color: var(--color-white);
    background: transparent;
    text-shadow: none;
  }

  .newsletter-modal__text {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .newsletter-modal,
  .newsletter-modal__overlay,
  .newsletter-modal__panel {
    transition: none;
  }
}
