:root {
  --color-bg: #f8f9fa;
  --color-bg-secondary: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #666;
  --color-border: #e0e0e0;
  --color-border-light: #f0f0f0;
  --color-primary: #0066cc;
  --color-code-bg: #f5f5f5;
  --color-nav-bg: #333333;
  --color-shadow: rgba(0, 0, 0, 0.05);
  --color-shadow-hover: rgba(0, 0, 0, 0.1);
  --max-width-content: 130ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a1a;
    --color-bg-secondary: #2d2d2d;
    --color-text: #e0e0e0;
    --color-text-muted: #999;
    --color-border: #444;
    --color-border-light: #333;
    --color-primary: #66b3ff;
    --color-code-bg: #2d2d2d;
    --color-nav-bg: #1a1a1a;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-shadow-hover: rgba(0, 0, 0, 0.5);
  }
}

/* ===== Base Styles ===== */
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

/* ===== Main Content ===== */
.main {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  line-height: 1.7;
}

.footer {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  line-height: 1.7;
  justify-content: center;
  text-align: center;
  padding-bottom: 50vh;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: 2.2rem;
  margin-top: 0;
  text-align: center;
  justify-content: center;
}

h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid var(--color-border-light);
  padding-bottom: 0.3em;
  justify-content: center;
  text-align: center;
}

h3 {
  font-size: 1.4rem;
}

p {
  margin-bottom: 1.2rem;
}

/* ===== Links ===== */
a {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

a:hover {
  border-bottom: 1px solid var(--color-primary);
}


/* ===== Lists ===== */
.content-list-container {
  margin-bottom: 1.2rem;
  display: flex;
  justify-content: center;
}

.content-list {
  margin-bottom: 1.2rem;
  padding-left: 0;
  max-width: 60%;
  width: 100%;
  list-style: none;
  
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}


ul, ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

ul li::marker {
  color: var(--color-text-muted);
}

/* ===== Code ===== */
code {
  font-family: 'Courier New', monospace;
  background: var(--color-code-bg);
  color: var(--color-text);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background: var(--color-code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.2rem;
  border-left: 4px solid var(--color-primary);
}

pre code {
  background: none;
  padding: 0;
  color: var(--color-text);
}

/* ===== Blockquotes ===== */
blockquote {
  border-left: 4px solid var(--color-border);
  padding-left: 1.2rem;
  margin: 0 0 1.2rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ===== Images ===== */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
  display: block;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

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

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

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

/* ===== Post Meta ===== */
.post-meta {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  display: flex;
  gap: 1.5rem;
}

.post-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ===== Navigation ===== */
.nav {
  font-size: 1rem;
  font-weight: 500;
  background-color: var(--color-nav-bg);
}

.nav-container {
  max-width: 65ch;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-favicon {
    height: 24px;
    width: 24px;
    margin-right: 8px;
}

.nav-brand {
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 700;
  transition: opacity 0.2s ease;
  border: none;
  display: flex;
  align-items: center;
}

.nav-brand:hover {
  opacity: 0.9;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  color: var(--color-text);
  text-decoration: none;
  transition: opacity 0.2s ease;
  border-bottom: 2px solid transparent;
}

.nav-menu a:hover {
  opacity: 0.9;
  border-bottom: 2px solid var(--color-text);
}

/* ===== List Items ===== */
.list-item {
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin: 12px 0;
  padding: 16px 20px;
  background-color: var(--color-bg-secondary);
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px var(--color-shadow);
}

.list-item:hover {
  border-color: var(--color-text-muted);
  box-shadow: 0 4px 12px var(--color-shadow-hover);
  transform: translateY(-2px);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .main {
    padding: 1.5rem 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-menu {
    gap: 1rem;
    justify-content: center;
  }
}


/* ===== Quotes Grid ===== */
.quotes-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem auto;
  max-width: var(--max-width-content);
  padding: 0 1rem; /* Optional: adds space on small screens */
}


.quote {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px var(--color-shadow);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quote:hover {
  border-color: var(--color-primary);
  box-shadow: 0 6px 20px var(--color-shadow-hover);
  transform: translateY(-4px);
}

.quote blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 1.2rem;
  margin: 0 0 1.5rem 0;
  color: var(--color-text);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.8;
  flex-grow: 1;
}

.quote .author {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: right;
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light);
}

/* ===== Responsive Grid Adjustments ===== */
@media (max-width: 1400px) {
  .quotes-container {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 1024px) {
  .quotes-container {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 768px) {
  .quotes-container {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
  }

  .quote {
    padding: 1.2rem;
    min-height: 180px;
  }

  .quote blockquote {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .quotes-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .quote {
    padding: 1rem;
    min-height: 160px;
  }

  .quote blockquote {
    padding-left: 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
  }
}
