/* Chess Notes - A Free Design by Bryant Smith (bryantsmith.com)
   A black, white and tan page for a chess hobby.
   Colours used:
       page tan      #efe7d7      panel cream  #fbf7ee
       ink black     #1b1a17      soft ink     #5f584c
       tan accent    #b98a44      pale tan     #ddc9a4
   Look for the section headings below to find what you want to change. */


/* ---- RESET: start from a clean sheet ---- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* ---- BODY: the warm tan desk the page rests on ---- */

body {
    background: #ddd2bc;
    color: #2b2822;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 16px;
    line-height: 1.75;
    padding: 40px 16px;
}


/* ---- PAGE: the sheet itself, centred and never too wide ---- */

#page {
    background: #efe7d7;
    border: 1px solid #cdbd9f;
    box-shadow: 0 2px 3px rgba(27, 26, 23, 0.08), 0 18px 40px rgba(27, 26, 23, 0.14);
    margin: 0 auto;
    max-width: 940px;
}


/* ---- MASTHEAD: dark banner with a chessboard strip on top ---- */

#masthead {
    background: #1b1a17;
}

/* the strip is a checkerboard drawn entirely with one CSS gradient */
#board {
    height: 20px;
    background-image: conic-gradient(#b98a44 90deg, #1b1a17 90deg 180deg, #b98a44 180deg 270deg, #1b1a17 270deg);
    background-size: 20px 20px;
}

.masthead-text {
    padding: 44px 44px 34px 44px;
}

.kicker {
    color: #b98a44;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

#masthead h1 {
    color: #faf3e6;
    font-size: 50px;
    font-weight: normal;
    letter-spacing: -0.5px;
    line-height: 1.05;
    margin: 12px 0 0 0;
}

.tagline {
    color: #c8bfad;
    font-size: 17px;
    font-style: italic;
    margin-top: 12px;
    max-width: 34em;
}


/* ---- MENU: the row of text links under the title ---- */

#menu {
    border-top: 1px solid #3a362e;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    letter-spacing: 2px;
    margin-top: 26px;
    padding-top: 20px;
    text-transform: uppercase;
}

#menu a,
#menu a:visited {
    border-bottom: 2px solid transparent;
    color: #e8dfcd;
    margin-right: 24px;
    padding-bottom: 4px;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
}

#menu a:hover,
#menu a:focus {
    border-bottom: 2px solid #b98a44;
    color: #b98a44;
    outline: none;
}


/* ---- LAYOUT: main column plus a narrower right rail ---- */

#layout {
    display: grid;
    gap: 44px;
    grid-template-columns: minmax(0, 1fr) 292px;
    padding: 44px;
}


/* ---- CONTENT: headings and running text in the main column ---- */

#content p {
    margin-bottom: 20px;
    max-width: 68ch;
}

.lead {
    color: #3a352c;
    font-size: 20px;
    line-height: 1.65;
}

.lead::first-letter {
    color: #b98a44;
    float: left;
    font-size: 3.4em;
    line-height: 0.82;
    padding: 5px 10px 0 0;
}

.intro {
    color: #5f584c;
}

#content a,
#content a:visited {
    border-bottom: 1px solid #d3b985;
    color: #8a5a24;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
}

#content a:hover,
#content a:focus {
    border-bottom: 1px solid #1b1a17;
    color: #1b1a17;
    outline: none;
}

h2 {
    align-items: center;
    border-bottom: 1px solid #d8cbb3;
    color: #1b1a17;
    display: flex;
    font-size: 27px;
    font-weight: normal;
    margin: 46px 0 18px 0;
    padding-bottom: 12px;
}

h2::before {
    background: #1b1a17;
    box-shadow: inset -7px -7px 0 #b98a44;
    content: "";
    display: inline-block;
    height: 15px;
    margin-right: 14px;
    width: 15px;
}

#content h2:first-child {
    margin-top: 0;
}


/* ---- TABLE: a bordered, display-only record of games ---- */

.games {
    background: #fbf7ee;
    border: 1px solid #d8cbb3;
    border-collapse: collapse;
    font-size: 15px;
    margin: 8px 0 8px 0;
    width: 100%;
}

.games caption {
    caption-side: top;
    color: #6b6354;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    letter-spacing: 1px;
    padding-bottom: 12px;
    text-align: left;
    text-transform: uppercase;
}

.games th {
    background: #1b1a17;
    color: #faf3e6;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    padding: 12px 14px;
    text-align: left;
    text-transform: uppercase;
}

.games td {
    border-bottom: 1px solid #e6dcc6;
    color: #2b2822;
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

.games tbody tr:nth-child(even) {
    background: #f3ecdd;
}

.games tbody tr:hover {
    background: #ecdfc4;
}

.games tbody tr:last-child td {
    border-bottom: none;
}

/* keep short cells from breaking onto two lines */
.games td:first-child,
.games th:first-child,
.games th:nth-child(3),
.games td:nth-child(3) {
    white-space: nowrap;
}

/* results are shown with monochrome badges, not colour */
.result {
    border: 1px solid #1b1a17;
    display: inline-block;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    min-width: 52px;
    padding: 3px 8px;
    text-align: center;
    text-transform: uppercase;
}

.result.win {
    background: #1b1a17;
    color: #faf3e6;
}

.result.draw {
    background: #e7d5ae;
    border-color: #b98a44;
    color: #4a3a1d;
}

.result.loss {
    background: transparent;
    color: #6b6354;
}


/* ---- TOPICS: a list with small alternating square markers ---- */

.topics {
    list-style: none;
}

.topics li {
    border-bottom: 1px solid #e0d5bf;
    color: #3a352c;
    padding: 13px 0 13px 26px;
    position: relative;
}

.topics li:last-child {
    border-bottom: none;
}

.topics li::before {
    background: #1b1a17;
    content: "";
    height: 9px;
    left: 2px;
    position: absolute;
    top: 21px;
    width: 9px;
}

.topics li:nth-child(even)::before {
    background: #b98a44;
}


/* ---- NOTE: the friendly "how to use this template" box ---- */

.note {
    background: #fbf7ee;
    border: 1px solid #d8cbb3;
    border-left: 5px solid #b98a44;
    margin-top: 40px;
    padding: 24px 28px 8px 28px;
}

.note h3 {
    color: #1b1a17;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.note p {
    color: #4a4438;
    font-size: 15px;
}


/* ---- SIDEBAR: the rail of opening cards ---- */

#sidebar h2 {
    font-size: 22px;
}

.rail-intro {
    color: #6b6354;
    font-size: 15px;
    margin-bottom: 24px;
}

.card {
    background: #fbf7ee;
    border: 1px solid #d8cbb3;
    border-top: 4px solid #1b1a17;
    margin-bottom: 24px;
    padding: 22px 22px 20px 22px;
}

.card h3 {
    align-items: center;
    color: #1b1a17;
    display: flex;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 14px;
    text-transform: uppercase;
}

/* tiny checkerboard tile used as a bullet in the card headings */
.swatch {
    border: 1px solid #cdbd9f;
    display: inline-block;
    height: 16px;
    margin-right: 9px;
    width: 16px;
    background-image: conic-gradient(#1b1a17 90deg, #f1e7d3 90deg 180deg, #1b1a17 180deg 270deg, #f1e7d3 270deg);
    background-size: 16px 16px;
}

.swatch.dark {
    background-image: conic-gradient(#b98a44 90deg, #1b1a17 90deg 180deg, #b98a44 180deg 270deg, #1b1a17 270deg);
}

.openings {
    list-style: none;
}

.openings li {
    border-bottom: 1px solid #e6dcc6;
    color: #2b2822;
    font-size: 15px;
    padding: 9px 0;
}

.openings li:last-child {
    border-bottom: none;
}

.eco {
    color: #a9793f;
    display: inline-block;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    width: 40px;
}

.aside-quote {
    border-left: 3px solid #b98a44;
    padding: 4px 0 4px 18px;
}

.aside-quote p {
    color: #4a4438;
    font-size: 16px;
    font-style: italic;
}

.aside-quote cite {
    color: #8a8275;
    display: block;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-style: normal;
    letter-spacing: 1px;
    margin-top: 8px;
    text-transform: uppercase;
}


/* ---- FOOTER: the required credit link ---- */

#footer {
    border-top: 3px double #cdbd9f;
    color: #8a8275;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 24px 44px 30px 44px;
    text-align: center;
    text-transform: uppercase;
}

#footer a,
#footer a:visited {
    border-bottom: none;
    color: #6b6354;
    text-decoration: none;
}

#footer a:hover,
#footer a:focus {
    color: #a9793f;
    outline: none;
}


/* ---- SMALL SCREENS: stack the rail and tame the table ---- */

@media (max-width: 640px) {
    body {
        padding: 16px 10px;
    }

    .masthead-text {
        padding: 32px 24px 26px 24px;
    }

    #masthead h1 {
        font-size: 36px;
    }

    .tagline {
        font-size: 15px;
    }

    #menu a {
        display: inline-block;
        margin-bottom: 10px;
    }

    #layout {
        gap: 30px;
        grid-template-columns: 1fr;
        padding: 30px 24px;
    }

    .lead {
        font-size: 18px;
    }

    h2 {
        font-size: 23px;
    }

    .games {
        font-size: 14px;
    }

    .games th,
    .games td {
        padding: 10px 9px;
    }

    /* drop the least important column so the table still fits */
    .col-optional {
        display: none;
    }

    #footer {
        padding: 22px 24px 26px 24px;
    }
}


/* ---- PRINT: a clean sheet, no desk and no shadows ---- */

@media print {
    body {
        background: #ffffff;
        padding: 0;
    }

    #page {
        border: none;
        box-shadow: none;
        max-width: 100%;
    }

    #menu {
        display: none;
    }
}
