/* Cookie banner and preference dialog — Letfolk. Matches the landing typography. */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--paper, #f3eee4);
  border-top: 1px solid var(--rule-strong, rgba(28, 27, 22, 0.28));
  padding: 12px 0 14px;
  box-shadow: 0 -10px 28px rgba(28, 27, 22, 0.07);
}

.cookie-banner[hidden],
.cookie-backdrop[hidden] { display: none !important; }

.cookie-banner .wrap {
  align-items: end;
}

.cookie-copy { grid-column: 1 / 8; }
.cookie-copy h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 4px;
  color: var(--ink);
}
.cookie-copy p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 62ch;
}
.cookie-copy a { color: inherit; }

.cookie-actions {
  grid-column: 8 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--forest);
  border: 1px solid var(--forest);
  border-radius: 3px;
  padding: 0 16px;
  height: 40px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  min-width: 7.5rem;
}
.btn-outline:hover { background: var(--forest-2, #12241b); color: var(--cream-on-green, #efe8d8); text-decoration: none; }

.cookie-actions .btn,
.cookie-dialog-actions .btn {
  min-width: 7.5rem;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink);
  border: 0;
  height: 40px;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.linkish {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}
.linkish:hover { text-decoration-thickness: 2px; }

body.cookie-banner-on {
  padding-bottom: var(--cookie-banner-h, 140px);
}

.cookie-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(28, 27, 22, 0.48);
  display: grid;
  place-items: center;
  padding: 24px;
}

.cookie-dialog {
  background: var(--paper, #f3eee4);
  color: var(--ink, #1c1b16);
  width: min(34rem, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px 28px 24px;
  border: 1px solid var(--rule, rgba(28, 27, 22, 0.16));
  border-radius: 2px;
  box-shadow: 0 16px 40px rgba(28, 27, 22, 0.18);
}
.cookie-dialog h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 10px;
}
.cookie-dialog .lead {
  font-size: 14.5px;
  color: var(--muted);
  margin: 0 0 20px;
  max-width: none;
}
.cookie-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 16px 0;
  border-top: 1px solid var(--rule, rgba(28, 27, 22, 0.16));
}
.cookie-option h3 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.cookie-option p {
  grid-column: 1 / 2;
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  max-width: none;
}
.cookie-option label.choice {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.cookie-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--forest, #1c3628);
  cursor: pointer;
}
.cookie-option input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
.cookie-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rule, rgba(28, 27, 22, 0.16));
}

@media (max-width: 820px) {
  .cookie-copy,
  .cookie-actions {
    grid-column: 1 / -1;
  }
  .cookie-banner { padding: 14px 0 16px; }
  .cookie-copy h2 { font-size: 1.3rem; margin: 0 0 6px; }
  .cookie-actions {
    justify-content: stretch;
    padding-top: 12px;
  }
  .cookie-actions .btn,
  .cookie-actions .btn-outline,
  .cookie-actions .btn-text {
    flex: 1 1 auto;
    min-width: 0;
  }
  .cookie-dialog { padding: 22px 20px 20px; }
  .cookie-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }
  .cookie-dialog-actions .btn-outline { min-width: 0; }
  .cookie-dialog-actions .btn { min-width: 0; }
  .cookie-dialog-actions .btn-text { grid-column: 1 / -1; order: 3; }
}
