/* Custom styles for the blog */
/* This file extends the Cayman theme with modern improvements */

/* Import variables */
:root {
  --brand-color: #667eea;
  --brand-color-dark: #764ba2;
  --text-color: #333;
  --background-color: #fff;
  --code-background-color: #f6f8fa;
}

/* Enhanced typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
}

/* Better headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  margin-top: 2em;
  margin-bottom: 1em;
}

h1 {
  font-size: 2.5rem;
  border-bottom: 2px solid var(--brand-color);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 2rem;
  color: var(--brand-color-dark);
}

h3 {
  font-size: 1.5rem;
}

/* Improved links */
a {
  color: var(--brand-color);
  text-decoration: none;
  transition: color 0.2s ease;
  
  &:hover {
    color: var(--brand-color-dark);
    text-decoration: underline;
  }
}

/* Better code blocks */
pre, code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background-color: var(--code-background-color);
  border-radius: 6px;
}

pre {
  padding: 16px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  
  code {
    padding: 0;
    background-color: transparent;
  }
}

code {
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 85%;
}

/* Improved blockquotes */
blockquote {
  margin: 2em 0;
  padding: 1em 1.5em;
  border-left: 5px solid var(--brand-color);
  background-color: #f8f9fa;
  border-radius: 0 6px 6px 0;
  
  p {
    margin: 0;
    font-style: italic;
    color: #666;
  }
}

/* Better tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 2em 0;
  
  th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e4e8;
  }
  
  th {
    background-color: var(--code-background-color);
    font-weight: 600;
    color: var(--brand-color-dark);
  }
  
  tr:hover {
    background-color: #f6f8fa;
  }
}

/* Enhanced images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 1.5em 0;
}

/* Better lists */
ul, ol {
  padding-left: 2em;
  
  li {
    margin-bottom: 0.5em;
  }
}

/* Custom button styles */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--brand-color) 0%, var(--brand-color-dark) 100%);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    color: white;
  }
}

.btn-secondary {
  background: transparent;
  color: var(--brand-color);
  border: 2px solid var(--brand-color);
  
  &:hover {
    background: var(--brand-color);
    color: white;
  }
}

/* Card component */
.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e4e8;
  transition: all 0.3s ease;
  
  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }
}

/* Grid system */
.grid {
  display: grid;
  gap: 24px;
  
  &.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  &.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* Utility classes */
.text-center {
  text-align: center;
}

.text-muted {
  color: #666;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* Responsive design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  .grid.grid-2,
  .grid.grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
*:focus {
  outline: 2px solid var(--brand-color);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  a {
    text-decoration: underline;
  }
}
