/* -----------------------------------
  Phix Stylesheet

  Author:  Phix
----------------------------------- */

/* -----------------------------------
    VARIABLES
----------------------------------- */

:root {
  --bg-primary: #191b29;
  --code-bg: rgba(255, 255, 255, 0.03);

  --surface-primary: #222436;
  --surface-secondary: #1e2030;

  --text-primary: #f5f5f5;
  --text-secondary: #c9c9d4;

  --accent-primary: #7c8cff;
  --accent-secondary: #db5c80;
  /* --accent-highlight: #d992a6; */

  --border-subtle: rgba(140, 142, 178, 0.15);
  --border-medium: rgba(140, 142, 178, 0.22);
  --border-strong: rgba(140, 142, 178, 0.3);
  --border-accessible: rgba(255, 255, 255, 0.34);

  /* Utilities */
  /* Focus ring for keyboard navigation */
  --focus-ring: 0 0 0 3px rgba(124, 140, 255, 0.4);
}

/* -----------------------------------
    BASE / ELEMENTS
----------------------------------- */

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

/* Gud for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir,
    "Nimbus Sans L", Roboto, "Noto Sans", "Segoe UI", Arial, Helvetica,
    "Helvetica Neue", sans-serif;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  gap: 50px;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1.15rem;
  line-height: 1.5;
}

body::after {
  content: "";
  background-image: url("../static/img/bg.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0.7;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  position: fixed;
  z-index: -1;
}

a {
  transition: color 0.2s ease-out, filter 0.2s ease;
}

a,
a:visited {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  filter: brightness(1.25);
  /* text-decoration: inherit; */
}

strong {
  font-weight: 700;
}

small {
  font-size: 0.875rem;
}

code,
pre {
  -moz-osx-font-smoothing: auto;
  -webkit-font-smoothing: auto;
  font-family: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
}

pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem 1.5rem;
  background-color: var(--code-bg);
  color: var(--text-secondary);
  font-size: 0.875rem;
  word-wrap: normal;
  white-space: pre;
}

pre code {
  background-color: transparent;
  color: currentColor;
  font-size: 1rem;
}

code {
  border: 1px solid var(--border-medium);
  background-color: var(--surface-primary);
  padding: 0.25em 0.5em 0.25em;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: normal;
}

/* -----------------------------------
    PAGE HEADER
----------------------------------- */

.page-header {
  border-bottom: 1px solid var(--accent-primary);
  /* background-color: var(--surface-primary); */
  display: flex;
  flex-direction: row;
  align-content: start;
  justify-content: start;
  align-items: center;
  justify-items: center;
  gap: 20px;
  width: 800px;
  height: 48px;
  margin: 10px auto 0 auto;
}

.page-header h1 {
  flex-grow: 1;
  padding: 0 5px;
  font-size: 1.5rem;
  font-style: italic;
  line-height: 0;
}

.page-header a {
  color: var(--text-secondary);
  transition: unset;
}

.page-header a:hover {
  filter: unset;
}

.navbar {
  display: flex;
  flex-direction: row;
  gap: 10px;
  /* font-size: 1rem; */
}

.navbar a {
  border: 1px solid transparent;
  font-weight: 500;
  /* TODO To decide on gap */
  /* padding: 5px 20px; */
  padding: 5px 15px;
  transition: all 0.2s ease;
}

.navbar a,
.navbar a:visited {
  color: var(--text-secondary);
}

.navbar a:hover {
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  /* TODO Make this darker */
  background-color: var(--accent-primary);
  color: #000000;
}

/* -----------------------------------
    CONTENT
----------------------------------- */

.content {
  display: flex;
  flex-direction: column;
  /* gap: 50px 24px; */
  gap: 20px;
  /* Pushes footer to bottom of page even if the page doesn't
   * have enough content to fill the viewport height. */
  flex-grow: 1;
  min-width: 768px;
  /* width: 1280px; */
  width: 800px;
  margin: 0 auto;
}

/* TODO More breakpoints, width of content 1280px at least */
@media screen and (max-width: 768px) {
  .content {
    width: 768px;
  }
}

.content section,
.content article {
  border: 1px solid var(--accent-primary);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content section {
  padding: 20px 20px;
}

.content section h2 {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 5px;
}

.content article > header {
  border-bottom: 1px solid var(--border-strong);
  background-color: var(--accent-primary);
}

.content article h2 {
  padding: 2.5px 20px;
  color: #000000;
  font-size: 1.3rem;
}

.content article > .article-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px 20px 20px 20px;
}

.content h2 {
  font-size: 1.75rem;
}

.content h3 {
  font-size: 1.35rem;
}

.content p {
  line-height: 1.5;
}

.content ul {
  list-style: none;
}

.content li {
  padding-left: 16px;
}

.content ul > ul > li {
  padding-left: 32px;
}

.content li::before {
  content: "-";
  padding-right: 8px;
}

/* .content > section > div > img { */
.content img {
  border: 1px solid var(--border-subtle);
  display: block;
  max-width: 100%;
  height: auto;
  /* aspect-ratio: 1/1; */
  /* Don't scale up image to fill container */
  /* object-fit: none; */
}

.content hr {
  display: block;
  border: none;
  background-color: var(--border-subtle);
  height: 2px;
  margin: 10px 0;
}

/* -----------------------------------
    PAGE FOOTER
----------------------------------- */

.page-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-items: center;
  align-content: flex-end;
  justify-content: flex-end;
  gap: 32px;
  /* border-top: 1px solid var(--border-subtle); */
  border-top: 1px solid var(--accent-primary);
  width: 800px;
  height: 42px;
  padding: 0 2px;
  margin: 25px auto 10px auto;
}

/* TODO Move right or center */
.page-footer p {
  padding: 10px 0;
  color: var(--text-secondary);
}
