@import "colors.css";
@import "fonts.css";

body {
  background-color: var(--color-bg);
  font-family: "Libertinus Sans", sans-serif;
  font-size: 19px;
  color: var(--color-body);
  width: min(100% - 5rem, 1200px);
  margin: auto;
  padding-bottom: 100px;

  line-height: 1.5;
}

.center {
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

h1 > a {
  text-decoration: none;
  color: inherit;
}

h1, h2, .subtitle {
  text-align: center;
  font-weight: normal;

  line-height: 1.1;
}

h1 {
  color: var(--color-title);
  font-size: 3em;

  justify-self: center;
  margin-bottom: 1rem;

  padding-bottom: 10px;
  border-bottom: 5px dotted;
}

.subtitle {
  color: var(--color-subtitle);

  font-size: 1.8em;
  font-style: italic;
  margin-top: 1rem;
}

h2 {
  font-size: 1.9em;
}

strong {
  font-family: "Libertinus Serif", sans-serif;
  font-style: italic;
  font-weight: normal;
  color: var(--color-accent);
  font-size: 1.2em;
}

.cols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  &.cascade {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0px 60px !important;

    :nth-child(3n+1) { --n: 0 }
    :nth-child(3n+2) { --n: 1 }
    :nth-child(3n+3) { --n: 2 }

    align-items: normal;
    div {
      padding-top: calc(40px * var(--n, 0));
    }
    }

  @media (max-width: 900px) {
    &.cascade {
      grid-template-columns: repeat(2, 1fr);

      :nth-child(2n+1) { --n: 0; }
      :nth-child(2n+2) { --n: 1; }
      :nth-child(3n+3) { --n: 0; }
    }
  }

  @media (max-width: 600px) {
    &.cascade {
      grid-template-columns: repeat(1, 1fr);

      :nth-child(2n+1) { --n: 0; }
      :nth-child(2n+2) { --n: 0; }
      :nth-child(3n+3) { --n: 0; }
    }
  }
}

.cols > div {
  flex: 1;
}

.blob {
  text-align: center;
  height: fit-content;
  width: fit-content;

  padding: 10px 10px;
  max-width: 400px;
  background-color: var(--color-pop);
  color: var(--color-pop-fg);
}

.funny-links {
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: auto auto;
  gap: 20px;
  justify-content: center;

  :nth-child(2) {
    margin-left: 20px;
  }
  :nth-child(3) {
    margin-left: 80px;
  }
  :nth-child(4) {
    margin-left: 20px;
  }
}
.funny-links a {
  font-size: 1.2em;
  background-color: var(--color-flink);
  padding: 45px 50px;

  color: var(--color-flink-fg);
  text-decoration: none;
}

.pop {
  padding: 50px 70px;
  margin-top: 0px;
  margin-bottom: -10px;
  background-color: var(--color-pop);
  color: var(--color-pop-fg);
}

.shifted {
  max-width: 600px;
  margin-left: var(--shift, 40px);
}

img {
  border-radius: 5px;
}

.wrap.left {
  float: left;
  margin-right: 30px;
  margin-bottom: 30px;
}

.wrap.right {
  float: right;
  margin-left: 30px;
  margin-bottom: 30px;
}

img.tiny {
  max-width: 200px;
  height: auto;

  &.avatar {
    object-fit: cover;
    border-radius: 100px;
    width: 200px;
    height: 200px;
  }
}
img.smaller {
  max-width: 300px;
  height: auto;
}
img.small {
  max-width: 400px;
  height: auto;
}
img.medium{
  max-width: 600px;
  height: auto;
}

@media(max-width: 400px) {
  img.tiny.wrap {
    width: 100%;
    max-width: 100%;
    max-height: none !important
  }
}
@media(max-width: 500px) {
  img.smaller.wrap {
    width: 100%;
    max-width: 100%;
    max-height: none !important
  }
}
@media(max-width: 600px) {
  img.small.wrap {
    width: 100%;
    max-width: 100%;
    max-height: none !important
  }
}
@media(max-width: 800px) {
  img.medium.wrap {
    width: 100%;
    max-width: 100%;
    max-height: none !important
  }
}

.quote {
  font-size: 0.9em;
  max-width: 500px;

  > blockquote {
    padding: 60px 80px;
    margin: auto
  }

  .attribution {
    text-align: right
  }
}


ul {
  padding-left: 0px;
  margin: 0px;
}
ul li {
  display: block;
}

ul.cascade {
  li {
    padding-left: calc(40px * var(--n, 0));
    margin: 10px 0;
  }
  
  :nth-child(1) { --n: 0 }
  :nth-child(2) { --n: 1 }
  :nth-child(3) { --n: 2 }
  :nth-child(4) { --n: 3 }
  :nth-child(5) { --n: 4 }
  :nth-child(6) { --n: 5 }
}

hr {
  margin: 40px auto;
  max-width: 200px;
  border-color: var(--color-accent)
}


.pops {
  margin: auto;
}

.pops.triangle {
  max-width: 800px;
  display: flex;
  flex-wrap: wrap;
  gap: 0px;
  align-items: center;

  > div {
    flex: 1 1;
    min-width: 250px;
  }

  :first-child {
    margin-right: -20px;
  }
  > div :first-child {
    margin-bottom: 10px;
  }
}

.pops.row {
  max-width: 900px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;

  > .blob {
    flex: 1 1;
    min-width: 150px;
  }
}

.pops.stairs {
  max-width: 1000px;
  :first-child {
    margin-left: auto;
  }
  :nth-child(2) {
    margin-left: auto;
    margin-right: auto;
  }
}

.pops.pyramid {
  max-width: 800px;

  > div {
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;

    > .blob {
      flex: 1 1;
      min-width: 150px;
    }
  }
  .pop {
    max-width: 200px;
  }
}

form p {
  max-width: min(100%, 800px);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;

  label {
    margin-right: 30px;
  }
  
  input, textarea, select, button {
    max-width: 100%;
    vertical-align: middle;
    background: transparent;
    color: var(--color-accent);
    border: 3px solid var(--color-accent);
    border-radius: 30px;
    padding: 10px;
    font: inherit;
    appearance: none;

    &:active, &:focus-visible {
      outline: 2px solid var(--color-accent);
    }
  }

  @media(max-width: 800px) {
    input, textarea, select, button {
      display: block;
    }
  }

  select {
    text-align: center
  }
}

#submitted-msg {
  margin-top: 40px;
  display: none;
  justify-self: center;
  padding: 30px 40px;

  font-size: 1.5em;
  background-color: var(--color-accent);
  border: 3px solid var(--color-accent);

  color: var(--color-bg);
}
