/* ============================================================
   VARIABLES & COLOR SCHEME
   ============================================================ */
:root {
  --accent: rgb(212, 86, 97);
  --max-width: 720px;
  --bg: #ffffff;
  --bg-code: #f4f4f4;
  --text: rgb(51, 51, 51);
  --text-muted: rgb(110, 110, 110);
  --border: rgb(220, 220, 220);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: rgb(30, 30, 30);
    --bg-code: rgb(45, 45, 45);
    --text: rgb(240, 240, 240);
    --text-muted: rgb(160, 160, 160);
    --border: rgb(60, 60, 60);
  }
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
}

.markdown-goes-here img {
  border-radius: 12px;
}

/* ============================================================
   BASE
   ============================================================ */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 1rem 0 2rem;
}

.markdown-goes-here > :first-child {
  margin-top: 0.5em;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
  padding: 1rem 0;
  font-size: 1.1rem;
  font-weight: 400;
}

nav a {
  color: var(--accent);
  text-decoration: underline;
  margin: 0 0.9em;
}

.nav-sep {
  color: var(--text-muted);
}

.nav-home {
  text-decoration: none;
  margin-left: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 1rem 0;
  font-size: 1.1rem;
  font-weight: 400;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.2;
  margin-top: 2em;
  margin-bottom: 0.75rem;
}

h1 { font-size: 1.75em; margin-top: 1.5em; }
.home-page h1 { font-size: 2.49em; }
h2 { font-size: 2.32em; margin-top: 2em; line-height: 1.25; }
h3 { font-size: 1.72em; margin-top: 1.75em; line-height: 1.3; }
h4 { font-size: 1.3em; font-weight: 600; }
h5, h6 { font-size: 1.1em; font-weight: 600; }

p {
  margin-top: 0;
  margin-bottom: 1.5em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  text-decoration: none;
}

/* ============================================================
   LISTS
   ============================================================ */
ul, ol {
  margin-top: 0;
  margin-bottom: 1.5em;
  padding-left: 0;
  list-style: none;
}

ul li {
  padding-left: 1.5em;
  position: relative;
  margin-bottom: 0.5em;
  line-height: 1.7;
}

ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

ol {
  counter-reset: item;
}

ol li {
  display: block;
  padding-left: 1.5em;
  position: relative;
  margin-bottom: 0.5em;
  line-height: 1.7;
}

ol li::before {
  content: counter(item) ".";
  counter-increment: item;
  color: var(--accent);
  position: absolute;
  left: 0;
}

ul ul, ol ol, ul ol, ol ul {
  margin-top: 0.5em;
  margin-bottom: 0;
}

/* ============================================================
   BLOCKQUOTE, CODE, PRE
   ============================================================ */
blockquote {
  margin: 0 0 1.5em;
  padding: 0 1rem;
  border-left: 4px solid var(--border);
  color: var(--text-muted);
}

code, pre, kbd {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9em;
}

code {
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--bg-code);
  padding: 1em;
  border-radius: 4px;
  overflow: auto;
  margin-bottom: 1.5em;
  line-height: 1.45;
}

pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 1em;
}

/* ============================================================
   HORIZONTAL RULE
   ============================================================ */
hr {
  border: none;
  border-top: 2px solid var(--text);
  margin: 2rem 0;
}

/* ============================================================
   TABLES
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  display: block;
  overflow-x: auto;
}

th, td {
  padding: 0.5em 0.75em;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  border-bottom-width: 2px;
}

/* ============================================================
   IMAGES & MEDIA
   ============================================================ */
figure {
  margin: 1.5em 0;
}

figcaption {
  font-size: 0.85em;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.4em;
}

iframe {
  max-width: 100%;
}


/* ============================================================
   HOME PAGE
   ============================================================ */
.home-page img {
  max-width: 480px;
}

.home-page h2 {
  margin-top: 1.5em;
}

.home-page ul {
  line-height: 2.2;
}

.home-page a {
  text-decoration: none;
}

/* ============================================================
   BLOG LIST
   ============================================================ */
.post-list h2 {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.4;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}


.post-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 6;
  object-fit: cover;
  margin-bottom: 1em;
}

/* ============================================================
   BLOG POST — del, mark, abbr
   ============================================================ */
del {
  text-decoration: line-through;
}

mark {
  background-color: #ff0;
  color: #000;
}

abbr[title] {
  text-decoration: underline dotted;
}
