/* #region All */

:root {
  --header-background: #000000;
  --body-background: #383838;
  --primary-color: #ffffff;
  --secondary-color: #ffc700;
  --tertiary-color: #000000;
}

* {
  box-sizing: border-box;
  font-family: "Poppins";
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* #endregion */

/* #region Header */

  /* #region all */

  header {
    background-color: var(--header-background);
    color: var(--secondary-color);

    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;

    box-shadow: 0px 1px 5px 0px #000000;
    position: relative;
    z-index: 1;
    padding: 1em;
  }

  header a {
    color: var(--secondary-color);
    text-decoration: none;
  }

  /* #endregion */

  /* #region Title */

  #title {
    display: flex;
    /* gap: 0.8em; */
    /* height: 100px; */
    /* align-items: flex-start; */
    justify-content:center;
    align-items: center;
    font-size: min(1em, 3vw);
    /* font-size: min(1em, 2.5vw); */
  }

  #title>div:last-child {
    padding-left: 0.8em;
  }

  #title img {
    height: 6em;
  }

  #title h1, #title p {
    margin: 0;
    text-align: left;
  }

  #title h1 {
    font-size: 1.5em;
    font-weight: 400;
  }

  #title p {
    color: var(--primary-color);
    font-size: 1.2em;
  }

  /* #endregion */

  /* #region nav */

  nav {
    flex: 1;
    display: flex;
    justify-content: space-evenly;
  }

  nav>* {
    flex: 1;
    text-align: center;
    margin: 1em;
  }

  nav a {
    align-content: center;
    transition-property: color, background-color;
    transition-duration: 0.5s;
    padding: 1.75em 0;
  }

  nav a:hover, nav .dropdown:hover>a {
    background-color: var(--secondary-color);
    color: var(--tertiary-color);
  }

  nav a[aria-current="page"] {
    text-decoration: underline;
    /* background-color: var(--body-background); */
    /* background-color: var(--secondary-color); */
    /* color: var(--tertiary-color); */
  }

  nav .dropdown {
    display: inline-block;
    position: relative;
  }

  nav .dropdown a {
    display: inline-block;
    width: 100%;
  }
  
  nav .dropdown-content {
    min-width: 100%;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1;
    background-color: var(--body-background);
    box-shadow: 0px 1px 5px 0px #000000;
    transition: visibility 0s, opacity 1s;
  }

  .dropdown:hover .dropdown-content {
    visibility: visible;
    opacity: 1;
  }

  nav .dropdown-content a {
    padding: 0 0.5em;
  }

  /* #endregion */

  /* #region Socials */

  #socials a {
    display: inline-block;
    height: 2em;
    width: 2.25em;
    text-align: center;
  }

  #socials svg {
    height: 100%;
    width: auto;
    fill: var(--secondary-color);
  }

  /* #endregion */

  /* #region Menu */

  #menu {
    display: none;
    position: absolute;
    font-size: min(1em, 3vw);
    right: 1em;
    top: 3em;
  }

  #menu>button {
    all: unset;
    cursor: pointer;
    display: inline-block;
    height: 2em;
    width: 2em;
    text-align: center;
  }

  #menu svg {
    height: 100%;
    width: auto;
    fill: var(--secondary-color);
  }

  #menu-close {
    display: none;
  }

  @media only screen and (max-width: 1160px) {
    header nav, header #socials {
        display: none;
    }
    #menu {
      display: block;
    }
  }

  /* #endregion */

  /* #region Expanded Menu */

  header.expanded {
    /* Move nav and socials down, make column, visibilities etc. */
    /* Keep in mind if resizing while expanded */
    flex-direction: column;
  }

  header.expanded>#title {
    align-self: start;
  }
  
  header.expanded>nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 1em;
    margin-bottom: 1em;;
  }

  header.expanded>nav>a {
    margin: 0;
    padding: 1em;
  }

  header.expanded>nav>.dropdown {
    margin: 0;
  }

  header.expanded>nav>.dropdown>a {
    padding: 1em;
  }

  header.expanded>nav>.dropdown:hover .dropdown-content {
    display: none;
  }

  header.expanded>#socials {
    display: inline;
  }

  header.expanded>#menu {
    display: block;
  }

  header.expanded>#menu #menu-open {
    display: none;
  }

  header.expanded>#menu #menu-close {
    display: inline;
  }

  /* #endregion */

/* #endregion */

/* #region Main */

  /* #region all */

  main {
    flex-grow: 1;
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    /* background-image: url("/images/hands-on-keys.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed; */
  }

  main::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: -1;
    height: 100vh;
    width: 100vw;
    /* height: 100%; */
    /* width: 100%; */
    overflow: hidden;
    background: url("/images/hands-on-keys.jpg") center center;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
  }

  main::after {
    content: "";
    background-color: var(--body-background);
    flex-grow: 1;
  }

  main>section {
    background-color: var(--body-background);
    /* display: flex; */
    padding: 2em;
    /* margin-left: 2em; */
    /* margin-right: 2em; */
  }

  @media only screen and (max-width: 400px) {
    main>section {
      padding: 0.5em;
    }
  }

  main>section>article {
    margin: 1em 0;
  }

  main a:link {
    color: skyblue;
  }

  main a:visited {
    color: pink;
  }

  main h1 {
    text-align: center;
    font-size: min(3em, 9vw);
  }

  main h3 {
    color: var(--secondary-color);
  }

  main h4 {
    color: var(--secondary-color);
    font-style: italic;
    text-align: center;
  }

  main img {
    box-shadow: 1px 1px 5px 0px #000000;
  }

  main a.button-link, main button.button-link {
    background-color: var(--secondary-color);
    color: var(--tertiary-color);
    border: unset;
    display: inline-block;
    text-decoration: none;
    padding: 0.5em 0;
    width: 80%;
    text-align: center;
    margin: 0 10%;
  }

  main a.button-link:hover, main button.button-link:hover {
    opacity: 0.8;
  }

  /* #endregion*/

  /* #region Spacing */

  .spacing {
    height: 200px;
  }

  hr {
    height: 0;
    width: 100%;
    border: 3px solid var(--secondary-color);
    margin: 0;
  }

  /* #endregion */

  /* #region Side by Side */

  .side-by-side {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em 4em;
  }

  .side-by-side>div {
    /* padding: 2em; */
    min-width: 300px;
    flex: 0 1 50%;
    /* width: max-content; */
  }
  
  .side-by-side>div.tiny {
    flex: 0.5;
  }

  .side-by-side>div.small {
    flex: 1;
  }

  .side-by-side>div.medium {
    flex: 2;
  }

  .side-by-side>div.large {
    flex: 3;
  }

  .side-by-side>div.huge {
    flex: 5;
  }

  .side-by-side img {
    /* max-width: 30vw; */
    /* min-width: 300px; */
    width: 100%;
  }

  /* #endregion */

  /* #region Service Links */

  #services-links {
    display: flex;
    justify-content: space-evenly;
    justify-items: center;
    flex-wrap: wrap;
  }

  #services-links>article {
    display: flex;
    flex-direction: column;

    /* TODO: This is like a hacky grid view with fixed pixel width, should use flex grow etc. */
    /* flex: 1; */
    /* min-width: 300px; */
    /* max-width: 500px; */
    max-width: 350px;

    margin: 1em;
    height: inherit;
    justify-content: flex-start;
    align-items: center;
    text-align: center;

    border-radius: 5px;
    padding: 1em;
    color: var(--tertiary-color);
    background-color: var(--primary-color);
    box-shadow: 1px 1px 5px 0px #000000;
  }

  .round-img {
    border-radius: 50%;
    width: 200px;
    height: 200px;
    overflow: hidden;
  }

  .round-img>img {
    height: 100%;
  }

  #services-links a {
    margin-top: auto;
    background-color: var(--secondary-color);
    color: var(--tertiary-color);
    text-decoration: none;
    padding: 0.5em;
    width: 80%;
  }

  /* #endregion */

  /* #region Reviews */

  .reviews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1em;
  }

  .reviews>div {
    border-radius: 5px;
    padding: 1em;
    color: var(--tertiary-color);
    background-color: var(--primary-color);
    box-shadow: 1px 1px 5px 0px #000000;
  }

  /* #endregion */

  /* #region iframe */

  .iframe-container, .side-by-side>div.iframe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio (divide 9 by 16 = 0.5625) */
  }

  iframe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
  }

  /* #endregion */

  /* #region Form */

  main form label {
    font-size: 1.2em;
  }

  main form input, main form textarea, main form select {
    width: 100%;
    font-size: 1em;
  }

  main form textarea {
    resize: vertical;
    height: 6em;
  }

  main form input[type="submit"] {
    border: unset;
    cursor: pointer;
    background-color: var(--secondary-color);
    color: var(--tertiary-color);
    padding: 0.5em;
    width: 100%;
    text-align: center;
    margin: 0.5em 0;
  }

  main form .invalid {
    border: 2px solid red;
  }

  main form {
    position: relative;
  }

  main form.loading::before, main form .form-response::before {
    content: "";
    position: absolute;
    cursor: progress;

    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;

    background-color: black;
    opacity: 50%;

    box-shadow: 0 0 10px 20px black;
  }

  main form.loading::after {
    content: "";
    position: absolute;
    cursor: progress;

    top: calc(50% - 60px);
    left: calc(50% - 60px);
    height: 100px;
    width: 100px;
    z-index: 5;

    border-color: var(--primary-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    border-style: solid;
    border-width: 10px;

    animation: spin 1.5s ease infinite;
  }

  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  main form .form-response::before {
    cursor: unset;
  }

  main form .form-response div {
    background-color: var(--body-background);
    margin: auto;
    opacity: 100%;
    z-index: 5;
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;

    text-align: center;
  }

  main form .form-response h1 {
    color: var(--secondary-color);
    font-size: 2em;
  }

  main form .form-response button {
    position: absolute;
    bottom: 2em;
    left: 0;
    font-size: 1em;
  }

  /* #endregion */

  /* #region Resources */

  #resources #posters .side-by-side {
    align-items: flex-start;
  }

  #resources #posters h3::before {
    content: "📁 ";
  }

  #resources #posters h3::after {
    content: " ⏷";
  }

  #resources #posters h3 {
    cursor: pointer;
  }

  #resources #posters ul {
    overflow: hidden;
    transition: height 1s;
  }

  /* #endregion */

/* #endregion */

/* #region Footer */

footer {
  background-color: var(--header-background);
  color: var(--primary-color);
}

footer>div {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}

footer>div>div {
  flex: 1;
  text-align: center;
  margin-right: 1em;
  margin-left: 1em;
  white-space: nowrap;
  /* margin: auto; */
}

footer h2 {
  color: var(--secondary-color);
}

footer a {
  color: skyblue;
}

/* #endregion */
