
/* ================= AUTO NUMBERING ================= */

body{
counter-reset: h1counter;
}

h1{
counter-reset: h2counter;
counter-increment: h1counter;
}

h1::before{
content: counter(h1counter) ". ";
color: var(--primary-blue);
font-weight:700;
}

h2{
counter-reset: h3counter;
counter-increment: h2counter;
}

h2::before{
content: counter(h1counter) "." counter(h2counter) " ";
color: var(--accent-orange);
font-weight:700;
}

h3{
counter-reset: h4counter;
counter-increment: h3counter;
}

h3::before{
content: counter(h1counter) "." counter(h2counter) "." counter(h3counter) " ";
color:#009688;
font-weight:600;
}

h4{
counter-increment: h4counter;
}

h4::before{
content: counter(h1counter) "." counter(h2counter) "." counter(h3counter) "." counter(h4counter) " ";
color:#673ab7;
font-weight:600;
}




/* Wrapper for mobile scrolling */
.table-container{
    width:100%;
    overflow-x:auto;
}

/* Table Styling */
table{
    border-collapse:collapse;
    width:100%;
    min-width:600px; /* prevents breaking on small screens */
    margin:20px 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background:#ffffff;
    border-radius:10px;
    overflow:hidden;
    box-shadow:0 4px 12px rgba(0,0,0,0.08);
}

/* Header */
thead{
    background:linear-gradient(135deg,#4e73df,#224abe);
    color:white;
}

th{
    padding:14px;
    font-weight:600;
    letter-spacing:0.5px;
    text-align:left;
}

/* Body cells */
td{
    padding:12px;
    text-align:left;
    border-bottom:1px solid #e0e0e0;
}

/* Zebra stripes */
tbody tr:nth-child(even){
    background:#f8f9fc;
}

/* Hover effect */
tbody tr:hover{
    background:#e2e6f5;
    transition:0.3s ease;
}

/* Remove last row border */
tbody tr:last-child td{
    border-bottom:none;
}

/* Mobile optimization */
@media(max-width:768px){
    table{
        font-size:14px;
    }
    th, td{
        padding:10px;
    }
}


/* Paragraph Styling */
p{
    line-height: 1.9;
    margin-bottom: 18px;
    text-align: justify;
    font-size: 1.05rem;
    color: #2c2c2c;
    font-family: serif;
    letter-spacing: 0.3px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
}

/* Highlighted text inside paragraph */
p strong{
    color: var(--primary-blue, #1f4e79);
    font-weight: 600;
}

/* Smooth reading on mobile */
@media (max-width: 768px){
    p{
        font-size: 0.98rem;
        line-height: 1.8;
       
        padding: 0 14px;
    }
}


    /* Container styling */
.math-list{
  max-width: 800px;
  margin: 30px auto;
  padding: 25px 30px;
  background: var(--soft-bg);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Ordered list styling */
.math-list ol{
  padding-left: 25px;
  margin: 0;
}

/* Each list item */
.math-list li{
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #ffffff;
  border-left: 4px solid var(--primary-blue);
  border-radius: 6px;
  transition: all 0.3s ease;
}

/* Hover effect (desktop only) */
.math-list li:hover{
  background: #eef2ff;
  transform: translateX(4px);
}

/* Mobile responsiveness */
@media (max-width: 600px){
  .math-list{
    padding: 18px;
  }

  .math-list li{
    font-size: 1rem;
    padding: 8px 10px;
  }
}


/* ================= EQUATION STYLE ================= */


body{
    counter-reset: eqcounter;
}

.math-equation{
    position: relative;
    padding: 20px 70px 20px 20px;  /* extra right space for number */
    margin: 20px 0;
    background:	#fff2cc;
    border-left: 4px solid #4a6cf7;
    border-radius: 8px;

    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;

  /*  counter-increment: eqcounter;*/
}

/* Keep MathJax width natural */
.math-equation .MathJax{
    display: inline-block !important;
    min-width: max-content;
}

/* ===== Equation Number ===== */
.math-equation::after{
  /*  content: "(" counter(eqcounter) ")"; */
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #555;
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ================= MOBILE ================= */

@media (max-width: 768px){

    .math-equation{
        font-size: .95rem;
        padding: 20px 70px 20px 15px; /* KEEP right space */
    }

    /* IMPORTANT: keep absolute positioning even on mobile */
    .math-equation::after{
        right: 10px;
        font-size: .85rem;
    }
}