/* CSS Variables for Light Theme (Default) */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --text-muted: #666666;
  --link-color: #333333;
  --link-hover: #000000;
  --border-color: #cccccc;
  --code-bg: #f5f5f5;
  --code-text: #333333;
}

/* Dark Theme */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-muted: #999999;
    --link-color: #e0e0e0;
    --link-hover: #ffffff;
    --border-color: #444444;
    --code-bg: #2a2a2a;
    --code-text: #e0e0e0;
  }
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: system-ui;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text-color);
  background-color: var(--bg-color);
  padding: 40px 20px;
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header and Navigation */
header {
  display: flex;
  align-items: center;
  gap: 45px;
  margin-bottom: 60px;
}

.site-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
}

.site-title:hover {
  color: var(--link-hover);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
}

nav a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 14px;
}

nav a:hover,
nav a.active {
  text-decoration: underline;
}

/* Photography submenu */
.submenu {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.submenu a {
  color: var(--text-muted);
  text-decoration: none;
}

.submenu a:hover,
.submenu a.active {
  color: var(--link-color);
  text-decoration: underline;
}

/* Main Content */
main {
  flex: 1;
}

/* Landing Page */
.intro-heading {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-color);
}

.intro-text {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 40px;
  color: var(--text-color);
  max-width: 600px;
}

.social-links {
  display: flex;
  gap: 20px;
}

.social-links a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 14px;
}

.social-links a:hover {
  text-decoration: underline;
}

/* Essay List */
.essay-list {
  list-style: none;
}

.essay-list li {
  margin-bottom: 20px;
}

.essay-list a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 16px;
}

.essay-list a:hover {
  text-decoration: underline;
}

/* Essay Page */
article h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
}

.essay-date {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 30px;
}

.essay-content {
  font-size: 16px;
  line-height: 1.6;
}

.essay-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 5px;
}

.essay-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 5px;
}

.essay-content p {
  margin-bottom: 20px;
}

.essay-content ul,
.essay-content ol {
  margin-bottom: 20px;
  margin-left: 30px;
}

.essay-content li {
  margin-bottom: 8px;
}

.essay-content a {
  color: var(--link-color);
  text-decoration: underline;
}

.essay-content img {
  max-width: 100%;
  height: auto;
}

.essay-content blockquote {
  border-left: 3px solid var(--border-color);
  padding-left: 20px;
  margin: 20px 0;
  color: var(--text-muted);
  font-style: italic;
}

.essay-content code {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
}

.essay-content pre {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 20px 0;
}

.essay-content pre code {
  background-color: transparent;
  padding: 0;
  font-size: 14px;
}

.essay-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.essay-content table th,
.essay-content table td {
  border: 1px solid var(--border-color);
  padding: 10px;
  text-align: left;
}

.essay-content table th {
  background-color: var(--code-bg);
  font-weight: 600;
}

/* Photography Page */
.photo-container {
  margin-top: 0;
}

.photo-container img {
  width: 100%;
  max-height: 70vh;
  height: auto;
  display: block;
}

.photo-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
}

.photo-nav {
  font-size: 12px;
}

.photo-nav a {
  color: var(--link-color);
  text-decoration: none;
  margin-left: 10px;
}

.photo-nav a:hover {
  text-decoration: underline;
}

.photo-nav a.disabled {
  color: var(--text-muted);
  pointer-events: none;
}

/* Footer */
footer {
  margin-top: 80px;
  text-align: center;
  color: var(--text-muted);
  font-size: 10px;
}

/* Responsive Design */
@media (max-width: 600px) {
  body {
    padding: 20px 15px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 40px;
  }

  nav ul {
    gap: 20px;
  }

  .submenu {
    gap: 15px;
  }

  .intro-heading {
    font-size: 20px;
  }

  article h1 {
    font-size: 24px;
  }

  .essay-content h2 {
    font-size: 20px;
  }

  .essay-content {
    font-size: 15px;
  }
}
