/* ==========================================================================
   Lazzaro Theme - Minimal Hugo Theme
   ========================================================================== */

/* CSS Variables */
:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", Monaco, "Inconsolata", "Fira Mono", "Droid Sans Mono", "Source Code Pro", monospace;
  
  --max-width: 700px;
  --spacing: 1.5rem;
  
  /* Light theme (default) */
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --border: #e5e7eb;
  --code-bg: #f3f4f6;
  --accent: #3b82f6;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --link: #58a6ff;
  --link-hover: #79c0ff;
  --border: #30363d;
  --code-bg: #161b22;
  --accent: #58a6ff;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Header */
.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  text-decoration: none;
}

/* Theme Toggle */
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

#theme-toggle:hover {
  color: var(--text);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

/* Main Content */
main {
  flex: 1;
  padding-bottom: 3rem;
}

.content {
  padding: 1rem 0;
}

.content h1:first-child {
  margin-top: 0;
}

/* Homepage */
.homepage .intro {
  margin-bottom: 3rem;
}

.homepage .intro h1:first-of-type {
  margin-top: 0;
}

.latest-posts {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.latest-posts h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

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

.post-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

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

.post-date {
  display: inline-block;
  width: 100px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

.post-summary {
  margin: 0.5rem 0 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Single Post */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  margin-bottom: 0.5rem;
}

.post-header time {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.tags {
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-right: 0.5rem;
}

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

.post-content {
  margin-bottom: 2rem;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.post-nav .prev,
.post-nav .next {
  max-width: 45%;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.content img {
  margin: 1rem 0;
}

/* Book cover specific */
.content a > img {
  display: block;
  max-width: 300px;
  margin: 1.5rem auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Code Blocks */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

/* Hugo syntax highlighting */
.highlight {
  margin: 1rem 0;
  border-radius: 6px;
  overflow: hidden;
}

.highlight pre {
  margin: 0;
  border-radius: 0;
}

/* Blockquotes */
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Lists */
ul, ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: auto;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.social-icons a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.social-icons a:hover {
  color: var(--link);
}

.social-icons svg {
  width: 22px;
  height: 22px;
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }
  
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .site-nav {
    width: 100%;
    justify-content: space-between;
  }
  
  .post-date {
    display: block;
    width: auto;
    margin-bottom: 0.25rem;
  }
  
  .post-nav {
    flex-direction: column;
  }
  
  .post-nav .prev,
  .post-nav .next {
    max-width: 100%;
  }
}

/* Moto Section */
.moto-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.moto-trip {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.moto-trip:last-child {
  border-bottom: none;
}

.moto-trip h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.2rem;
}

.moto-trip time {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.moto-trip p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.trip-distance {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

.moto-post .trip-distance {
  display: block;
  margin: 0.5rem 0 0 0;
}

/* Print styles */
@media print {
  .site-header,
  .site-footer,
  #theme-toggle,
  .post-nav {
    display: none;
  }
  
  body {
    color: #000;
    background: #fff;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
}
