/* Variables */
:root {
  --fg-clr: #1f1f1f;
  --bg-clr: #edf6db;

  --article-clr: #fefae0;
  --article-lighter-clr: #fcfaeb;

  --card-clr: #f7f3d9;

  --border-1: #c6ceb4;
  --border-2: #e0dcc3;

  /* Colors */
  --primary-1: #8b932c;
  --secondary-1: #b99470;
  --tertiary-1: #e7cccc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 1rem;
  background-color: var(--bg-clr);
  background-image: url("./public/greenbg.png");
  font-family: Lato, Avenir, Montserrat, Corbel, "URW Gothic", source-sans-pro, sans-serif;
  color: var(--fg-clr);
  display: grid;
  grid-template-rows: 1fr auto;
  grid-template-columns: minmax(0, 1fr); /* Evil grid bug */
  row-gap: 1rem;
  line-height: 1.5;
}

/* Fix scrollbars moving over the body if possible */
@media (width > 800px) {
  :root {
    scrollbar-gutter: stable both-edges;
  }
}

::selection {
  background-color: rgb(from var(--tertiary-1) r g b / 90%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Noto Serif", Rockwell, "Rockwell Nova", "Roboto Slab", "DejaVu Serif", "Sitka Small", serif;
  text-decoration: underline 0.05em solid var(--secondary-1);
  text-underline-offset: 0.125em;
  margin-block: 1.5rem 1rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5em;
  text-decoration-style: wavy;
}

h2 {
  font-size: 1.75rem;
  text-decoration-line: none;
  border-bottom: 3px double;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

hr {
  border-width: 2px 0 0;
  border-style: solid;
  margin-inline: 1ch;
}

a {
  color: var(--primary-1);
  text-decoration-color: rgb(from var(--primary-1) r g b / 25%);
  transition: text-decoration-color 70ms ease;

  &:hover {
    text-decoration-color: var(--primary-1);
  }
}

ul {
  padding-inline-start: 2rem;
}

img {
  display: block;
  margin: 0 auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: cover;
}

/* Layout */

main {
  min-height: 60vh;
  min-height: 60lvh;
  padding: 1.25rem 1rem;
  border-radius: 8px;
  background-color: var(--article-clr);
  background-image: linear-gradient(to bottom, rgb(from var(--article-lighter-clr) r g b / 80%), transparent 300px);
  border: 2px solid var(--border-1);
  box-shadow: 0 4px 4px rgb(from var(--primary-1) r g b / 25%);
}

body > footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  column-gap: 1rem;
}

main > article {
  display: grid;
  grid-template-rows: 1fr auto;
  padding-bottom: 0.5rem;

  section,
  aside {
    & > :first-child {
      margin-top: 0;
    }
    & > :last-child {
      margin-bottom: 0;
    }
  }
}

nav ul li {
  list-style: none url("./public/flan.gif");
  line-height: 1.75;
}

aside nav ul {
  margin-top: 0;
  margin-bottom: 0;
}

/* Specific Styles */

.container {
  max-width: 960px;
  width: 100%;
  margin-inline: auto;
}

.sidebar-split {
  display: grid;
  gap: 1rem;

  & aside {
    padding-bottom: 1.25rem;
    border-bottom: 2px dotted var(--border-1);
  }
}

.card {
  padding: 0.5rem;
  background: var(--card-clr);
  border: 1px solid var(--border-2);
  border-radius: 8px;

  & > :first-child {
    margin-top: 0;
  }
  & > :last-child {
    margin-bottom: 0;
  }

  &.center {
    width: fit-content;
    max-width: 85%;
    margin-inline: auto;
  }

  &.outline {
    background: unset;
    border: 1px dashed var(--border-1);
  }
}

.button-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
}

.clearfix {
  clear: both;
}

/* Desktop only styles */
@media (width > 600px) {
  .sidebar-split {
    grid-template-columns: 15ch 1fr;

    & aside {
      padding-top: 0.5rem;
      border-bottom: 0;
      border-right: 2px dotted var(--border-2);
    }
  }
  .float-right {
    float: right;
    margin-top: 0.5em;
    margin-left: 1.5ch;
    max-width: 50%;
  }
}

/* Fun */
.lsd {
  animation: lsd 1s linear infinite;
  color: var(--lsd);
  text-shadow: var(--lsd) 1px 0 10px;
}

@keyframes lsd {
  0% {
    --lsd: #829f53;
  }
  33% {
    --lsd: #a581c7;
  }
  66% {
    --lsd: #1ca7ab;
  }
  100% {
    --lsd: #829f53;
  }
}

/* Give type for interpolation */
@property --lsd {
  syntax: "<color>";
  inherits: false;
  initial-value: #000;
}
