:root {
  --ff-serif: "garamond", Georgia, serif;
  --ff-sans-serif: "LatoWeb", Arial, Tahoma, sans-serif;

  --clr-neutral-100: hsl(0, 0%, 100%);
  --clr-neutral-400: hsl(0, 0%, 44%);
  --clr-neutral-500: hsl(0, 0%, 39%);
  --clr-neutral-900: hsl(0, 0%, 0%);
  --clr-primary-100: hsl(214, 35%, 92%);
  --clr-primary-900: hsl(210, 50%, 40%);
  --clr-accent-link: hsl(0, 87%, 62%);
  --clr-accent-body: hsl(49, 100%, 50%);

  /* social media colours */
  --facebook: #1b74e4;
  --twitter: #1d9bf0;
  --linkedin: #0a66c2;

  /* The default space between elements in row, column or grid */
  --space: 1.5rem;
  /* The default max-width, nothing should be wider than: */
  --measure: 70ch;

  /* Modular Scale */
  --ratio: 1.5;
  --s-5: calc(var(--s-4) / var(--ratio));
  --s-4: calc(var(--s-3) / var(--ratio));
  --s-3: calc(var(--s-2) / var(--ratio));
  --s-2: calc(var(--s-1) / var(--ratio));
  --s-1: calc(var(--s0) / var(--ratio));
  --s0: 1rem;
  --s1: calc(var(--s0) * var(--ratio));
  --s2: calc(var(--s1) * var(--ratio));
  --s3: calc(var(--s2) * var(--ratio));
  --s4: calc(var(--s3) * var(--ratio));
  --s5: calc(var(--s4) * var(--ratio));

  /* Shadows! Courtesy of https://www.joshwcomeau.com/shadow-palette/ */
  --shadow-color: 0deg 0% 63%;
  --shadow-elevation-low: 0.4px 0.7px 0.9px hsl(var(--shadow-color) / 0.34),
    0.6px 1.1px 1.4px -1.2px hsl(var(--shadow-color) / 0.34),
    1.5px 2.6px 3.4px -2.5px hsl(var(--shadow-color) / 0.34);
  --shadow-elevation-medium: 0.4px 0.7px 0.9px hsl(var(--shadow-color) / 0.36),
    1.2px 2.2px 2.8px -0.8px hsl(var(--shadow-color) / 0.36),
    3px 5.4px 6.9px -1.7px hsl(var(--shadow-color) / 0.36),
    7.4px 13.1px 16.9px -2.5px hsl(var(--shadow-color) / 0.36);
  --shadow-elevation-high: 0.4px 0.7px 0.9px hsl(var(--shadow-color) / 0.34),
    2.2px 3.8px 4.9px -0.4px hsl(var(--shadow-color) / 0.34),
    4px 7.1px 9.2px -0.7px hsl(var(--shadow-color) / 0.34),
    6.6px 11.7px 15.1px -1.1px hsl(var(--shadow-color) / 0.34),
    10.5px 18.7px 24.1px -1.4px hsl(var(--shadow-color) / 0.34),
    16.5px 29.2px 37.7px -1.8px hsl(var(--shadow-color) / 0.34),
    25px 44.4px 57.3px -2.1px hsl(var(--shadow-color) / 0.34),
    36.9px 65.5px 84.6px -2.5px hsl(var(--shadow-color) / 0.34);

    /* custom properties for the grids */
    /* 
      xs s m l xl columns
      numCol, with the fallback of say 400px declaring numCol locally
      grid-template-columns: repeat(auto-fit, minmax(min(calc((100vw - var(--space))/numCol), 100%), 1fr));
    */

    --xs: 100px;
    --s: 200px;
    --m: 300px;
    --l: 400px;
    --xl: 500px;

    /* These make the decoration styles easier to read / maintain! */
    --border-width: 5px;
    --triangle-width: calc(300px + 10vw);
    --logo-width: 150px;
}

/* Start Reset - inpsired by/learning from Kevin Powell, further tweaks from Josh Comeau*/
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html,
body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
h1,
h2,
h3,
h4,
figure {
  margin: 0;
  padding: 0;
}

p {
  overflow-wrap: break-word;
  hyphens: manual;
}

h1,
h2,
h3,
h4 {
  line-height: 1;
}

body {
  line-height: 1.5;
  font-size: var(--s0);
  -webkit-font-smoothing: antialiased;
}

p {
  margin: 0;
}

ul[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input[type="submit"],
textarea, 
select,
option {
  border: none;
  font-family: inherit;
  font-size: inherit;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-inline-size: 100%;
}
/* End Reset */

/**************** 
Intrinsic Sizing
****************/
* {
  max-inline-size: var(--measure);
}

html,
body,
header,
nav,
main, aside,
form, input, textarea,
div, 
section, 
table, tr,
footer, .no-measure {
  max-inline-size: none;
}

/**************** 
Typography
****************/

body {
  font-weight: 400;
}

body, .sans {
  font-family: var(--ff-sans-serif);
}

span  {
  font-style: italic;
}

nav a, footer a, .btn {
  text-decoration: none;
} 

h1,
h2,
h3,
h4, .serif {
  font-family: var(--ff-serif);
}

h1, .h1 {
  font-size: var(--s3);
}

h2, .h2 {
  font-size: var(--s2);
  max-inline-size: calc(var(--measure) / 2);
}

p.h2 {
  font-family: 'LatoWebLight';
}

h3, .h3 {
  font-size: var(--s1);
}

ul {
  margin-block: 0;
}

.text-center {
  text-align: center;
  align-self: center;
}

.landing, .banner {
  color: var(--clr-neutral-100);
}

.landing .btn {
  font-size: var(--s1);
}

/* Colours */
.accent {
  color: var(--clr-accent-body);
}

.subtitle {
  color: var(--clr-neutral-500);
}

.error {
  outline: 2px solid var(--clr-accent-link);
}

.form-error {
  color: var(--clr-accent-link);
}

a {
  color: inherit;
}
/* End Colours */

/**************** 
Utility classes 
****************/

.debug {
  outline: 2px solid hotpink
}

.container {
  margin-inline: auto;
  padding-inline: var(--space);
  /* inline-size: 90%; */
}

.place-center {
  display: grid;
  place-content: center;
  font-size: var(--s1);
}

/****************
General styling 
****************/
body {
  background-color: var(--clr-primary-100);
}

main, section {
  padding-block: var(--space);
}

.grid .btn {
  align-self: flex-end;
}

.box {
  border-color: var(--clr-neutral-100);
  border-width: var(--border-width);
}

.box, .news__image, .staff__image, .module__category {
  border-style: solid;
}

/* modify default box look */
.box-light, .news__image, .staff__image, .module__category {
  border-width: 2px;
  border-color: var(--clr-neutral-400); 
}

.box-light, .note-editing-area {
  background-color: var(--clr-neutral-100);
}
/* end modify default box look */

.module__category {
  inline-size: calc(2.5 * var(--logo-width));
  border-color: var(--clr-neutral-900);
}

.card {
  align-items: center;
}

.card .image-center {
  align-self: center;
}

.card a {
  align-self: flex-end;
}

/* Images */
.icon {
  height: 75px;
}

.banner img, .thumbnail {
  inline-size: max(calc(1.5 * var(--logo-width)), 25%);
}

.team img, .news img {
  margin-inline: auto;
}

.staff__image {
  margin-block-end: var(--space);
}

.news__image {
  margin-block-start: var(--space);
}

.about__employee .staff__image {
  max-inline-size: min(35vw, 400px);
  margin-inline: auto;
}

.logo {
  inline-size: var(--logo-width);
}

.logo-med, .thumbnail {
  inline-size: calc(1.5 * var(--logo-width));
}

.logo-lrg {
  inline-size: calc(2 * var(--logo-width));
}

/* End images */

.legal {
  text-align: end;
}

/***************** 
Buttons! 
*****************/

a:hover, a:focus {
  color: var(--clr-accent-link);
}

.share {
  color: var(--clr-neutral-100);
  border: 2px solid var(--clr-neutral-400);
}

/* default button */
.btn {
  color: var(--clr-neutral-100);
  background-color: var(--clr-accent-link);
  padding: var(--s-1) var(--s1);
  box-shadow: var(--shadow-elevation-low);
}

.btn:hover, .btn:focus {
  color: var(--clr-accent-link);
  background-color: var(--clr-neutral-100);
}
/* End default button */
.btn__admin {
  width: 100%;
  background-color: var(--clr-primary-900);
  text-align: start;
  padding: 1.5rem 2rem;
  border: none;
  box-shadow: none;
}

.btn__nav {
  background-color: transparent;
  border: 2px solid var(--clr-neutral-100);
  padding: var(--s-2) var(--s-1)
}

.btn__light {
  color: var(--clr-neutral-900);
  background-color: var(--clr-neutral-100);
  border: 2px solid var(--clr-neutral-500);
}

.btn__light:hover, .btn__light:focus,
.btn__accent:hover, .btn__accent:focus {
  border-color: var(--clr-accent-link);
  background-color: var(--clr-neutral-100);
}

.btn__light:hover, .btn__light:focus,
.btn__accent:hover, .btn__accent:focus,
.btn__add:hover, .btn__add:focus,
.btn__accent:hover, .btn__accent:focus {
  box-shadow: var(--shadow-elevation-medium);
}

.btn__accent:hover, .btn__accent:focus {
  border: 2px solid var(--clr-accent-link)
}

/* Buttons on white backgrounds */
/* .btn__accent:hover, .btn__accent:focus {
  background-color: var(--clr-accent-body);
} */

/* Cancel and Save Buttons */
form button:hover, form button:focus {
  border-color: var(--clr-accent-link);
}

.btn__cancel {
  color: var(--clr-accent-link);
}

.btn__cancel:hover, .btn__cancel:focus {
  border-color: var(--clr-neutral-900);
  background-color: var(--clr-neutral-900);
  color: var(--clr-accent-body);
}

/***************** 
End Buttons 
*****************/

.pagination {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.h-captcha {
  float: right;
  margin-top: 1rem;
}

/***************** 
Start Inputs! 
*****************/
input, select, textarea, form button {
  font: inherit;
  background-color: var(--clr-neutral-100);
  border: 2px solid var(--clr-neutral-500);
  padding: 1rem 2rem;
}

textarea {
  resize: vertical;
}

/***************** 
End Inputs! 
*****************/
nav, aside {
  background-color: var(--clr-primary-900);
}

/************************
    Start Navigation    
************************/

nav {
  position: relative;
  padding-block: var(--space);
  color: var(--clr-neutral-100);
}

/* 
nav.cluster:nth-child(2) {
  margin-inline-start: auto;
} */

nav ul.cluster {
  position: relative; 
  justify-content: flex-start;
  z-index: 5;
}

nav .logo {
  position: relative;
  z-index: 10;
}

:where(nav a), :where(footer a) {
  color: var(--clr-neutral-100);
}

.nav__toggle, .nav__toggle-label {
  display: none;
}

@media (max-width: 729px) {

  /* grabs the hamburger menu and aligns it to the top, but doesn't select the further nested stack */
  nav .stack:last-of-type:not(:first-of-type)  {
    align-self: flex-start;
  }

  nav ul.cluster, .teamviewer__toggle, .nav__toggle {
      display: none;
  }

  nav .stack > .cluster.no-wrap {
    position: absolute;
    block-size: 100vh;
    top: 0;
    right: 0;
    padding: calc(1.5rem - var(--border-width));
    z-index: 15;
  }
  
  .menuBackground {
    background-color: rgb(0, 0, 0, 0.5);
  }

  .nav__toggle:checked ~ ul.cluster {
      --space: calc(1.5rem - var(--border-width));
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
    }
  
  .nav__toggle-label, .hamburger {
      display: block;
  }

  .hamburger {
      position: relative;
      background-color: var(--clr-neutral-100);
      margin-top: 8px;
  }
  
  .hamburger,
  .hamburger::before,
  .hamburger::after {
      width: 2em;
      height: 3px;
  }
  
  .hamburger:hover,
  .hamburger:focus {
      background-color: var(--clr-accent-link);
  }
  
  .hamburger::before,
  .hamburger::after {
      content: "";
      position: absolute;
      background-color: inherit;
      left: 0;
  }
  
  .hamburger::before {
      top: 8px;
  }

  .hamburger::after {
      bottom: 8px;
  }
}

/********************
  End Navigation  
********************/

/* footer */
footer {
  --space: 1rem;
  color: var(--clr-neutral-100);
  background-color: var(--clr-neutral-400);
  padding: var(--space);
  margin-block-start: auto;
}

footer .cluster {
  align-items: flex-start;
}

footer div p:first-of-type {
  text-decoration: underline;
}

/****************
Layout 
****************/
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space, 1.5rem);
}

.landing, .banner {
  background-color: var(--clr-primary-900);
  padding: var(--space);
}

/* 'center' */
.landing {
  inline-size: 100%;
  min-block-size: calc(100vh - var(--logo-width) - 2 * var(--space));
}

.landing .stack {
  block-size: 100%;
}

.landing .stack > :first-child {
  margin-block: auto;
}

.landing .stack > :last-child:not(:first-child) {
  margin-block-start: auto;
}

/* to give spacing between paragraphs in an article (the text editor gives a class that it assigns) *
 * this selector allows for nesting, which is why we tell it to ignore the author paragraph         *
 * (as there is a nesting of stacks in .article!                                                    *
 * NOTE: This was changed from margin-top to margin-bottom, as <br> tags would add spacing above    *
 *       the last line of every paragraph.                                                          */
/* 2024-11-08  JDK  Removed as this doesn't really work, and ruins styling of ordered lists etc. */
/* .article .stack :not(p.author) * + * {
  margin-bottom: var(--space);
} */

.stack > .stack {
  gap: 0;
}

.stack > .stack > * + * :not(article) :not(br) {
  margin-block-start: var(--space, 1.5rem);
}

.box {
  position: relative;
  padding: var(--space) calc(1.5 * var(--space));
}

.flex-box {
  display: flex;
  justify-content: center;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space);
  align-items: center;
  justify-content: space-between;
}

.no-wrap {
  flex-wrap: nowrap;
}

.grid {
  display: grid;
  grid-gap: var(--space);
}

@supports (width: min(450px, 100%)) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(min( 450px, 100%), 1fr));
  }
}

@media (min-width: 800px) {
  .team, .news, .two-col {
    grid-template-columns: repeat(2, 1fr);
  }

  .team, .news {
    display: grid;
    grid-column: span 2;
    gap: var(--space)
  }
}

@supports (grid-template-columns: subgrid) {
  @media (min-width: 800px) {
    .team, .news {
      display: grid;
      grid-column: span 2;
      grid-template-columns: subgrid;
    }

    .staff__image {
      margin-block-end: 0;
    }

    .news__image {
      margin-block-start: 0;
    }
  }
}

.masonry {
  grid-template-columns: repeat(auto-fit, minmax(min(530px, 100%), 1fr));
}

.masonry > :nth-child(2) {
  grid-row: span 2;
}

@supports (grid-template-rows: masonry) {
  .masonry {
    grid-template-rows: masonry;
  }
}

.with-sidebar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space);
  background-color: var(--clr-primary-900);
}

.with-sidebar > :first-child {
  flex-basis: 25rem;
  flex-grow: 1;
  justify-content: flex-start;
}

.with-sidebar > :last-child {
  flex-basis: 0;
  flex-grow: 999;
  min-inline-size: 50%;
  align-self: stretch;
  background-color: var(--clr-primary-100);
}

#software, #users {
  display: none;
}

.switcher {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}

.switcher > * {
  flex-grow: 1;
  flex-basis: calc(( 43rem - 100%) * 999);
}

.switcher > :nth-last-child(n+ 5),
.switcher > :nth-last-child(n+ 5) ~ * {
  flex-basis: 100%;
}

/****************
Decorations
****************/

/* the triangle */
.triangle::before {
  content: '';
  position: absolute;
  border-style: solid;
  border-width: var(--triangle-width) var(--triangle-width) 0px 0px;
  border-color: #fff transparent transparent transparent;
  top: 0;
  left: -7vw; 
}

/* the dark border */
.landing .box-decoration::after, .banner .box-decoration::after {
  content: '';
  position: absolute;
  border-style: solid;
  border-width: var(--border-width); 
  border-color: #000 transparent transparent #000; 
  padding-top:  calc(var(--triangle-width) - calc(4 * var(--space)) - calc(2 * var(--border-width)) - var(--logo-width) - 7vw);
  padding-left: calc(var(--triangle-width) - calc(4 * var(--space)) - calc(2 * var(--border-width)) - var(--logo-width) - 7vw);
  top: calc(-1 * var(--border-width));
  left: calc(-1 * var(--border-width));
}

/* Scafolding Image */
.construction::before {
  content: "";
  position: absolute;
  background-image: url("/imgs/workArea.png");
  background-repeat: no-repeat;
  background-position: bottom right;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.construction-zindexModifier {
  position: relative;
  z-index: 5;
}

.row {
  padding: 1rem;
  border-top: 2px solid var(--clr-neutral-900);
}

/* .row > * {
  flex-grow: 1;
} */

/***************** 
Media Queries 
*****************/

@media (max-width: 599px) {
  :root {
    --ratio: 1.25;
  }

  .legal {
    text-align: start;
  }
}
