:root{
  --muted-bg: rgba(255,255,255,0.03);
  --muted-text: #ddd;
  --link-accent: #9ecaff;
}

/* Back link in top-left */
.back-link{
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
}
.back-link a{
  color: white;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
}

h1 {
  font-family: 'Zen Tokyo Zoo', cursive;
  font-size: 6rem;
  font-weight: 400;
  text-align: center;
}

/* Main blog container */
.blog-main{
  width: 92%;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  display: block;
  height: auto;
}

.blog-main .circle_img{
  /* keep existing image sizing from style.css; override margin if needed */
  margin: 0.5rem auto;
}

/* give a little extra space below the fixed back-link so the header doesn't sit too close */
.back-link{
  padding-bottom: 0.5rem;
}

.blog-header{
  margin-top: 0.5rem;
}

.posts{
  margin-top: 1.5rem;
  text-align: left;
  /* normal document flow: let the page scroll, articles size to content */
  overflow: visible;
  box-sizing: border-box;
  padding: 0.5rem 0.5rem 2rem 0.5rem;
}

/* Hide scrollbar but keep scrolling functional */
.posts::-webkit-scrollbar {
  display: none;
}
.posts {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}


.blog-article{
  background: var(--muted-bg);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  /* normal article: size to content */
  height: auto;
  box-sizing: border-box;
  display: block;
}

/* On single-post pages (full article view) remove the muted panel background so text sits on page background */
body.single-post .blog-article{
  background: transparent;
}

.post-inner{
  width: 100%;
}

/* remove snap behaviour for normal blog listing */
/* single-post overrides still apply for full article pages */

/* Ensure blog page overrides the homepage layout settings */
body.blog-page{
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

/* Single-post pages should behave like normal pages: no internal scrolling, no snap, normal document flow */
body.single-post{
  /* revert to normal document flow */
  display: block !important;
  height: auto !important;
  min-height: auto !important;
  overflow: auto !important;
}

body.single-post .blog-main{
  height: auto !important;
  flex: initial !important;
}

body.single-post .posts{
  /* allow posts to flow in page (no internal scroll) */
  overflow: visible !important;
  height: auto !important;
  flex: initial !important;
  scroll-snap-type: none !important;
  -webkit-overflow-scrolling: auto !important;
  padding-bottom: 2rem !important;
}

body.single-post .blog-article{
  /* each article should size to its content on single-post pages */
  height: auto !important;
  scroll-snap-align: none !important;
}

/* chevron shown when there's more content */
.scroll-chevron{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.scroll-chevron.visible{
  opacity: 1;
  pointer-events: auto;
}
.scroll-chevron:before,
.scroll-chevron:after{
  content: '';
  position: absolute;
  left: 50%;
  width: 50%;
  height: 3px;
  background: #fff;
  transform-origin: center;
}
.scroll-chevron:before{
  transform: translateX(-50%) rotate(45deg);
  top: 40%;
}
.scroll-chevron:after{
  transform: translateX(-50%) rotate(-45deg);
  top: 40%;
}

/* bounce animation */
.scroll-chevron.visible{
  animation: chevron-bounce 1.5s infinite;
}
@keyframes chevron-bounce{
  0%{ transform: translateX(-50%) translateY(0); }
  50%{ transform: translateX(-50%) translateY(8px); }
  100%{ transform: translateX(-50%) translateY(0); }
}

.blog-article .post-title{
  color: white;
  margin: 0 0 0.5rem 0;
  font-family: 'Poppins', sans-serif;
}

/* Ensure title links are white and not the browser default blue */
.post-title a{
  color: white;
  text-decoration: underline;
}
.post-title a:hover{
  color: #e6f4ff; /* slight tint on hover */
}

.blog-article p{
  color: var(--muted-text);
  margin: 0 0 0.5rem 0;
}

a.read-more{
  color: var(--link-accent);
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
}

/* Small tweaks to ensure blog fits on smaller screens */
@media screen and (max-width:600px){
  .blog-main{
    padding-top: 1.25rem;
  }
  .back-link{ top: 0.5rem; left: 0.5rem;}
}
