/* Download gate. Desktop card, bottom sheet under 768px. */

button.btn[data-hg-briefing],
button.btn[data-hg-download] {
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  appearance: none;
}

button.hg-dl-link {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

button.hg-dl-link:hover {
  color: var(--meadow);
}

button.hg-dl-inline {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #b9c6a6;
}

button.hg-dl-inline:hover {
  color: var(--ink);
}

.hg-dl {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(16, 20, 16, 0.46);
}

.hg-dl[hidden] {
  display: none;
}

.hg-dl-card {
  position: relative;
  width: min(440px, 100%);
  max-height: min(640px, calc(100vh - 56px));
  overflow: auto;
  padding: 32px 32px 28px;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 70px -24px rgba(16, 20, 16, 0.45), 0 0 0 1px rgba(16, 20, 16, 0.06);
}

.hg-dl-grab {
  display: none;
}

.hg-dl-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.hg-dl-x:hover {
  background: var(--bone, #f6f3ee);
  color: var(--ink);
}

.hg-dl-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hg-dl-card h2 {
  margin: 8px 48px 0 0;
  font-family: Fraunces, Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}

.hg-dl-form,
.hg-dl-thanks {
  margin-top: 22px;
}

.hg-dl-field {
  margin: 0 0 16px;
}

.hg-dl-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hg-dl-field input {
  width: 100%;
  height: 48px;
  border: 0;
  border-bottom: 1px solid #858b81;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
}

.hg-dl-field input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 1px 0 0 var(--ink);
}

.hg-dl-field input[aria-invalid="true"] {
  border-color: #a3261b;
}

.hg-dl-err {
  margin: 6px 0 0;
  color: #a3261b;
  font-size: 0.88rem;
}

.hg-dl-err[hidden] {
  display: none;
}

.hg-dl-note {
  margin: 6px 0 18px;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.45;
}

.hg-dl-note a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #b9c6a6;
  text-underline-offset: 3px;
}

.hg-dl-note a:hover {
  color: var(--meadow);
}

.hg-dl-submit {
  width: 100%;
  justify-content: center;
}

.hg-dl-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.hg-dl-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.hg-dl-thanks p {
  margin: 0;
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.5;
}

.hg-dl-again {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  color: var(--meadow);
  font-weight: 500;
}

.hg-dl :focus-visible {
  outline: 2px solid var(--meadow);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .hg-dl {
    align-items: flex-end;
    padding: 0;
  }

  .hg-dl-card {
    width: 100%;
    max-height: 92vh;
    padding: 12px 22px calc(22px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
  }

  .hg-dl-grab {
    display: block;
    width: 36px;
    height: 4px;
    margin: 4px auto 8px;
    border-radius: 99px;
    background: #cfd2ca;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hg-dl-card {
    animation: hg-dl-in 0.22s ease;
  }
}

@keyframes hg-dl-in {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
