/**
 * React Fabric
 * @version 1.0.0
 * @license MIT
 * @copyright 2024 Adarsh Pastakia
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

@layer components {
  h1 {
    font-size: 2.5rem;
    font-weight: 500;
  }

  h2 {
    font-size: 2rem;
    font-weight: 500;
  }

  h3 {
    font-size: 1.75rem;
    font-weight: 500;
  }

  h4 {
    font-size: 1.5rem;
    font-weight: 500;
  }

  h5 {
    font-size: 1.25rem;
    font-weight: 500;
  }

  h6 {
    font-size: 1rem;
    font-weight: 500;
  }

  p {
    line-height: 1.5;

    & + p,
    & + article {
      margin-top: 1rem;
    }
  }

  article {
    & + p,
    & + article {
      margin-top: 1rem;
    }
  }

  ul,
  ol {
    margin: 0;
    padding-inline-start: 2em;
    list-style-position: outside;

    & > li {
      padding: 0 2px;
      line-height: 2;
    }
  }

  ul {
    list-style: disc;
  }

  ol {
    list-style: decimal;
  }

  dl {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: minmax(6rem, 12rem) 1fr;

    margin: 0 0 1rem;

    line-height: 1.5em;

    dt {
      overflow: hidden;
      grid-column-start: 1;

      min-width: 6em;
      max-width: 12em;
      padding-inline: 1em;

      font-size: 0.875em;
      color: var(--text-color-dimmed);
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    dd {
      grid-column-start: 2;
      margin: 0;
      padding: 0;
    }

    &.align-end > dt {
      text-align: end;

      &::after {
        content: ": ";
      }
    }
  }

  abbr {
    cursor: help;

    display: inline-block;

    padding: 0 2px;

    color: var(--color-secondary-700);
    text-decoration: underline dashed 1px;

    background-color: color-mix(in lab, currentcolor 10%, var(--fabric-bg));
  }

  mark {
    display: inline-block;
    color: var(--fabric-text);
    background-color: var(--color-secondary-100);
  }
}
