/* ================================
   === Blog Index (Feed) ===
   ================================ */

/* Container */
.blog-container {
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
  position: relative;
  padding-left: 1.25%;
  padding-right: 1.5%;
  gap: 2.25rem;
  background-color: #faf3e3;  /* slightly warmer, a bit more deliberate */
  max-width: 1380px;          /* wider working area for cards + content */
  margin: 0 auto;             /* center under the navbar */
}

/* Sidebar styling is centralized in sidebar.css for consistency */
/* Main content area */
.blog-main {
  flex: 1;
  margin-left: 0;
  margin-right: 1%;
  max-width: 76%;
  text-align: left;
}

.blog-intro {
  text-align: center;
  margin: -3rem 0 3rem;
}

.blog-intro .blog-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-primary, #463935);
}

.blog-intro .blog-description {
  font-size: 1.2rem;
  color: #555;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Section separator */
.section-separator {
  border: none;
  height: 3px;
  background-color: var(--color-primary, #463935);
  margin: 1em 0;
  width: 100%;
}

/* Post card wrapper */
.post-wrapper {
  position: relative;
  margin-bottom: 3rem;
}

/* .blog-post {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  margin: 2.5rem 0;
  padding: 1.5rem;
  border: 3px solid var(--color-primary, #463935);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
} */
 
.blog-post {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  margin: 2.5rem 0;
  padding: 1.5rem;
  border: 2px solid rgba(70, 57, 53, 0.5); /* softer line than full solid */
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
/* Post image */
.blog-post .post-image {
  flex: 0 0 52%;
  max-width: 52%;
  padding-right: 2%;
  margin-right: 0.9rem;
  border-right: 1px solid rgba(70, 57, 53, 0.28);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.blog-post .post-image > a {
  display: block;
  width: 100%;
  aspect-ratio: 1514 / 877;
  overflow: hidden;
  border-radius: 10px;
  background: #ffffff;
}

.blog-post .post-image img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  border: none;
  box-shadow: none !important;
  filter: none !important;
}

/* Post text */
.blog-post .post-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.blog-post .post-text h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 1.9vw, 1.55rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-primary, #463935);
  overflow-wrap: anywhere;
}

.blog-post .post-text hr {
  border: none;
  border-top: 2px solid var(--color-primary, #463935);
  margin: 0.3rem 0 1rem;
  width: 100%;
}

.blog-post .post-text p {
  margin: 0 0 1rem;
  line-height: 1.6;
  font-size: 1.05rem;
  color: #333;
}

.blog-post .post-text a {
  margin-top: auto;
  font-weight: bold;
  color: #007acc;
  text-decoration: none;
}

.blog-post .post-text a:hover {
  text-decoration: underline;
  color: #005999;
}

/* Metadata (feed) */
.blog-post .post-text .post-date-feed {
  position: static;
  display: block;
  font-size: 0.9rem;
  color: #555;
  margin: 0.12rem 0 0.18rem;
  line-height: 1.2;
  font-style: italic;
}

.blog-post .post-text .post-views-feed {
  margin-top: 0;
  margin-bottom: 0.42rem;
  opacity: 0.6;
}
/* Hero banner wrapper – uses main column width */
.blog-opener {
  margin-bottom: 2.5rem;
}

/* Background image region */
.blog-hero {
  position: relative;
  max-width: 100%;              /* no wider than .blog-main */
  margin: 2rem auto 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  background-image: url("/assets/img/banner.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Dark overlay for legible text – lighter now */
.blog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom right,
    rgba(0, 0, 0, 0.25),  /* was 0.45 */
    rgba(0, 0, 0, 0.45)   /* was 0.65 */
  );
}
/* Text inside the banner */
.blog-hero-inner {
  position: relative;
  padding: 2.5rem 2rem;
  text-align: center;
}
/* Title row – remove typewriter here so it only applies to the code span */
.blog-opener-title {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.7rem;
  margin: 0 0 0.5rem;
  /* no font-family here, let it inherit the normal heading font */
}

.blog-title-code {
  font-family: "Ubuntu Mono", "Courier New", monospace;  /* typewriter only here */
  font-size: 3.2rem;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.35);         /* low-opacity black highlight */
  padding: 0.2em 0.75em;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.blog-title-math {
  font-size: 3.2rem;
  color: #ffffff;
  /* no font-family here so MathJax uses its own math font */
}



/* Subtitle on top of the image */
.blog-opener-subtitle {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  color: #f3f3f3;
  font-style: italic;
}

/* Keep the hr aligned with the main column beneath the banner */
.section-separator {
  border: none;
  height: 3px;
  background-color: var(--color-primary, #463935);
  margin: 0.5rem 0 1.5rem;
  width: 100%;
}

.blog-sidebar a:hover {
  color: var(--color-hover);
  text-decoration: none; /* no underline on hover */
}

@media (max-width: 1100px) {
  .blog-container {
    gap: 1.25rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .blog-main {
    max-width: none;
    margin-right: 0;
  }

  .blog-post {
    margin: 1.35rem 0;
  }
}

@media (max-width: 900px) {
  .blog-container {
    flex-direction: column;
    gap: 1rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .blog-main {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .blog-opener {
    margin-bottom: 1rem;
  }

  .blog-hero {
    margin: 1rem auto 0.8rem;
  }

  .blog-hero-inner {
    padding: 1.3rem 1rem;
  }

  .blog-title-code,
  .blog-title-math {
    font-size: 2rem;
  }

  .blog-opener-subtitle {
    font-size: 0.95rem;
  }

  .blog-post {
    flex-direction: column;
    margin: 1rem 0;
    padding: 0.9rem;
    border-radius: 14px;
  }

  .blog-post .post-image {
    flex: none;
    max-width: 100%;
    width: 100%;
    padding-right: 0;
    margin-right: 0;
    margin-bottom: 0.75rem;
    border-right: none;
  }

  .blog-post .post-text h2 {
    font-size: clamp(1.1rem, 5vw, 1.35rem);
  }

  .blog-post .post-text p {
    font-size: 1rem;
  }
}
