/* ===========================================
   boringSQL - Pico CSS Customizations
   Based on Pico CSS with One Light/Dark Pro colors
   =========================================== */

/* ---------------------------------------------
   CSS Custom Properties (Design Tokens)
   --------------------------------------------- */
:root {
  /* Light mode colors - One Light Pro inspired */
  --color-theme: #fafafa;
  --color-entry: #f0f0f1;
  --color-primary: #383a42;
  --color-secondary: #5c5f66;
  --color-tertiary: #e5e5e6;
  --color-border: #d3d3d3;
  --color-code-bg: #eaeaeb;

  /* Accent color */
  --color-accent: #7c3aed;
  --color-accent-hover: #6d28d9;

  /* Code - One Dark Pro */
  --color-hljs-bg: #1e2127;
  --color-code-text: #abb2bf;

  /* Layout */
  --gap: 24px;
  --content-gap: 20px;
  --nav-width: 1024px;
  --main-width: 720px;
  --header-height: 60px;
  --footer-height: 60px;
  --radius: 8px;

  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-size-base: 20px;

  /* Pico CSS overrides */
  --pico-font-family: var(--font-sans);
  --pico-font-size: var(--font-size-base);
  --pico-line-height: 1.6;
  --pico-background-color: var(--color-theme);
  --pico-color: var(--color-primary);
  --pico-muted-color: var(--color-secondary);
  --pico-primary: var(--color-accent);
  --pico-primary-hover: var(--color-accent-hover);
  --pico-secondary: var(--color-secondary);
  --pico-card-background-color: var(--color-entry);
  --pico-card-border-color: var(--color-border);
  --pico-border-radius: var(--radius);
  --pico-code-background-color: var(--color-code-bg);
  --pico-code-color: var(--color-primary);
  --pico-block-spacing-vertical: 1.5rem;
  --pico-typography-spacing-vertical: 1.5rem;
}

/* Dark mode colors */
[data-theme="dark"],
.dark {
  --color-theme: #282c34;
  --color-entry: #21252b;
  --color-primary: #abb2bf;
  --color-secondary: #8b9198;
  --color-tertiary: #3e4451;
  --color-border: #3e4451;
  --color-code-bg: #21252b;

  --pico-background-color: var(--color-theme);
  --pico-color: var(--color-primary);
  --pico-muted-color: var(--color-secondary);
  --pico-card-background-color: var(--color-entry);
  --pico-card-border-color: var(--color-border);
  --pico-code-background-color: var(--color-code-bg);
  --pico-code-color: var(--color-primary);
}

@media screen and (max-width: 768px) {
  :root {
    --gap: 14px;
  }
}

/* ---------------------------------------------
   Base Styles & Pico Overrides
   --------------------------------------------- */
html {
  -webkit-tap-highlight-color: transparent;
  overflow-y: scroll;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  word-break: break-word;
  background-color: var(--color-theme);
  color: var(--color-primary);
  margin: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1, h2 {
  font-weight: 800;
}

ul, ol {
  padding-left: 1.5em;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

code {
  direction: ltr;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  overflow-x: auto;
  word-break: keep-all;
}

/* ---------------------------------------------
   Layout
   --------------------------------------------- */
.container {
  max-width: var(--nav-width);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.main {
  position: relative;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  max-width: calc(var(--main-width) + var(--gap) * 2);
  margin: 0 auto;
  padding: var(--gap);
}

/* ---------------------------------------------
   Header & Navigation
   --------------------------------------------- */
.header {
  background-color: var(--color-theme);
}

.header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  max-width: var(--nav-width);
  margin: 0 auto;
  padding: 0 var(--gap);
  line-height: var(--header-height);
}

.header .logo-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.header .logo {
  display: block;
  width: 166px;
  height: 40px;
  margin-top: 10px;
  background-image: url('/boringSQL-logo-light.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.dark .header .logo {
  background-image: url('/boringSQL-logo-dark.png');
}

/* Theme toggle */
#theme-toggle {
  font-size: 26px;
  margin: auto 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  padding: 0;
}

.dark #moon {
  display: none;
}

body:not(.dark) #sun {
  display: none;
}

/* Navigation menu */
.nav-menu {
  display: flex;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  font-size: 1rem;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-menu a:hover {
  color: var(--color-accent);
}

.nav-menu .active {
  font-weight: 500;
  border-bottom: 2px solid currentColor;
}

/* ---------------------------------------------
   Footer
   --------------------------------------------- */
.footer {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem var(--gap);
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--color-secondary);
}

.footer a {
  color: var(--color-secondary);
  border-bottom: 1px solid currentColor;
}

.footer a:hover {
  color: var(--color-primary);
}

/* Scroll to top button */
#top-link {
  position: fixed;
  z-index: 50;
  bottom: 3.5rem;
  right: 2rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.75rem;
  border-radius: 50%;
  background-color: var(--color-tertiary);
  color: var(--color-secondary);
  font-size: 0.75rem;
  visibility: hidden;
  opacity: 0;
  transition: all 0.5s;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#top-link:hover {
  color: var(--color-primary);
}

/* ---------------------------------------------
   Page Headers & Breadcrumbs
   --------------------------------------------- */
.page-header,
.post-header {
  margin: 24px auto var(--content-gap);
}

.post-title {
  margin-bottom: 2px;
  font-size: 2.625rem;
  font-weight: 800;
}

.post-meta,
.breadcrumbs {
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  color: var(--color-secondary);
}

.breadcrumbs a {
  font-size: 1rem;
  color: var(--color-secondary);
}

.breadcrumbs a:hover {
  color: var(--color-accent);
}

/* ---------------------------------------------
   Article Cards (Home & Section pages)
   --------------------------------------------- */
.post-entry {
  position: relative;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background-color: var(--color-entry);
  transition: transform 0.2s;
}

.post-entry:active {
  transform: scale(0.96);
}

.post-entry .entry-header h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.post-entry .entry-content {
  margin: 0.5rem 0;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--color-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-entry .entry-content p {
  margin: 0;
}

.post-entry .entry-footer {
  font-size: 0.8125rem;
  color: var(--color-secondary);
}

.post-entry .entry-link {
  position: absolute;
  inset: 0;
}

/* ---------------------------------------------
   Home Info Section
   --------------------------------------------- */
.first-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 240px;
  margin: var(--gap) 0 calc(var(--gap) * 2);
}

.first-entry .entry-header {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.first-entry .entry-header h1 {
  font-size: 2.25rem;
  line-height: 1.3;
  font-weight: 800;
}

.first-entry .entry-content {
  margin: 14px 0;
  font-size: 1rem;
  color: var(--color-secondary);
}

.first-entry .entry-footer {
  font-size: 0.875rem;
}

.home-info .entry-content {
  -webkit-line-clamp: unset;
}

/* Section intro text */
.section-intro {
  margin-bottom: 2rem;
}

/* Social icons */
.social-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.social-icons a {
  display: inline-flex;
  color: var(--color-secondary);
  transition: all 0.2s;
}

.social-icons a:hover {
  color: var(--color-accent);
  transform: translateY(-2px);
}

.social-icons svg {
  width: 1.75rem;
  height: 1.75rem;
}

/* Recent Posts heading */
.section-header {
  margin: 1.5rem auto;
}

.section-header h2 {
  margin: 0;
}

/* View all button */
.view-all-btn {
  display: inline-block;
  padding: 0 1rem;
  font-size: 0.875rem;
  line-height: 2.25rem;
  border-radius: 9999px;
  background-color: var(--color-primary);
  color: var(--color-theme) !important;
  text-decoration: none;
}

.view-all-btn:hover {
  opacity: 0.9;
  color: var(--color-theme) !important;
}

/* ---------------------------------------------
   Tags
   --------------------------------------------- */
.post-tags {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-tags li {
  display: inline-block;
  margin-inline-end: 3px;
  margin-bottom: 5px;
}

.post-tags a {
  display: block;
  padding: 0 14px;
  font-size: 0.875rem;
  line-height: 2.125rem;
  border-radius: var(--radius);
  background-color: var(--color-code-bg);
  color: var(--color-secondary);
  border: 1px solid var(--color-border);
}

.post-tags a:hover {
  background-color: var(--color-border);
  color: var(--color-primary);
}

/* Terms/Tags page */
.terms-tags {
  list-style: none;
  padding: 0;
}

.terms-tags li {
  display: inline-block;
  margin: 10px;
  font-weight: 500;
}

.terms-tags a {
  display: block;
  padding: 3px 10px;
  border-radius: 6px;
  background-color: var(--color-tertiary);
  transition: transform 0.1s;
}

.terms-tags a:active {
  transform: scale(0.96);
}

/* ---------------------------------------------
   Table of Contents
   --------------------------------------------- */
.toc {
  margin: 0 0 40px;
  padding: 1.25em 1.5em;
  border-radius: var(--radius);
  background-color: var(--color-entry);
  border: 1px solid var(--color-border);
}

.toc details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.toc details summary::-webkit-details-marker {
  display: none;
}

.toc details summary::before {
  content: "\25B6"; /* Right-pointing triangle */
  font-size: 0.7em;
  color: var(--color-secondary);
  transition: transform 0.2s ease;
}

.toc details[open] summary::before {
  transform: rotate(90deg);
}

.toc .details {
  font-weight: 600;
  font-size: 1.05em;
  color: var(--color-primary);
}

.toc .inner {
  margin-top: 1em;
  padding: 0;
}

.toc .inner ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: toc-counter;
}

.toc .inner > ul > li {
  counter-increment: toc-counter;
  padding: 0.4em 0;
  border-bottom: 1px solid var(--color-border);
}

.toc .inner > ul > li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.toc .inner > ul > li:first-child {
  padding-top: 0;
}

.toc .inner > ul > li > a::before {
  content: counter(toc-counter) ". ";
  color: var(--color-accent);
  font-weight: 600;
}

.toc li ul {
  margin-top: 0.5em;
  margin-inline-start: 0;
  padding-left: 1.75em;
  border-left: 2px solid var(--color-border);
}

.toc li ul li {
  padding: 0.3em 0;
  font-size: 0.875em;
}

.toc li ul li a::before {
  content: "\2014\0020"; /* em dash + space */
  color: var(--color-tertiary);
}

.toc a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.toc a:hover {
  color: var(--color-accent);
}

.toc summary:focus {
  outline: none;
}

/* ---------------------------------------------
   Prose Content Styling
   --------------------------------------------- */
.post-content {
  line-height: 1.75;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2em;
  margin-bottom: 0.5em;
  font-weight: 800;
}

.post-content h1 { font-size: 2.25em; }
.post-content h2 { font-size: 1.5em; }
.post-content h3 { font-size: 1.25em; }
.post-content h4 { font-size: 1em; }

.post-content p {
  margin: 1.25em 0;
}

.post-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

.post-content a:hover {
  color: var(--color-accent-hover);
}

.post-content strong {
  font-weight: 600;
}

.post-content blockquote {
  border-left: 0.25rem solid var(--color-border);
  padding-left: 1em;
  margin: 1.6em 0;
  color: var(--color-secondary);
  font-style: italic;
}

.post-content ul,
.post-content ol {
  margin: 1.25em 0;
  padding-left: 1.625em;
}

.post-content li {
  margin: 0.5em 0;
}

.post-content hr {
  border: none;
  height: 2px;
  background-color: var(--color-border);
  margin: 3em 0;
}

.post-content img {
  margin: 2em 0;
  border-radius: var(--radius);
}

.post-content figure {
  margin: 2em 0;
}

.post-content figcaption {
  color: var(--color-secondary);
  font-size: 0.875em;
  margin-top: 0.5em;
  text-align: center;
}

/* Tables in content */
.post-content table {
  width: 100%;
  margin: 2em 0;
  font-size: 0.875em;
  border-collapse: collapse;
}

.post-content thead {
  border-bottom: 1px solid var(--color-border);
}

.post-content th {
  padding: 0.5em;
  text-align: left;
  font-weight: 600;
}

.post-content td {
  padding: 0.5em;
  border-bottom: 1px solid var(--color-border);
}

.post-content tbody tr:last-child td {
  border-bottom: none;
}

/* Inline code */
.post-content code {
  font-family: var(--font-mono);
  background-color: var(--color-code-bg);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.8em;
}

/* Code blocks */
.post-content pre {
  background-color: var(--color-hljs-bg) !important;
  border-radius: var(--radius);
  padding: 0;
  margin: 1.5em 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.post-content pre code {
  font-family: var(--font-mono);
  display: block;
  margin: 0;
  padding: 16px 20px;
  overflow-x: auto;
  word-break: normal;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #d5d5d6;
  background-color: var(--color-hljs-bg) !important;
  border: none;
}

.post-content .highlight {
  margin: 1.5em 0;
  border-radius: var(--radius);
  direction: ltr;
  background-color: var(--color-hljs-bg) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.post-content .highlight pre {
  margin: 0;
  box-shadow: none;
}

/* Code block with line numbers */
.post-content pre code > table {
  display: table;
  margin: 10px auto;
  border-radius: var(--radius);
  border-spacing: 0;
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.post-content pre code > table td {
  vertical-align: top;
  padding: 0;
  margin: 0;
  border: 0;
}

.post-content pre code > table td:first-child {
  white-space: pre;
  user-select: none;
  margin: 0;
  padding: 0 1em 0 0;
  color: #7f7f7f;
  text-align: right;
  display: table-cell;
  max-width: 10%;
}

.post-content pre code > table td:nth-child(2) {
  width: 92%;
}

/* Heading anchor links */
.post-content .zola-anchor {
  opacity: 0;
  text-decoration: none;
  margin-left: 0.2em;
  transition: opacity 0.2s;
  position: relative;
  color: transparent;
  display: inline-block;
}

.post-content .zola-anchor::after {
  content: "#";
  font-size: 1.25rem;
  color: var(--color-secondary);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.post-content h1:hover .zola-anchor,
.post-content h2:hover .zola-anchor,
.post-content h3:hover .zola-anchor,
.post-content h4:hover .zola-anchor,
.post-content h5:hover .zola-anchor,
.post-content h6:hover .zola-anchor {
  opacity: 1;
}

.post-content .zola-anchor:hover::after {
  color: var(--color-accent);
}

/* Guide article entries - card style */
.guide-content p:has(> strong:first-child) {
  margin-top: 2em !important;
  margin-bottom: 0 !important;
  padding: 1.25em 1.5em 0.5em;
  background-color: var(--color-entry);
  border-radius: var(--radius) var(--radius) 0 0;
}

.guide-content p:has(> strong:first-child) + p {
  padding: 0.5em 1.5em 1.25em;
  margin-top: 0 !important;
  margin-bottom: 2em !important;
  background-color: var(--color-entry);
  border-radius: 0 0 var(--radius) var(--radius);
}

.post-content p strong a {
  color: var(--color-primary);
  font-size: 1.1em;
}

.post-content p strong a:hover {
  color: var(--color-accent);
}

/* ---------------------------------------------
   SQL Lab Widget
   --------------------------------------------- */
.sql-lab-widget {
  padding: 24px;
  margin: 32px 0;
  border-radius: var(--radius);
  background-color: var(--color-entry);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sql-lab-header h3 {
  margin: 0 0 8px 0;
  font-size: 1.2em;
  color: var(--color-primary);
}

.sql-lab-header p {
  margin: 0 0 16px 0;
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--color-secondary);
}

.sql-lab-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95em;
  color: white !important;
  text-decoration: none !important;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.sql-lab-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
  color: white !important;
}

.sql-lab-button svg {
  transition: transform 0.2s ease;
}

.sql-lab-button:hover svg {
  transform: translate(2px, -2px);
}

.sql-lab-description {
  margin: 16px 0 0 0;
  font-size: 0.85em;
  font-style: italic;
  color: var(--color-secondary);
}

/* ---------------------------------------------
   Events Section
   --------------------------------------------- */
.events-section {
  background-color: var(--color-entry);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 32px 0;
}

.events-header h3 {
  margin: 0 0 8px 0;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--color-primary);
}

.events-header p {
  margin: 0 0 16px 0;
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--color-secondary);
}

.events-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-item {
  display: flex;
  padding: 12px 0;
}

.event-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.event-item:first-child {
  padding-top: 0;
}

.event-date {
  flex-shrink: 0;
  font-size: 0.9em;
  font-weight: 500;
  min-width: 90px;
  margin-right: 16px;
  color: var(--color-secondary);
}

.event-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: color 0.2s ease;
  flex: 1;
  color: var(--color-primary);
}

.event-link:hover {
  color: var(--color-accent);
}

.event-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.event-tag {
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 3px;
  margin-left: 8px;
  font-weight: 400;
  opacity: 0.7;
  color: var(--color-secondary);
  background-color: var(--color-code-bg);
}

.event-location {
  font-size: 0.85em;
  color: var(--color-secondary);
}

.events-footer {
  margin-top: 16px;
  padding-top: 12px;
}

.talks-archive-link {
  font-size: 0.85em;
  text-decoration: none;
  transition: color 0.2s ease;
  color: var(--color-secondary);
}

.talks-archive-link:hover {
  color: var(--color-accent);
}

/* Past talks section */
.past-talks-section .section-description {
  color: var(--color-secondary);
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------
   Pagination (Prev/Next Post Navigation)
   --------------------------------------------- */
.paginav {
  margin: 40px 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.paginav a {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background-color: var(--color-entry);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.paginav a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.paginav .title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
}

.paginav a > span:last-child {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-primary);
  line-height: 1.4;
}

.paginav .prev {
  grid-column: 1;
}

.paginav .next {
  grid-column: 2;
  text-align: right;
}

.paginav .next:only-child {
  grid-column: 2;
}

.paginav .prev:only-child {
  grid-column: 1;
}

@media screen and (max-width: 600px) {
  .paginav {
    grid-template-columns: 1fr;
  }

  .paginav .prev,
  .paginav .next,
  .paginav .next:only-child,
  .paginav .prev:only-child {
    grid-column: 1;
    text-align: left;
  }
}

/* Pagination (page lists) */
.pagination {
  display: flex;
}

.pagination a {
  font-size: 0.8125rem;
  line-height: 2.25rem;
  padding: 0 16px;
  border-radius: 18px;
  color: var(--color-theme);
  background-color: var(--color-primary);
}

.pagination .next {
  margin-inline-start: auto;
}

/* ---------------------------------------------
   Archive Page
   --------------------------------------------- */
.archive-posts {
  width: 100%;
  font-size: 1rem;
}

.archive-year {
  margin-top: 40px;
}

.archive-year:not(:last-of-type) {
  border-bottom: 2px solid var(--color-border);
}

.archive-year-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.archive-month {
  display: flex;
  align-items: flex-start;
  padding: 10px 0;
}

.archive-month-header {
  margin: 25px 0;
  width: 200px;
}

.archive-month:not(:last-of-type) {
  border-bottom: 1px solid var(--color-border);
}

.archive-entry {
  position: relative;
  padding: 5px;
  margin: 10px 0;
}

.archive-entry .entry-link {
  position: absolute;
  inset: 0;
}

.archive-entry-title {
  margin: 5px 0;
  font-weight: 400;
}

.archive-count,
.archive-meta {
  font-size: 0.875rem;
  color: var(--color-secondary);
}

.archive-meta a {
  color: var(--color-secondary);
}

.archive-meta a:hover {
  color: var(--color-accent);
}

/* ---------------------------------------------
   Code Copy Button
   --------------------------------------------- */
.copy-code {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 0 5px;
  font-size: 0.875rem;
  border-radius: var(--radius);
  user-select: none;
  color: rgba(255, 255, 255, 0.8);
  background-color: rgba(78, 78, 78, 0.8);
  cursor: pointer;
  border: none;
}

div.highlight:hover .copy-code,
pre:hover .copy-code {
  display: block;
}

/* ---------------------------------------------
   Post Footer
   --------------------------------------------- */
.post-footer {
  margin-top: 56px;
}

/* ---------------------------------------------
   Not Found Page
   --------------------------------------------- */
.not-found {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80%;
  font-size: 10rem;
  font-weight: 700;
}

/* ---------------------------------------------
   Syntax Highlighting (Dracula Theme)
   --------------------------------------------- */
.bg {
  color: #f8f8f2;
  background-color: #282a36;
}

.chroma {
  color: #f8f8f2;
  background-color: unset !important;
}

.chroma .lntd {
  vertical-align: top;
  padding: 0;
  margin: 0;
  border: 0;
}

.chroma .lntable {
  border-spacing: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.chroma .hl {
  background-color: #474733;
}

.chroma .lnt,
.chroma .ln {
  white-space: pre;
  user-select: none;
  margin-right: 0.4em;
  padding: 0 0.4em;
  color: #7f7f7f;
}

.chroma .line {
  display: flex;
}

.chroma .k,
.chroma .kc,
.chroma .kn,
.chroma .kp,
.chroma .kr {
  color: #ff79c6;
}

.chroma .kd,
.chroma .kt {
  color: #8be9fd;
  font-style: italic;
}

.chroma .na,
.chroma .nc,
.chroma .nf {
  color: #50fa7b;
}

.chroma .nb {
  color: #8be9fd;
  font-style: italic;
}

.chroma .nl,
.chroma .nv,
.chroma .vc,
.chroma .vg,
.chroma .vi {
  color: #8be9fd;
  font-style: italic;
}

.chroma .nt,
.chroma .o,
.chroma .ow {
  color: #ff79c6;
}

.chroma .s,
.chroma .sa,
.chroma .sb,
.chroma .sc,
.chroma .dl,
.chroma .sd,
.chroma .s2,
.chroma .se,
.chroma .sh,
.chroma .si,
.chroma .sx,
.chroma .sr,
.chroma .s1,
.chroma .ss {
  color: #f1fa8c;
}

.chroma .m,
.chroma .mb,
.chroma .mf,
.chroma .mh,
.chroma .mi,
.chroma .il,
.chroma .mo {
  color: #bd93f9;
}

.chroma .c,
.chroma .ch,
.chroma .cm,
.chroma .c1,
.chroma .cs {
  color: #6272a4;
}

.chroma .cp,
.chroma .cpf {
  color: #ff79c6;
}

.chroma .gd {
  color: #f55;
}

.chroma .ge {
  text-decoration: underline;
}

.chroma .gh,
.chroma .gu {
  font-weight: 700;
}

.chroma .gi {
  color: #50fa7b;
  font-weight: 700;
}

.chroma .go {
  color: #44475a;
}

.chroma .gl {
  text-decoration: underline;
}

/* ---------------------------------------------
   Responsive Adjustments
   --------------------------------------------- */
@media screen and (max-width: 768px) {
  .first-entry {
    min-height: 260px;
  }

  .archive-month {
    flex-direction: column;
  }

  .archive-year {
    margin-top: 20px;
  }

  .footer {
    padding: calc((var(--footer-height) - var(--gap) - 10px) / 2) var(--gap);
  }

  .event-item {
    flex-direction: column;
  }

  .event-date {
    min-width: auto;
    margin-right: 0;
    margin-bottom: 4px;
  }

  .post-title {
    font-size: 2rem;
  }
}

@media screen and (max-width: 900px) {
  .list .top-link {
    transform: translateY(-5rem);
  }
}

@media (prefers-reduced-motion) {
  .terms-tags a:active,
  .post-entry:active,
  .top-link {
    transform: none;
  }
}

/* ---------------------------------------------
   Scrollbar Styling
   --------------------------------------------- */
::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-tertiary);
  border: 5px solid var(--color-theme);
  border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-secondary);
}

@media screen and (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 19px;
    height: 11px;
  }
}

.post-content ::-webkit-scrollbar-thumb {
  border: 2px solid var(--color-hljs-bg);
  background-color: #717175;
}

.post-content ::-webkit-scrollbar-thumb:hover {
  background-color: #a3a3a5;
}
