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

:root {
  font-size: 15px;
}

/* Resets & defaults */
body, p, img, figure, figcaption, h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0;
}
ul, ol {
  margin-block: 0;
}

img {
  max-width: 100%;
}

/* Spacing */
body {
  line-height: 1.5;
}

p, ul, ol {
  margin-block-end: 0.5rem;
}

embed {
  margin: 1rem auto;
  border: 1px solid rgba(0 0 0 / 20%);
}

h2, h3 {
  margin-block: 1rem 0.5rem;
}

/* Layout */
body {
  display: grid;
  grid-template-columns: 3fr 6fr 2fr;
  height: 100vh;
  overflow: hidden;
}

.titlenav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline: 1rem;
  border-bottom: 1px solid grey;
}

main {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  min-height: 0;
  overflow: hidden;
}

.contentcontext {
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, rgba(255 255 255 / 1) 0%, rgba(255 255 255 / 1) 85%, rgba(255 255 255 / 0) 100%);
  z-index: 10;
  flex-shrink: 0;
  /* Space for the fade effect on scroll */
  padding-bottom: 1rem;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  overflow-y: auto;
  flex: 1;
  margin: 0;
}

.text-container {
  max-width: 90ch;
  margin-inline: auto;
  padding-bottom: 1.5rem;
}

/* Scroll behavior */
.content-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Fade effet on scroll */
  margin-block: -2rem;
  padding-top: 2rem;
  margin-bottom: 1.5rem;
}

/* Space main content so the scrollbar for .grid-container 
gets some space to breathe */
.contentcontext,
.content-container {
  padding-inline: 1rem;
}
/* Make sure the scrollbar doesn't fade behind the gradient
  on browsers that support webkit */
.content-container::-webkit-scrollbar {
  z-index: 5;
}

/*** Styles ***/
body {
  font-family: "Noto Serif", serif;
}

#sidebar {
  overflow-y: auto;
  padding: 0.25rem 1rem 1.5rem;
  background-color: #f4f4f4;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

/* Projects & Writeups custom elements */
.project-title {
  font-size: 2rem;
  text-decoration: underline;
  text-align: center;
  margin-block: 1rem;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: -1rem;
}
.breadcrumbs-arrow {
  place-self: center;
  font-size: 0.625rem;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.filter-button {
  cursor: pointer;
  padding: 0.5rem 0.85rem;
  background-color: #f2f2f2;
  border: 1px solid #999;
  border-radius: 0.35rem;
  color: #111;
}
.filter-button:hover,
.filter-button.active {
  background-color: #111;
  border-color: #111;
  color: #fff;
}

.filter-box {
  border: 1px solid rgba(0 0 0 / 20%);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
}

#sidebar .filter-box {
  margin-block: 0.5rem;
}

.filter-box img {
  max-height: 200px;
  display: block;
  margin: 0.5rem auto;
  max-width: 75%;
}
/* Not a fan
.filter-box p {
  text-align: justify;
}*/

.box-title {
  font-size: 1rem;
  font-weight: bold;
}
.box-subtitle {
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  display: grid;
  justify-content: center;
  background-image: url(images/frutigeraero_bg.webp);
    background-color: #0999bc;
  background-size: cover;
  background-position: top right;
}

footer div {
  display: inline-block;
  margin: 1rem 2rem;
  padding: 0.5rem 1rem;
  text-align: center;
}

footer .heart {
  align-self: start;
  background-color: rgba(240 240 240 / 75%);
  border-radius: 46% 45% 52% 55%;
  border: 1px solid rgba(0 0 0 / 75%);
}

footer .credits {
  align-self: end;
  font-size: 0.75rem;
  background-color: rgba(240 240 240 / 65%);
  border-radius: 45% 48% 52% 51%;
}

/* Media queries for mobile */
@media (max-width: 720px) {
  body {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
  }
  main {
    overflow: unset;
  }
  footer {
    position: relative;
    overflow: hidden;
  }
  footer > div {
    isolation: isolate;
  }
  footer::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-size: contain;
    transform: rotate(90deg);
    height: 100vw;
    background-position: -25px;
  }
}