/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    background: #fafafa;
    color: #333;
    line-height: 1.6;
  }
  
  /* Header */
  .site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  .logo {
    font-weight: bold;
    font-size: 1.2rem;
  }
  .menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
  }
  .menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
  }
  
  /* Category Filters */
  .filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-bottom: 1px solid #eee;
  }
  .sticky {
    position: sticky;
    top: 60px;
    z-index: 900;
  }
  .filter-btn {
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    background: #f0f0f0;
    transition: all 0.3s ease;
  }
  .filter-btn.active, .filter-btn:hover {
    background: #333;
    color: #fff;
  }
  
  /* Featured Article */
  .featured {
    margin: 1rem auto;
    max-width: 1200px;
  }
  .featured-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
  }
  .featured-card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
  }
  .featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
  }
  .featured-content h2 {
    margin: 0.5rem 0;
  }
  .meta {
    font-size: 0.8rem;
    opacity: 0.9;
  }
  
  /* Grid Layout */
  .posts-grid {
    max-width: 1200px;
    margin: 2rem auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* fixed 3 columns */
    gap: 1.5rem;
    grid-auto-flow: row; /* place items left-to-right, then next row */
  }
  .post-card {
    width: 100%;               /* fill its grid cell */
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
  }
  .post-card:hover {
    transform: translateY(-5px);
  }
  .post-card img {
    width: 100%;
    height: 200px;             /* consistent thumb height */
    object-fit: cover;
  }
  .post-content {
    padding: 1rem;
  }
  .post-content h3 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
  }
  .post-content p {
    font-size: 0.9rem;
    color: #555;
  }
  
  /* Badges */
  .badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
  }

  .about {
    background: #ffffff00;
    color: #007f3f00;
  }
  
  .biomedical {
    background: #d1f5d3;
    color: #007f3f;
  }
  .technology {
    background: #d9e8ff;
    color: #1d4ed8;
  }
  .art {
    background: #f9d8ff;
    color: #a21caf;
  }
  
  .worklog {
    background: #faeca0;
    color: #7c4c0d;
  }

/* Pagination container */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    padding: 2rem 0 3rem;
  }
  
  /* Page buttons */
  .page-btn {
    border: 0;
    padding: .55rem .9rem;
    border-radius: .6rem;
    background: #f1f1f3;
    color: #111;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
  }
  .page-btn:hover { background: #e7e7ee; }
  
  .page-btn.is-active {
    background: #7c3aed;          /* accent */
    color: #fff;
  }
  
  .page-btn.is-disabled {
    background: #e9e9ee;
    color: #9aa0a6;
    cursor: not-allowed;
  }
  
  .page-ellipsis {
    padding: .55rem .5rem;
    color: #777;
    font-weight: 700;
    user-select: none;
  }
  
  /* Optional: make Prev/Next a bit wider */
  .page-btn.prev, .page-btn.next { padding: .55rem 1rem; }
  

  /* Responsive */
  @media (max-width: 1100px) {
    .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 700px) {
    .posts-grid { grid-template-columns: 1fr; }
  }
  

  /* ===== ARTICLE VIEW ===== */
.article-view {
  max-width: 980px;
  margin: 0 auto 4rem;
  padding: 0 1rem;
}

/* Big hero with gradient overlay for readable text */
.article-hero {
  position: relative;
  isolation: isolate;
  height: clamp(220px, 35vw, 420px);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 1rem;
}
.article-hero img {
  position: absolute; 
  inset: 0; 
  z-index: -1; 
  object-fit: cover; 
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-hero::after {
  z-index: 0;
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.65) 75%);
}

.hero-content {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: 0;
  padding: 1.5rem 1.75rem 1.75rem;
  color: #fff;
}
/* Title + meta: slight halo + stronger size/weight */
.hero-title {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 900;
  letter-spacing: .01em;
  text-wrap: balance;                 /* modern browsers: nicer line breaks */
  text-shadow:
    0 12px 28px rgba(0,0,0,.55),
    0 3px 8px   rgba(0,0,0,.55);
}
.hero-meta {
  font-weight: 700;
  opacity: 1;                         /* was .95; make fully opaque */
  text-shadow: 0 2px 6px rgba(0,0,0,.55);
}


/* Article body */
.article-body {
  max-width: 760px;
  margin: 2rem auto 0;
  color: #2b2b2b;
}
.article-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  margin: 1rem 0;
  color: #3a3a3a;
}
.article-body .lead {
  color: #6b7280;
  font-size: 1.05rem;
  margin-top: .75rem;
}

/* Author box */
.author-box {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .75rem;
  align-items: center;
  padding-top: 1.5rem;
  margin-top: 1.75rem;
  border-top: 1px solid #e5e7eb;
}
.author-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #e5e7eb;
  display: grid; place-items: center;
  font-weight: 800; color: #555;
}

/* Back to Posts */
.back-row {
  display: flex; align-items: center; gap: .5rem;
  margin: 1rem 0 .25rem;
}
.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  text-decoration: none;
  font-weight: 700; color: #111;
}
.back-link:hover { text-decoration: underline; }


/* Make the invisible link fill the entire card */
.post-card, .featured-card { position: relative; }
.card-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
  text-indent: -9999px; 
}
.card-overlay:focus-visible {
  outline: 3px solid #7c3aed; outline-offset: 2px; border-radius: 12px;
}
  