/* ========================================
   IN SEARCH OF THE MIRACULOUS - STYLES
   ======================================== */

/* Figure toggle tables - prevent data table styles from affecting them */
table.figure-toggle,
table.figure-toggle td,
table.figure-toggle th {
    border: none !important;
    border-collapse: separate !important;
    background: transparent !important;
    padding: 0 !important;
    text-align: center !important;
    font-weight: normal !important;
    z-index: auto !important;
    position: static !important;
}

table.figure-toggle td {
    vertical-align: top !important;
}

table.figure-toggle {
    width: auto !important;
    display: table !important;
}

/* TABLE 8 - Cosmological Time Scales Interactive Table */

/* Remove these page-level rules - they affect everything */
/* * { box-sizing: border-box; } */
/* body { font-family: Georgia, 'Times New Roman', serif; background-color: #f5f5f5; padding: 20px; margin: 0; } */

/* If you need box-sizing for this table only, add it to the container */
.table8-container {
    box-sizing: border-box;
}

.table8-container * {
    box-sizing: border-box;
}

.table8-container h4 {
    text-align: center;
    margin-bottom: 5px;
    font-size: 1.5em;
    margin-top: 10px;
}

.table8-container .subtitle {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
    margin-top: 5px;
}

.table8-container .preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.table8-container .preset-btn {
    padding: 10px 20px;
    border: 2px solid #000;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    background-color: #fff;
    color: #000;
    transition: all 0.3s;
}

.table8-container .preset-btn:hover {
    background-color: #000;
    color: #fff;
}

.table8-container .preset-btn.active {
    background-color: #000;
    color: #fff;
}

.table8-container .toggle-section {
    border: 2px solid #000;
    border-radius: 8px;
    padding: 15px;
    background-color: #fafafa;
    margin-bottom: 20px;
    margin-top: 10px;
}

.table8-container .toggle-label {
    font-weight: bold;
    color: #000;
    margin-bottom: 15px;
    font-size: 14px;
}

.table8-container .toggle-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table8-container .toggle-btn {
    padding: 8px 16px;
    border: 2px solid #000;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #000;
    transition: all 0.3s;
}

.table8-container .toggle-btn:hover {
    background-color: #f0f0f0;
}

.table8-container .toggle-btn.active {
    background-color: #000;
    color: white;
    border-color: #000;
}

.table8-container .table-wrapper {
    overflow-x: auto;
    border: 2px solid #1f2937;
    border-radius: 8px;
    margin-bottom: 10px;
}

.table8-container table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table8-container th,
.table8-container td {
    border: 2px solid #1f2937;
    padding: 12px;
    text-align: center;
}

.table8-container th {
    background-color: #f3f4f6;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
}

.table8-container td.row-label {
    font-weight: bold;
    text-align: left;
    position: sticky;
    left: 0;
    background-color: inherit;
    z-index: 10;
}

.table8-container th.row-label-header {
    text-align: left;
    position: sticky;
    left: 0;
    background-color: #f3f4f6;
    z-index: 11;
    width: 130px;
    max-width: 130px;
}

.table8-container tr:nth-child(even) {
    background-color: #f9fafb;
}

.table8-container tr:nth-child(even) td.row-label {
    background-color: #f9fafb;
}

.table8-container tr:nth-child(odd) td.row-label {
    background-color: white;
}

.table8-container .hidden-column {
    display: none;
}

.table8-container .credit {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #6b7280;
}

.table8-container .credit em {
    font-style: italic;
}

/* TABLE 9 */
.table9 {
  min-width: 600px;  /* adjust this value based on what looks right */
  width: auto;
}

.table9 math mi {
    font-style: italic;
}

/* First column - cosmological names */
.table9 td:nth-child(1) {
    padding: 5px 10px;
}

/* Second column */
.table9 td:nth-child(2) {
    padding: 5px 10px;
}

/* Third column */
.table9 td:nth-child(3) {
    padding: 5px 0px;
}

/* Fourth column */
.table9 td:nth-child(4) {
    padding: 5px 0px;
}

/* TABLE 4 */
table.table-style4 td {
    border: 1px solid #000 !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 2px 6px !important;
    font-size: 11pt !important;
    font-weight: bold !important;
}
/* Remove border from Table 4 caption row */
table.table-style4 td[colspan] {
    border: none !important;
}
.table-style4 td:empty::after {
    content: '\00a0';
}

        /* Triad table styling */
        .triad-table {
            border-collapse: collapse;
            margin: 0.25em 0;  /* vertical margins only */
            font-family: serif;
            font-size: 1em;
        }
        
        .triad-table td {
            padding: 0.02em 0.3em;
            text-align: left;
            line-height: 1.1;
        }
        
        /* Bracket column - centered with no padding */
        .triad-table td:nth-child(6) {
            vertical-align: middle;
            text-align: center;
            padding: 0;
        }
        
        /* H-numbers column - semi-bold */
        .triad-table td:nth-child(7) {
            font-weight: 600;
        }
        
        /* Table 1 - The big hydrogen table */
        /* Table wrapper for horizontal scrolling */
        .table-wrapper {
        overflow-x: auto;
        width: 100%;
        margin: 20px 0;
        }
        
        #table-1 td {
        border: none;
        text-align: left;
        vertical-align: middle;
        padding: 0px 4px;
        font-size: 11pt;
        }
        
        #table-1 {
        min-width: 600px;
         width: auto;
        }

         /* Widen specific columns that are too cramped */
         #table-1 td:nth-child(2),  /* Middle section first column (C2, O4, N6, etc.) */
         #table-1 td:nth-child(9) { /* Right section first column (do, si, la, sol, fa) */
         padding-right: 10px;    /* Add extra spacing to the right */
         }
         
         /* Fix nested tab widths */
        .tab_container-style2 .tab_content-style2 {
         width: 100% !important;
        }

        div#tab173-style2 {
        width: 100% !important;
        }
        
        /* Table 2-3 */
        .table2-3 {
        width: fit-content;
        }
       .table2-3 td {
        padding: 4px 10px;
        text-align: left;
        }
      .table2-3 td.bracket-cell {
       padding: 4px 0px;  /* No horizontal padding at all */
       }
       
       math mi {
       font-style: italic;
       }
