/* ===================================================
   Mania AI — Cascade Layers + Reset + Base
   =================================================== */

/* Layer order declaration — controls cascade priority */
@layer reset, base, layout, components, pages, utilities;

/* ── Reset ── */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
  }

  body {
    min-block-size: 100dvh;
    display: flex;
    flex-direction: column;
  }

  img, picture, video, canvas, svg {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
  }

  input, button, textarea, select {
    font: inherit;
    color: inherit;
  }

  button {
    cursor: pointer;
    background: none;
    border: none;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  ul, ol {
    list-style: none;
  }

  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }

  table {
    border-collapse: collapse;
    border-spacing: 0;
  }

  /* Remove default search input appearance */
  input[type="search"]::-webkit-search-decoration,
  input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
  }
}

/* ── Base ── */
@layer base {
  body {
    font-family: var(--m-font-sans);
    font-size: var(--m-text-base);
    font-weight: var(--m-font-normal);
    line-height: var(--m-leading-normal);
    letter-spacing: 0.01em;
    color: var(--m-text-secondary);
    background-color: var(--m-bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  ::selection {
    background: var(--m-active-bg);
    color: var(--m-text-primary);
  }

  :focus-visible {
    outline: 2px solid var(--m-focus-ring);
    outline-offset: 2px;
  }

  a {
    color: var(--m-purple);
    transition: color var(--m-duration) var(--m-ease);
  }

  a:hover {
    color: var(--m-purple-hover);
  }

  /* WordPress admin bar — only needed if header is sticky */

  /* Screen reader text (WordPress convention) */
  .screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    block-size: 1px;
    inline-size: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal;
  }

  .screen-reader-text:focus {
    clip: auto;
    clip-path: none;
    display: block;
    block-size: auto;
    inline-size: auto;
    inset-block-start: 5px;
    inset-inline-start: 5px;
    padding: 15px 23px 14px;
    z-index: 100000;
    background-color: var(--m-bg-overlay);
    color: var(--m-text-primary);
  }
}
