/* ============================================
   Light Typewriter Theme
   Elegant, Simplistic, Dopamine-Inducing Design
   ============================================ */

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Courier New', 'Courier', monospace;
  background: #faf8f3;
  color: #2c2c2c;
  line-height: 1.8;
  padding: 40px 20px;
  max-width: 720px;
  margin: 0 auto;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Courier New', 'Courier', monospace;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

p {
  margin-bottom: 1.5rem;
}

a {
  color: #2c2c2c;
  text-decoration: none;
  border-bottom: 1px solid #d4d4d4;
  transition: all 0.2s ease;
}

a:hover {
  border-bottom-color: #2c2c2c;
  background: #f0ede5;
}

/* === HEADER === */
.header-home {
  text-align: center;
  padding: 60px 0 80px 0;
  border-bottom: 2px solid #e8e5dd;
  margin-bottom: 60px;
}

.header-home .title {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.header-home .description {
  font-size: 1.125rem;
  color: #666;
  font-weight: 400;
  margin-bottom: 2rem;
}

/* === SOCIAL LINKS === */
.social-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 2rem;
}

.social-links .link {
  border: none;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-links .link:hover {
  opacity: 1;
  transform: translateY(-2px);
  background: none;
}

.social-links .icon {
  width: 24px;
  height: 24px;
  fill: #2c2c2c;
}

/* === BLOG LIST === */
.blog-list-table {
  width: 100%;
  margin: 0;
}

.blog-list-item {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #e8e5dd;
  transition: all 0.3s ease;
}

.blog-list-item:last-child {
  border-bottom: none;
}

.blog-list-item a {
  display: block;
  border: none;
  padding: 12px 16px;
  margin: -12px -16px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.blog-list-item a:hover {
  background: #f0ede5;
  transform: translateX(8px);
}

.blog-list-item a:hover .blog-post-title {
  color: #000;
}

.blog-post-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.blog-post-date {
  display: block;
  font-size: 0.9rem;
  color: #888;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === POST PAGE === */
.post {
  max-width: 720px;
  margin: 0 auto;
}

.post .title {
  margin-top: 60px;
  margin-bottom: 1rem;
  font-size: 2.25rem;
  line-height: 1.2;
}

.post .date {
  display: block;
  font-size: 0.9rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 2px solid #e8e5dd;
}

/* === NAVIGATION === */
.nav {
  margin-bottom: 3rem;
  padding: 20px 0;
  border-bottom: 1px solid #e8e5dd;
}

.nav .list {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav .link {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
}

.nav .link:hover {
  background: #f0ede5;
}

/* === CODE BLOCKS === */
pre, code {
  font-family: 'Courier New', 'Courier', monospace;
  background: #f5f2eb;
  border: 1px solid #e8e5dd;
}

code {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  padding: 20px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 2rem 0;
  line-height: 1.5;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* === SYNTAX HIGHLIGHTING === */
.highlight {
  background: #f5f2eb;
  border-radius: 6px;
  margin: 2rem 0;
  overflow-x: auto;
}

.highlight pre {
  margin: 0;
  border: none;
}

.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr {
  color: #0066cc;
  font-weight: 600;
}

.highlight .nf {
  color: #cc0066;
  font-weight: 600;
}

.highlight .s, .highlight .s1, .highlight .s2 {
  color: #007700;
}

.highlight .c, .highlight .cm, .highlight .c1 {
  color: #999;
  font-style: italic;
}

.highlight .mi, .highlight .mh {
  color: #cc6600;
}

.highlight .n {
  color: #2c2c2c;
}

.highlight .p, .highlight .o {
  color: #666;
}

.highlight .nl {
  color: #cc0066;
}

/* === BLOCKQUOTES === */
blockquote {
  margin: 2rem 0;
  padding: 20px 30px;
  border-left: 4px solid #d4d4d4;
  background: #f5f2eb;
  font-style: italic;
  color: #555;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* === LISTS === */
ul, ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.75rem;
}

/* === IMAGES === */
img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* === TABLES === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e8e5dd;
}

th {
  font-weight: 600;
  background: #f5f2eb;
}

/* === WRAPPER === */
.wrapper-large {
  max-width: 100%;
}

.page, .page.home {
  max-width: 720px;
  margin: 0 auto;
}

/* === RELATED POSTS === */
.related {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid #e8e5dd;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  body {
    padding: 20px 16px;
    font-size: 15px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .header-home .title {
    font-size: 2rem;
  }

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

  .blog-list-item a:hover {
    transform: translateX(4px);
  }

  pre, .highlight {
    margin: 1.5rem -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* === DOPAMINE-INDUCING ANIMATIONS === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-list-item {
  animation: fadeIn 0.5s ease forwards;
}

.blog-list-item:nth-child(1) { animation-delay: 0.1s; opacity: 0; }
.blog-list-item:nth-child(2) { animation-delay: 0.2s; opacity: 0; }
.blog-list-item:nth-child(3) { animation-delay: 0.3s; opacity: 0; }
.blog-list-item:nth-child(4) { animation-delay: 0.4s; opacity: 0; }
.blog-list-item:nth-child(5) { animation-delay: 0.5s; opacity: 0; }

/* === SELECTION === */
::selection {
  background: #e8e5dd;
  color: #1a1a1a;
}

/* === FOCUS STYLES === */
a:focus, button:focus {
  outline: 2px solid #d4d4d4;
  outline-offset: 2px;
}

/* === SVG ICONS === */
svg {
  display: inline-block;
  vertical-align: middle;
}

/* === FIGURE === */
figure {
  margin: 2rem 0;
}

.language-plaintext {
  background: #f5f2eb;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

/* === POST HEADER === */
.post-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e8e5dd;
}

.back-home {
  display: inline-block;
  font-size: 0.95rem;
  color: #666;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.back-home:hover {
  color: #1a1a1a;
  background: #f0ede5;
  transform: translateX(-4px);
}

/* === SKIP TO CONTENT LINK (Accessibility) === */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #2c2c2c;
  color: #faf8f3;
  padding: 8px 16px;
  text-decoration: none;
  border: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid #00ff41;
  outline-offset: 2px;
}

/* === PRINT STYLES === */
@media print {
  /* Hide non-essential elements */
  .social-links,
  .post-header,
  .nav,
  svg {
    display: none !important;
  }

  /* Optimize for print */
  body {
    background: white;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Remove unnecessary spacing */
  .header-home {
    border-bottom: 2px solid #000;
    padding: 20px 0;
    margin-bottom: 30px;
  }

  /* Optimize post content */
  .post {
    max-width: 100%;
  }

  .post .title {
    font-size: 18pt;
    margin-top: 0;
  }

  /* Better code blocks for print */
  pre, code {
    background: #f5f5f5;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  /* Avoid breaking inside elements */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  blockquote, pre {
    page-break-inside: avoid;
  }

  /* Show URLs for links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
    color: #666;
  }

  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }

  /* Page breaks */
  @page {
    margin: 2cm;
  }
}

/* === ABOUT TEXT === */
.about-text {
  font-size: 1rem;
  color: #666;
  max-width: 600px;
  margin: 1.5rem auto 2rem auto;
  line-height: 1.7;
  font-weight: 400;
}
