/* ==========================================================================
   Quantum Rogers Blog Stylesheet
   ---
   1. Global & Base Styles
   2. Header & Navigation
   3. Main Page (Post List)
   4. Single Post Page
   5. Common Components (Pagination, Tags, etc.)
   6. Footer
   7. Responsive Media Queries
   ========================================================================== */

/* --- 1. Global & Base Styles --- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6; /* Increased for better readability */
  background: #f4f4f9;
  color: #333;
  margin: 0;
}

.container { 
  width: 90%; 
  max-width: 960px; 
  margin: 0 auto; 
}

a {
  color: #1a73e8;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: #0f3460;
}


body > header {
  background: #1a1a2e;
  color: #fff;
  padding: 1rem 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allows nav to wrap on smaller screens */
}

a.logo-link {
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  margin: 0;
  display: flex;          /* keep its own box, align children */
  align-items: center;    /* vertically center { QR } and text */
  gap: 1rem;
  line-height: 1.2;       /* control vertical spacing */
}


.logo-qr { 
  font-size: 2.5rem; 
  color: #e94560; 
}

.logo-text-group { text-align: left; }
.logo-text { 
  font-size: 1.2rem; 
  font-family: monospace; 
  letter-spacing: 0.1em; 
}
.logo-subtext { 
  font-size: 0.7rem; 
  font-family: monospace; 
  opacity: 0.8; 
  display: block; 
}

#main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

#main-nav a.nav-link {
  color: #fff;
  font-weight: 500;
  padding-bottom: 5px; /* Add space for the underline effect */
  border-bottom: 2px solid transparent; /* Prepare for active state */
  transition: color 0.2s, border-color 0.2s;
}

#main-nav a.nav-link:hover, 
#main-nav a.nav-link.active { 
  color: #e94560;
  border-bottom-color: #e94560;
}

/* --- 3. Main Page (Post List) --- */
.page-title { 
  color: #1a1a2e; 
  border-bottom: 2px solid #e94560; 
  padding-bottom: 0.5rem; 
  margin-top: 2rem; 
}

.blog-post {
  display: flex;
  flex-direction: column; /* Mobile-first: stacks image on top of text */
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  margin: 2rem 0;
  transition: box-shadow 0.3s ease;
}

.blog-post:hover {
  box-shadow: 0 6px 12px rgba(0,0,0,0.1); /* Fixed typo from 'A12px' */
}

.post-image-link {
  display: block;
}

.post-featured-image {
  width: 100%;
  height: 220px;              /* uniform height across posts */
  object-fit: contain;        /* keep aspect ratio, no cropping */
  object-position: center;
  background-color: #fff;     /* fill space around smaller images */
  padding: 10px;              /* adds breathing room around the image */
  border-radius: 8px;         /* rounded corners */
  box-sizing: border-box;     /* ensures padding doesn’t increase total size */
  display: block;
}



.post-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Allows content to fill space */
}

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

.blog-post h2 { 
  margin: 0; 
  font-size: 1.5rem;
}

.blog-post h2 a { 
  color: #0f3460;
}

.blog-post .meta { 
  font-size: 0.9rem; 
  color: #555; 
  margin: 0.5rem 0 1rem; 
}
.blog-post p {
  margin-top: 0;
  flex-grow: 1; /* Pushes the "Read More" link down */
}

.read-more { 
  font-weight: bold; 
  margin-top: auto; /* Aligns to the bottom of the card */
}

/* --- 4. Single Post Page --- */
.single-post {
  background: #fff; 
  padding: 2rem; 
  margin-top: 2rem; 
  border-radius: 8px; 
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.post-full-header {
  margin-bottom: 2rem;
  text-align: left; /* Changed from center to left */
  background: transparent;
  color: inherit;
  padding: 0;
}

.post-full-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #1a1a2e;
  text-align: left; /* Optional: ensures title is left-aligned too */
}

.post-full-header,
.post-full-title {
  overflow-wrap: break-word;  /* Modern standard */
  word-wrap: break-word;      /* Legacy support */
  hyphens: auto;              /* Adds soft hyphens for nicer wrapping if supported */
}


.single-post .meta { 
  margin-bottom: 2rem; 
  font-size: 1rem; 
  color: #555; 
}

.post-full-image {
  width: 100%;
  height: auto;
  max-height: auto;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.post-full-content {
  font-size: 1.1rem;
  line-height: 1.7;
}

.post-full-content p {
  margin: 0 0 1.5rem 0;
}

/* Styles for inline images within a post */
.post-full-content .image-inline {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2.5rem auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- 5. Common Components --- */
.category-tag { 
  background-color: #e94560; 
  color: #fff; 
  padding: 0.3rem 0.8rem; 
  border-radius: 20px; 
  font-size: 0.8rem; 
  font-weight: bold; 
  text-transform: uppercase; 
}

.pagination { 
  margin: 2rem 0; 
  text-align: center; 
}

.pagination a { 
  margin: 0.25rem; 
  padding: 0.5rem 1rem; 
  color: #0f3460; 
  border: 1px solid #ddd; 
  border-radius: 5px; 
  display: inline-block;
}

.pagination a:hover { 
  background-color: #0f3460; 
  color: #fff; 
}

.pagination a.active { 
  background-color: #1a1a2e; 
  color: #fff; 
  border-color: #1a1a2e; 
  font-weight: bold;
}

.share-buttons {
  margin: 1.5rem auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 800px;
}

.share-buttons a {
  padding: 8px 16px;
  border-radius: 20px;
  background: #e9e9f0;
  font-size: 14px;
  font-weight: 500;
}

.share-buttons a:hover {
  background: #d8d8e0;
}

.back-link { 
  display: block; /* Make it a block for better spacing and centering */
  margin: 2rem auto;
  max-width: 800px; 
  font-size: 1.1rem; 
  font-weight: bold; 
  text-align: center;
}

/* --- 6. Footer --- */
footer { 
  text-align: center; 
  padding: 1.5rem 0; 
  margin-top: 2rem; 
  background: #1a1a2e; 
  color: #a9a9b3; 
}

/* --- 7. Responsive Media Queries --- */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column; /* Stack logo and nav vertically */
    gap: 1rem;
  }
  
  #main-nav ul {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem; /* Smaller gaps for mobile */
  }

  .post-full-title {
    font-size: 2rem; /* Smaller title on mobile */
  }

  .single-post {
    padding: 1rem; /* Less padding on small screens */
  }
}

@media (min-width: 768px) {
  .blog-post {
    flex-direction: row; /* Side-by-side card layout on desktop */
  }

  .post-image-link {
    flex: 0 0 300px; /* Give the image a fixed width */
  }
  
.post-featured-image {
  width: 100%;
  height: 100%;               /* match the fixed image container height */
  object-fit: contain;
  object-position: center;
  background-color: #fff;
}

  
  .post-content {
    padding: 1.5rem 2rem;
  }
}