/* Minimalist CSS inspired by Medium, compatible with WordPress */

@font-face {
  font-family: "AdiShila";
  src: url("https://adishila.com/wp-content/uploads/2020/05/Adishila.ttf");
} 

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}
body {
  font-family: 'AdiShila';
  font-size: 25px;
  line-height: 1.6;
  color: #333;
  background-color: #f7f7f7;
  margin: 0;
  padding: 0;
}


.Mula, .Sarvamula, .pramana, .padya, .Colophon_Mula, .Colophon_Sarvamula {
  margin-bottom: 0.5em;
}

.Mula, .Sarvamula, .Colophon_Mula, .Colophon_Sarvamula{
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.Mula {
    font-size: 30px;
    font-weight: bold;
}

.padya p {
  margin: 0 0 1em;
  text-align: justify;
  line-height:1.2;
 }

.padya {
  display:block;
  margin-bottom: 0.25em;
  margin-top: 0.5em;
}

.padya span {
  display: block;
  margin-bottom: 0.25em;
}

/* Hierarchical styles for Heading1 to Heading6 */
.Heading1, .Heading0 {
  font-size: 1.5em;
  font-weight: bold;
  color: #1a237e;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  border-bottom: 2px solid #3949ab;
  padding-bottom: 0.2em;
}

.Heading2 {
  font-size: 1.3em;
  font-weight: bold;
  color: #283593;
  margin-top: 1em;
  margin-bottom: 0.4em;
  /*padding-left: 16px;*/
  border-left: 4px solid #5c6bc0;
}

.Heading3 {
  font-size: 1.2em;
  font-weight: bold;
  color: #3949ab;
  margin-top: 0.8em;
  margin-bottom: 0.3em;
  /*padding-left: 32px;*/
  border-left: 3px solid #7986cb;
}

.Heading4 {
  font-size: 1.1em;
  font-weight: bold;
  color: #5c6bc0;
  margin-top: 0.7em;
  margin-bottom: 0.2em;
  /*padding-left: 48px;*/
  border-left: 2px solid #9fa8da;
}

.Heading5 {
  font-size: 1em;
  font-weight: bold;
  color: #7986cb;
  margin-top: 0.6em;
  margin-bottom: 0.2em;
  /*padding-left: 64px;*/
  border-left: 2px dotted #c5cae9;
}

.Heading6 {
  font-size: 0.9em;
  font-weight: bold;
  color: #9fa8da;
  margin-top: 0.5em;
  margin-bottom: 0.2em;
  /*padding-left: 80px;*/
  border-left: 1px dotted #e8eaf6;
}

.Subheading {
  font-size: 1.0em !important;           /* Much smaller font */
  font-weight: normal;                   /* Not bold, adjust if needed */
  color: #3949ab;                        /* Subtle color if you wish */
  position: relative;
  margin-bottom: 0.5em;                /* Space below the subheading */
  padding-left: 40px;                   /* Indentation for the subheading */
}

.Subheading::before {
    content: '(';           
}

.Subheading::after {
    content: ')';           
}
/* BhashyaHeading styles inherit all properties from Heading2 to Heading6, except color */

.BhashyaHeading1 {
  /* All styles from .Heading2 */
  font-size: 1.3em;
  font-weight: bold;
  margin-top: 1em;
  margin-bottom: 0.4em;
  padding-left: 16px;
  border-left: 4px solid #5c6bc0;
  color: #424242; /* Changed color */
}

.BhashyaHeading2 {
  /* All styles from .Heading3 */
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 0.8em;
  margin-bottom: 0.3em;
  padding-left: 32px;
  border-left: 3px solid #7986cb;
  color: #616161 /* Changed color */
}

.BhashyaHeading3 {
  /* All styles from .Heading4 */
  font-size: 0.9em;
  font-weight: bold;
  margin-top: 0.7em;
  margin-bottom: 0.2em;
  padding-left: 48px;
  border-left: 2px solid #9fa8da;
  color: #757575; /* Changed color */
}

.BhashyaHeading4 {
  /* All styles from .Heading5 */
  font-size: 0.8em;
  font-weight: bold;
  margin-top: 0.6em;
  margin-bottom: 0.2em;
  padding-left: 64px;
  border-left: 2px dotted #c5cae9;
  color: #9e9e9e; /* Changed color */
}

.BhashyaHeading5 {
  /* All styles from .Heading6 */
  font-size: 0.7em;
  font-weight: bold;
  margin-top: 0.5em;
  margin-bottom: 0.2em;
  padding-left: 80px;
  border-left: 1px dotted #e8eaf6;
  font-style: italic;
  color: #bdbdbd; /* Changed color */
}

.BhashyaHeading6 {
  /* All styles from .Heading6 (same as above, but different color) */
  font-size: 0.6em;
  font-weight: bold;
  margin-top: 0.5em;
  margin-bottom: 0.2em;
  padding-left: 80px;
  border-left: 1px dotted #e8eaf6;
  font-style: italic;
  color: #e0e0e0; /* Changed color

p {
  margin: 0 0 1em;
  /*font-size: 18px;*/
  /*color: #2c3e50;*/
}

.Sarvamula, .Colophon_Sarvamula {
  border-left: 4px solid #3498db;
  padding-left: 16px;
  /*padding-top: 0px;*/
}

.pramana {
  /*border-left: 4px solid #e67e22;*/
  /*padding-left: 16px;*/
  font-style: italic;
  color:blue;
  display:inline;
  align-items: baseline;

}
.pramana-inline {
  color:blue;
  display:inline !important;
  align-items: baseline;
}

.Mula, .Colophon_Mula{
  border-left: 4px solid #2ecc71;
  padding-left: 16px;
}

a {
  color: #3498db;
  text-decoration: none;
  border-bottom: 1px solid #3498db;
}

a:hover {
  color: #2c3e50;
  border-bottom: 1px solid #2c3e50;
}

blockquote {
  font-style: italic;
  color: #7f8c8d;
  padding: 10px 20px;
  margin: 20px 0;
  border-left: 4px solid #bdc3c7;
  background: #ecf0f1;
}

code {
  font-family: 'Courier New', Courier, monospace;
  background: #f7f7f7;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 90%;
}

ul, ol {
  margin: 20px;
  padding: 0 20px;
}

li {
  margin-bottom: 10px;
}




.kutra {
    margin-left: 8px; /* Adds some spacing between the text and the kutra element */
    /*vertical-align: super;  Aligns it with the middle of the text */
    font-style: italic; /* Optional styling for better aesthetics */
    color: #333; /* Adjust text color to suit your design */
    font-size: 16px;
    color:blue;
    display: inline;
    align-items: center;
    white-space: nowrap;

}


/* Make last span of last padya inline with .kutra */
.pramana > .padya:last-of-type span:last-of-type {
  display: inline;
  margin-right: 0.5em;
}

.kutra::before {
  content: "(";
  margin-right: 2px;
}

.kutra::after {
  content: ")";
  margin-left: 2px;
  white-space: pre;
}

.pratika {
  font-weight: bold;
}

.footnote-ref, .pathantara-ref {
  font-size: 0.8em;
  vertical-align: super;
  cursor: pointer;
  color: blue;
}

.footnotes-container {
  margin-top: 3rem;
  border-top: 1px solid #ccc;
  font-size: 0.9em;
}

.footnotes-container ol {
  padding-left: 1.5rem;
}


.document-status {
  text-align: center;
  font-weight: bold;  
  padding: 0.75rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: white;
  border-radius: 6px;
}

/* Stage-specific colors */
.document-status.draft {
  background-color: #f39c12;
}

.document-status.review {
  background-color: #3498db;
}

.document-status.final {
  background-color: #27ae60;
}


/* Make the final text node (e.g., इति ब्रह्माण्डे।) inline too */
.Sarvamula::after {
  display: inline;
  margin-left: 6px;
  font-style: normal;
  color: #333;
}

.closing {
  display: inline !important;
  margin-left: 4px;
  color:black;
  font-style: normal;
}


span.pathantara {
    display: inline;
}

span.kutra {
    display: inline;
    color:black
}

span.inline-padya {
    display: inline;
}



.padya.inline-padya {
  display: flex !important;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0.5em;
}

span.pramana {
    display: inline;
}

.toc-right {
  position: fixed;
  top: 100px;
  right: 30px;
  width: 300px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 16px 16px 8px 16px;
  font-size: 14px;
  z-index: 1100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  max-height: 70vh;
  overflow-y: auto;
  transition: all 0.3s;
  display: block;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 25px;
}
.toc-right.minimized {
  display: none;
}
#toc-float-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1200;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #007acc;
  color: #007acc;
  font-size: 2em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toc-right ul {
  list-style: none;
  padding-left: 0.25em;
  margin: 0;
}
.toc-right li {
  margin-bottom: 6px;
}
.toc-right a {
  text-decoration: none;
  color: #007acc;
  transition: background 0.2s, color 0.2s;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-block;
}
.toc-right a.active {
  background: #e3f2fd;
  color: #1565c0;
  font-weight: bold;
}
#toc-toggle {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 1101;
  background: #fff;
  border-radius: 50%;
  border: 1px solid #ccc;
  width: 32px;
  height: 32px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
@media (max-width: 800px) {
  .toc-right {
    width: 95vw;
    left: 2.5vw;
    right: unset;
    top: auto;
    bottom: 20px;
    border-radius: 8px 8px 0 0;
    padding: 12px 12px 6px 12px;
    font-size: 16px;
    max-height: 60vh;
    overflow-y: auto;

  }
  #toc-float-toggle {
    bottom: 20px;
    right: 20px;
  }
}
@media (max-width: 500px) {
  .toc-right {
    width: 100vw;
    left: 0;
    right: unset;
    bottom: 0;
    border-radius: 8px 8px 0 0;
    padding: 10px 8px 4px 8px;
    font-size: 16px;
    max-height: 50vh;
    overflow-y: auto;
  }
}


.padya span.kutra {
  display: inline !important;
  vertical-align: baseline;
  margin-left: 8px;
  font-style: italic;
  color: #555;
  white-space: nowrap;
}

.padya span.kutra::before {
  content: "(";
  margin-right: 2px;
}

.padya span.kutra::after {
  content: ")";
  margin-left: 2px;
}

/*.padya span:last-of-type:not(.kutra) {
  display: contents !important;
}*/

.inline {
  display: inline !important;
}

/* Apply these styles to all your numbered heading classes */
.Heading1,
.Heading2,
.Heading3,
.Heading4,
.Heading5,
.Heading6,
.Heading7 {
    /* Ensure the heading itself contains the floated elements correctly */
    overflow: hidden; /* Creates a new Block Formatting Context */
    /* You might want to remove/adjust default browser margins for h-tags */
    margin-top: 0.83em;
    margin-bottom: 0.83em;
    padding-left: 20px; /* Ensure no extra padding pushes text right */
    text-indent: 0; /* Ensure no existing text-indent interferes */
}



/* The numbering part (e.g., "1.1.") */
.heading-prefix {
    float: left;         /* Floats the number to the left */
    white-space: nowrap; /* Prevents the number itself from wrapping */
    margin-right: 0.5em; /* Creates space between the number and the main text */
    /* Adjust margin-right to fine-tune the gap */
}

/* The main text content (e.g., "Narayanasya sadaya") */
.heading-text {
    /* This element will automatically flow around the floated .heading-prefix.
       Its lines will start after the prefix on the first line,
       and then subsequent lines will start at the element's own left edge,
       which achieves the desired alignment under "Narayanasya". */
    /*display: block;*/ /* Ensure it behaves as a block element for wrapping */
    /* No need for text-indent/padding-left here for this specific effect */
}

.rev_reference {
  display: list-item;
  font-size: 0.85em;
  color: #555;
  margin-left: 2em;
  margin-top: 0.2em;
}
.rev_reference a {
  display: inline-block;
  margin-right: 0.5em;
}
.rev_reference-number {
  font-weight: bold;
  margin-right: 0.3em;
  color: #888;
}

.pramana-inline span {
    display: contents;
}
.toggle-headings-btn {
    display: block;
    width: 100%;
    padding: 8px 0;
    margin-bottom: 12px;
    background-color: #1976d2;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-headings-btn:hover,
.toggle-headings-btn:focus {
    background-color: #1565c0;
    outline: none;
}


#toc, #toc-content, .Sarvamula, .Mula .Heading1, .Heading2, .Heading3, .Heading4, .Heading5, .Heading6 {
    box-sizing: border-box;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
    word-wrap: break-word; 
}

.book-title {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
}

/* Patha toggle button styles */
.patha-btn {
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 16px;
    margin-bottom: 4px;
    margin-right: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.patha-btn.active {
    background: #1976d2;
    color: #fff;
    font-weight: bold;
    text-decoration: underline;
    border-color: #1976d2;
}

.patha-btn:hover:not(.active) {
    background: #e3eafc;
    color: #1976d2;
}

.patha-content {
    margin-top: 10px;
    font-size: 1.1rem;
    padding: 8px 0;
    display: block;
    transition: opacity 0.2s;
}

.patha-toggle-container {
    margin: 16px 0 8px 0;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}