/* =========================================================================
 * Newsletter pop-up — 2026-11-04. Markup in inc/newsletter.php.
 *
 * Every rule starts "body .vw-nl" so it outranks Divi's and the editorial
 * layer's type rules; the paragraphs set their own font because
 * body.vw-editorial p sets one directly.
 *
 * Left: blue cloth (texture-blue.jpg) with the photograph in a cartouche
 * pressed into it. The press is two copies of the same clip-path shape: a
 * slightly larger "mat" in the same cloth, darkened, and the photograph on
 * it; the light and dark drop-shadows on the frame read as an embossed edge.
 * Right: cream, olive ink, an italic EB Garamond title, Yantramanav for the
 * line and the fields, a brown button.
 * ========================================================================= */

body .vw-nl {
  --vw-nl-ink: #403508;
  --vw-nl-cream: #EAE6D6;
  --vw-nl-button: #6B3A22;
  --vw-nl-button-ink: #F3EEDC;
  --vw-nl-blue: #6E8497;          /* the cloth's average, shown while it loads */

  width: min(780px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--vw-nl-ink);
  overflow: visible;
}

/* The dialog itself takes focus on opening (newsletter.js), so no field or the
 * close button lights up before the visitor has done anything. */
body .vw-nl:focus { outline: none; }

body .vw-nl::backdrop {
  background: rgba(30, 26, 16, 0.45);
}

body .vw-nl[open] { animation: vw-nl-in 600ms cubic-bezier(.2, .7, .2, 1); }
body .vw-nl[open]::backdrop { animation: vw-nl-fade 600ms ease; }

@keyframes vw-nl-in {
  from { opacity: 0; transform: translateY(16px); }
}

@keyframes vw-nl-fade {
  from { opacity: 0; }
}

body .vw-nl .vw-nl__card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
  box-shadow: 0 24px 60px rgba(30, 26, 16, 0.28);
}

/* --- left: cloth and cartouche ------------------------------------------- */

body .vw-nl .vw-nl__art {
  display: grid;
  place-items: center;
  padding: 48px 40px;
  background: var(--vw-nl-blue) url("img/texture-blue.jpg") center / cover;
}

body .vw-nl .vw-nl__frame {
  position: relative;
  width: 88%;
  aspect-ratio: 4 / 5;
  /* The embossed edge: a highlight below-right, a shade above-left. */
  filter:
    drop-shadow(1.5px 2px 0 rgba(255, 255, 255, 0.28))
    drop-shadow(-1px -1.5px 1px rgba(20, 30, 40, 0.35));
}

body .vw-nl .vw-nl__mat,
body .vw-nl .vw-nl__photo {
  position: absolute;
  clip-path: url(#vw-nl-shape);
}

body .vw-nl .vw-nl__mat {
  inset: 0;
  background:
    linear-gradient(rgba(20, 30, 40, 0.16), rgba(20, 30, 40, 0.16)),
    var(--vw-nl-blue) url("img/texture-blue.jpg") center / 600px;
}

body .vw-nl .vw-nl__photo {
  inset: 6%;
  width: 88%;
  height: 88%;
  object-fit: cover;
  object-position: 50% 40%;
}

/* --- right: text and form ------------------------------------------------ */

body .vw-nl .vw-nl__body {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 48px;
  background: var(--vw-nl-cream);
  text-align: center;
  font-family: Yantramanav, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.25;
}

body .vw-nl .vw-nl__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--vw-nl-ink);
  background: none;
  border: 0;
  cursor: pointer;
}

body .vw-nl .vw-nl__close:focus-visible,
body .vw-nl .vw-nl__button:focus-visible,
body .vw-nl .vw-nl__field input:focus-visible {
  outline: 2px solid var(--vw-nl-ink);
  outline-offset: 2px;
}

body .vw-nl .vw-nl__title {
  margin: 0 0 22px;
  padding: 0;
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.08;
  color: var(--vw-nl-ink);
  text-wrap: balance;
}

body .vw-nl .vw-nl__title em {
  display: block;
  font-style: italic;
}

body .vw-nl .vw-nl__text,
body .vw-nl .vw-nl__small {
  font-family: Yantramanav, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.25;
}

body .vw-nl .vw-nl__text {
  margin: 0 auto 28px;
  padding: 0;
  max-width: 30ch;
  color: var(--vw-nl-ink);
}

body .vw-nl .vw-nl__form {
  display: grid;
  gap: 14px;
  margin: 0;
}

body .vw-nl .vw-nl__field input {
  display: block;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 18px;
  font: inherit;
  color: var(--vw-nl-ink);
  background: transparent;
  border: 1px solid var(--vw-nl-ink);
  border-radius: 0;
  box-shadow: none;
}

body .vw-nl .vw-nl__field input::placeholder {
  color: var(--vw-nl-ink);
  opacity: 0.8;
}

body .vw-nl .vw-nl__button {
  height: 48px;
  margin-top: 4px;
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vw-nl-button-ink);
  background: var(--vw-nl-button);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 200ms ease;
}

body .vw-nl .vw-nl__button:hover { background: #5A3019; }

body .vw-nl .vw-nl__small {
  margin: 4px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.75;
}

/* Phones: one column, the cloth becomes a short band with the cartouche
 * across it, so the form is in reach without scrolling. */
@media (max-width: 640px) {
  body .vw-nl .vw-nl__card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  body .vw-nl .vw-nl__art { padding: 28px 0 20px; }
  body .vw-nl .vw-nl__frame { width: 42%; }
  body .vw-nl .vw-nl__body { padding: 32px 24px 28px; }
  body .vw-nl .vw-nl__title { font-size: 24px; margin-bottom: 14px; }
  body .vw-nl .vw-nl__text { margin-bottom: 20px; }
  body .vw-nl .vw-nl__close { top: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  body .vw-nl[open],
  body .vw-nl[open]::backdrop { animation: none; }
}
