:root {
  /* Color system */
  --kornhaus-color: rgb(43, 58, 68);
  --kornhaus-contrast-color: rgb(255,255,230);
  --link-color: oklch(95% 0.15 60);
  --link-hover: oklch(85% 0.15 120);

  /* Typography */
  font-size: 20px;
  font-family: Helvetica, sans-serif;

  /* Main Grid Width */
  --max-grid-width: 51ch;
  --min-gird-width: 27ch;
}

html {
  background-color: var(--kornhaus-color);
  color: var(--kornhaus-contrast-color);
}

body {
  padding: 50px 20px 0 20px;
  display: grid;
  grid-template-columns: min-content;
  justify-content: center;
}

header img {
  object-fit: contain;
  height: auto;
  margin: 0 auto;
}

main {
  display: grid;
  margin: 0 auto;
  padding: 0 1ch;
}

footer {
  padding-bottom: 1rem;

  nav {
    display: flex;
    gap: 0.6rem;
    flex-direction: column;
    align-items: center;

    a {
      opacity: 0.5;
    }

    a:hover {
      opacity: 1;
    }
  }
}

@media (width < 74ch) {
  body {
    row-gap: 4rem;
    header img {
      width: 95vw;
      min-width: var(--min-gird-width);
      max-width: var(--max-grid-width);
    }
  }
  body.homepage {
    main {
      grid-template-columns: 1fr max-content 1fr;
      row-gap: 2rem;
      grid-template-areas:
      "welcome welcome welcome"
      ". hours ."
      ". phone ."
      ". social ."
      ". address .";

      #kornhaus-welcome-message-section {

      }
    }
  }
  body.secondary-page {
    dl#legal-business-details {
      grid-template-columns: 26ch;

      dd {
        padding-left: 1ch;
      }
    }
  }
}

@media (width >= 74ch)
/*and (width < calc(74ch * 1.4)) */
{
  body{
    column-gap: 4ch;
    row-gap: 4rem;
    header {
      width: var(--max-grid-width);
    }
  }
  body.homepage {
    main {
      grid-template-columns: repeat(2, max-content);
      row-gap: 2rem;
      grid-template-areas:
      "welcome welcome"
      "hours address"
      "phone social";

      #kornhaus-welcome-message-section {
        width: calc(var(--max-grid-width) - 2ch);
      }
    }
  }
  body.secondary-page {
    .only-on-narrow-screens {
      display: none;
    }
    main {
      margin-left: 0;
    }
    #legal-business-details {
      grid-template-columns: min-content 30ch;
    }
  }
}

/*@media (min-width: calc(74ch * 1.4)) {
  main {
    grid-template-columns: repeat(3, max-content);
    row-gap: 0.7rem;
    grid-template-areas:
    "hours phone address"
    "hours social address";
  }
  #legal-business-details {
    grid-template-columns: min-content minmax(25ch, max-content);
  }
}*/

body.homepage {
  main {

    section.with-icon {
      display: grid;
      grid-template-columns: 1.2rem max-content;
      column-gap: 2ch;
    }

    #kornhaus-welcome-message-section {
      grid-area: welcome;
      line-height: 1.5;

      details {
        filter: drop-shadow(0.1rem 0.1rem 0.2rem black);
      }

      summary {
        list-style: none;
        &::marker {
          content: "";
        }

        border-radius: 0.75rem;
        padding-block: 0.5rem;
        padding-inline: 0.75rem;
        background: var(--kornhaus-contrast-color);
        color: var(--kornhaus-color);

        &:hover {
          cursor: pointer;
        }
      }

      details[open] {
        background-color: oklch(from var(--kornhaus-contrast-color) l c h / 0.8);
        color: oklch(from var(--kornhaus-color) calc(l * 0.8) c h);
        border-radius: 0.75rem;
        p {
          padding-block: 0.5rem;
          padding-inline: 0.75rem;
        }
      }

      p:not(:last-of-type) {
        padding-bottom: 1rem;
      }
    }

    #kornhaus-opening-hours-section {
      grid-area: hours;

      #kornhaus-opening-hours {
        display: grid;
        column-gap: 2ch;
        row-gap: 0.4rem;
        grid-template-columns: max-content max-content;
        grid-template-rows: max-content max-content;
      }
    }

    #kornhaus-phone-section {
      grid-area: phone;
    }

    #kornhaus-social-section {
      grid-area: social;
    }

    #kornhaus-address-section {
      grid-area: address;

      #kornhaus-address {
        display: grid;
        row-gap: 0.4rem;
        grid-template-columns: max-content;
        grid-template-rows: max-content;
      }
    }
  }
  .icon {
    width: 1.2rem;
  }
}

body.secondary-page {

  main {
    grid-template-columns: max-content;

    h2 {
      margin: 0 auto;
      padding-bottom: 2rem;
      font-size: 2rem;
      hyphens: auto;
    }

    dl#legal-business-details {
      margin: 0 auto;
      display: grid;
      column-gap: 3ch;
      row-gap: 0.4rem;
      line-height: 1.3;

      dt {
        font-weight: 550;
      }

      dd {
        padding-bottom: 0.2rem;
        font-weight: 300;
      }
    }
  }
}

address {
  font-style: normal;
}

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

a:visited {
  color: var(--link-color);
}

:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Remove focus styles for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

a:hover {
  color: var(--link-hover);
}

a {
  transition: all 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
