/**
 * DJ Refresh — newsletter panel.
 * Figma: 1440x440 dark rounded panel. Copy + inline form on the left half, photo filling
 * the right half and bleeding to the panel edge.
 */

.djr-newsletter {
  --djr-news-h: 440px;
  --djr-news-radius: 16px;

  background: var(--djr-white);
  /* Figma: this section is tight — the 440px panel sits in a 500px band, i.e. 30px above
     and below. It does NOT take the usual 72px section padding. */
  padding-top: 30px;
  padding-bottom: 30px;
}

.djr-newsletter__panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: var(--djr-news-h);
  border-radius: var(--djr-news-radius);
  /* Figma: true black, same as the footer — not the #1a1a1a used elsewhere. */
  background: #000000;
  overflow: hidden;
}

/* ---------- Copy ---------- */

/* Figma insets the copy 80px from the panel edge and centres it vertically. */
.djr-newsletter__copy {
  padding: 60px 80px;
  color: var(--djr-white);
}

/* Figma: 14px, no tracking. */
.djr-newsletter__eyebrow {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--djr-red);
}

.djr-newsletter__heading {
  margin-top: 22px;
  font-size: clamp(32px, 3.2vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--djr-white);
}

.djr-newsletter__text {
  margin-top: 22px;
  max-width: 447px;
  font-size: var(--djr-lead);
  line-height: 1.5;
  /* Figma uses a warm off-white here, not the cool grey used elsewhere. */
  color: #f7e5e5;
}

/* ---------- Form ---------- */

/*
 * Figma (updated 2026-07-14): the FIELD is a solid WHITE pill with no border and a 50%-black
 * placeholder, and the SUBMIT is a RED pill with a white bold label, inset 1px inside the
 * field's right edge.
 *
 * Applies to all four desktop frames (EN/ES/FR/DE) and the mobile frame.
 */
.djr-newsletter__form {
  position: relative;
  display: flex;
  align-items: center;
  width: 447px;
  max-width: 100%;
  height: 48px;
  margin-top: 22px;
}

.djr-newsletter__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  /* Right padding clears the overlapping submit button. */
  padding: 0 150px 0 20px;
  border: 0;
  border-radius: var(--djr-radius-pill);
  background: var(--djr-white);
  color: var(--djr-ink);
  font: inherit;
  font-size: 15px;
}

.djr-newsletter__input::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

.djr-newsletter__input:focus {
  outline: none;
}

.djr-newsletter__input:focus-visible {
  outline: 2px solid var(--djr-red);
  outline-offset: 2px;
}

/* Red pill, inset 1px so the white field reads as a ring around it. */
.djr-newsletter__submit {
  position: absolute;
  top: 1px;
  right: 1px;
  height: calc(100% - 2px);
  padding: 0 28px;
  background: var(--djr-red);
  border-color: var(--djr-red);
  color: var(--djr-white);
}

.djr-newsletter__submit:hover,
.djr-newsletter__submit:focus-visible {
  background: var(--djr-red-dark);
  border-color: var(--djr-red-dark);
  color: var(--djr-white);
}

/* ---------- Media ---------- */

.djr-newsletter__media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
}

.djr-newsletter__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
 * The photo fades in from the panel's black, left to right — so it dissolves into the copy
 * side instead of butting against it with a hard seam. Matches the gradient added to the
 * Figma frames: solid black at the media's left edge, fully clear by ~30% across.
 */
.djr-newsletter__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    #000000 0%,
    rgba(0, 0, 0, 0.72) 10%,
    rgba(0, 0, 0, 0) 32%
  );
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  /* minmax(0, 1fr), not 1fr: plain 1fr keeps an implicit min-content minimum, and the form's
     447px preferred width forced the column — and the whole copy block — wider than the
     panel, spilling out to the right. minmax(0,…) lets the column shrink to the panel width. */
  .djr-newsletter__panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .djr-newsletter__copy {
    min-width: 0;
  }

  /* Photo becomes a band above the copy rather than a right-hand half. */
  .djr-newsletter__media {
    position: relative;
    width: 100%;
    height: 220px;
    order: -1;
  }

  /* The fade has to turn with the layout: the photo now sits ABOVE the copy, so it dissolves
     into the black at its BOTTOM edge. A left-to-right fade here would darken the wrong side. */
  .djr-newsletter__media::after {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 45%,
      #000000 100%
    );
  }

  .djr-newsletter__copy {
    padding: 32px 24px 40px;
  }
}

/*
 * Mobile: field and Subscribe stack as two full-width pills, matching the mobile frame. The
 * submit leaves its absolute slot (which was overlapping/clipping once the copy narrowed) and
 * becomes a full-width red pill under the white field. Stacked from 768 so it's never clipped
 * anywhere in the mobile range.
 */
@media (max-width: 768px) {
  .djr-newsletter__form {
    flex-direction: column;
    align-items: stretch;
    /* Full width, not the desktop 447px — the fixed width was part of what overflowed. */
    width: 100%;
    height: auto;
    gap: 10px;
  }

  .djr-newsletter__input {
    height: 48px;
    padding: 0 20px;
  }

  .djr-newsletter__submit {
    position: static;
    height: 48px;
    width: 100%;
  }
}
