/* variables */

:root {
  --text-color: #191970;
  --accent: #4682b4;
  --background: #f0f8ff;
  --surface: #ffffff;

  --opacity-subtle: 0.35;

  --font-family: 'Courier New', Courier, monospace;

  --xs: 4px;
  --sm: 8px;
  --md: 16px;
  --lg: 32px;
  --xl: 48px;

  --main-width: 900px;
  --reading-width: 65ch;

  --font-weight-bold: 700;
  --line-height-h: 1;
  --line-height-p: 1.6;

  --border: 1px solid var(--text-color);
  --box-shadow: 3px 3px 3px var(--accent), -3px -3px 3px var(--accent);
  --border-radius: 3px;
}

/* dark mode */
.dark {
  --text-color: #e6e6fa;
  --accent: #87cefa;
  --background: #0b0c10;
  --surface: #1f2833;

  --border: 1px solid var(--text-color);
  --box-shadow: 3px 3px 3px var(--accent), -3px -3px 3px var(--accent);
}

/* global */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: var(--line-height-p);
  color: var(--text-color);

  cursor: default;
  scroll-behavior: smooth;
  user-select: text;

  overflow-x: hidden;
  overflow-y: scroll;
}

body {
  background-color: var(--background);
}

/* extra */

::selection {
  color: var(--surface);
  background: var(--text-color);
}

::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

/* global wrapper */

main {
  min-height: 100vh;
}

/* header and footer */

.site-header,
.h-nav,
.site-footer {
  display: flex;
  flex-direction: row;
  gap: var(--md);
  white-space: nowrap;
}

.site-header {
  justify-content: space-between;
  align-items: center;

  background-color: var(--surface);
  border-bottom: solid var(--background);

  position: sticky;
  top: 0;
  z-index: 100;
}

.site-footer {
  justify-content: center;
}

/* header individual items */

.h-nav {
  align-items: center;
}

#theme-toggle {
  border: none;
  background-color: transparent;
  font-size: 1.2rem;
  color: var(--text-color);
}

#theme-toggle:hover {
  text-shadow: var(--box-shadow);
}

/* blocks */

.h-feed {
  display: flex;
  flex-direction: column;
  gap: var(--md);
}

.h-entry {
  background-color: var(--surface);
  padding: var(--md);
}

.h-feed .h-entry {
  cursor: pointer;
}

section {
  margin: var(--md) 0;
}

/* typography */

h1,
h2,
h3 {
  margin: 0;
  padding: 0;
  line-height: var(--line-height-h);
}

a {
  color: var(--text-color);
}

a:hover {
  color: var(--accent);
}

.u-url {
  color: var(--text-color);
  text-decoration: none;
}

ol {
  margin-left: var(--lg);
}

/* img and iframe */

img {
  width: 100%;
  height: auto;
}

iframe {
  border: none;
}

/* input */

button, input[type="text"] {
  padding: var(--sm) var(--md);
  margin: var(--sm);
  background-color: var(--accent);
  border: var(--border);
}

button:hover, input[type="text"] {
  background-color: var(--surface);
}

/* util */

.subtle {
  opacity: var(--opacity-subtle);
}

/* misc */

.sub-meta {
  opacity: var(--opacity-subtle);
}

.p-category::before {
  content: "#";
}

.breadcrumbs {
  opacity: var(--opacity-subtle);
}

.reading-width {
  max-width: var(--reading-width);
  margin: auto;
}

.flex-feed {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: space-between;
}

.h-feed .flex-card {
  width: fit-content;
  padding: var(--xl);
  margin: 0;
  cursor: default;
}

/* homepage */

.homepage-flex {
  display: flex;
}

/* weiqi */

.goban {
  width: 300px;
  display: block;
  margin: auto;
}

.slide {
  height: 400px;
  padding: var(--md);
}

.slideshow nav {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.slideshow .slide {
  display: none;
}

.slideshow .slide.current-slide {
  display: block;
}

/* ----------------------------------------------- */

@media (min-width: 900px) {
  .page {
    max-width: var(--main-width);
    margin: 0 auto;
  }

  main {
    padding: var(--md) 0;
  }

  .site-header {
    padding: var(--md);
  }

  .homepage-flex {
    flex-direction: row;
  }
}

/* ----------------------------------------------- */

@media (max-width: 600px) {
  .main {
    max-width: 100vw;
  }

  .site-header {
    overflow-x: scroll;
    white-space: nowrap;
    padding: var(--sm) 0;
  }

  .site-header .h-nav {
    flex-wrap: nowrap;
    gap: var(--sm);
  }

  .site-header a {
    font-size: 0.9rem;
  }

  .flex-card {
    min-width: 100%;
  }

  .homepage-flex {
    flex-direction: column;
  }
}