/* Moon Helpdesk — frontend styles */

:root {
  --mhd-green: #12c571;
  --mhd-green-dark: #0ea35c;
  --mhd-ink: #1a1a1a;
  --mhd-muted: #6b7280;
  --mhd-border: #e5e7eb;
  --mhd-bg: #f8faf9;
  --mhd-white: #ffffff;
  --mhd-radius: 12px;
  --mhd-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  --mhd-font: "Graphik", "Segoe UI", sans-serif;
}

.moon-helpdesk,
.mhd-page {
  font-family: var(--mhd-font);
  color: var(--mhd-ink);
}

.mhd-page a {
  color: var(--mhd-green-dark);
}

/* Header / footer fallbacks */
.mhd-header,
.mhd-footer {
  background: var(--mhd-white);
  border-bottom: 1px solid var(--mhd-border);
}

.mhd-footer {
  border-top: 1px solid var(--mhd-border);
  border-bottom: 0;
  margin-top: 48px;
}

.mhd-header__inner,
.mhd-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mhd-header__logo img {
  height: 32px;
  width: auto;
}

/* Breadcrumbs: markup uses Tailwind classes from the HTML kit (no slash separators). */

/* Search hero */
.mhd-search-hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 32px;
  text-align: center;
  position: relative;
}

.mhd-search-hero__title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  margin: 0 0 8px;
}

.mhd-search-hero__subtitle {
  color: var(--mhd-muted);
  margin: 0 0 24px;
}

.mhd-search-hero__form {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--mhd-white);
  border: 1px solid var(--mhd-border);
  border-radius: 999px;
  box-shadow: var(--mhd-shadow);
  padding: 6px 6px 6px 18px;
}

.mhd-search-hero__input {
  flex: 1;
  border: 0;
  outline: none;
  font: inherit;
  background: transparent;
  min-width: 0;
  padding: 10px 8px;
}

.mhd-search-hero__submit {
  border: 0;
  background: var(--mhd-green);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mhd-search-hero__ticket {
  display: inline-flex;
  margin-top: 20px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--mhd-green);
  color: #fff !important;
  text-decoration: none;
  font-weight: 500;
}

/* Suggestions dropdown */
.mhd-search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: var(--mhd-white);
  border: 1px solid var(--mhd-border);
  border-radius: var(--mhd-radius);
  box-shadow: var(--mhd-shadow);
  text-align: left;
  z-index: 30;
  overflow: hidden;
}

.mhd-search-suggestions[hidden] {
  display: none !important;
}

.mhd-search-suggestions__item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--mhd-border);
}

.mhd-search-suggestions__item:last-child {
  border-bottom: 0;
}

.mhd-search-suggestions__item:hover,
.mhd-search-suggestions__item.is-active {
  background: var(--mhd-bg);
}

.mhd-search-suggestions__title {
  font-weight: 500;
  display: block;
}

.mhd-search-suggestions__excerpt {
  font-size: 13px;
  color: var(--mhd-muted);
  margin-top: 2px;
}

.mhd-search-suggestions__empty,
.mhd-search-suggestions__loading {
  padding: 14px 16px;
  color: var(--mhd-muted);
  font-size: 14px;
}

/* Skeletons */
.mhd-skeleton {
  display: block;
  background: linear-gradient(90deg, #eef2f1 25%, #e2e8e6 37%, #eef2f1 63%);
  background-size: 400% 100%;
  animation: mhd-shimmer 1.2s ease-in-out infinite;
  border-radius: 8px;
}

.mhd-skeleton--title {
  height: 18px;
  width: 70%;
  margin-bottom: 10px;
}

.mhd-skeleton--line {
  height: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.mhd-skeleton--line.is-short {
  width: 45%;
}

.mhd-skeleton-card {
  padding: 16px;
  border: 1px solid var(--mhd-border);
  border-radius: var(--mhd-radius);
  background: var(--mhd-white);
}

@keyframes mhd-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* Lists / cards */
.mhd-article-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mhd-article-list__item + .mhd-article-list__item {
  border-top: 1px solid var(--mhd-border);
}

.mhd-article-list__link {
  display: block;
  padding: 14px 4px;
  text-decoration: none;
  color: inherit;
}

.mhd-article-list__link:hover {
  color: var(--mhd-green-dark);
}

.mhd-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 24px auto;
  padding: 10px 20px;
  border: 1px solid var(--mhd-border);
  border-radius: 999px;
  background: var(--mhd-white);
  cursor: pointer;
  font: inherit;
}

.mhd-load-more[disabled] {
  opacity: 0.6;
  cursor: wait;
}

/* Voting — Figma: 36px height, 8×16 padding, 1px primary border, 6px radius, 10px gap */
.mhd-page [data-mhd-voting] .mhd-voting__actions,
.moon-helpdesk [data-mhd-voting] .mhd-voting__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mhd-page [data-mhd-voting] .mhd-vote-btn,
.mhd-page [data-mhd-voting] .mhd-voting__btn,
.moon-helpdesk [data-mhd-voting] .mhd-vote-btn,
.moon-helpdesk [data-mhd-voting] .mhd-voting__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 55px;
  height: 36px;
  padding: 8px 16px;
  border: 1px solid #093181;
  border-radius: 6px;
  background: #ffffff;
  color: #093181;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mhd-page [data-mhd-voting] .mhd-vote-btn:hover,
.mhd-page [data-mhd-voting] .mhd-voting__btn:hover,
.moon-helpdesk [data-mhd-voting] .mhd-vote-btn:hover,
.moon-helpdesk [data-mhd-voting] .mhd-voting__btn:hover {
  background: #f4f9ff;
}

.mhd-page [data-mhd-voting] .mhd-vote-btn:disabled,
.mhd-page [data-mhd-voting] .mhd-voting__btn:disabled,
.moon-helpdesk [data-mhd-voting] .mhd-vote-btn:disabled,
.moon-helpdesk [data-mhd-voting] .mhd-voting__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mhd-voting__thanks {
  margin: 0;
  color: var(--mhd-green-dark);
}

/* Social share — article footer (Figma: 42×42 tile, 14px radius, 9.33px gap) */
.mhd-page .mhd-article-panel__footer .mhd-social-share,
.moon-helpdesk .mhd-article-panel__footer .mhd-social-share {
  margin: 0;
}

.mhd-page .mhd-article-panel__footer .mhd-social-share__list,
.moon-helpdesk .mhd-article-panel__footer .mhd-social-share__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9.33px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mhd-page .mhd-article-panel__footer .mhd-social-share__link,
.moon-helpdesk .mhd-article-panel__footer .mhd-social-share__link {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  text-decoration: none;
  box-sizing: border-box;
}

.mhd-page .mhd-article-panel__footer .mhd-social-share__icon,
.moon-helpdesk .mhd-article-panel__footer .mhd-social-share__icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  /* SVG assets use white fill; tint to design muted slate on white tiles */
  filter: brightness(0) saturate(100%) invert(38%) sepia(9%) saturate(1015%) hue-rotate(176deg) brightness(92%) contrast(89%);
}

.mhd-page .mhd-article-panel__footer .mhd-social-share__link:hover .mhd-social-share__icon,
.moon-helpdesk .mhd-article-panel__footer .mhd-social-share__link:hover .mhd-social-share__icon {
  filter: brightness(0) saturate(100%) invert(14%) sepia(42%) saturate(2278%) hue-rotate(201deg) brightness(93%) contrast(98%);
}

.mhd-page .mhd-article-panel__footer .mhd-social-share__link.is-copied .mhd-social-share__icon,
.moon-helpdesk .mhd-article-panel__footer .mhd-social-share__link.is-copied .mhd-social-share__icon {
  filter: brightness(0) saturate(100%) invert(48%) sepia(79%) saturate(1559%) hue-rotate(111deg) brightness(95%) contrast(87%);
}

/* Ticket form */
.mhd-ticket-form {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.mhd-ticket-form__row {
  margin-bottom: 16px;
}

.mhd-ticket-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}

.mhd-ticket-form input[type="text"],
.mhd-ticket-form input[type="email"],
.mhd-ticket-form input[type="tel"],
.mhd-ticket-form select,
.mhd-ticket-form textarea {
  width: 100%;
  border: 1px solid var(--mhd-border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: var(--mhd-white);
}

.mhd-ticket-form textarea {
  min-height: 140px;
  resize: vertical;
}

.mhd-ticket-form__submit {
  border: 0;
  background: var(--mhd-green);
  color: #fff;
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.mhd-ticket-form__submit[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.mhd-ticket-form__error {
  color: #b42318;
  font-size: 14px;
  margin-top: 8px;
}

.mhd-ticket-form__success {
  color: var(--mhd-green-dark);
  margin-top: 12px;
}

/* Recent activity */
.mhd-recent-activity {
  margin: 32px 0;
}

.mhd-recent-activity__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mhd-recent-activity__item {
  padding: 10px 0;
  border-bottom: 1px solid var(--mhd-border);
}

.mhd-recent-activity__meta {
  font-size: 12px;
  color: var(--mhd-muted);
}

/* Toast — top-right notice (vote errors, generic messages). */
.mhd-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  max-width: min(380px, calc(100vw - 48px));
  background: #093181;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  box-shadow:
    0 12px 28px rgba(9, 49, 129, 0.28),
    0 4px 12px rgba(15, 23, 42, 0.12);
  z-index: 10050;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.mhd-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.mhd-toast.mhd-toast--error {
  background: #fff;
  color: #9f1239;
  border: 1px solid #fecdd3;
  box-shadow:
    0 12px 28px rgba(159, 18, 57, 0.12),
    0 4px 12px rgba(15, 23, 42, 0.08);
}

@media (max-width: 1199px) {
  .mhd-toast {
    top: 88px;
  }
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

@media (max-width: 640px) {
  .mhd-search-hero {
    padding-top: 28px;
  }

  .mhd-header__inner {
    flex-wrap: wrap;
  }
}

/* Helpdesk home — category cards: primary border on hover (matches category detail boxes) */
.mhd-page a.mhd-category-card,
.moon-helpdesk a.mhd-category-card {
  border-color: #e7ebf3;
  transition: border-color 0.15s ease;
}

.mhd-page a.mhd-category-card:hover,
.moon-helpdesk a.mhd-category-card:hover,
.mhd-page a.mhd-category-card:focus-visible,
.moon-helpdesk a.mhd-category-card:focus-visible {
  border-color: #093181;
}

/* Article sidebar — slate default (#475569); primary + underline on hover and current article */
.mhd-page .mhd-article-sidebar,
.moon-helpdesk .mhd-article-sidebar {
  width: 100%;
  max-width: 300px;
}

.mhd-page .mhd-article-sidebar .mhd-sidebar-heading,
.moon-helpdesk .mhd-article-sidebar .mhd-sidebar-heading {
  margin: 0;
  color: #151515;
}

.mhd-page .mhd-article-sidebar .mhd-sidebar-list,
.moon-helpdesk .mhd-article-sidebar .mhd-sidebar-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.mhd-page .mhd-article-sidebar .mhd-sidebar-list li,
.moon-helpdesk .mhd-article-sidebar .mhd-sidebar-list li {
  margin: 0;
}

.mhd-page .mhd-article-sidebar a.mhd-sidebar-link,
.moon-helpdesk .mhd-article-sidebar a.mhd-sidebar-link {
  display: inline;
  color: #475569;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-decoration: none;
  text-underline-offset: 3px;
  transition:
    color 0.15s ease,
    text-decoration-color 0.15s ease;
}

.mhd-page .mhd-article-sidebar a.mhd-sidebar-link:hover,
.moon-helpdesk .mhd-article-sidebar a.mhd-sidebar-link:hover,
.mhd-page .mhd-article-sidebar a.mhd-sidebar-link:focus-visible,
.moon-helpdesk .mhd-article-sidebar a.mhd-sidebar-link:focus-visible,
.mhd-page .mhd-article-sidebar a.mhd-sidebar-link.is-current,
.moon-helpdesk .mhd-article-sidebar a.mhd-sidebar-link.is-current,
.mhd-page .mhd-article-sidebar a.mhd-sidebar-link[aria-current="page"],
.moon-helpdesk .mhd-article-sidebar a.mhd-sidebar-link[aria-current="page"] {
  color: #093181;
  font-weight: 300;
  text-decoration: underline;
  text-decoration-color: #093181;
  text-decoration-thickness: 1px;
}

/* Article detail — content card (Figma: 32px padding, 32px vertical gaps). */
.mhd-page .mhd-article-panel,
.moon-helpdesk .mhd-article-panel {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px;
}

.mhd-page .mhd-article-panel__footer,
.moon-helpdesk .mhd-article-panel__footer {
  border-top: 1px solid #e7ebf3;
  padding-top: 32px;
}

/* Article CTA banner (Figma: #F4F9FF, 24px radius, 24px padding, 24px gap) */
.mhd-page .mhd-article-contact,
.moon-helpdesk .mhd-article-contact {
  box-sizing: border-box;
  min-height: 84px;
  padding: 24px;
  gap: 24px;
  border: 0;
  border-radius: 24px;
  background: #f4f9ff;
}

/* Article detail — WordPress body (lists, images, links). Tailwind preflight strips list markers. */
.mhd-page .mhd-article-content,
.moon-helpdesk .mhd-article-content {
  max-width: 100%;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #151515;
}

.mhd-page .mhd-article-content > :first-child,
.moon-helpdesk .mhd-article-content > :first-child {
  margin-top: 0;
}

.mhd-page .mhd-article-content > :last-child,
.moon-helpdesk .mhd-article-content > :last-child {
  margin-bottom: 0;
}

.mhd-page .mhd-article-content p,
.moon-helpdesk .mhd-article-content p {
  margin: 0 0 8px;
}

.mhd-page .mhd-article-content p:last-child,
.moon-helpdesk .mhd-article-content p:last-child {
  margin-bottom: 0;
}

.mhd-page .mhd-article-content ol,
.moon-helpdesk .mhd-article-content ol,
.mhd-page .mhd-article-content ul,
.moon-helpdesk .mhd-article-content ul {
  margin: 0;
  padding-left: 1.5rem;
}

.mhd-page .mhd-article-content ol,
.moon-helpdesk .mhd-article-content ol {
  list-style-type: decimal;
}

.mhd-page .mhd-article-content ul,
.moon-helpdesk .mhd-article-content ul {
  list-style-type: disc;
}

.mhd-page .mhd-article-content li,
.moon-helpdesk .mhd-article-content li {
  margin-bottom: 8px;
  padding-left: 0;
  line-height: 1.5;
}

.mhd-page .mhd-article-content li::marker,
.moon-helpdesk .mhd-article-content li::marker {
  color: #151515;
  font-weight: 400;
}

.mhd-page .mhd-article-content li:last-child,
.moon-helpdesk .mhd-article-content li:last-child {
  margin-bottom: 0;
}

.mhd-page .mhd-article-content li > ol,
.moon-helpdesk .mhd-article-content li > ol,
.mhd-page .mhd-article-content li > ul,
.moon-helpdesk .mhd-article-content li > ul {
  margin-top: 8px;
  margin-bottom: 0;
}

.mhd-page .mhd-article-content a,
.moon-helpdesk .mhd-article-content a {
  color: #093181;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.mhd-page .mhd-article-content a:hover,
.moon-helpdesk .mhd-article-content a:hover {
  color: var(--mhd-green-dark);
}

.mhd-page .mhd-article-content img,
.moon-helpdesk .mhd-article-content img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 32px 0 0;
  border-radius: 12px;
}

.mhd-page .mhd-article-content[data-mhd-image-lightbox="1"] a.mhd-article-lightbox-trigger,
.moon-helpdesk .mhd-article-content[data-mhd-image-lightbox="1"] a.mhd-article-lightbox-trigger {
  cursor: zoom-in;
}

.mhd-page .mhd-article-content[data-mhd-image-lightbox="1"] a.mhd-article-lightbox-trigger img,
.moon-helpdesk .mhd-article-content[data-mhd-image-lightbox="1"] a.mhd-article-lightbox-trigger img {
  cursor: zoom-in;
}

.mhd-page .mhd-article-content figure,
.moon-helpdesk .mhd-article-content figure {
  margin: 32px 0 0;
  max-width: 100%;
}

.mhd-page .mhd-article-content > :first-child figure,
.moon-helpdesk .mhd-article-content > :first-child figure {
  margin-top: 0;
}

.mhd-page .mhd-article-content > :first-child img,
.moon-helpdesk .mhd-article-content > :first-child img {
  margin-top: 0;
}

.mhd-page .mhd-article-content figure img,
.moon-helpdesk .mhd-article-content figure img {
  margin: 0;
}

.mhd-page .mhd-article-content figcaption,
.moon-helpdesk .mhd-article-content figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--mhd-muted);
}

.mhd-page .mhd-article-content h2,
.moon-helpdesk .mhd-article-content h2,
.mhd-page .mhd-article-content h3,
.moon-helpdesk .mhd-article-content h3,
.mhd-page .mhd-article-content h4,
.moon-helpdesk .mhd-article-content h4 {
  font-weight: 500;
  color: var(--mhd-ink);
  margin: 1.5rem 0 0.75rem;
  line-height: 1.35;
}

.mhd-page .mhd-article-content h2,
.moon-helpdesk .mhd-article-content h2 {
  font-size: 1.25rem;
}

.mhd-page .mhd-article-content h3,
.moon-helpdesk .mhd-article-content h3 {
  font-size: 1.125rem;
}

.mhd-page .mhd-article-content .wp-block-image,
.moon-helpdesk .mhd-article-content .wp-block-image {
  margin: 32px 0 0;
}

.mhd-page .mhd-article-content .wp-block-image img,
.moon-helpdesk .mhd-article-content .wp-block-image img,
.mhd-page .mhd-article-content .alignnone img,
.moon-helpdesk .mhd-article-content .alignnone img {
  max-width: 100%;
  width: 100%;
  height: auto;
}

.mhd-page .mhd-article-content .aligncenter,
.moon-helpdesk .mhd-article-content .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.mhd-page .mhd-article-content .wp-block-list,
.moon-helpdesk .mhd-article-content .wp-block-list {
  padding-left: 1.5rem;
}

/* Helpdesk CTAs — pointer cursor (fallback when Tailwind utilities are absent). */
[data-mhd-recent-more],
[data-mhd-ticket-submit],
[data-mhd-vote],
[data-mhd-load-more],
[data-mhd-load-more-articles] {
  cursor: pointer;
}

[data-mhd-recent-more]:disabled,
[data-mhd-ticket-submit]:disabled,
[data-mhd-vote]:disabled,
[data-mhd-load-more]:disabled,
[data-mhd-load-more-articles]:disabled {
  cursor: not-allowed;
}
