/* Gated resources. Behaviour lives in js/resource-gate.js. */

.resource-gate[hidden],
.resource-gated[hidden],
.resource-share[hidden],
.resource-form[hidden],
[data-resource-one-click][hidden],
.resource-error[hidden] {
  display: none !important;
}

.article-header + .resource-gate {
  margin-top: 48px;
}

.article-body:has(+ .resource-gate:not([hidden])) {
  position: relative;
  padding-bottom: 1.5rem;
}

.article-body:has(+ .resource-gate:not([hidden]))::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 18rem;
  background: linear-gradient(
    to bottom,
    rgb(245 243 238 / 0) 0%,
    rgb(245 243 238 / 0.35) 28%,
    var(--dv-bg) 72%
  );
  pointer-events: none;
}

.article-body:has(+ .resource-gate[hidden]) {
  padding-bottom: 0;
}

.resource-gate[hidden] + .resource-gated {
  padding-top: 32px;
}

.resource-gated:has(+ .resource-share) {
  padding-bottom: 8px;
}

.resource-gated > h2:first-child {
  margin-top: 0;
}

.resource-gate {
  width: min(100% - 40px, 760px);
  margin: 0 auto 96px;
}

.resource-optin {
  padding: 36px 40px 40px;
  border: 1px solid var(--dv-line);
  border-top: 3px solid var(--dv-accent);
  background: var(--dv-surface);
}

.resource-preview-note {
  margin: 0 0 14px;
  color: var(--dv-accent);
  font-family: var(--dv-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.resource-optin h2 {
  margin: 6px 0 0;
  font-family: var(--dv-font-display);
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.resource-lede {
  margin: 20px 0 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--dv-text-dim);
}

.resource-checks {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.resource-checks li {
  position: relative;
  padding-left: 34px;
  color: var(--dv-text);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
}

.resource-checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dv-accent);
}

.resource-checks li::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 5px;
  height: 10px;
  border: solid var(--dv-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.resource-form,
[data-resource-one-click] {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
}

.resource-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--dv-text-mute);
  font-family: var(--dv-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
}

.resource-field input {
  box-sizing: border-box;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: #f8f6f1;
  color: var(--dv-text);
  border: 1px solid var(--dv-border-hi);
  border-radius: 0;
  font-family: var(--dv-font-body);
  font-size: 15px;
  line-height: 1.4;
}

.resource-field input:focus {
  outline: 2px solid var(--dv-accent);
  outline-offset: 1px;
}

.resource-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--dv-text-dim);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.resource-consent input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--dv-accent);
  cursor: pointer;
}

.resource-consent input:focus-visible {
  outline: 2px solid var(--dv-accent);
  outline-offset: 2px;
}

.resource-error {
  margin: 0;
  color: #b42318;
  font-size: 14px;
  line-height: 1.4;
}

.resource-submit {
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

.resource-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.resource-switch {
  margin: 0;
}

.resource-switch button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dv-text-mute);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.resource-switch button:hover,
.resource-switch button:focus-visible {
  color: var(--dv-accent);
}

.resource-gated + .resource-share {
  width: min(100% - 40px, 760px);
  margin: 28px auto 96px;
  padding-top: 28px;
  border-top: 1px solid var(--dv-line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.resource-share-status {
  margin: 0;
  color: var(--dv-text-mute);
  font-size: 14px;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .resource-gated + .resource-share {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .resource-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 12px;
    row-gap: 16px;
  }

  .resource-form .resource-submit {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    height: 52px;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .resource-form .resource-consent,
  .resource-form .resource-error {
    grid-column: 1 / -1;
  }

  .resource-form:has(.resource-field ~ .resource-field) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resource-form:has(.resource-field ~ .resource-field) .resource-submit {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
  }
}

@media (max-width: 639px) {
  .resource-gate {
    margin-bottom: 72px;
  }

  .resource-optin {
    padding: 28px 22px;
  }
}

/* ?landing=focused. The class is set before paint and removed on unlock. */

.resource-landing-brand,
.resource-kicker,
.resource-landing-legal {
  display: none;
}

body.resource-landing-focused .site-header,
body.resource-landing-focused .site-footer,
body.resource-landing-focused .draft-banner,
body.resource-landing-focused .article-header,
body.resource-landing-focused .article-body:not(.resource-gated) {
  display: none !important;
}

body.resource-landing-focused main,
body.resource-landing-focused main > article {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.resource-landing-focused .resource-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100% - 48px, 680px);
  margin: auto;
  padding: 48px 0;
}

body.resource-landing-focused .resource-landing-brand {
  display: inline-flex;
  margin-bottom: 36px;
}

body.resource-landing-focused .resource-landing-brand .logo-icon,
body.resource-landing-focused .resource-landing-brand .logo-text {
  height: 28px;
}

body.resource-landing-focused .resource-optin {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
}

body.resource-landing-focused .resource-kicker {
  display: block;
  margin: 0 0 22px;
  color: var(--dv-text-mute);
  font-family: var(--dv-font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.resource-landing-focused .resource-kicker::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  background: var(--dv-accent);
  vertical-align: 1px;
}

body.resource-landing-focused .resource-preview-note {
  display: none;
}

body.resource-landing-focused .resource-optin h2 {
  margin: 0;
  font-size: clamp(2.5rem, 5.4vw, 3.45rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

body.resource-landing-focused .resource-lede {
  max-width: 34em;
  margin: 22px auto 0;
}

body.resource-landing-focused .resource-checks {
  width: max-content;
  max-width: 100%;
  margin: 32px auto 0;
  text-align: left;
}

body.resource-landing-focused .resource-form,
body.resource-landing-focused [data-resource-one-click] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(100%, 440px);
  margin: 36px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--dv-line);
  text-align: left;
}

body.resource-landing-focused .resource-form .resource-submit,
body.resource-landing-focused [data-resource-one-click] .resource-submit {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  height: auto;
  margin-top: 8px;
  padding-top: 16px;
  padding-bottom: 16px;
}

body.resource-landing-focused .resource-landing-legal {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 28px 0 0;
  color: var(--dv-text-mute);
  font-size: 13px;
  line-height: 1.4;
}

body.resource-landing-focused .resource-landing-legal a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.resource-landing-focused .resource-landing-legal a:hover,
body.resource-landing-focused .resource-landing-legal a:focus-visible {
  color: var(--dv-accent);
}
