/* Custom CSS for Peter van Onselen's Personal Website */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Base styles */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #ffffff;
  --bg-light: #f8f9fa;
  --border-color: #e1e8ed;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  --border-radius: 8px;
  --max-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

/* Global image reset for blog posts */
img {
  max-width: 100%;
  height: auto;
}

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

/* Header */
.site-header {
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.site-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
}

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

.site-nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.3s ease;
}

.site-nav a:hover {
  color: var(--secondary-color);
}

/* Main content */
main {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

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

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-color);
}

/* Links */
a {
  color: var(--secondary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

li {
  margin-bottom: 0.5rem;
}

/* Code blocks */
pre, code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  background-color: var(--bg-light);
  border-radius: var(--border-radius);
}

code {
  padding: 0.2rem 0.4rem;
  font-size: 0.9rem;
}

pre {
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}

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

/* Cards/Sections */
.card {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #2980b9;
  text-decoration: none;
}

.btn-outline {
  background-color: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
}

.btn-outline:hover {
  background-color: var(--secondary-color);
  color: white;
}

/* Resume specific styles */
.resume-section {
  margin-bottom: 2rem;
}

.resume-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

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

.resume-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background-color: var(--bg-light);
  border-radius: var(--border-radius);
}

.resume-title {
  font-weight: 600;
  color: var(--primary-color);
}

.resume-meta {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Enhanced resume styling */
.resume-item ul {
  margin-top: 0.5rem;
}

.resume-item ul li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.resume-item strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Categories and tags */
.category {
  background-color: var(--secondary-color);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-meta {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Project grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-item {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

/* Contact info */
.contact-info {
  background-color: var(--bg-light);
  padding: 2rem;
  border-radius: var(--border-radius);
  margin: 2rem 0;
}

/* Footer */
.site-footer {
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--text-light);
}

/* Blog post content styling - Force image containment */
.post-content img,
article img,
.page-content img,
.post img,
article.post img,
.post-content p img,
article p img,
main img,
.content img {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  display: block !important;
  margin: 1.5rem auto !important;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  box-sizing: border-box !important;
  object-fit: contain !important;
}

.post-content,
article,
.page-content,
.post,
main .post-content,
main article {
  max-width: 800px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  word-wrap: break-word !important;
}

/* Block quote styling */
.post-content blockquote,
article blockquote,
.page-content blockquote {
  background-color: var(--bg-light);
  border-left: 4px solid var(--secondary-color);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic;
  color: var(--text-light);
  position: relative;
}

.post-content blockquote::before,
article blockquote::before,
.page-content blockquote::before {
  content: """;
  font-size: 3rem;
  color: var(--secondary-color);
  position: absolute;
  left: 0.5rem;
  top: -0.5rem;
  font-family: Georgia, serif;
  opacity: 0.3;
}

.post-content blockquote p,
article blockquote p,
.page-content blockquote p {
  margin: 0;
  padding-left: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .post-content img,
  article img,
  .page-content img,
  .post img,
  article.post img {
    max-width: calc(100vw - 40px) !important;
    margin: 1rem auto !important;
  }
  
  .post-content,
  article,
  .page-content,
  .post {
    padding: 0 15px;
  }
  
  .site-header .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .site-nav ul {
    gap: 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .resume-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  .site-nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  h1 {
    font-size: 1.8rem;
  }
}

/* Final image override - highest specificity */
.site-wrapper img,
.wrapper img,
body img,
html img {
  max-width: 100% !important;
  height: auto !important;
  box-sizing: border-box !important;
}

/* Ensure post content containers are properly constrained */
.site-wrapper .post-content,
.wrapper .post-content,
.site-wrapper article,
.wrapper article,
body .post-content,
body article {
  max-width: 800px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  overflow-x: hidden !important;
}
