/* Import Geist Mono font */
@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@300;400;500;600&display=swap');

/* Color Variables - Based on Vesper Theme */
:root {
  /* Light Theme (Default) */
  --bg-primary: #f9f9f9;
  --bg-secondary: #f4f4f4;
  --bg-tertiary: #e8e8e8;
  --text-primary: #333333;
  --text-secondary: #666666;
  --accent-primary: teal;
  --accent-secondary: #008080cc;
  --border-color: #eaeaea;
  --code-bg: #f4f4f4;
  --skeleton-bg: #e0e0e0;
}

/* Dark Theme (Vesper-inspired) */
[data-theme="dark"] {
  --bg-primary: #101010;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #252525;
  --text-primary: #ffffff;
  --text-secondary: #bbbbbb;
  --accent-primary: #4ec9b0;
  --accent-secondary: #4ec9b0cc;
  --border-color: #333333;
  --code-bg: #1e1e1e;
  --skeleton-bg: #333333;
}

/* Theme toggle styles */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  border-radius: 50%;
  transition: background-color 0.3s;
}

.theme-toggle:hover {
  background-color: var(--bg-tertiary);
}

.theme-toggle-icon {
  transition: transform 0.5s ease;
}

.theme-toggle .sun {
  display: none;
}

.theme-toggle .moon {
  display: block;
}

.theme-toggle.dark-mode .sun {
  display: block;
}

.theme-toggle.dark-mode .moon {
  display: none;
}

/* Base styles */
* {
  box-sizing: inherit;
}

html {
  font-size: 16px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

/* Base body styles without transitions */
body {
  margin: 0;
  padding: 0;
  font-family: "Geist Mono", monospace;
  width: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  /* letter-spacing: -0.5px; */
}

/* Only apply transitions when toggling theme manually */
[data-theme-transition="true"] body {
  transition: background-color 0.3s, color 0.3s;
}

/* Typography */
h1 {
  color: var(--accent-primary);
  margin: 2rem 0 0.75rem;
}

h2 {
  margin: 1.75em 0 0.5em;
}

h3 {
  margin: 1.5em 0 0.25em;
}

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

a:hover {
  text-decoration: underline;
}

p {
  line-height: 1.75rem;
}

time {
  color: var(--text-secondary);
}

/* Code blocks */
code {
  font-family: "Geist Mono", "Dm Mono", "Roboto mono", monospace;
  letter-spacing: 0;
  font-size: 0.9rem;
  background-color: var(--code-bg);
  padding: 2px 6px;
  border-radius: 0.25rem;
  color: var(--accent-primary);
}

pre {
  code {
    display: block;
    padding: 1rem;
    background-color: var(--code-bg);
    border-radius: 0.5rem;
    overflow-x: auto;
    line-height: 1.5rem;
  }
}

/* Media */
img {
  max-width: 100%;
  height: auto;
}

/* Layout */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem;
}

.container {
  width: 100%;
  max-width: 696px;
  margin: 0 auto;
}

header {
  width: 100%;
  padding: 1.5rem 0;
}

footer {
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  padding: 1rem 0 !important;
  width: 100%;
  font-size: 0.875rem;
}

/* Navigation */
.main-menu {
  display: flex;
  gap: 2rem;
  font-weight: 400;

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

/* Content */
.main-content {
  width: 100%;
  flex: 1;
}

.prose {
  img {
    margin-top: 1rem;
    border-radius: 1rem;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
  }
}

/* Lists */
ul {
  li {
    padding: 0.25rem 0;
  }
}

/* Utility classes - Keep these as they may be used in templates */
.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.flex {
  display: flex;
}

.flex-center {
  justify-content: center;
  align-items: center;
}

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

.block {
  display: block;
}

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

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

/* Tag styling for possible post tags */
.tag {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  background-opacity: 0.5;
  padding: 1px 8px;
  border-radius: 0.25rem;

  &:hover {
    background: var(--bg-secondary);
  }
}


@media screen and (min-width: 768px) {
  .aside-outline {
    display: block;
  }
}

/* Syntax Highlighting - Compatible with both light and dark modes */
/* Light mode colors */
.hl-keyword {
  color: #0550ae;
}

.hl-property {
  color: #116329;
}

.hl-attribute {
  font-style: italic;
  color: #953800;
}

.hl-type {
  color: #8250df;
}

.hl-generic {
  color: #8250df;
}

.hl-value {
  color: #0a3069;
}

.hl-variable {
  color: #24292f;
}

.hl-comment {
  color: #6e7781;
  font-style: italic;
}

/* Dark mode syntax colors */
[data-theme="dark"] .hl-keyword {
  color: #569cd6;
}

[data-theme="dark"] .hl-property {
  color: #4ec9b0;
}

[data-theme="dark"] .hl-attribute {
  font-style: italic;
  color: #9cdcfe;
}

[data-theme="dark"] .hl-type {
  color: #c586c0;
}

[data-theme="dark"] .hl-generic {
  color: #dcdcaa;
}

[data-theme="dark"] .hl-value {
  color: #ce9178;
}

[data-theme="dark"] .hl-variable {
  color: #9cdcfe;
}

[data-theme="dark"] .hl-comment {
  color: #6a9955;
  font-style: italic;
}

/* Common styles for both themes */
.hl-blur {
  filter: blur(2px);
}

.hl-strong {
  font-weight: bold;
}

.hl-em {
  font-style: italic;
}

.hl-addition {
  display: inline-block;
  min-width: 100%;
  background-color: rgba(84, 174, 84, 0.2);
}

.hl-deletion {
  display: inline-block;
  min-width: 100%;
  background-color: rgba(220, 80, 80, 0.2);
}

/* Comments section styling */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.comments-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.comments-container {
  padding: 0.5rem 0;
  border-radius: 0.25rem;
  position: relative;
}

/* Make the utterances iframe look better */
.comments-container iframe {
  width: 100%;
}

/* Skeleton loading animation for comments */
#comments-skeleton {
  margin: 1rem 0;
  display: block;
}

.skeleton-comment {
  display: flex;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--skeleton-bg);
  flex-shrink: 0;
}

.skeleton-content {
  flex-grow: 1;
  width: 100%;
}

.skeleton-line {
  height: 14px;
  background-color: var(--skeleton-bg);
  border-radius: 4px;
  margin-bottom: 10px;
  width: 100%;
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-line-short {
  width: 20%;
}

.skeleton-line-medium {
  width: 60%;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.6;
  }
}