/*
 *
 * @info Collapsible block styles
 * @path assets/css/blocks/collapsible.css
 *
 */ 


[data-type*="collapsible"] {
  /* padding-block-start: var(--space-s); */
  /* padding-block-start: var(--space-s); */
}

  
  
  details {
  
    
    padding-inline: 2ch;
    margin-inline: -2ch;
    /* transition: all .2s ease-in-out;   */
    summary {
      
      position: relative;
      cursor: pointer;
      text-decoration: none;
      
      h3 {
        text-decoration: underline;  
        padding: unset;
        display: inline;
        font-weight: 400;
        font-size: inherit;
        line-height: inherit;
      }

      /* the sign: a + that turns into × when open (rotated, so both are
         the same glyph at the same place); hangs in the margin, inline on
         narrow screens. Inline-block with a negative margin (not absolute
         positioning), so it sits on the heading's baseline */
      &::before {
        content: "+";
        display: inline-block;
        margin-inline-start: -1.6ch;
        margin-inline-end: .6ch;
        width: 1ch;
        text-align: center;
        font-weight: 400;
        color: var(--color);
        transition: rotate .2s ease-in-out;
      }
  
  
      @media (max-width: 70ch) {
        padding-inline-start: 1.6ch;
      }
  
    }

    &[open] > summary::before {
      rotate: 45deg;
    }

    @media (prefers-reduced-motion: reduce) {
      summary::before {
        transition: none;
      }
    }
  
    &[open] {
      
      margin-block-end: -.5ch;
      padding-block-end: 1ch;
      margin-block-start: -1ch;
      padding-block-start: 1ch;
      background-color: var(--color-accent-25);
      padding-inline: 3ch;
      margin-inline: -3ch;
      /* color: var(--color-accent-inverted, --color-white); */
      
      summary {
        padding-block-end: 1ch;
        /* margin-left: -2ex;
        padding-left: 2ex; */
  
        h3 {
          /* color: var(--color-accent-inverted, --color-white); */
          text-decoration: none;
          font-weight: 600;
        }
      }

      

  
    }
  
  }
  