//
// array & objects
//

@use 'sass:color';

.namespace {
  color: var(--color-namespace);
  opacity: var(--opacity-namespace);
}

.array-inner,
.object-inner {
  display: block;
  margin-left: 1em;
}

.classname {
  font-weight: bold;
  color: var(--color-classname);
}

// this is outside of .t_object because tooltip gets placed outside
.attribute {
  .t_punct {
    color: inherit;
    font-weight: bold;
  }
}
// method parameter or attribute argument
// this is outside of .t_object because tooltip gets placed outside
.t_parameter-name {
  color: var(--color-param);
}

.t_array {
  > .t_array-collapse,
  > .array-inner,
  > .t_punct {
    display: none;
  }
  &.expanded {
    > .t_array-expand {
      display: none;
    }
    > .t_array-collapse,
    > .t_punct {
      display: inline;
    }
    > .array-inner {
      display: block;
    }
  }
  &.array-file-tree {
    .array-inner {
      margin-left: 0.25em;
    }
    .exclude-count {
      background: var(--color-info-bg);
      color: var(--color-info-fg);
    }
    .t_key {
      color: var(--color-array-file-tree-key);
      font-weight: bold;
    }
    .t_string,
    .t_key {
      // directory "key" & files
      &::before,
      &::after {
        display: none;
      }
    }
  }
}
.array-inner {
  > li {
    > .t_operator {
      margin: 0 0.25em;
    }
  }
}
li[class*=m_] > .t_array.array-file-tree > .array-inner {
  margin-left: -10px;
}

.t_identifier[title],
.t_identifier.hasTooltip {
  border-bottom: currentColor dashed 1px;
}

.t_object {
  display: inline;

  /*
    Method static-vars / return-value header
  */
  h3 {
    margin: 0;
    font-size: inherit;
    font-style: italic;
    color: var(--color-header);
  }

  .t_modifier_abstract, i.fa-circle-o {
    font-weight: bold;
    // color: #9d2d2d
  }
  .t_modifier_debug {
    color: var(--color-object-debug);
  }
  .t_modifier_eager {
    color: var(--color-object-eager);
  }
  .t_modifier_final {
    color: var(--color-object-final);
    font-weight: bold;
  }
  .t_modifier_private,
  .t_modifier_private-set {
    color: var(--color-object-private);
  }
  .t_modifier_protected,
  .t_modifier_protected-set {
    color: var(--color-object-protected);
  }
  .t_modifier_public {
    color: var(--color-object-public);
  }
  .t_modifier_static {
    font-style: italic;
    color: var(--color-object-static);
  }

  > .object-inner {
    > .modifiers {
      display: none;
    }
    > dd {
      width: fit-content;
    }
    > dd[class*=t_modifier_] {
      display: inline-block;
      margin-left: 0;
      margin-right: 0.5em;
      border-style: solid;
      border-width: 1px;
      border-radius: 4px;
      padding: 0.33em .75em;
      // height: 1.75em;
      text-indent: 0;
      // line-height: 2;
      font-weight: bold;
    }
    /*
    > dd[class*=t_modifier_]:before {
      content: "";
      display: inline-block;
      vertical-align: middle;
      height: 100%;
    }
    */
    /*
    > .t_modifier_abstract {
      // color: var(--color-fg);
      // background-color: color.adjust(#c0c0c0, $lightness: 15%);
      border-color: var(--color-fg);
    }
    */
    > .t_modifier_final {
      color: var(--color-error-fg);
      background-color: var(--color-error-bg);
      border-color: var(--color-error-border);
    }
    > .t_modifier_lazy,
    > .t_modifier_interface {
      color: var(--color-info-fg);
      background-color: var(--color-info-bg);
      border-color: var(--color-info-border);
    }
    > .t_modifier_readonly {
      color: var(--color-warn-fg);
      background-color: var(--color-warn-bg);
      border-color: var(--color-warn-border);
      .fa-stack {
        font-size: 0.8em;
        margin-right: 0.33em;
        .fa-ban {
          opacity: 0.75;
        }
      }
    }
    h3 {
      color: var(--color-object-heading);
    }
    .heading {
      color: var(--color-object-heading);
      text-decoration: underline;
      font-weight: bold;
    }
  }

  .vis-toggles {
    *[data-toggle] {
      padding: 0.15em 0.5em;
      display: inline-block;
    }
  }
  dd + .vis-toggles {
    margin-top: .25em;
  }

  .method .parameter .t_parameter-name[title],
  .t_type[title] {
    border-bottom: currentColor dashed 1px;
  }

  .method {
    ul {
      margin-left: 15px;
    }
    &.deprecated {
      opacity: 0.66;
      i {
        opacity: 0.66; // inherits, want even lighter
        color: var(--color-error-fg);
        border-bottom: 0;
      }
    }
    > .t_punct:not(.t_colon) {
      opacity: 1;
      font-weight: bold;
      color: inherit;
    }
    i.fa-clone { color: #999; }
  }

  .property {
    i.isVirtual {
      color: var(--color-object-virtual);
      text-shadow: 0px 0px 1px #990099;
    }
  }

  .private-ancestor:not(:hover) {
    > * { opacity: 0.5; }
    > .fa-lock,
    > .t_modifier_private {
      opacity: 1;
    }
  }

  i.fa-flag,
  i.fa-warning {
    color: var(--color-object-warning);
  }

  i.fa-eye {
    color: var(--color-object-debug);
    font-size: 1.1em;
    border-bottom: 0;
  }
  i.fa-magic,
  .t_modifier_magic,
  .t_modifier_magic-read,
  .t_modifier_magic-write {
    color: var(--color-object-magic);
  }
  .debugInfo-excluded > i.fa-eye-slash { color: #999; }

  .info {
    // "this object has magic methods"
    display: inline-block;
    background-color: var(--color-info-bg);
    color: var(--color-info-fg);
  }

  &.prop-only {
    > .t_object-collapse,
    > .t_punct {
      display: none;
    }
    > .object-inner {
      > .properties {
        // don't display header
        display: none;
      }
      > .property {
        text-indent: -1em;
        padding-left: 1em;
        margin: 0;
      }
    }
  }

  &.expanded {
    > .t_object-expand {
      display: none;
    }
    > .t_object-collapse,
    > .t_punct {
      display: inline;
    }
  }
}
td.t_object {
  display: table-cell;
}
