/******************************************************/
/* FONTS */
/******************************************************/

/* FontAwesome Icons
  More info: https: //fontawesome.com
  If there is an error, change your href with the main url:
  https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css
*/
@import './font-awesome.min.css';

:root {
  --color-white: 255, 255, 255;
  --color-black: 0, 0, 0;
  --color-blue: 52, 152, 219;
  --color-beige: 250, 235, 215;
  --color-red-pdf: 204, 0, 0;
  --color-red-dark: 150, 0, 0;

  --color-primary: var(--color-beige);
  --color-secondary: var(--color-black);
  --color-accent: var(--color-red-dark);

  --font-size: 16px;
  --font-family-primary: 'Helvetica Neue', 'Lora', serif, 'Helvetica Neue', sans-serif;
  --font-family-secondary: 'Georgia', serif;

  --gallery-speed: 15s;
  --gallery-photo-width: 15rem;
  --gallery-scroll: 50dvw;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: var(--font-size);
  font-family: var(--font-family-primary);
  line-height: 1.5rem;
  letter-spacing: .25rem;
  scroll-behavior: smooth;
  user-select: none;
}

body {
  margin: 0;
  background: rgb(var(--color-primary));
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.05) 10%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.03) 15%, transparent 60%);
  background-blend-mode: overlay;
  color: rgb(var(--color-secondary));
  overflow-x: hidden;
}

header {
  position: relative;
  text-align: center;
  padding: 3rem 1rem;
  background: rgb(var(--color-primary));
  color: rgb(var(--color-secondary));
  overflow: hidden;

  h1 {
    font-family: var(--font-family-secondary);
    font-size: 2.5rem;
    margin: 0;
    padding: 1rem;
    line-height: 3rem;
  }

  p {
    margin-top: .5rem;
    font-style: italic;
  }
}

/**************************************/
/* SECTIONS: CV & COMPOSITIONS */
/**************************************/

section {
  width: calc(100% - 2rem);
  max-width: 900px;
  margin: 2rem auto;
  padding: 1rem;

  h2 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: .5rem;
    margin: 1rem 0;
    text-transform: uppercase;
    font-family: var(--font-family-secondary);
    border-bottom: 2px solid rgba(var(--color-accent), 1);

    i {
      margin-right: .5rem;
    }
  }
}

.cv,
.compositions {
  color: rgb(var(--color-black));
  background: rgba(var(--color-white), 0.9);
  box-shadow: 0 0 8px rgba(var(--color-black), 0.2);
  border-radius: 1rem;
}

.cv {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;

  .cv-photo-contact {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 90%;

    img {
      width: 100%;
      max-width: 20rem;
      margin: 1rem;
      box-shadow: 0 4px 10px rgba(var(--color-secondary), 0.2);
      border-radius: 1rem;
    }

    #cv-contact {
      width: 100%;
      margin: 1rem 0;

      ul {
        list-style-type: none;
        margin: 0;

        li {
          display: flex;
          flex-direction: row;
          justify-content: flex-start;
          align-items: center;
          gap: .5rem;
          margin: .25rem 0;

          a {
            width: 100%;
            padding: .75rem 1rem;
            font-size: var(--font-size);
            color: rgb(var(--color-secondary));
            text-decoration: none;
            border-left: .15rem solid transparent;
            border-right: .15rem solid transparent;
            transition: all 0.3s ease-in-out;

            &:hover {
              color: rgba(var(--color-accent), 1);
              background: rgba(var(--color-accent), .1);
              border-color: rgba(var(--color-accent), 1);
            }
          }
        }
      }
    }
  }

  .cv-info {
    width: 100%;

    #cv-bio {
      padding: 0 1rem;
      text-align: justify;
    }
  }

  #cv-link {
    margin: 2rem 0;

    .other-projects {
      text-align: center;
      margin: 1rem 0;
      font-size: .75rem;
    }
  }
}

.container-accordion {
  margin: 1rem 0;

  .accordion {
    margin: 0.5rem 0;
    padding: 1rem;
    text-transform: capitalize;
    background: rgba(var(--color-white), 0.9);
    box-shadow: 0 0 8px rgba(var(--color-black), 0.2);
    border-radius: 1rem;
    cursor: pointer;
    transition: background 0.3s;

    &:hover {
      background: #e0e0e0;
    }

    &.selected {
      color: rgb(var(--color-white));
      background: rgba(var(--color-accent), .75);
    }

    .accordion-icon {
      margin-right: 0.5rem;
      transition: transform 0.3s;
    }
  }

  .accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;

    &.open {
      max-height: 100%;
    }

    .pdf-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(33%, 1fr));
      gap: 1rem;
      margin-top: 1rem;

      .pdf-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        min-width: 15rem;
        padding: .75rem;
        text-align: center;
        background: rgb(var(--color-white));
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        border-radius: 1rem;
        cursor: pointer;
        transition: transform 0.2s, box-shadow 0.2s;

        .pdf-icon {
          font-size: 2rem;
        }

        p {
          text-align: left;
          padding: 0 .5rem;
          font-size: .9rem;
        }

        &:hover {
          transform: translateY(-3px);
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

          .pdf-icon {
            color: rgb(var(--color-red-pdf));
          }
        }
      }
    }

    p.content {
      margin: 0;
      padding: 1.5rem;
      text-align: justify;
      font-size: .9rem;
      border: .15rem solid rgba(var(--color-accent), 0.5);
      border-radius: 1rem;
    }
  }
}

#cv-photos {
  position: relative;
  overflow: hidden;

  .gallery-track {
    --gallery-column-count: 4;
    --gallery-column-size: calc(100% / var(--gallery-column-count) - 2rem);

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--gallery-column-size), 1fr));
    gap: 1rem;
    align-items: center;
    justify-items: center;
    width: 100%;
    padding: 1rem 0;

    .gallery-item {
      position: relative;
      user-select: none;
      cursor: pointer;
      transition: transform 0.2s;

      .gallery-type-icon {
        position: absolute;
        display: flex;
        justify-content: center;
        align-items: center;
        top: .25rem;
        left: .25rem;
        padding: .25rem;
        color: rgb(var(--color-white));
        font-size: 1rem;
        background: rgba(var(--color-black), 0.75);
        border-radius: .25rem;
        pointer-events: none;
        z-index: 2;
      }

      .gallery-photo {
        width: 100%;
        max-width: var(--gallery-photo-width);
        aspect-ratio: 2/1;
        object-fit: cover;
        border-radius: .5rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        user-select: none;
      }

      &:hover {
        transform: scale(1.08);
        z-index: 2;
      }
    }
  }

  @media (max-width: 768px) {
    .gallery-track {
      --gallery-column-count: 2;
    }
  }
}

.photo-modal {
  position: fixed;
  display: none;
  align-items: center;
  justify-content: center;
  left: 0;
  top: 0;
  width: 100dvw;
  height: 100dvh;
  background: rgba(var(--color-secondary), 0.8);
  z-index: 1000;

  .photo-modal-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100dvw;
    height: 100dvh;

    video,
    img {
      max-width: 90dvw;
      max-height: 90dvh;
      border-radius: 1rem;
      box-shadow: 0 0 2rem rgba(var(--color-black), 0.75);
    }
  }

  .photo-modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 1001;
    user-select: none;
  }
}

/**************************************/
/* MODAL */
/**************************************/

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(var(--color-secondary), 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;

  .modal-content {
    position: relative;
    width: 90%;
    height: 90%;
    background: var(--color-primary);
    border-radius: 1rem 1rem 0 0;
    overflow: hidden;

    #pdfViewer {
      width: 100%;
      height: 100%;
      border: none;
    }

    .close-btn {
      position: fixed;
      top: 1rem;
      right: 1rem;
      font-size: 3rem;
      font-weight: bold;
      color: rgb(var(--color-white));
      text-shadow: inset 0 0 1rem rgba(var(--color-red-dark), 0.75);
      cursor: pointer;
      transition: all 0.5s ease-in-out;

      &:hover {
        color: rgb(var(--color-red-pdf));
        transition: all 0.5s ease-in-out;
      }
    }
  }
}

/**************************************/
/* ANIMATED NOTES */
/**************************************/

.note {
  position: absolute;
  font-size: 5rem;
  font-family: 'Noto Music', sans-serif;
  color: rgb(var(--color-accent));
  animation: float 8s linear infinite;
  opacity: 0;
}

@keyframes float {
  from {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0.75;
  }

  50% {
    opacity: 1;
  }

  to {
    transform: translateY(-20vh) rotate(360deg);
    opacity: 0.75;
  }
}

/**************************************/
/* MEDIA QUERIES */
/**************************************/

@media screen and (max-width: 768px) {
  :root {
    --font-size: 14px;
  }

  * {
    letter-spacing: .1rem;
  }

  .cv-photo-contact {
    flex-direction: column !important;
    width: 100% !important;
  }

  .accordion {
    text-align: left !important;
  }
}