/* LoveTrails offer modal — Battle for Hastings editorial */
.bfh-lovetrails-modal {
  padding: 0;
  border: none;
  margin: auto;
  position: fixed;
  inset: 0;
  width: min(480px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  height: fit-content;
  overflow: visible;
  background: transparent;
  color: inherit;
}

.bfh-lovetrails-modal::backdrop {
  background: rgba(28, 22, 18, 0.52);
  backdrop-filter: blur(4px);
}

@keyframes bfh-lovetrails-slide-up {
  from {
    opacity: 0;
    transform: translateY(clamp(1.5rem, 10vh, 4rem));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bfh-lovetrails-modal[open] .bfh-lovetrails-modal__panel {
  animation: bfh-lovetrails-slide-up 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .bfh-lovetrails-modal[open] .bfh-lovetrails-modal__panel {
    animation: none;
  }

  .bfh-lovetrails-modal.is-success .bfh-lovetrails-modal__success {
    animation: none;
  }
}

.bfh-lovetrails-modal__panel {
  position: relative;
  box-sizing: border-box;
  border-radius: 14px;
  background: rgba(252, 249, 243, 0.98);
  border: 1px solid rgba(88, 64, 48, 0.14);
  box-shadow: 0 28px 70px rgba(32, 22, 14, 0.22);
  max-height: min(90vh, 680px);
  overflow: hidden;
}

.bfh-lovetrails-modal__stripe {
  display: flex;
  height: 5px;
}
.bfh-lovetrails-modal__stripe span {
  flex: 1;
}
.bfh-lovetrails-modal__stripe span:nth-child(1) { background: #c0392b; }
.bfh-lovetrails-modal__stripe span:nth-child(2) { background: #d4a017; }
.bfh-lovetrails-modal__stripe span:nth-child(3) { background: #2c5f8a; }
.bfh-lovetrails-modal__stripe span:nth-child(4) { background: #6b8f71; }

.bfh-lovetrails-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(88, 64, 48, 0.16);
  border-radius: 8px;
  background: rgba(252, 249, 243, 0.95);
  color: rgba(40, 32, 24, 0.7);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.bfh-lovetrails-modal__close:hover {
  background: #fff;
  color: #1a1a1a;
}

.bfh-lovetrails-modal__body {
  padding: clamp(24px, 4vw, 32px) clamp(20px, 4vw, 28px) clamp(22px, 3.5vw, 28px);
  overflow-y: auto;
  max-height: min(86vh, 640px);
}

.bfh-lovetrails-modal__kicker {
  margin: 0 0 10px;
  font-family: "Cinzel", serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tap-ochre, #c8952a);
}

.bfh-lovetrails-modal__title {
  margin: 0 0 12px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.65rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--hast-ed-ink, #1a1a1a);
}

.bfh-lovetrails-modal__lede {
  margin: 0 0 12px;
  font-family: var(--hast-ed-sans, "DM Sans", sans-serif);
  font-size: 15px;
  line-height: 1.55;
  color: rgba(40, 32, 24, 0.72);
}

.bfh-lovetrails-modal__rules {
  margin: 0 0 20px;
  font-family: var(--hast-ed-sans, "DM Sans", sans-serif);
  font-size: 14px;
}

.bfh-lovetrails-modal__rules a {
  color: var(--tap-ochre, #c8952a);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bfh-lovetrails-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.bfh-lovetrails-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bfh-lovetrails-apply {
  margin-top: clamp(24px, 4vw, 36px);
  background: #fff;
  border: 1px solid var(--hast-ed-border, rgba(88, 64, 48, 0.14));
  padding: clamp(24px, 4vw, 36px);
}

.bfh-lovetrails-apply__success[hidden] {
  display: none;
}

.hast-apply.submitted .bfh-lovetrails-apply__success {
  display: block;
}

.hast-body.hast-editorial .hast-apply__sub a {
  color: var(--tap-terracotta, #9b4f33);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bfh-lovetrails-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bfh-lovetrails-modal__field label {
  font-family: var(--hast-ed-sans, "DM Sans", sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(40, 32, 24, 0.55);
}

.bfh-lovetrails-modal__field input {
  font-family: var(--hast-ed-sans, "DM Sans", sans-serif);
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid rgba(88, 64, 48, 0.2);
  border-radius: 6px;
  background: #fff;
  color: var(--hast-ed-ink, #1a1a1a);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.bfh-lovetrails-modal__field input:focus {
  border-color: var(--tap-ochre, #c8952a);
  box-shadow: 0 0 0 3px rgba(200, 149, 42, 0.15);
}

.bfh-lovetrails-modal__actions {
  margin-top: 4px;
}

.bfh-lovetrails-modal__check {
  margin-top: 2px;
}

.bfh-lovetrails-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.bfh-lovetrails-check input {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--tap-ochre, #c8952a);
}

.bfh-lovetrails-check__text {
  font-family: var(--hast-ed-sans, "DM Sans", sans-serif);
  font-size: 14px;
  line-height: 1.45;
  color: rgba(40, 32, 24, 0.72);
}

.bfh-lovetrails-modal__status {
  margin: 12px 0 0;
  font-family: var(--hast-ed-sans, "DM Sans", sans-serif);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(40, 32, 24, 0.55);
  min-height: 1.25em;
}

@keyframes bfh-lovetrails-success-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bfh-lovetrails-modal__success {
  text-align: center;
  padding: clamp(20px, 4vw, 32px) 0 8px;
}

.bfh-lovetrails-modal__success[hidden] {
  display: none;
}

.bfh-lovetrails-modal.is-success .bfh-lovetrails-modal__success {
  display: block;
  animation: bfh-lovetrails-success-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bfh-lovetrails-modal.is-success .bfh-lovetrails-modal__success[hidden] {
  display: none;
}

.bfh-lovetrails-modal__success-title {
  margin: 0 0 10px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  color: var(--hast-ed-ink, #1a1a1a);
}

.bfh-lovetrails-modal__success-lede {
  margin: 0;
  font-family: var(--hast-ed-sans, "DM Sans", sans-serif);
  font-size: 15px;
  line-height: 1.55;
  color: rgba(40, 32, 24, 0.72);
}

.bfh-lovetrails-modal.is-success .bfh-lovetrails-modal__form-view {
  display: none;
}
