/*********************************** Posts ***********************************/

.page-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 40px auto;
  gap: 30px;
  padding: 0 20px;
  box-sizing: border-box;
}

.sidebar-left,
.sidebar-right {
  width: 250px;
  position: relative;
  box-sizing: border-box;
}

.toc {
  width: 100%;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  height: fit-content;
}

.toc h4 { margin-bottom: 10px; }

.toc a {
  display: block;
  color: #2c3e50;
  text-decoration: none;
  margin-bottom: 8px;
  font-size: 14px;
  transition: color 0.2s;
}
.toc a:hover { color: #f36e45; }

.main-content {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.main-content h1 {
  font-size: 2.5em;
  color: #2c3e50;
  margin-bottom: 15px;
}

.meta {
  color: #7f8c8d;
  margin-bottom: 30px;
  font-size: 16px;
  border-bottom: 1px solid #efefef;
}

.content {
  font-size: 18px;
  line-height: 1.8;
  color: #2c3e50;
}

.content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
}

.content h2, .content h3 {
  margin-top: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}

.social {
  width: 100%;
  position: sticky;
  top: 20px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  text-align: center;
}

.social h4 {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 10px;
}

.social-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.social-buttons a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: white;
  font-size: 18px;
  text-decoration: none;
  transition: transform 0.2s;
}
.social-buttons a:hover { transform: scale(1.1); }

.social-buttons .insta { background: #962fbf; }
.social-buttons .fb { background: #3b5998; }
.social-buttons .linkedin { background: #0077b5; }

.ad-box {
  width: 100%;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}
.ad-box h5 { margin: 0; font-size: 14px; font-weight: 600; color: #2c3e50; }
.ad-box p { margin: 0; font-size: 12px; color: #555; padding: 0; }
.ad-box a {
  padding: 6px 12px;
  background: #f36e45;
  border: none;
  border-radius: 5px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.other-posts { margin: 50px auto; padding: 0 20px; box-sizing: border-box; }
.post-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.post-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  transition: all 0.3s ease;
  border-left: 4px solid #f36e45;
  box-sizing: border-box;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  background: #fff;
}
.post-card h4 { margin: 0 0 10px 0; font-size: 1.1em; line-height: 1.4; }
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #95a5a6;
}

pre.language-python {
  background-color: #efefef;
  color: #333;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: poppins, monospace;
  font-size: 14px;
  line-height: 1.5;
}

@media screen and (max-width: 992px) {
  .page-container {
    flex-direction: column;
    align-items: center;
  }
  .toc, .social {
    position: static;
    width: 100%;
    max-width: 600px;
  }
  .main-content { width: 100%; max-width: 600px; }
  .post-cards { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 768px) {
  .toc { display: none; }
  .main-content { max-width: 100%; padding: 0 10px; }
}

@media screen and (max-width: 600px) {
  .post-cards { grid-template-columns: 1fr; }
  .main-content h1 { font-size: 1.8em; }
  .content { font-size: 16px; }
}