/* Harbor Consent banner. Colors live on .harbor-root so admin settings and dark mode can override them. */
.harbor-root {
  --harbor-bg: #f6f3ee;
  --harbor-text: #1c1917;
  --harbor-muted: #57534e;
  --harbor-border: #e6e0d6;
  --harbor-accept-bg: #1c1917;
  --harbor-accept-text: #faf8f5;
  --harbor-link: #9a3412;
  --harbor-focus: #c2410c;
  --harbor-radius: 14px;
  --harbor-shadow: 0 16px 40px rgba(28, 25, 23, 0.16);
  --harbor-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--harbor-text);
  font-family: var(--harbor-font);
  font-size: 16px;
  line-height: 1.45;
  z-index: 100000;
}

@media (prefers-color-scheme: dark) {
  .harbor-root {
    --harbor-bg: #1c1917;
    --harbor-text: #f5f5f4;
    --harbor-muted: #a8a29e;
    --harbor-border: #44403c;
    --harbor-accept-bg: #f5f5f4;
    --harbor-accept-text: #1c1917;
    --harbor-link: #fdba74;
    --harbor-focus: #fdba74;
    --harbor-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}

.harbor-banner,
.harbor-modal__panel,
.harbor-notice {
  background: var(--harbor-bg);
  color: var(--harbor-text);
  border: 1px solid var(--harbor-border);
  box-shadow: var(--harbor-shadow);
}

.harbor-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 18px 22px;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}

.harbor-root[data-position="corner"] .harbor-banner {
  left: 16px;
  right: auto;
  bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--harbor-border);
  border-radius: var(--harbor-radius);
  flex-direction: column;
  align-items: stretch;
}

.harbor-root[data-position="center"] .harbor-banner {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  border-radius: var(--harbor-radius);
  flex-direction: column;
  align-items: stretch;
}

.harbor-banner__copy h2,
.harbor-modal__panel h2,
.harbor-cat h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.3;
}

.harbor-banner__copy p,
.harbor-cat p,
.harbor-note,
.harbor-details p {
  margin: 0 0 8px;
  color: var(--harbor-muted);
}

.harbor-actions,
.harbor-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.harbor-btn,
.harbor-switch,
.harbor-footer__btn {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--harbor-border);
  background: transparent;
  color: var(--harbor-text);
}

.harbor-btn--accept {
  background: var(--harbor-accept-bg);
  color: var(--harbor-accept-text);
  border-color: transparent;
}

.harbor-btn--text,
.harbor-footer__btn,
.harbor-linkish {
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
  color: var(--harbor-link);
}

.harbor-btn:focus-visible,
.harbor-switch:focus-visible,
.harbor-footer__btn:focus-visible,
.harbor-footer__link:focus-visible,
.harbor-link:focus-visible {
  outline: 3px solid var(--harbor-focus);
  outline-offset: 2px;
}

.harbor-link,
.harbor-footer__link {
  color: var(--harbor-link);
}

.harbor-modal[hidden],
.harbor-banner[hidden],
.harbor-notice[hidden],
.harbor-backdrop[hidden] {
  display: none;
}

.harbor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.48);
}

.harbor-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
}

.harbor-modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  border-radius: var(--harbor-radius);
  padding: 20px;
}

.harbor-cat {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--harbor-border);
}

.harbor-switch {
  min-width: 76px;
  border-radius: 999px;
}

.harbor-switch[aria-checked="true"] {
  background: var(--harbor-accept-bg);
  color: var(--harbor-accept-text);
  border-color: transparent;
}

.harbor-switch:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.harbor-details {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
}

.harbor-details code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.harbor-notice {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px));
  border-radius: var(--harbor-radius);
  padding: 14px 16px;
  z-index: 100001;
}

.harbor-status {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 32px));
  background: var(--harbor-bg);
  color: var(--harbor-text);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--harbor-border);
  z-index: 100001;
  pointer-events: none;
}

.harbor-status:empty {
  display: none;
}

.harbor-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  padding: 8px 0 16px;
  font-size: 0.95rem;
}

.harbor-noscript {
  padding: 8px 0;
}

@media (max-width: 720px) {
  .harbor-banner {
    flex-direction: column;
    align-items: stretch;
    max-height: 70vh;
    overflow: auto;
  }
  .harbor-actions,
  .harbor-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .harbor-btn,
  .harbor-modal__actions .harbor-btn {
    width: 100%;
  }
  .harbor-modal__panel {
    max-height: 100%;
    height: 100%;
    border-radius: 0;
  }
  .harbor-modal {
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .harbor-root,
  .harbor-banner,
  .harbor-modal__panel {
    scroll-behavior: auto;
  }
}
