
ul.style-guides {
  list-style: none;
  
  display: flex;
  flex-wrap: wrap;
  gap: var(--margin);
  /* outline: 1px solid red; */
  
  margin-right: calc(-1 * var(--right-gutter));
  margin-bottom: calc(3 * var(--margin));
  
  /* margin-left: calc(.5 * var(--right-gutter)); */
  
  & > li {
    /* outline: 1px solid red; */
    /* width: 1fr; */
    
    /* width: 50%; */
    flex: 0 0 calc((100% - 2 * var(--margin)) / 3);
    box-sizing: border-box;
    
    font-family: var(--font-selectric-un);
    line-height: 1.2;
    /* letter-spacing: .03em; */
    font-size: var(--figcaption-font-size);
    
    display: flex;
    flex-direction: column;
    
    cursor: var(--cursor);    
    &:active {
      cursor: var(--cursor-pressed);	
    }


    &:before {
      display: none;
    }

    background: var(--light-gray);
    @media (prefers-color-scheme: dark) {
      background: var(--dark-gray);  
    }
    padding: var(--margin) !important;
    
    .images {
      flex-grow: 1;
      height: 300px;
      margin-top: var(--margin);
      margin-bottom: var(--margin);
      position: relative;
      /* background: blue; */
      
      figure:hover {
        z-index: 50 !important;
      }
      
      figure.cover,
      figure.cover-left,
      figure.cover-right {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        aspect-ratio: var(--aspect-ratio);
        margin: 0 !important;
        height: calc(100% - var(--margin) * 2);        
        /* max-width: calc(100% - 2 * var(--margin)); */
        /* outline: 3px solid red; */
        
        /* top: 50%;
        transform: translateY(-50%); */
        
        .image-sizes-wrapper {
          width: 100%;
          aspect-ratio: var(--aspect-ratio);
        }
      }
      figure.cover {
        left: 50%;
        transform: translateX(-50%) translateY(-50%);
      }      
      figure.cover-left {
        left: 0;
      }
      figure.cover-right {
        right: 0;
        left: auto;
      }
      figure.screenshot {        
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        aspect-ratio: var(--aspect-ratio);
        margin-top: 0 !important;
        z-index: 10;
        
        &.tall {
          top: calc(1 * var(--margin));
          width: auto;
          height: calc(100% - 2 * var(--margin));
          left: 50%;
          margin-top: 0;
          max-width: calc(100% - 2 * var(--margin));
          transform: translateX(-50%);
        }
        &.tall-left {
          top: calc(1 * var(--margin));
          width: auto;
          height: calc(100% - 2 * var(--margin));
          max-width: calc(100% - 2 * var(--margin));
          left: 0;
          margin-top: 0;
        }
        &.wide {
          left: calc(1 * var(--margin));
          width: calc(100% - 2 * var(--margin));
          top: 50%;
          margin-top: 0;
          transform: translateY(-50%);
        }
        &.very-wide {
          left: 0;
          width: 100%;
          top: 50%;
          margin-top: 0;
          transform: translateY(-50%);
        }
        &.wide-left {
          left: 0;
          width: calc(100% - 2 * var(--margin));
          top: 50%;
          margin-top: 0;
          transform: translateY(-50%);
        }
        &.wide-bottom-left {
          left: 0;
          width: calc(100% - 2 * var(--margin));
          bottom: 0;
          top: auto;
          margin-top: 0;
        }
        &.wide-right {
          left: auto;
          right: 0;
          width: calc(100% - 2 * var(--margin));
          top: 50%;
          margin-top: 0;
          transform: translateY(-50%);
        }
        &.wide-top-right {
          left: auto;
          right: 0;
          width: calc(100% - 2 * var(--margin));
          top: 0;
          margin-top: 0;
        }
        
        &.top-left {
          left: calc(0 * var(--margin));
          top: calc(0 * var(--margin));
        }
        &.top-right {
          right: calc(0 * var(--margin));
          left: auto;
          top: calc(0 * var(--margin));
        }
        &.bottom-right {
          bottom: calc(0 * var(--margin));
          right: calc(0 * var(--margin));
          left: auto;
          top: auto;
        }
        &.bottom-left {
          left: calc(0 * var(--margin));
          bottom: calc(0 * var(--margin));
          top: auto;
        }
        
        /* transform: translateY(-50%); */
        
        .image-sizes-wrapper {
          width: 100%;
          aspect-ratio: var(--aspect-ratio);
        }

      }

      figure {
        &.above {
          z-index: 11;
        }
        &.below {
          z-index: 9;
        }
      }
      
      

    }
    
    .explanation {
      color: var(--text-gray);
      margin-top: calc(.25 * var(--margin));      
    }
    
    .links > ul {
      margin-left: 0;
      padding-left: 0;
      
      display: flex;
      flex-wrap: wrap;
      gap: 0 1em;
      
      li {
        display: inline-block;
        padding-left: 0;
        line-height: 1;
        
        a {
          background: var(--text);
          color: var(--background);
          /* white-space: nowrap; */
          word-break: break-word;
        }
        a,
        a:hover {
          padding-left: .3em !important;
          margin-left: -.3em !important;
          padding-right: .3em !important;
          margin-right: -.3em !important;
          padding-top: .2em !important;
          margin-top: -.2em !important;
          padding-bottom: .1em !important;
          margin-bottom: -.1em !important;
          
          /* margin-right: 1em !important; */
        }
        
        a:active {
          position: relative;
          top: .1em;
          padding-left: .3em !important;
          margin-left: -.3em !important;
          padding-right: .3em !important;
          margin-right: -.3em !important;
          padding-top: .3em !important;
          margin-top: -.2em !important;
          padding-bottom: 0em !important;
          margin-bottom: -.1em !important;
          
        }

        &.secondary a {
          background: var(--text-gray);
        }
        
/*        &.secondary {
          color: var(--text-gray);
          a {
          
            color: var(--accent-somewhat-diluted);  
          }
          
        }*/
        
      }
      li:before {
        display: none;
      }
    }
    
    
    &:has(h3) {
      background: var(--text);
      color: var(--background);      
    }
    
    
    @media (width > 1440px) {
      &:has(h3) {
        min-width: 0;
        
        display: flex;
        flex-direction: row;
        gap: var(--margin);
      
        h3 {
          margin-left: 0;
          margin-top: 0;
          hyphens: auto;
          width: 1.1em;
          margin-right: 0;
          text-align: right;
          overflow-wrap: break-word;
          writing-mode: sideways-lr;
        }
        p {
          flex-grow: 0;
          min-width: 0;
          margin-bottom: 0;
          text-justify: none;
          align-content: end;
        }
      }
    }
    
    @media (width <= 1440px) {
      &:has(h3) {
        height: auto;
        flex: 1 0 100%;
        max-width: none;
        
        h3 {
          margin-top: 0;
        }
        
        p {
          margin-bottom: 0;
        }
      }
      
    }

    @media (width > 1800px) {
      & {
        flex: 0 0 calc(((100% + 397px) - 3 * var(--margin)) / 4);
      }      
      &:has(h3) {
        margin-left: -397px !important;
      }
    }
    
    @media (width <= 1280px) {
      &:not(:has(h3)) { /* Two per, not three */
        flex: 0 0 calc((100% - 1 * var(--margin)) / 2);
      }
    }
    @media (width <= 767px) {
      &:has(h3) {
        margin-left: calc(-1 * var(--left-gutter)) !important;
      }      
    }
    @media (width <= 600px) {
      &:not(:has(h3)) { /* Two per, not three */
        flex: 1 0 100%;
        
        .images {
          height: 40vh;
        }
      }
    }
     
    
  }
  
}

@media (width > 1800px) {
  html {
    --main-chute-width: 850px;
    --right-gutter: 700px;
    /* --main-chute-width: 850px; */
    /* --right-gutter: 300px; */

  }
  
  ul.style-guides {
    margin-left: 397px; 
  }  
}
  
