/* --- Stagit Typography & Baseline --- */
.stagit-container {
    font-family: var(--font-mono);
    font-size: 1rem; /* Smaller font to accommodate dense code and tables */
    overflow-x: auto;
}

.stagit-container pre {
    font-family: var(--font-mono);
    white-space: pre-wrap;
    word-break: break-word;
}

/* --- Stagit Tables & Layout --- */
.stagit-container table {
    width: 100%;
    border-collapse: collapse;
}

.stagit-container table thead td {
    font-weight: bold;
    color: var(--highlight-yellow);
    border-bottom: 1px dashed var(--muted-grey);
    padding-bottom: 0.5rem;
}

.stagit-container table td {
    padding: 0.2rem 0.5rem;
}

.stagit-container #content table td {
    vertical-align: top;
    white-space: nowrap;
}

/* Force commit messages and descriptions to wrap, taking available space */
.stagit-container #index tr td:nth-child(2),
.stagit-container #tags tr td:nth-child(3),
.stagit-container #branches tr td:nth-child(3),
.stagit-container #log tr td:nth-child(2) {
    white-space: normal;
    width: 100%;
}

/* Remove the blanket pink color from all numbers */
.stagit-container td.num {
    text-align: right;
    color: var(--muted-grey);
}

/* Force the '+' column (both header and numbers) on the log page to be green */
.stagit-container #log tr td:nth-child(5) {
    color: var(--highlight-green) !important;
}

/* Force the '-' column (both header and numbers) on the log page to be red */
.stagit-container #log tr td:nth-child(6) {
    color: var(--highlight-red) !important;
}

.stagit-container .desc {
    color: var(--muted-grey);
}

/* Row Hover States */
.stagit-container #branches tr:hover td,
.stagit-container #tags tr:hover td,
.stagit-container #index tr:hover td,
.stagit-container #log tr:hover td,
.stagit-container #files tr:hover td {
    background-color: #0a0a0a; /* Matches your nested-code background */
}

/* --- Links --- */
.stagit-container a {
    color: var(--highlight-green);
    text-decoration: none;
}

.stagit-container a:hover {
    background-color: var(--highlight-green);
    color: var(--bg-color);
    font-weight: bold;
}

.stagit-container a.d,
.stagit-container a.h,
.stagit-container a.i,
.stagit-container a.line {
    text-decoration: none;
}

/* Line Numbers */
.stagit-container #blob a {
    color: var(--muted-grey);
}

.stagit-container #blob a:hover {
    color: var(--bg-color);
    background-color: var(--highlight-yellow);
}

.stagit-container a:target {
    background-color: var(--highlight-yellow);
    color: var(--bg-color);
}

/* --- Diff Colors --- */
/* Hunks (@@ -X,Y +X,Y @@) */
.stagit-container pre a.h {
    color: var(--highlight-blue);
}

/* Additions (+) */
.stagit-container .A,
.stagit-container span.i,
.stagit-container pre a.i {
    color: var(--highlight-green);
}

/* Deletions (-) */
.stagit-container .D,
.stagit-container span.d,
.stagit-container pre a.d {
    color: var(--highlight-red);
}

.stagit-container pre a.h:hover,
.stagit-container pre a.i:hover,
.stagit-container pre a.d:hover {
    text-decoration: none;
    background-color: transparent;
}

/* Prevent the header table from stretching and causing massive gaps */
.stagit-container table:first-of-type {
    width: auto;
    margin-bottom: 1.5rem;
}

.stagit-container table:first-of-type td {
    padding: 0;
    padding-right: 1rem; /* Adjust this to control the exact space between icon and text */
}
