@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');

:root {
  --main-background-color: #F4F4F4;
  --button-shadow-color: rgba(0, 0, 0, 0.25);

}

* {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans', 'Roboto';
}

html,
body {
  height: 100%;
  color: #191919;
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  color: #191919;
}

button {
  background: transparent;
  border: none;
  cursor: pointer;
}

.content-width {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 2rem;
  box-sizing: border-box;
}

#nav-wrapper {
  background: white;
  border-bottom: 2px solid #aaa;
  z-index: 9999;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 7rem;

  font-weight: 600;
}

#pages {
  display: flex;
  gap: 2rem;
  font-size: large;
}


.link {
  font-weight: 600;

  padding: 0.1rem 0.3rem;
  text-align: center;
  border-bottom: 2px solid #888;
  transition: 0.1s ease-in-out;
  transition-property: border-color, transform;
}

.link:hover {
  border-color: darkcyan;
  transform: scale(1.05);
}

nav .logo {
  display: block;
  height: 80%;
}

.logo {
  height: 100%;
}

.logo img {
  height: 100%;
}

.sidebar-button {
  padding: 0.5rem;
}

#sidebar-open {
  height: 3.5rem;
  display: none;
  font-size: 0;
}

#sidebar-open img {
  height: 100%;
}

#sidebar {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: -100%;

  background: var(--main-background-color);

  width: 100%;
  height: 100%;

  z-index: 99999;

  align-items: center;

  transition: 0.2s ease-in-out;
}

#sidebar-close {
  height: 3.5rem;
  margin-top: 5rem;
  margin-bottom: 1.5rem;
  font-size: 0;
}

#sidebar-close img {
  height: 100%;
}

#sidebar-links {
  width: 90%;
  border-top: 2px solid #aaa;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding-top: 1.5rem;
}

#sidebar-links .link {
  text-align: center;
  /* width: 7rem; */
}

main {
  background: var(--main-background-color);
  padding: 5rem 0;

  display: flex;
  flex-direction: column;
  gap: 10rem;
}

.header-line {
  border-top: 2px solid #aaa;
  width: 100%;
}

.header-line>h2 {
  position: relative;
  top: -0.75em;

  background: var(--main-background-color);

  font-size: xx-large;
  padding: 0 1rem;
  margin: 0 auto;
  margin-bottom: 2rem;

  width: fit-content;
}

#services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1.5rem;
  margin: 0 auto;
}

#services-wrapper {
  width: 100%;
}

#service-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;

  width: 100%;

  * {
    width: 100%;
    overflow-wrap: break-word
  }

  ul,
  ol {
    margin: 0.5rem 0;
    padding-left: 2rem;
    box-sizing: border-box;
  }

  p {
    margin: 1rem 0;
  }

  li {
    list-style: unset;
    margin: 0.5rem 0;
  }

  .service {
    max-width: 100%;
    width: 100%;

    &:not(:last-child) {
      margin-bottom: 1rem;
      padding-bottom: 2rem;
      border-bottom: 1px solid #ccc;
    }

    img {
      width: 100%;
      aspect-ratio: 16 / 9;
      object-fit: cover;
    }

    h1 {
      margin-top: 1rem;
      margin-bottom: 2rem;
    }

    p,
    h2,
    h3,
    h4,
    h5 {
      margin: 1em 0;
    }
  }
}

@media(max-width: 75rem) {
  footer.content-width {
    max-width: unset;
    justify-content: space-evenly;
  }

  #services {
    grid-template-columns: repeat(2, 1fr);
    max-width: 46rem;
  }

  div#gallery {
    column-count: 2;
  }
}

@media(max-width: 51rem) {
  #nav-wrapper {
    width: 100%;
    position: fixed;
    top: 0;
  }

  nav.content-width {
    justify-content: space-between;
    max-width: unset;
    width: 100%;
    padding: 0 2rem;
    margin: 0;
    box-sizing: border-box;
  }

  #pages {
    display: none;
  }

  #sidebar-open {
    display: block;
  }

  main {
    padding-top: 12rem;
    padding-bottom: 5rem;
  }

  #services {
    grid-template-columns: 1fr;
    max-width: min(25rem, calc(100vw - 4rem));
  }

  #contact-form #contact-info {
    flex-direction: column;
    gap: 1rem;
  }

  #gallery {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

  }

  #image-dialog {
    img#image-fullres {
      max-width: 100vw;
      max-height: calc(100vh - 8rem);
      flex-grow: 1;
    }
  }

  #gallery.content-width {
    padding: 1rem;
    margin: 0 auto;
    margin-top: 3rem;
    gap: 1rem;
  }

  #gallery .gallery-image {
    width: 100%;
    height: unset;
  }

  .gallery-image img {
    max-height: unset;
    min-width: unset;
    min-height: 100%;
    max-width: 100%;
  }

  footer.content-width {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding-left: 3rem;
    padding-right: 3rem;
  }

  footer div.vertical {
    width: 100%;
    align-items: center;
  }

  footer .logo img {
    width: 50%;
  }
}

@supports (corner-shape: notch) {
  .card {
    corner-shape: superellipse(1.2);
  }
}

.card,
.card form {
  display: flex;
  height: 30rem;
  flex-direction: column;
  overflow: hidden;

  border-radius: 0.7rem;
  box-sizing: border-box;

  background: white;
  box-shadow:
    0 0 0.9rem 0.1rem var(--button-shadow-color);
  /* 0.1rem 0.2rem 0 0.1rem var(--button-shadow-color); */
  transition: 0.1s ease-in-out;

  .img-wrapper {
    width: 100%;
    height: 45%;

    .image {
      height: 100%;
      width: 100%;
      object-fit: cover;
      background-size: cover;
    }
  }
}

.card:hover {
  transform: scale(1.02);
  transition: 0.1s ease-in-out;
}

.card-text {
  padding: 0.5rem 1.5rem;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-grow: 1;
  align-items: center;
  overflow: hidden;
}

.card-link {
  margin-bottom: 1rem;
}

.card-title {
  text-align: center;
}

.card-description {
  flex-grow: 1;
  width: 100%;
  overflow-y: auto;
}

#footer-wrapper {
  background: #191919;
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;

  width: min(45rem, var(--content-width));
  margin: 0 auto;
  box-sizing: border-box;
}

#contact-info {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 3rem;
  box-sizing: border-box;
}

.form-input {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form-input label {
  display: block;
  font-size: large;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;

  padding-left: 0.5rem;
}

.form-input input,
textarea#message {
  font-size: medium;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;


  color: #191919;
}

textarea#message {
  resize: vertical;
}

input#submit-button {
  margin: 0 auto;
  width: 6rem;
  height: 2.3rem;
  border: none;

  background: white;
  font-size: medium;
}

:is(input#submit-button):hover {
  cursor: pointer;
}

.form-input input,
textarea#message,
input#submit-button {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0.1rem 0.2rem 0 0.05rem var(--button-shadow-color);
}

footer.content-width {
  display: flex;
  justify-content: space-around;
  padding: 5rem 0;
}

footer * {
  color: #FAF9F6;
}

footer .logo {
  height: 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.vertical {
  display: flex;
  flex-direction: column;
}

footer .vertical {
  width: 30%;
  gap: 2rem;
}

.underlined {
  text-decoration: underline;
}

li {
  list-style: none;
}

#contact-list {
  width: 100%;
}

.text-large {
  font-size: x-large;
}

.contact-item {
  display: flex;
  flex-direction: row;

  padding: 1rem 0;

  border-top: 1px solid #333;
}

#contact-list li:first-child {
  border-top: none;
}

.contact-item h3 {
  width: 7rem;
}

#gallery {
  width: 100%;
  column-count: 3;
  column-gap: 10px;
}

.gallery-image {
  break-inside: avoid;

  &:not(:first-child) {
    margin-top: 5px;
  }
}

.gallery-image img {
  width: 100%;
  object-fit: cover;

  cursor: pointer;
}

.image {
  height: 100%;
  width: 100%;
}

#image-dialog {
  background: white;
  border: none;
  border-radius: 0.5rem;

  position: fixed;
  margin: auto;

  padding: 0.5rem;
  padding-top: 0;
  box-sizing: border-box;

  &::backdrop {
    backdrop-filter: blur(3px) brightness(50%);
  }

  &:open {
    display: flex;
  }

  flex-direction: column;

  #image-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin: 0.5rem;
    --height: 3rem;
    flex-basis: var(--height);

    button {
      min-height: 100%;
      aspect-ratio: 1;
    }
  }

  #image-fullres {
    max-width: calc(100vw - 8rem);
    max-height: calc(100vh - 8rem);
    flex-grow: 1;

    /* border-bottom-left-radius: 1rem; */
    /* border-bottom-right-radius: 1rem; */
  }
}

.flashes {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;

  width: 100%;

  li {
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;

    border-radius: 0.5rem;
  }

  .flash-error {
    background: lightcoral;
  }

  .flash-success {
    background: lightgreen;
  }

  .flash-message {
    background: lightgray;
  }
}