/* Shared editorial primitives. Opt-in classes keep legacy pages unchanged. */
/* stylelint-disable selector-class-pattern */
:root {
  --wh-ink: #292b24;
  --wh-muted: #666a5e;
  --wh-paper: #f5f4ee;
  --wh-surface: #fff;
  --wh-line: #dedfd5;
  --wh-accent: #f9d40f;
  --wh-focus: #978200;
  --wh-error: #a03830;
  --wh-radius: 5px;
  --wh-font-heading: georgia, "Times New Roman", serif;
}

.wh-page {
  margin-inline: auto;
  color: var(--wh-ink);
}

.wh-page--narrow {
  max-width: 440px;
}

.wh-panel {
  padding: 20px;
  border: 1px solid var(--wh-line);
  border-radius: var(--wh-radius);
  background: var(--wh-surface);
}

.wh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--wh-line);
  border-radius: var(--wh-radius);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.wh-button--primary {
  border-color: var(--wh-ink);
  background: var(--wh-ink);
  color: #fff;
}

.wh-button--primary:hover {
  border-color: #424638;
  background: #424638;
  color: #fff;
}

.wh-button--secondary {
  background: var(--wh-surface);
  color: var(--wh-ink);
}

.wh-button--secondary:hover {
  border-color: #a3a798;
  background: var(--wh-paper);
}

.wh-button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.wh-form .form-group {
  margin-bottom: 14px;
}

.wh-form label {
  margin-bottom: 6px;
  color: var(--wh-ink);
  font-size: 13px;
  font-weight: 600;
}

.wh-form .form-control {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--wh-line);
  border-radius: var(--wh-radius);
  background-color: var(--wh-surface);
  color: var(--wh-ink);
  font-size: 16px;
  line-height: 1.4;
  box-shadow: none;
}

.wh-form .form-control:focus {
  border-color: var(--wh-focus);
  box-shadow: none;
}

.wh-form .form-control::placeholder {
  color: #85897e;
}

.wh-form .form-text {
  margin-top: 7px;
  font-size: 12px;
}

.wh-form .form-check {
  padding-left: 25px;
}

.wh-form .form-check-label {
  margin: 0;
  padding-left: 0;
  color: var(--wh-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}

.wh-form .form-check-input {
  display: block;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  margin-left: -25px;
  accent-color: var(--wh-ink);
}

.wh-form .form-check-label::before,
.wh-form .form-check-label::after {
  content: none;
}

.wh-form .is-invalid {
  border-color: var(--wh-error);
}

.wh-form .invalid-feedback {
  color: var(--wh-error);
  font-size: 12px;
}

.wh-form .alert-danger {
  border: 1px solid #e5bdb8;
  border-radius: var(--wh-radius);
  background: #fff5f3;
  color: var(--wh-error);
  font-size: 13px;
}

.wh-auth-page,
.wh-editorial-page {
  background: var(--wh-paper);
}

.wh-workspace {
  padding-block: 18px 56px;
}

.wh-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.wh-page-title {
  margin: 0 0 10px;
  font-family: var(--wh-font-heading);
  font-size: clamp(34px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.wh-page-description {
  margin: 0;
  color: var(--wh-muted);
  font-size: 15px;
  line-height: 1.6;
}

.wh-back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--wh-muted);
  font-size: 13px;
}

.wh-eyebrow {
  margin-bottom: 10px;
  color: var(--wh-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.wh-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--wh-line);
  border-radius: 3px;
  background: var(--wh-paper);
  color: var(--wh-muted);
  font-size: 11px;
  line-height: 1.4;
}

.wh-status-icon {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.wh-modal .modal-dialog {
  max-width: 480px;
}

.wh-modal .modal-content {
  padding: 32px;
  border: 1px solid var(--wh-line);
  border-radius: var(--wh-radius);
  background: var(--wh-paper);
  color: var(--wh-ink);
}

.wh-modal-header {
  padding-right: 22px;
}

.wh-modal-title {
  margin: 0 0 16px;
  font-family: var(--wh-font-heading);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.035em;
}

.wh-modal-description {
  margin: 0 0 24px;
  color: var(--wh-muted);
  font-size: 14px;
  line-height: 1.6;
}

.wh-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--wh-muted);
  cursor: pointer;
}

.wh-modal-footer {
  margin-top: 14px;
  text-align: center;
}

.wh-text-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--wh-muted);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.wh-modal :focus-visible {
  outline: 2px solid var(--wh-focus);
  outline-offset: 3px;
}

.wh-newsletter-note {
  margin: 12px 0 0;
  color: var(--wh-muted);
  font-size: 12px;
  text-align: center;
}

.wh-newsletter-preference {
  padding-block: 18px;
  border-top: 1px solid var(--wh-line);
}

.wh-newsletter-preference p {
  margin: 8px 0 0;
  color: var(--wh-muted);
  font-size: 13px;
  line-height: 1.5;
}

.wh-newsletter-preference .custom-switch {
  margin-top: 0 !important;
  padding-left: 40px;
}

.wh-newsletter-preference .custom-control-label {
  font-size: 14px;
  font-weight: 600;
}

.wh-newsletter-preference .custom-control-input:checked ~ .custom-control-label::before {
  border-color: var(--wh-ink);
  background-color: var(--wh-ink);
}

.wh-newsletter-preference .custom-control-input:focus-visible ~ .custom-control-label::before {
  outline: 2px solid var(--wh-focus);
  outline-offset: 3px;
  box-shadow: none;
}

.wh-modal .htmx-indicator {
  display: none;
}

.wh-modal .htmx-request .htmx-indicator {
  display: inline-flex;
}

.wh-modal .subscription-success h3,
.wh-modal .subscription-errors h4 {
  font-family: var(--wh-font-heading);
  font-size: 24px;
}

@media (width <= 575.98px) {
  .wh-modal .modal-dialog {
    margin-inline: 16px;
  }

  .wh-modal .modal-content {
    padding: 24px;
  }

  .wh-modal-title {
    font-size: 30px;
  }
}

.wh-status--success {
  border-color: #d6dfce;
  background: #eff3eb;
  color: #46603b;
}

.wh-status--pending,
.wh-status--sponsor {
  border-color: #e8ddb0;
  background: #faf5df;
  color: #766325;
}

.wh-status--error {
  border-color: #e5bdb8;
  background: #fff5f3;
  color: var(--wh-error);
}

.wh-empty-state {
  padding: 64px 24px;
  text-align: center;
}

.wh-empty-state h2 {
  margin-bottom: 12px;
  font-family: var(--wh-font-heading);
  font-size: 28px;
}

.wh-empty-state .wh-button {
  margin-top: 24px;
}

.wh-site-list {
  padding: 0 24px;
}

.wh-site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 24px;
}

.wh-site-row + .wh-site-row {
  border-top: 1px solid var(--wh-line);
}

.wh-site-summary {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.wh-site-logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 1px solid var(--wh-line);
  border-radius: var(--wh-radius);
  object-fit: contain;
  background: var(--wh-paper);
}

.wh-site-logo-wrap {
  flex-shrink: 0;
}

.wh-site-placeholder {
  display: grid;
  place-items: center;
  font-family: var(--wh-font-heading);
  font-size: 24px;
}

.wh-site-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wh-site-title {
  margin: 0 0 5px;
  font-size: 18px;
  font-weight: 600;
}

.wh-site-title a {
  color: var(--wh-ink);
}

.wh-site-tagline {
  margin: 0 0 10px;
  color: var(--wh-muted);
  font-size: 13px;
  line-height: 1.5;
}

.wh-site-statuses,
.wh-site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wh-site-actions {
  flex-shrink: 0;
  justify-content: flex-end;
  max-width: 340px;
  gap: 8px;
}

.wh-site-metrics {
  flex-basis: 100%;
  color: var(--wh-muted);
  font-size: 11px;
}

.wh-subscription-list {
  margin-bottom: 16px;
  list-style: none;
}

.wh-subscription-controls {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 28px;
}

.wh-subscription-billing {
  min-width: 64px;
  margin: 0;
  font-size: 13px;
}

.wh-subscription-billing dt {
  margin-bottom: 4px;
  color: var(--wh-muted);
  font-size: 11px;
  font-weight: 400;
}

.wh-subscription-billing dd {
  margin: 0;
  font-weight: 600;
}

.wh-subscription-note,
.wh-subscription-new {
  color: var(--wh-muted);
  font-size: 13px;
  line-height: 1.6;
}

.wh-subscription-new {
  margin: 18px 0 0;
}

.wh-subscription-new a {
  color: var(--wh-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wh-subscription-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  border: 1px solid #e8ddb0;
  border-radius: 50%;
  background: #faf5df;
  color: #766325;
}

.wh-subscription-empty-icon svg {
  width: 24px;
  height: 24px;
}

.wh-pagination {
  flex-wrap: wrap;
}

.wh-pagination .page-link {
  border-color: var(--wh-line);
  background: var(--wh-surface);
  color: var(--wh-ink);
}

.wh-pagination .active .page-link {
  border-color: var(--wh-ink);
  background: var(--wh-ink);
  color: #fff;
}

@media (width <= 767.98px) {
  .wh-page-header,
  .wh-site-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .wh-site-list {
    padding-inline: 18px;
  }

  .wh-site-actions {
    justify-content: flex-start;
    max-width: 100%;
  }

  .wh-subscription-controls {
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    gap: 16px;
  }

}

.wh-auth {
  padding-block: 18px 48px;
}

.wh-auth-header {
  margin-bottom: 20px;
  text-align: center;
}

.wh-auth-title {
  margin: 0 0 10px;
  color: var(--wh-ink);
  font-family: var(--wh-font-heading);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.wh-auth-description,
.wh-auth-switch {
  margin: 0;
  color: var(--wh-muted);
  font-size: 14px;
  line-height: 1.6;
}

.wh-auth a {
  color: var(--wh-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wh-auth-social,
.wh-auth-submit {
  width: 100%;
}

.wh-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--wh-muted);
  font-size: 12px;
}

.wh-auth-divider::before,
.wh-auth-divider::after {
  flex: 1;
  height: 1px;
  background: var(--wh-line);
  content: "";
}

.wh-auth-terms {
  margin: 0 0 20px;
  color: var(--wh-muted);
  font-size: 12px;
  line-height: 1.7;
}

.wh-auth-switch {
  margin-top: 22px;
  text-align: center;
}

@media (width <= 575.98px) {
  .wh-auth {
    padding-block: 20px 40px;
  }

  .wh-auth-title {
    font-size: 34px;
  }
}

.wh-account-nav {
  display: flex;
  gap: 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--wh-line);
}

.wh-account-nav a {
  padding: 8px 0 16px;
  border-bottom: 2px solid transparent;
  color: var(--wh-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.wh-account-nav a[aria-current="page"] {
  border-bottom-color: var(--wh-ink);
  color: var(--wh-ink);
}

.wh-settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.wh-settings-nav a,
.wh-settings-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--wh-radius);
  background: transparent;
  color: var(--wh-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.wh-settings-nav a[aria-current="page"] {
  border-color: var(--wh-line);
  background: var(--wh-surface);
  color: var(--wh-ink);
}

.wh-account-nav a:hover,
.wh-settings-nav a:hover,
.wh-settings-nav button:hover {
  color: var(--wh-ink);
}

.wh-settings-nav :focus-visible {
  outline: 2px solid var(--wh-focus);
  outline-offset: 3px;
}

.wh-settings-content {
  max-width: 760px;
}

.wh-settings-panel {
  padding: 28px;
}

.wh-settings-panel + .wh-settings-panel {
  margin-top: 20px;
}

.wh-settings-panel h2 {
  margin: 0 0 8px;
  font-family: var(--wh-font-heading);
  font-size: 25px;
  font-weight: 700;
}

.wh-settings-panel > .wh-page-description {
  margin-bottom: 22px;
  font-size: 14px;
}

.wh-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.wh-settings-link {
  padding: 10px 0;
  color: var(--wh-muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wh-email-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-block: 16px;
  border-block: 1px solid var(--wh-line);
}

.wh-email-row + .wh-email-row {
  border-top: 0;
}

.wh-email-row input {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--wh-ink);
}

.wh-email-row label {
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.wh-email-address {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.wh-button--danger {
  border-color: #e5bdb8;
  background: var(--wh-surface);
  color: var(--wh-error);
}

.wh-button--danger:hover {
  background: #fff5f3;
}

.wh-settings-warning {
  color: var(--wh-error);
  font-size: 14px;
}

.wh-button:focus-visible,
.wh-workspace a:focus-visible,
.wh-form :focus-visible,
.wh-auth a:focus-visible {
  outline: 2px solid var(--wh-focus);
  outline-offset: 3px;
}

@media (width <= 575.98px) {
  .wh-account-nav {
    justify-content: space-between;
    gap: 12px;
  }

  .wh-account-nav a {
    font-size: 13px;
  }

  .wh-settings-nav {
    gap: 4px;
  }

  .wh-settings-nav a,
  .wh-settings-nav button {
    padding-inline: 10px;
  }

  .wh-settings-panel {
    padding: 20px;
  }
}
