:root {
  --thmbox-padding: 0.3rem 0.5rem;
  --thmbox-margin: 0.5rem 0;
  --thmbox-head-gap: 0.25rem;
  --thmbox-head-weight: 600;
}

main {
  grid-column: 1/3;
  grid-row: 2/3;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  padding: 2em 0 2em 4em;
  gap: 2em;
  margin: 0 auto;
  align-items: center;
}

.post-heading {
  text-align: center;
}

.article-header {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: keep-all;
}

article h1,
article h2,
article h3,
article h4,
article h5,
article h6 {
  margin-bottom: unset;
}

#aside-nav {
  display: none;
}

#aside-nav-heading {
  display: none;
}

#aside-search {
  display: none;
}

#aside-search-heading {
  display: none;
}

.nav-right {
  display: flex;
  justify-content: right;
  grid-row: 1/2;
  grid-column: 5/6;
}

.search-form {
  display: flex;
  align-items: center;
  border: 1px solid var(--accent);
  border-radius: 22px;
  background-color: var(--bg-alt);
  overflow: hidden;
  padding: 0.25rem 0.25rem 0.25rem 0.5rem;
  width: 80%;
}

.search-input {
  flex: 1;
  background-color: transparent;
  color: var(--fg);
  border: none;
  padding: 0.45rem 0.8rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  width: 80%;
}

.search-input::placeholder {
  color: var(--fg);
  opacity: 0.4;
}

.search-input:focus {
  outline: none;
}

.search-btn {
  background: none;
  border: none;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-logo {
  width: 1.2rem;
  height: 1.2rem;
}

#sidebar {
  grid-column: 3/4;
  grid-row: 2/3;
  height: fit-content;
  margin-top: 4rem;
  width: 64%;
  min-width: 350px;
  max-width: 420px;
  background-color: var(--bg-alt);
  padding: 0 1rem 1.5rem;
  border-top: 4px solid var(--accent);
  border-bottom: 4px solid var(--accent);
  border-radius: 6px;
}

article {
  background-color: var(--bg-alt);
  padding: 2rem 3rem;
  display: flex;
  width: 100%;
  min-width: 800px;
  max-width: 1100px;
  gap: 1.3em;
  flex-direction: column;
  border-left: 8px solid var(--accent);
  border-right: 8px solid var(--accent);
  border-radius: 8px;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.post-content {
  position: relative;
  min-height: 100px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.3em;
  overflow: hidden;
  margin-bottom: 2rem;
}

.post-content::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10rem;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bg) 0%, transparent),
    var(--bg-alt)
  );
  pointer-events: none;
}

article:hover {
  background-color: color-mix(in srgb, var(--accent) 8%, var(--bg-alt));
  transform: translateY(-4px);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent2) 60%, transparent);
}

article:hover .post-content::before {
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--dark-black) 0%, transparent),
    color-mix(in srgb, var(--accent) 8%, var(--bg-alt))
  );
}

.post-date {
  margin-bottom: 3rem;
}

.read-more-link {
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  background-color: var(--storm);
  color: var(--white);
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 6px;
  transition:
    transform 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}

.read-more-link:hover {
  transform: scale(1.03);
  color: var(--fg);
  box-shadow: 0 0 12px var(--dark-black);
}

main h1 {
  font-size: 2.7em;
}

article h2 a {
  font-size: 1.5em;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition:
    color 0.25s ease,
    text-decoration-color 0.25s ease;
}

article h3 {
  font-size: 2rem;
}

article h4 {
  font-size: 1.5rem;
}

article h5 {
  font-size: 1.25rem;
}

aside h3 {
  margin-top: 1.5rem;
  color: var(--yellow);
}

aside ul {
  list-style: none;
  padding-left: 0;
  padding-right: 0.5rem;
  display: flex;
  flex-flow: wrap column;
  gap: 0.5rem;
}

aside ul h4 {
  margin-bottom: 0;
}

aside li {
  margin-bottom: 0.5rem;
}

aside li a {
  color: var(--accent);
  text-decoration: none;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag-list li a {
  background-color: var(--bg);
  border: 1px solid var(--accent2);
  border-radius: 4px;
  padding: 0.5rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--accent2);
  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

article h2 a:hover {
  color: var(--accent2);
  text-decoration-color: var(--accent2);
}

.tag-list li a:hover {
  background-color: var(--accent2);
  text-decoration: none;
  color: var(--bg);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent2) 30%, transparent);
}

.sidebar-box {
  padding: 15px;
  border-left: 4px solid var(--accent2);
  border-right: 4px solid var(--accent2);
  border-radius: 4px;
  background-color: var(--bg-alt);
}

.sidebar-suggest-list {
  display: flex;
  flex-direction: column;
}

.sidebar-tag-list {
  display: flex;
  flex-flow: wrap row;
}

.post-para-href {
  text-decoration: none;
  color: unset;
}

.post-para-href:hover {
  color: unset;
}

.aside-post-link {
  position: relative;
  text-decoration: none;
}

/* Set up math boxes for math posts */

.claim-box {
  display: block;
  border-left: 4px solid #4fa27a;
  padding: var(--thmbox-padding);
  background-color: #1f2b25;
  margin: var(--thmbox-margin);
}

.claim-box::before {
  content: var(--title, "Claim") " — ";
  font-weight: var(--thmbox-head-weight);
  color: #9ece6a;
}

.theorem-box {
  display: block;
  border-left: 4px solid #7aa2f7;
  padding: var(--thmbox-padding);
  background-color: #1e2437;
  margin: var(--thmbox-margin);
}

.theorem-box::before {
  content: var(--title, "Theorem") ". ";
  display: block;
  font-weight: var(--thmbox-head-weight);
  margin-bottom: var(--thmbox-head-gap);
  color: #7aa2f7;
}

.proposition-box {
  display: block;
  border-left: 4px solid #bb9af7;
  padding: var(--thmbox-padding);
  background-color: #26233a;
  margin: var(--thmbox-margin);
}

.proposition-box::before {
  content: var(--title, "Proposition") ". ";
  display: block;
  font-weight: var(--thmbox-head-weight);
  margin-bottom: var(--thmbox-head-gap);
  color: #bb9af7;
}

.definition-box {
  display: block;
  border-left: 4px solid #f7768e;
  padding: var(--thmbox-padding);
  background-color: #2a1f22;
  margin: var(--thmbox-margin);
}

.definition-box::before {
  content: var(--title, "Definition") ". ";
  display: block;
  font-weight: var(--thmbox-head-weight);
  margin-bottom: var(--thmbox-head-gap);
  color: #f7768e;
}

.example-box {
  background-color: #4db6ac0e;
  border: 1px solid #4db6ac;
  padding: var(--thmbox-padding);
  margin: var(--thmbox-margin);
}

.example-box::before {
  content: var(--title, "Example") ". ";
  display: block;
  font-weight: var(--thmbox-head-weight);
  margin-bottom: var(--thmbox-head-gap);
  color: #4db6ac;
}

.problem-box {
  display: block;
  padding: var(--thmbox-padding);
  margin: var(--thmbox-margin);
  border-left: 3px solid #7aa2f7;
  background-color: #7aa2f714;
  color: #c0caf5;
}

.problem-box::before {
  content: var(--title, "Problem") " " var(--problem-number) ". ";
  font-weight: var(--thmbox-head-weight);
  color: #7aa2f7;
  margin-bottom: var(--thmbox-head-gap);
}

.proof-env::before {
  content: var(--title, "Proof") ". ";
  font-style: italic;
}

.proof-env::after {
  content: "□";
  float: right;
}

.soln-env::before {
  content: var(--title, "Solution") ". ";
  font-style: italic;
}

.soln-env::after {
  content: "■";
  float: right;
}
