
/* ----- Color definitions ----- */
h1,
h2,
h3,
h4,
img,
span,
p,
div,
nav a {
  color: var(--fg-primary);
}

hr {
  opacity: 0;
}

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

nav hr {
  color: #00000000;
  background-color: var(--fg-primary);
}

a#scroll-top {
  color: var(--fg-primary);
  background-color: var(--bg);
}


/* ----- Global helpers ----- */
/* Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margins */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
ul,
ol,
dl,
dt,
dd {
  margin: 0;
}

/* Allow percentage-based heights in the application */
html {
  height: 100%;
}

body {
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  display: none;
}

/* Improve the typography across the site. */
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}


/* ----- Layout definitions ----- */
body {
  position: relative;
  width: 60vw;
  margin: 3rem auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;

  & p:first-child {
    overflow-x: initial;
    position: relative;
    width: min-content;
    margin: 0 auto 3rem auto;

    & > a {
      top: 0;
      position: absolute;
      z-index: 5;
      min-width: max-content;

      &:first-child {
        right: 1.5rem;
      }
      &:last-child {
        left: 1.5rem;
      }

      @media (max-width: 960px) {
        &:first-child {
          right: 0.75rem;
        }
        &:last-child {
          left: 0.75rem;
        }
      }
    }
  }
}

hr {
  margin: 1.5rem 0;
}

figure {
  margin: 2rem 0;
}

figcaption {
  display: none;
}

a#scroll-top {
  position: fixed;
  display: block;
  align-self: flex-end;
  bottom: 3rem;
  right: 4vw;
  width: 4rem;
  height: 4rem;
  font-size: 2rem;
  border-radius: 50%;
  text-align: center;
}

main {
  margin-bottom: 1rem;
}

nav div.submenu {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 0.5rem;
  margin: 2rem;
}

h1,
h3,
h4,
p,
blockquote,
ol,
aside {
  margin: 1rem 0;
}
p,
ol {
  margin-top: 0;
}

h2 {
  margin: 2rem 0;
  &::before,
  &::after {
    display: block;
    content: "";
    margin: 1rem 0;
    width: 100%;
    height: 0.25rem;
    background-color: var(--fg-primary);
  }
}

p:has(
    + p > img:not(.icon),
    + p > picture,
    + p > video,
    + p > canvas,
    + p > svg
  ) {
  margin-bottom: 2rem;
}

#main-title {
  padding-left: 0.5rem;
  margin-left: 3rem;
}

section#content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
  min-height: 80vh;
  max-width: 100vw;

  &:has(#post) {
    max-width: 60rem;
    margin: 0 auto;
  }
}

span > img.icon {
  display: inline-block;
  width: initial;
}

#workshops {
  & ~ h3 {
    margin-top: 0;
  }
  & ~ p:has(+ h3) {
    margin-bottom: 0;
  }
}

nav#menu {
  width: 100%;
}

@media (max-width: 960px) {
  body {
    width: 90vw;
  }

  nav#menu {
    width: 80%;
  }

  h2::before,
  h2::after {
    margin: 0.5rem 0;
  }
}


/* ----- Typography definitions ----- */
@font-face {
  font-family: "MunkenSansRegular";
  src: url(./assets/MunkenSans-Regular.otf) format("opentype");
}

@font-face {
  font-family: "MunkenSansMedium";
  src: url(./assets/MunkenSans-Medium.otf) format("opentype");
}

h1,
h2,
h3,
h4,
nav span,
button#scroll-top,
b,
strong {
  font-family: "MunkenSansMedium";
  font-weight: 800;
}

h3 {
  line-height: 1.25em;
}

p {
  overflow-x: hidden;
  text-overflow: ellipsis;
}

body p:nth-child(1),
body p:nth-child(2),
h2 {
  text-align: center;
}

#workshops ~ p:has(+ h3) {
  text-align: left;
}

img,
span,
p,
a,
div,
td {
  font-family: "MunkenSansRegular";
  line-height: 1.4em;
}

h2 {
  font-size: 3.5rem;
}

h3 {
  font-size: 2.5rem;
}

a {
  text-decoration: none;
}

nav a {
  font-size: 2.5rem;
}

@media (max-width: 960px) {
  nav a,
  h3 {
    font-size: 1.25rem;
    line-height: 1.25em;
  }

  h2 {
    font-size: 2rem;
  }

  p {
    font-size: 0.9rem;
  }

  body p:nth-child(1) > a {
    font-size: 0.75rem;
  }
}
