// Article tree (single-doc child index + shortcode card lists). A compact,
// indented tree: each level steps in with a soft vertical guide line, rows
// get a rounded hover/active highlight, and parent vs. child rows are cued by
// the document / chevron leader glyph.
.article_list {
  // Indent step per nesting level; the guide line is drawn on this offset.
  --ezd-tree-step: 18px;

  padding: 0;
  margin: 0;
  list-style: none !important;
  display: flex;
  flex-direction: column;
  gap: 2px;

  li {
    margin: 0;
    padding: 0;
    position: relative;

    // Nested level: indent + a vertical guide line connecting the children to
    // their parent. The line is drawn with a left border so it grows with the
    // list and never overshoots the last item.
    ul.children {
      list-style: none;
      margin: 2px 0 2px 0;
      padding-left: var(--ezd-tree-step);
      margin-left: var(--ezd-tree-step);
      border-left: 1px solid var(--border_on_white);

      // Every descendant row is a child: swap the document leader for a
      // chevron so the hierarchy reads at a glance.
      li > a::before {
        content: "=";
        font-size: 16px;
      }
    }

    // Row link — flex so the leader glyph, title and any badge align on one
    // baseline; the whole row is the hover/focus target.
    a {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px;
      border-radius: 8px;
      font-size: 15px;
      line-height: 1.4;
      color: var(--p_color);
      text-decoration: none !important;
      transition: color 0.2s ease, background-color 0.2s ease;

      &:before {
        content: "\68";
        font-family: "ElegantIcons";
        speak: none;
        font-style: normal;
        font-weight: normal;
        font-variant: normal;
        text-transform: none;
        font-size: 18px;
        line-height: 1;
        flex: 0 0 auto;
        color: var(--black_500);
        -webkit-font-smoothing: antialiased;
        transition: color 0.2s ease;
      }

      i {
        margin-right: 6px;
      }

      &:hover,
      &:focus-visible {
        color: var(--ezd_brand_color);
        background: var(--ezd_brand_color_07);

        &:before {
          color: var(--ezd_brand_color);
        }
      }

      &:focus-visible {
        outline: 2px solid var(--ezd_brand_color);
        outline-offset: 1px;
      }
    }

    // Current page (and its ancestors) — brand-tinted, bold, with a steady
    // highlight so the reader can see where they are in the tree.
    &.current_page_item > a {
      color: var(--ezd_brand_color);
      font-weight: 600;
      background: var(--ezd_brand_color_07);

      &:before {
        color: var(--ezd_brand_color);
      }
    }

    &.current_page_ancestor > a {
      color: var(--black_700);
      font-weight: 600;

      &:before {
        color: var(--ezd_brand_color);
      }
    }
  }
}

.d-items {
  display: grid;
  padding-top: 25px;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;

  @media (max-width: 768px) {
    grid-template-columns: auto;
  }

  .documentation_item {
    display: flex;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
    gap: 15px;

    &:hover {
      box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
      border: 1px solid var(--black_50);
      text-decoration: none;
      cursor: pointer;

      .title {
        color: var(--ezd_brand_color);
      }
    }

    .icon {
      border-radius: 8px;
      border: 1px solid var(--black_50);
      text-align: center;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-shrink: 0;
      box-sizing: content-box;
      line-height: 1.4;
      width: 36px;
      height: 36px;
      align-self: flex-start;
      padding: 10px;
      margin: 0;

      img {
        max-width: 32px !important;
        height: auto !important;
      }
    }

    .media-body {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 8px;

      .doc-sec-header {
        display: flex;
        align-items: center;
        gap: 5px;
        width: 100%;
      }

      .title {
        font-weight: 600;
        margin: 0;
        transition: color 0.2s linear;
        display: block;
        color: var(--black_900);
        text-decoration: none;
        font-size: 16px;
        line-height: 1.5;
        padding: 0;

        &:hover {
          text-decoration-color: var(--ezd_brand_color_25);
        }
      }

      .doc-badges {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        align-items: flex-start;
      }

      .doc-badge {
        display: inline-block;
        padding: 2px 8px;
        background-color: #f3f0ff;
        color: #7c3aed;
        font-size: 12px;
        font-weight: 500;
        line-height: 1.5;
        border-radius: 4px;
        text-transform: capitalize;
        white-space: nowrap;
      }

      p {
        margin-bottom: 0 !important;
        font-size: 14px;
        color: var(--black_500);
        line-height: 1.6;
      }
    }
  }
}