
/*
d8888b. db   db d888888b db       .d88b.  .d8888.  .d88b.  d8888b. db   db db    db 
88  `8D 88   88   `88'   88      .8P  Y8. 88'  YP .8P  Y8. 88  `8D 88   88 `8b  d8' 
88oodD' 88ooo88    88    88      88    88 `8bo.   88    88 88oodD' 88ooo88  `8bd8'  
88~~~   88~~~88    88    88      88    88   `Y8b. 88    88 88~~~   88~~~88    88    
88      88   88   .88.   88booo. `8b  d8' db   8D `8b  d8' 88      88   88    88    
88      YP   YP Y888888P Y88888P  `Y88P'  `8888Y'  `Y88P'  88      YP   YP    YP    
*/

section#philosophy {
  width: 100%;

  .container {
    width: 100%;
    justify-items: center;

    h2 {
      margin-bottom: 2rem;
    }

    .philosophy-image {
      width: 250px;
      margin: 0 auto 2rem;
      border-radius: 50%;
      overflow: hidden;

      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

      img {
        width: 100%;
        display: block;
      }
    }

    .philosophy-item {
      padding: 1rem 2rem;
      margin: 1rem auto;

      background: var(--secondary-bg-color);
      border-radius: 12px;

      h3 {
        margin: 1rem 1.5rem .5rem;
        font-family: var(--monospace-font);

        @media (max-width: 768px) {
          width: min-content;
          justify-self: center;
        }
      }

      p {
        margin-bottom: 1rem;
      }

      &.left {
        margin-left: 10px;
        margin-right: 10%;

        border-left: 4px solid color-mix(in srgb, var(--primary-accent-color) 70%, transparent);
        justify-items: start;

        @media (max-width: 768px) { /* on mobile, same margins left and right */
          margin-left: 0;
          margin-right: 0;
        }

        p {
          text-align: left;
          @media (max-width: 768px) { /* only on mobile */
            text-align: center;
          }
        }
      }
      &.right {
        margin-left: 10%;
        margin-right: 10px;

        border-right: 4px solid color-mix(in srgb, var(--primary-accent-color) 70%, transparent);
        justify-items: end;

        @media (max-width: 768px) { /* on mobile, same margins left and right */
          margin-left: 0;
          margin-right: 0;
        }

        p {
          text-align: right;
          @media (max-width: 768px) { /* only on mobile */
            text-align: center;
          }
        }
      }
    }
  }
}


/*
d8888b. d88888b d888888b  .d8b.  d888888b db      d88888b d8888b.      .d8888. d88888b d8888b. db    db d888888b  .o88b. d88888b .d8888. 
88  `8D 88'     `~~88~~' d8' `8b   `88'   88      88'     88  `8D      88'  YP 88'     88  `8D 88    88   `88'   d8P  Y8 88'     88'  YP 
88   88 88ooooo    88    88ooo88    88    88      88ooooo 88   88      `8bo.   88ooooo 88oobY' Y8    8P    88    8P      88ooooo `8bo.   
88   88 88~~~~~    88    88~~~88    88    88      88~~~~~ 88   88        `Y8b. 88~~~~~ 88`8b   `8b  d8'    88    8b      88~~~~~   `Y8b. 
88  .8D 88.        88    88   88   .88.   88booo. 88.     88  .8D      db   8D 88.     88 `88.  `8bd8'    .88.   Y8b  d8 88.     db   8D 
Y8888D' Y88888P    YP    YP   YP Y888888P Y88888P Y88888P Y8888D'      `8888Y' Y88888P 88   YD    YP    Y888888P  `Y88P' Y88888P `8888Y' 
*/

section#services-detailed {
  width: 100%;

  .service-item {
    margin: 1rem auto;
    padding: 0;
    scroll-margin-top: 10px; /* for anchor link offset */

    background: var(--secondary-bg-color);
    border-radius: 12px;

    .service-item-header {
      position: relative;
      min-height: 140px;

      color: #fff;
      text-decoration: none;

      border-radius: 16px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.15);

      overflow: hidden;

      @media (max-width: 768px) {
        min-height: 120px;
      }

      img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 0;

        object-fit: cover;
        transition: transform 0.6s ease;
      }
      a {
        position: absolute;
        padding: 1.5rem;
        width: 100%;
        inset: 0;  /* top:0; right:0; bottom:0; left:0; */
        z-index: 2;
        display: flex;
        flex-direction: column;

        color: #fff;
        text-decoration: none;

        justify-content: flex-end;

        @media (max-width: 768px) {
          padding: 1rem;
        }

        h3 {
          position: relative; /* stays above gradient */
          margin: 0;

          font-family: var(--monospace-font);
          font-size: 1.2rem;
        }
      }

      &::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;

        background: linear-gradient(
          to top,
          rgba(0,0,0,0.55),
          rgba(0,0,0,0.05)
        );
      }

      &:hover {
        img {
          transform: scale(1.1);
        }
      }
    }

    .service-item-content {
      display: grid;
      grid-template-rows: 0fr;
      overflow: hidden;
      opacity: 0;
      transition: grid-template-rows 0.3s ease, opacity 0.3s ease;

      justify-items: center;

      .service-item-inner {
        overflow: hidden;

        h4 {
          text-align: center;
        }

        p {
          margin: 1.5rem 2rem;

          line-height: 1.6;
          text-align: justify;

          @media (max-width: 768px) {
            text-align: center;
          }

          &#technologies {
            font-family: var(--monospace-font);
            font-size: 0.85rem;
          }
        }

        ul {
          margin: 1rem auto 2rem;
          padding: 0 2rem;
          list-style-position: inside;

          text-align: left;

          li {
            margin-bottom: .1rem;
            padding-bottom: .3rem;
            padding-top: .3rem;
            padding-left: 5%;

            line-height: 1.35rem;
          }
        }

        .cta {
          margin-top: 1rem;
          margin-bottom: 2rem;

          @media (max-width: 768px) {
            width: min-content;

            font-size: 0.9rem;
            text-align: right;

            .icon-push {
              width: 2.5rem;
              height: 2rem;
            }
          }
        }
      }
    }

    &.open {
      .service-item-header {
        box-shadow: 0 15px 40px rgba(0,0,0,0.25);
      }

      .service-item-content {
        grid-template-rows: 1fr;
        opacity: 1;
      }
    }
  }
}
