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

:root {
  --primary-color: #333;
  --secondary-color: #666;
  --accent-color: #d99d25;
  --button-color: #f5ca41;
  --background-color: #faf0e6;
  --border-color: #ddd;
  --max-width: 800px;
}

body {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  line-height: 1.7;
  color: var(--primary-color);
  background-color: var(--background-color);
}

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

/* Navigation */
nav {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 40px;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .site-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

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

nav .site-logo {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}

nav .nav-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

nav .nav-icon {
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

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

nav .nav-icon svg {
  display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 20px;
}

ul,
ol {
  margin-bottom: 20px;
  padding-left: 40px;
}

li {
  margin-bottom: 8px;
  line-height: 1.7;
}

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

a:hover {
  text-decoration: underline;
}

/* Post List */
.post-list {
  list-style: none;
}

.post-preview {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
}

.post-preview:last-child {
  border-bottom: none;
}

.post-title {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.post-title a {
  color: var(--primary-color);
}

.post-title a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

.post-subtitle {
  font-size: 1.2rem;
  color: var(--secondary-color);
  font-weight: 400;
  margin-bottom: 10px;
}

.post-meta {
  font-size: 0.9rem;
  color: var(--secondary-color);
  margin-top: 10px;
}

/* Post Content */
.post-header {
  margin-bottom: 40px;
}

.post-content {
  margin-bottom: 60px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 20px auto;
  display: block;
}

.post-content figure {
  margin: 30px auto;
  text-align: center;
  display: table;
}

.post-content figure img {
  margin: 0 auto;
  display: block;
}

.post-content figcaption {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--secondary-color);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}

.post-content ul,
.post-content ol {
  margin: 20px 0;
  padding-left: 40px;
}

.post-content li {
  margin-bottom: 10px;
}

.post-content pre {
  background-color: #f6f8fa;
  padding: 16px;
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid #e1e4e8;
  margin: 20px 0;
  line-height: 1.5;
}

.post-content code {
  background-color: #f6f8fa;
  padding: 3px 6px;
  border-radius: 3px;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier', monospace;
  font-size: 0.9em;
  color: #24292e;
}

.post-content pre code {
  background-color: transparent;
  padding: 0;
  border: none;
  font-size: 0.875em;
}

.post-content blockquote {
  border-left: 4px solid var(--border-color);
  padding-left: 20px;
  margin: 20px 0;
  color: var(--secondary-color);
  font-style: italic;
}

/* YouTube Embed */
.youtube-container {
  position: relative;
  padding-bottom: 56.25%;
  /* 16:9 aspect ratio */
  height: 0;
  overflow: visible;
  max-width: 100%;
  margin: 30px 0 38px 0;
}

.youtube-embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.youtube-link {
  display: block;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--secondary-color);
  text-align: center;
  text-decoration: none;
}

.youtube-link:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* Post Navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin: 40px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
}

.post-navigation a {
  padding: 10px 20px;
  background-color: var(--button-color);
  color: black;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

.post-navigation a:hover {
  opacity: 0.9;
}

.post-navigation .nav-previous {
  margin-right: auto;
}

.post-navigation .nav-next {
  margin-left: auto;
}

/* Footer */
footer {
  margin-top: 80px;
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--secondary-color);
  font-size: 0.9rem;
  position: relative;
  overflow: visible;
}

.social-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-links a {
  font-size: 1.25rem;
  color: var(--primary-color);
}

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

.footer-peek-character {
  position: absolute;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.footer-peek-character--right {
  right: 0;
}

.footer-peek-character--left {
  left: 0;
}

.footer-peek-character img {
  display: block;
  height: auto;
  position: relative;
  bottom: -40px;
}

.footer-peek-character--left img {
  bottom: -50px;
}

@media (max-width: 768px) {
  .footer-peek-character img {
    width: 120px;
    bottom: -20px;
  }
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.2rem;
  }

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

  .post-navigation {
    flex-direction: column;
    gap: 10px;
  }

  .post-navigation .nav-previous,
  .post-navigation .nav-next {
    margin: 0;
    text-align: center;
  }
}