/* -- Maintenance (website · Account & States) -----------------------------
   Explains temporary unavailability and provides status information - what is happening, when it ends, and where to follow; or a banner announcing it. */

@layer components {
  /* every box in the block measures border-box - the same on any page */
  :where(.mk-maintenance, .mk-maintenance *, .mk-maintenance ::before, .mk-maintenance ::after) { box-sizing: border-box; }

  .mk-maintenance { display: grid; justify-items: center; gap: 1rem; width: 100%; max-width: 32rem; margin-inline: auto; padding: 3rem 1.5rem; text-align: center; }
  .mk-maintenance-icon { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: var(--radius-xl); background: color-mix(in oklch, #d97706 15%, transparent); color: #b45309;
    & svg { width: 1.75rem; height: 1.75rem; animation: mk-maintenance-turn 4s ease-in-out infinite; }
  }
  @keyframes mk-maintenance-turn { 0%, 60%, 100% { rotate: 0deg; } 70% { rotate: -25deg; } 85% { rotate: 15deg; } }
  .mk-maintenance-title { margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
  .mk-maintenance-text { margin: 0; color: var(--muted-foreground); line-height: 1.6; text-wrap: pretty; }
  .mk-maintenance-eta { display: grid; gap: 0.5rem; width: 100%; max-width: 20rem; padding: 1rem; border-radius: var(--radius-lg); background: var(--muted); font-size: 0.875rem;
    & strong { font-size: 1rem; }
    & progress { width: 100%; height: 0.375rem; }
  }
  .mk-maintenance-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

  .mk-maintenance[data-variant="banner"] {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.375rem 0.75rem;
    max-width: none;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-lg);
    background: color-mix(in oklch, #d97706 12%, transparent);
    color: #92400e;
    font-size: 0.875rem;
    text-align: center;

    & .mk-maintenance-icon { width: auto; height: auto; background: none; & svg { width: 1rem; height: 1rem; animation: none; } }
    & .mk-maintenance-text { color: inherit; }
    & a { color: inherit; font-weight: 600; }
  }

  /* -- Accessibility ------------------------------------------- */
  @media (prefers-reduced-motion: reduce) {
    .mk-maintenance-icon svg { animation: none; }
  }

  @media (forced-colors: active) {
    .mk-maintenance-icon, .mk-maintenance[data-variant="banner"] { border: 1px solid CanvasText; }
  }
}
