﻿:root {
  --header-height: min(clamp(200px, 40vw, 400px), 40vh);

  --menu-height: clamp(36px, min(4.8vw, 7.2vh), 48px);
  --menu-background-color: black;
  --menu-text-color: white;
  --menu-selected-item-background-color: hsl(0deg 0% 25%);
  --menu-selected-item-highlight-color: hsl(0deg 0% 75%);

  --footer-height: clamp(24px, min(3.2vw, 4.8vh), 32px);
  --footer-background-color: #404241;
  --footer-text-color: white;

  --maximum-width: 1024px;
  --drop-shadow: drop-shadow(hsl(0deg 0% 0% / 75%) 0px 0 15px);
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;

  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu;
  color: var(--dark-text-color);
}

#main {
  height: 100%;
  width: 100%;

  display: grid;
  grid-template:
    "header"  var(--header-height)
    "menu"    var(--menu-height)
    "toolbar" auto
    "main"    1fr
    "footer"  var(--footer-height);

  > * {
    min-width: 0;
    overflow-x: clip;
  }
}

header {
  grid-area: header;

  background-image: url("Protide.FrontEnd.Header.jpg");
  background-size: cover;
  background-position: 80% 20%;
  background-repeat: no-repeat;
}

div.Logo {
  grid-area: header;
  z-index: var(--z-index-sticky);

  background-image: url("Protide.Logo.White.png");
  background-size: min(clamp(200px, 40vw, 400px), 60vh) auto; /* 400px is intrinsic width of image */
  background-position: left center;
  background-origin: content-box;
  background-repeat: no-repeat;
  filter: var(--drop-shadow);
}

div.SignIn {
  grid-area: header;
  z-index: var(--z-index-sticky);

  display: flex;
  justify-content: flex-end;

  a {
    --padding: clamp(12px, min(1.8vw, 2.7vh), 18px);

    display: flex;
    gap: 0.25em;

    height: fit-content;
    background-color: hsl(0deg 0% 100% / 90%);
    padding: var(--padding);
    border-radius: 0 0 calc(var(--padding) / 2) calc(var(--padding) / 2);
    filter: var(--drop-shadow);

    span.Icon {
      width: 1.5em;

      background-image: url("UserInterface.Icon.Lock.Black.svg");
      background-size: contain;
      background-position: center;
      background-repeat: no-repeat;
    }

    span.Caption {
      font-size: 1.5em;
      font-weight: 700;
    }
  }
}

div:has(> nav.Menu) {
  grid-area: menu;

  background-color: var(--menu-background-color);
  color: var(--menu-text-color);
}

nav.Menu {
  div.Menu > ol > li {
    padding-inline: clamp(10px, 1.6vw, 15px);

    &.pathCurrent {
      background-color: var(--menu-selected-item-background-color);
      box-shadow: inset 0 -3px 0 var(--menu-selected-item-highlight-color);
    }

    > span {
      display: flex;
      flex-direction: row-reverse;
      gap: 0.25em;

      line-height: var(--menu-height);
      font-size: max(calc(var(--menu-height) / 2.5), 1em);
      font-weight: 600;

      button {
        width: 1em;
      }
    }
  }
}

div.WebSiteToolbar {
  grid-area: toolbar;

  .Toggle {
    display: none;
  }

  div.Options {
    padding: 0;

    div.Menu > ol > li {
      padding: 0.25em;

      &.Language > ol > li:not(.en-US):not(.nl):not(.de) {
        display: none;
      }
    }
  }
}

main {
  grid-area: main;

  #articleContent {
    div.summary {
      font-weight: 600;
      margin-bottom: 0.5em;
    }

    p {
      text-align: justify;
    }
  }
}

div.LoadingPage {
  grid-area: main;
  display: none;

  .Loading > & {
    z-index: var(--z-index-pop-up);

    display: grid;
    grid-template-columns: 1fr min-content 1fr;
    grid-template-rows: 1fr min-content 1fr;
  }
}

div.ToastBox {
  grid-area: main;
}

footer {
  grid-area: footer;

  background-color: var(--footer-background-color);
  color: var(--footer-text-color);

  line-height: var(--footer-height);
  text-align: center;
}

.Centered {
  width: 100%;
  max-width: calc(var(--maximum-width) + 2 * 30px);
  margin-inline: auto;
  padding-inline: clamp(10px, 3vw, 30px);
  box-sizing: border-box;
}

*:not(main) a {
  color: inherit;
  text-decoration: none;
}

div.Menu > ol > li.expanded > ol {
  z-index: var(--z-index-drop-down);
  color: var(--dark-text-color);
  line-height: 1.75em;
}

span.Labels {
  display: none;
}
