/* ==========================================================
   BASE / SAFETY
   - explicit LTR + overflow guard in case theme/plugin
     sets RTL or an oversized element leaks page width
   ========================================================== */

html, body {
  direction: ltr;
  max-width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

.ramdev-single img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================
   HERO
   Mobile: image renders at its natural ratio (no crop) so
   any text baked into the featured-image graphic is never
   clipped or overlapped by the live overlay text.
   Desktop: switches to the cinematic 21:9 crop.
   ========================================================== */

.post-hero {
  position: relative;
  width: 100%;
  margin: 15px auto 0;
  overflow: hidden;
 	border: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.post-hero img {
  width: 100%;
  height: auto;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, .85) 0%,
    rgba(0, 0, 0, .55) 35%,
    rgba(0, 0, 0, .15) 100%
  );
  display: flex;
  align-items: flex-end;
}

.hero-content {
  width: 100%;
  padding: 20px;
  color: #fff;
}

.post-category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #d97706;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}

.hero-content h1 {
  color: #fff;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
  margin: 0 0 10px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, .4);
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  font-weight: 500;
}

.post-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ast-container{
	padding: 0;
}

/* ==========================================================
   MOBILE TOC
   ========================================================== */

.mobile-toc {
  display: block;
  margin: 20px;
}

.toc-box {
  background: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.toc-box ul {
  padding-left: 18px;
  margin: 10px 0 0;
}

.toc-box li {
  margin-bottom: 8px;
}

/* ==========================================================
   MAIN LAYOUT
   Mobile: plain stacked block flow — article, then sidebar,
   in the order they already appear in the HTML. No grid,
   no "order" property needed.
   ========================================================== */

.content-layout {
  width: 100%;
  padding: 0 15px;
  margin: 20px auto;
}

.article-main {
  width: 100%;
}

.article-sidebar {
  width: 100%;
  margin-top: 20px;
}

.desktop-toc {
  display: none;
}

/* ==========================================================
   POST CONTENT / TYPOGRAPHY (mobile base sizes)
   ========================================================== */

.post-content {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.post-content p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 16px;
}

.post-content h2 {
  font-size: 24px;
  line-height: 1.3;
  margin: 32px 0 12px;
}

.post-content h3 {
  font-size: 19px;
  line-height: 1.35;
  margin: 24px 0 10px;
}

.post-content ul,
.post-content ol {
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.7;
}

.post-content li {
  margin-bottom: 6px;
}

/* Tables: scroll within themselves rather than
   ever forcing the page wider than the viewport */
.post-content .wp-block-table {
  overflow-x: auto; /* scroll protection lives on the wrapper, not the table */
}

.post-content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  table-layout: fixed; /* optional: forces even column widths */
}

.post-content th,
.post-content td {
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  text-align: left;
  /* remove white-space: nowrap, or only apply it if you truly have long unbroken strings */
}

/* ==========================================================
   SIDEBAR CARDS
   ========================================================== */

.sidebar-card {
  background: white;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.sidebar-card:last-child {
  margin-bottom: 0;
}

.sidebar-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.sidebar-card p {
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 10px;
}

.sidebar-card ul {
  padding-left: 18px;
  margin: 0;
}

.sidebar-card li {
  margin-bottom: 8px;
  font-size: 15px;
}

.sidebar-card a {
  text-decoration: none;
  color: #333;
}

.sidebar-card a:hover {
  color: #d97706;
}

/* ==========================================================
   RELATED POSTS (mobile: single column)
   ========================================================== */

.related-posts {
  padding: 0 15px;
  margin: 50px auto;
}

.related-posts h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.related-card {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
  display: block;
}

.related-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.related-content {
  padding: 16px;
}

.related-card h3 {
  font-size: 17px;
  line-height: 1.4;
  margin: 0 0 10px;
  color: #0f172a;
}

.related-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin: 0 0 14px;
}

.read-more {
  display: inline-block;
  font-weight: 700;
  font-size: 14px;
  color: #d97706;
  transition: 0.3s;
}

.related-card:hover .read-more {
  transform: translateX(5px);
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .12);
}

/* ==========================================================
   TABLET (≥768px) — typography and spacing scale up,
   still single-column stacked layout
   ========================================================== */

@media (min-width: 768px) {

  .post-hero {
    margin-top: 25px;
    border-radius: 18px;
  }

  .hero-content {
    padding: 35px;
  }

  .post-category {
    font-size: 13px;
    padding: 8px 16px;
  }

  .hero-content h1 {
    font-size: 34px;
    margin-bottom: 16px;
  }

  .post-meta {
    font-size: 14px;
  }

  .content-layout {
    max-width: 800px;
    padding: 0 20px;
  }

  .post-content {
    padding: 40px;
  }

  .post-content p,
  .post-content ul,
  .post-content ol {
    font-size: 18px;
  }

  .post-content h2 {
    font-size: 32px;
  }


  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================
   DESKTOP (≥1025px) — two-column grid with sticky sidebar
   ========================================================== */

@media (min-width: 1025px) {

  .post-hero {
    max-width: 1400px;
    aspect-ratio: 21 / 9;
    margin-top: 30px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .15);
  }

  .post-hero img {
    height: 100%;
    object-fit: cover;
  }

  .hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px;
  }

  .post-category {
    font-size: 14px;
  }

  .hero-content h1 {
    font-size: clamp(40px, 4vw, 72px);
    line-height: 1.05;
    max-width: 900px;
  }

  .post-meta {
    font-size: 15px;
    gap: 12px;
  }

  .mobile-toc {
    display: none;
  }

  .desktop-toc {
    display: block;
  }

  .content-layout {
    max-width: 1200px;
    display: grid;
    grid-template-columns: 820px 320px;
    gap: 40px;
    justify-content: center;
    padding: 0 20px;
    margin: 50px auto;
  }

  .article-main {
    min-width: 0;
  }

  .article-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
    margin-top: 0;
	    align-self: start;
  }

  .post-content {
    padding: 60px;
    border-radius: 20px;
  }

  .related-posts {
    max-width: 1300px;
  }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }

  .related-card img {
    height: 220px;
  }
}