/* font and jimbo bg */
body {
    font-family: "Arial", sans-serif;
    color: white;
    background-color: #151515;
    background-image: url(bg_by_jimbophillips.com.png), url(bg_by_jimbophillips.com.png);
    background-repeat: no-repeat, repeat;
    background-attachment: fixed;
    background-position: right, left;
    background-size: auto 100%;
    margin: 0; /* for thin and centered content */
}

/* thin and centered content */
#maindiv {
    background-color: black;
    margin-left: auto;
    margin-right: auto;
    max-width: 987px; /* 987 + 8 + 8 = 1003 (viewport width of IE6 maximized on 1024x768 monitor, not counting scrollbar) */
    padding-left: 8px;
    padding-right: 8px;
    overflow: auto;
    min-height: 100vh;
}

/* link colors */
a {
    --a-link-color: #5e5eff;
    --a-visited-color: #994fde;
    /* --a-visited-color: #5e5eff; */
    --a-active-color: #ff0000;
}
a:link {
    color: var(--a-link-color);
    text-decoration: none;
}
a:visited {
    color: var(--a-visited-color);
}
a:hover {
    text-decoration: underline;
}
a:active {
    color: var(--a-active-color);
}

/* external links */
a[href^="http"]:link::after {
    content: "";
    /* extlink icon nabbed from wikipedia */
    --extlink-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M5.766 1L4.199 2.545l1.315 1.309-.164.164H1V11h6.982V6.762l.135-.135 1.31 1.31L11 6.391V1H5.766zm-.645.99l4.873.014.024 4.885L8.199 5.07l-.217.217-1 1L5.32 7.95 4.09 6.723l1.707-1.705 1.002-1 .174-.174L5.12 1.99zM2 5.018h2.35L2.703 6.662l2.69 2.688 1.59-1.588V10H2V5.018z'/%3E%3C/svg%3E");
    -webkit-mask-image: var(--extlink-svg);
    mask-image: var(--extlink-svg);
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 1px;
    background-color: var(--a-link-color);
}
a[href^="http"]:visited::after {
    background-color: var(--a-visited-color);
}
a[href^="http"]:active::after {
    background-color: var(--a-active-color);
}
.noextlink::after {
    display: none!important;
}

/* scale down images larger than window */
img {
    max-width: 100%;
    height: auto;
}

/* image with caption */
figure {
    max-width: 25%; /* best to override this with the image's width */
    border: 1px solid;
}
figure img {
    width: 100%;
    border-bottom: 1px solid;
}
figure figcaption {
    text-align: center;
    font-size: smaller;
}

/* line below headings and matching hr */
h1, hr {
    border: none;
    border-bottom: 2px solid;
}
h2, h3, h4, h5, h6 {
    border-bottom: 1px dotted;
}

/* list stuff */
ul {
    list-style-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpolygon points='0,0 3.51,3.5 0,7' style='fill:white;shape-rendering:crispEdges'/%3E%3C/svg%3E");
}
li {
    padding-bottom: 4px;
}

/* table of contents */
#toc {
    font-size: smaller;
    background-color: #202020;
    border: 1px solid #808080;
    width: fit-content;
    padding-left: 30px;
    padding-right: calc(30px - 2ch);
    padding-top: calc(15px - 1ex);
    padding-bottom: calc(15px - 1ex);
}
#toc div {
    text-align: center;
    margin-left: -2ch;
}
#toc,
#toc ol {
    list-style: none;
    counter-reset: item;
    line-height: 1.4;
}
#toc li,
#toc ol li {
    padding-bottom: initial;
}
#toc li::before,
#toc ol li::before {
    content: counters(item, ".") ".";
    counter-increment: item;
    margin-left: -2ch;
    margin-right: 0.5ch;
}

/* it ticks me off how the quotation marks of q tags aren't copyable, so I'll put them in manually */
q::before, q::after {
    content: none;
}

/* outline smilies */
img[src^="/smilies/"] {
    filter: drop-shadow(0px -1px white)
            drop-shadow(1px 0px white)
            drop-shadow(0px 1px white)
            drop-shadow(-1px 0px white);
}

/* I AM THE TABLE */
.cooltable,
.cooltable th,
.cooltable td {
    border: 1px solid;
    border-collapse: collapse;
}
.cooltable th,
.cooltable td {
    padding: 2px;
}
.cooltable tbody tr:nth-child(odd) {
    background-color: #303030;
}

/* code and friends */
code, samp, kbd, var, pre {
    background-color: #303030;
    font-size: 105%;
}
code, samp, kbd, var {
    white-space: nowrap;
    padding: 2px;
}
var {
    font-style: normal;
}

/* under construction message */
#uncon {
    text-align: center;
    font-size: smaller;
    max-width: 304px;
    margin-left: auto;
    margin-right: auto;
}

/* file table */
.files h1 {
    margin-bottom: 9px;
}
.files tr {
    white-space: nowrap;
}
.files td:first-child {
    min-width: 24px;
}
.files td:nth-child(2) {
    width: 100%;
}
.files td:nth-child(4) {
    text-align: right;
}
.files [colspan="4"] hr { /* really stupid hack to get hrs in the table to be the same width as ones outside, to satiate muh tism */
    filter: drop-shadow(3px 0px white)
            drop-shadow(-3px 0px white);
}

/* checkered background to show off transparent images */
.alphabg {
    background-image: url(data:image/gif;base64,R0lGODdhEAAQAIACAJmZmWZmZiwAAAAAEAAQAAACH4RvoauIzNyBSyYaLMDZcv15HAaSIlWiJ5Sya/RWVgEAOw==);
}
.alphabg:hover {
    background-image: url(data:image/gif;base64,R0lGODdhEAAQAIACAJmZmWZmZiwAAAAAEAAQAAACH4xvoKuIzNyBSyYKbMDZcv15HAaSIlWiJ5Sya/RWVgEAOw==);
}