@layer reset, theme, base, layout, modules, utilities;

@layer reset {

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  body,
  header,
  h1,
  h2,
  p,
  input {
    margin: unset;
    padding: unset;
  }

  button,
  input,
  textarea,
  select {
    font: inherit;
  }

  img,
  picture,
  svg,
  canvas {
    display: block;
    max-inline-size: 100%;
    height: auto;
  }
}

@layer theme {
  :root {
    --main-bg-color: #1f289a;
    --main-text-color: #e7f0c7;
    --font-family: "Rubik", sans-serif;
    --head-font-size: 3rem;
    --head-line-height: 2.8rem;
    --subhead-font-size: 1.1rem;
  }
}

@layer base {
  body {
    background-color: var(--main-bg-color);
    color: var(--main-text-color);
    display: flex;
    width: 100%;
    overflow-x: hidden;
    font-family: "Merriweather", serif;
  }

  h1,
  h2,
  h3 {
    color: var(--main-text-color);
    font-family: var(--font-family);
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
  }

  h1,
  h2 {
    padding: 0.5rem;
    margin-bottom: 2rem;
    line-height: 2.5rem;
  }

  h1 {
    padding-top: 1rem;
    letter-spacing: -0.5px;
    font-size: var(--head-font-size);
    line-height: var(--head-line-height);
  }

  h2 {
    font-size: 2.5rem;
  }

  h3 {
    font-size: var(--subhead-font-size);
    letter-spacing: 1px;
    line-height: 1.5rem;
    text-transform: uppercase;
    margin: 1rem 0;
  }

  h4,
  ul,
  p,
  a {
    color: var(--main-text-color);
    font-family: "Merriweather", serif;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
  }

  p {
    max-width: 30rem;
    line-height: 1.6rem;
  }

  ul {
    padding-inline-start: 0;
    list-style-type: none;
  }

  li {
    color: var(--main-text-color);
    padding: 0.5rem 0;
    line-height: 1.5rem;
  }

  summary {
    text-decoration: underline;
  }

  figure img {
    max-width: 100%;
    border: 1px solid var(--main-bg-color);
  }

  figcaption {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    margin-bottom: 3rem;
  }

  @media (max-width: 1000px) {
    ul {
      max-width: 100%;
    }
  }
}

@layer layout {
  main {
    margin: 5rem;
    width: 80%;
    text-align: left;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    position: relative;
    left: 0;
    transition: all 0.25s ease-out;
  }

  .hgroup {
    transition: left 0.25s ease-out;
    /* border-top: 5px solid var(--main-text-color); */
    display: flex;
    flex-direction: column;
  }

  @media (max-width: 500px) {
    main {
      margin: 2rem;
    }

    figure {
      margin: 0;
    }
  }
}

@layer modules {

  /* WORK SECTION STYLES */
  .work-list {
    display: flex;
  }

  .work-type {
    border-top: 5px solid var(--main-text-color);
    width: 50%;
    margin-top: 5rem;
  }

  .work-type:first-of-type {
    margin-right: 5rem;
  }

  .work-details {
    margin-top: 5rem;
    border-top: 5px solid var(--main-text-color);
  }

  .project-container {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .project-container img {
    width: 100%;
  }

  .project-title {
    font-weight: 600;
    border-top: 1px solid var(--main-text-color);
    padding-top: 2rem;
    margin-top: 1rem;
  }

  .project-detail {
    margin-top: 1rem;
    /* max-width: 40rem; */
    max-width: 450px;
  }

  .project-text {
    color: var(--main-text-color);
    font-size: 0.9rem;
    line-height: 1.4rem;
    margin-top: 1rem;
    font-weight: 400;
  }

  .project-links {
    font-size: 0.9rem;
    margin-top: 1rem;
    font-weight: 400;
    display: flex;
  }

  a.project-link {
    color: var(--main-text-color);
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-right: 1rem;
    display: flex;
    align-items: center;
  }

  a.project-link:hover {
    background-color: color-mix(in srgb, var(--main-text-color) 20%, transparent);
    transition: all 0.25s ease-out;
  }

  .project-link svg {
    fill: var(--main-text-color);
    margin-right: 0.3rem;
  }

  /* EDIT MENU STYLES */
  .edit-menu {
    width: 75px;
    background-color: #4b4b4bc9;
    height: 100vh;
    position: fixed;
    left: -75px;
    text-align: center;
    transition: all 0.25s ease-out;
  }

  div.show-edit {
    left: 0;
  }

  .edit-section {
    padding: 1rem 0;
    border-bottom: 1px solid #ffffff55;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .edit-label {
    color: #ffffff95;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
    margin-bottom: 5px;
    font-family: Arial, sans-serif;
  }

  /* COLOR THEME STYLES */
  .color-theme {
    display: flex;
    margin: 0.5rem 0;
    border-radius: 11px;
    border: 3px solid #ffffffc2;
  }

  .color-theme:hover {
    cursor: pointer;
    border-color: #ffffffd5;
  }

  .color-theme:active {
    border-color: var(--main-text-color);
  }

  .color-theme-left,
  .color-theme-right {
    width: 20px;
    height: 20px;
  }

  .color-theme-left {
    border-right: none;
    border-radius: 8px 0 0 8px;
  }

  .color-theme-right {
    border-radius: 0 8px 8px 0;
  }

  /* COLOR PICKER STYLES */
  input[type="color"] {
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    height: 35px;
    width: 35px;
    margin: 0;
    box-sizing: border-box;
    font-size: 16px;
  }

  input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    margin: 0;
    border-radius: 50%;
  }

  input[type="color"]::-webkit-color-swatch {
    padding: 0;
    margin: 0;
    border-radius: 50%;
    border: 3px solid #ffffffc2;
  }

  input[type="color"]::-webkit-color-swatch:hover {
    border-color: #fff;
  }

  input[type="color"]::-moz-color-swatch {
    padding: 0;
    margin: 0;
    border-radius: 50%;
    border: 3px solid #ffffffc2;
  }

  input[type="color"]::-moz-color-swatch:hover {
    border-color: #fff;
  }

  @media (max-width: 1000px) {
    .work-list {
      flex-direction: column;
    }

    .work-type {
      width: 100%;
    }

    .project-title {
      border-top: 2px solid var(--main-text-color);
      margin-top: 2rem;
      margin-bottom: 2rem;
      max-width: 100%;
    }
  }
}

@layer utilities {
  .main-show-edit {
    left: 75px;
    width: 80%;
  }

  .flex {
    display: flex;
    align-items: flex-start;
  }

  .flex img {
    width: 7rem;
  }

  /* EDIT BUTTON STYLES */
  .hide-edit {
    display: none;
  }

  .edit-button {
    width: 4rem;
    border-radius: 0 45% 45% 0;
    border: none;
    font-size: 3rem;
    background-color: var(--main-text-color);
    color: var(--main-bg-color);
    position: fixed;
    left: 0;
    bottom: 5rem;
    /* padding: 0 0 5px 0; */
    transition: all 0.25s ease-out;
  }

  .edit-button:hover {
    cursor: pointer;
  }

  .editing {
    left: 75px;
  }

  .button {
    background-color: #ffffff55;
    border: none;
    border-radius: 8px;
    transition: all 0.25s ease-out;
  }

  .button:hover {
    background-color: #ffffff90;
    cursor: pointer;
  }

  .button:active {
    background-color: var(--main-text-color);
  }

  .invert-button {
    font-size: 24px;
    padding: 0 12px;
    height: 25px;
    line-height: 18px;
    color: #fff;
  }

  .text-button {
    padding: 8px 10px;
    margin: 5px;
  }

  .background {
    position: relative;
    left: -10px;
    top: 5px;
  }

  .foreground {
    position: relative;
    margin: 0;
    left: 10px;
    top: -10px;
  }

  .links {
    margin-top: 3rem;
    border-top: 5px solid var(--main-text-color);
    margin-bottom: 3rem;
  }

  .links-content {
    display: flex;
  }

  .single-link {
    margin-right: 1.5rem;
    display: flex;
  }

  .svg {
    fill: var(--main-text-color);
    margin-right: 0.5rem;
  }

  @media (max-width: 1000px) {
    .main-show-edit {
      width: 70%;
    }
  }
}