/* Copyright (c) Ansible and contributors */

// Documentation table (for module options and return values)
table.documentation-table {
  // Borders and basic spacing
  border-bottom: 1px solid #000;
  border-right: 1px solid #000;

  td, th {
    padding: 4px;
    border-left: 1px solid #000;
    border-top: 1px solid #000;
  }

  td.elbow-placeholder {
    border-top: 0;
    width: 30px;
    min-width: 30px;
  }

  // More table formatting
  td {
    vertical-align: top;
  }
  td:first-child {
    white-space: nowrap;
  }

  // Direct links to options / return values
  tr {
    .ansibleOptionLink {
      display: inline-block;
      visibility: hidden;

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

    &:hover .ansibleOptionLink::after {
      visibility: visible;
    }
  }
}

dl.ansible-attributes {
  dt:nth-of-type(1), dd:nth-of-type(1) {
    display: none;
  }

  .ansible-attribute-support-label, .ansible-attribute-support-property {
    font-weight: bold;
  }

  .ansible-attribute-support-none {
    font-weight: bold;
    color: red;
  }

  .ansible-attribute-support-partial {
    font-weight: bold;
    color: #a5a500;
  }

  .ansible-attribute-support-full {
    font-weight: bold;
    color: green;
  }

  .ansible-attribute-support-na {
  }

  .ansible-attribute-details {
    font-style: italic;
  }
}

@media (min-width: 1000px) {
  dl.ansible-attributes {
    display: grid;
    border: solid 1px #777;
    box-sizing: border-box;

    dt:nth-of-type(1), dd:nth-of-type(1) {
      display: table-row;
      font-weight: bold;
    }

    dt:not(:nth-of-type(1)), dd:not(:nth-of-type(1)) {
      border-top: solid 1px #777;
      box-sizing: border-box;
    }

    dt {
      margin: 0 !important;
      padding: 0.5rem !important;
    }

    dt:after {
      display: none;
    }

    dd {
      display: grid !important;
      grid-template-columns: 2fr 4fr;
      margin: 0 !important;
    }

    .ansible-attribute-desc, .ansible-attribute-support {
      border-left: solid 1px #777;
      box-sizing: border-box;
      margin: 0 !important;
      padding: 0.5rem !important;
    }

    .ansible-attribute-support-label {
      display: none;
    }
  }
}
