/* ===============================
   ARTICLE PAGE LAYOUT
================================ */
.article-layout{
  display: grid;
  grid-template-columns: 3fr 1.2fr;
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  font-family: "Poppins", sans-serif;
  align-items: start;
  overflow: visible; /* sticky safe */
}

/* ✅ Sticky ke liye parent/grid ko overflow se block na kare */
.article-layout,
.article-main,
.article-sidebar{
  overflow: visible;
}

/* ===============================
   MAIN ARTICLE
================================ */
.article-main{
  background: #fff;
  padding: 25px;
  border-radius: 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.article-title{
  font-size: 28px;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
  line-height: 1.3;
}

.article-meta{
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #777;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 20px;
}
.article-meta strong{ color: #111; }

.article-img{
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  margin: 20px 0;
}

.article-text{
  font-size: 16px;
  line-height: 1.9;
  color: #333;
}
.article-text p{ margin-bottom: 18px; }

/* ===============================
   RELATED ARTICLES
================================ */
.related-articles{ margin-top: 40px; }

.related-articles h3{
  font-size: 20px;
  margin-bottom: 15px;
  border-left: 4px solid #007bff;
  padding-left: 10px;
}

.related-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
}

.related-card{
  background: #fafafa;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: #000;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: .3s;
}
.related-card:hover{ transform: translateY(-6px); }

.related-card img{
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.related-card p{
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
}

/* ===============================
   SIDEBAR WRAPPER
================================ */
.article-sidebar{
  position: sticky;
  top: 100px;

  /* ✅ Ensure sidebar apna height pakde */
  height: fit-content;
  max-height: none;
  align-self: start;
  overflow: visible;

  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* SIDEBAR CARD BOX */
.sidebar-box{
  background: #fff;
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.05);
  transition: .3s;
}
.sidebar-box:hover{ transform: translateY(-3px); }

.sidebar-box h4{
  font-size: 16px;
  margin-bottom: 15px;
  font-weight: 600;
  border-left: 4px solid #28a745;
  padding-left: 8px;
}

/* AD BOX */
.ad-box{
  background: #f5f7fa;
  padding: 25px;
  text-align: center;
  border-radius: 10px;
  font-size: 14px;
  border: 1px dashed #ddd;
}

/* CATEGORY LINKS */
.side-link{
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #eee;
  transition: .3s;
}
.side-link:last-child{ border-bottom: none; }
.side-link:hover{
  color: #007bff;
  padding-left: 6px;
}

/* POST STYLE (image + text) */
.side-post{
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  text-decoration: none;
  color: #333;
}

.side-post img{
  width: 65px;
  height: 55px;
  object-fit: cover;
  border-radius: 8px;
}

.side-post span{
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.side-post small{
  display: block;
  font-size: 12px;
  color: #777;
}

/* TAGS */
.tag-wrap{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-wrap a{
  background: #eef2ff;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 30px;
  text-decoration: none;
  color: #2563eb;
  transition: .3s;
}
.tag-wrap a:hover{
  background: #2563eb;
  color: #fff;
}

/* SUBSCRIBE */
.subscribe-box input{
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
  outline: none;
}
.subscribe-box input:focus{ border-color: #007bff; }

.subscribe-box button{
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #007bff;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  transition: .3s;
}
.subscribe-box button:hover{ background: #0056b3; }

/* SOCIAL */
.social-links{
  display: flex;
  gap: 15px;
}
.social-links a{
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
  border-radius: 50%;
  color: #007bff;
  transition: .3s;
}
.social-links a:hover{
  background: #007bff;
  color: #fff;
}

/* ===============================
   BACK TO TOP BUTTON
================================ */
#backToTop{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: #111;
  color: #fff;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: .25s;
}

#backToTop.show{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#backToTop:hover{ transform: translateY(-3px); }

/* ===============================
   MOBILE RESPONSIVE
================================ */
@media (max-width: 900px){
  .article-layout{ grid-template-columns: 1fr; }

  .article-sidebar{
    position: relative;
    top: 0;
  }

  .article-title{ font-size: 24px; }
}

@media (max-width: 500px){
  .article-meta{
    flex-direction: column;
    gap: 5px;
  }

  .article-text{ font-size: 15px; }
}
