/*
 * BugBytes, Inc. site styles.
 *
 * Plain CSS, no build step. Converted in 2026 from the original Sass, which
 * compiled to exactly these rules. The page is designed at 840px wide
 * (52.5rem); sizes are in rem with the original pixel value noted where
 * helpful (1rem = 16px). Below 840px the header scales with the viewport,
 * and below 720px the sidebar moves under the content.
 */

:root {
    --bb-white: white;
    --bb-blue: #000084;            /* headings and the company name */
    --bb-link: #0000ee;            /* classic link blue */
    --bb-tagline: #0000b7;
    --bb-tagline-shadow: #8484ff;
    --bb-sidebar: #eeeef9;
    --bb-hover: red;
    --bb-gray: #585858;            /* body text and rules */
    --bb-font: Helvetica, Arial, sans-serif;
}

/* ---- Page frame ------------------------------------------------------- */

html {
    margin: 0;
    padding: 0;
    height: 100%;
    box-sizing: border-box;
    font-family: var(--bb-font);
    font-size: 100%;
    color: var(--bb-gray);
    background: var(--bb-white);
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    margin: 0 auto;
    padding: 0;
    min-height: 100%;
    max-width: 52.5rem;            /* 840px */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-content: stretch;
    overflow-x: hidden;
}

/* ---- Text ------------------------------------------------------------- */

p {
    margin: 0 0 0.625rem 0;        /* 10px */
    padding: 0;
    box-sizing: border-box;
    font: inherit;
    font-size: 1rem;
    line-height: 1.375rem;         /* 22px */
    vertical-align: baseline;
}

b {
    font-weight: bold;
}

em {
    font-weight: normal;
    font-style: italic;
}

a {
    color: var(--bb-link);
}

a:hover {
    color: var(--bb-hover);
}

img {
    max-width: 100%;
}

a.inline {
    text-decoration: none;
}

a.inline:hover {
    text-decoration: underline;
}

.caps {
    font-variant: small-caps;
}

/* ---- Layout: sidebar and content -------------------------------------- */

#main_body {
    flex-grow: 1;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

#main_content {
    padding: 1.25rem 0 1.25rem 1.25rem;   /* 20px */
    flex-grow: 1;
    flex-shrink: 1;
    overflow: hidden;
}

@media screen and (max-width: 52.5em) {   /* 840px */
    #main_content {
        padding-right: 1.25rem;
    }
}

@media screen and (max-width: 45em) {     /* 720px: sidebar moves below the content */
    #main_body {
        flex-direction: column;
    }

    #main_content {
        order: -1;
    }
}

/* ---- Header ----------------------------------------------------------- */

#main_header {
    margin-top: 0.625rem;          /* 10px */
    padding: 0.625rem 0;
    padding-left: 10rem;           /* 160px, room for the logo */
    border-bottom: 0.0625rem solid var(--bb-gray);
    background-image: url(/images/logo.png);
    background-repeat: no-repeat;
    background-position: left;
    background-size: contain;
}

#main_header div:nth-child(1) {    /* "BugBytes(R), Inc." */
    color: var(--bb-blue);
    font-size: 4.5rem;             /* 72px */
    font-weight: 700;
    text-shadow: 0.03125rem 0.03125rem 0.0625rem var(--bb-link);
}

#main_header div:nth-child(1) span {   /* the (R) mark */
    font-size: 0.2em;
    vertical-align: text-top;
    width: 0.625rem;
    margin-right: -0.625rem;
}

#main_header div:nth-child(2) {    /* tagline */
    margin-top: 0.25rem;
    color: var(--bb-tagline);
    text-shadow: 0.025rem 0.025rem 0.03125rem var(--bb-tagline-shadow);
    font-size: 1.25rem;            /* 20px */
    font-style: italic;
}

/* Below 840px the header keeps its 840px proportions, scaled to the viewport.
   Each vw value is the desktop pixel size / 840 * 100. */
@media screen and (max-width: 52.5em) {
    #main_header {
        margin-top: 1.19048vw;
        padding: 1.19048vw 0;
        padding-left: 19.04762vw;
        border-bottom-width: 0.11905vw;
    }

    #main_header div:nth-child(1) {
        font-size: 8.57143vw;
        text-shadow: 0.05952vw 0.05952vw 0.11905vw var(--bb-link);
    }

    #main_header div:nth-child(1) span {
        width: 1.19048vw;
        margin-right: -1.19048vw;
    }

    #main_header div:nth-child(2) {
        margin-top: 0.47619vw;
        text-shadow: 0.04762vw 0.04762vw 0.05952vw var(--bb-tagline-shadow);
        font-size: max(2.38095vw, 0.75rem);   /* scales down, but never below 12px */
    }
}

/* ---- Sidebar navigation ----------------------------------------------- */

#main_aside {
    flex-grow: 0;
    flex-shrink: 0;
    padding: 1.25rem;              /* 20px */
    width: 14.375rem;              /* 230px */
    background: var(--bb-sidebar);
}

#main_aside h2 {
    margin: 1.25rem 0 0.625rem 0;
    padding: 0;
    box-sizing: border-box;
    display: block;
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--bb-blue);
}

#main_aside h2 span {
    margin-right: 0.25rem;
}

#main_aside ul {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    display: block;
}

#main_aside li {
    margin: 0 0 0.625rem 0;
    padding: 0;
    box-sizing: border-box;
    display: block;
}

#main_aside h2 + ul {
    padding-left: 1.25rem;
}

@media screen and (max-width: 45em) {     /* 720px: two columns under the content */
    #main_aside {
        width: auto;
        column-count: 2;
        column-width: 14.375rem;
        border-top: 0.0625rem solid var(--bb-gray);
    }

    #main_aside div {
        break-inside: avoid;
    }

    #main_aside li {
        margin: 0 0 0.3125rem 0;
    }
}

@media screen and (max-width: 33.125em) {  /* 530px */
    #main_aside {
        column-width: 37.73585vw;
    }
}

/* ---- Footer ----------------------------------------------------------- */

#main_footer {
    padding-bottom: 0.25rem;
    font-size: 0.6875rem;          /* 11px */
    border-top: 0.0625rem solid var(--bb-gray);
}

/* ---- Product icons in the sidebar (32px square) ----------------------- */

.bug-icon,
.column-icon,
.flashcards-icon,
.numberator-icon,
.sheetmusic-icon {
    display: inline-block;
    vertical-align: bottom;
    box-sizing: border-box;
    width: 2rem;
    height: 2rem;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

.bug-icon        { background-image: url(/images/bug-icon.png); }
.column-icon     { background-image: url(/images/column-icon.gif); }
.flashcards-icon { background-image: url(/images/flashcards-icon.png); }
.numberator-icon { background-image: url(/images/numberator-icon.png); }
.sheetmusic-icon { background-image: url(/images/sheetmusic-icon.png); }
