html {
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: inherit;
}
/* ====
   Grid
   ==== */
body {
    display: grid;
    grid-template-areas: "header"
                         "main"
                         "footer";
}
.main-header {
    grid-area: header;
}
main {
    grid-area: main;
    display: grid;
    grid-template-rows: auto;
    gap: 2em;
}
.main-footer {
    grid-area: footer;
}

/* =======
   Counter
   ======= */
body {
    counter-reset: instructions;
}
.info dt::before {
    content: counter(instructions) ". ";
    counter-increment: instructions;  /* Increment "instructions" counter */
}

/* ======
   Styles
   ====== */
body {
    max-width: 80em;
    margin: 0 auto;
    font-family: "Open Sans", sans-serif;
    line-height: 1.5;
}
h1 {
    text-transform: uppercase;
    font-size: 3em;
    text-align: center;
    margin: 0;
}
a:visited, a:hover {
    color: #3790fc;
}
a:active {
    color: #014EAB;
}
.main-header,
main,
.main-footer {
    padding: 1em;
}
.main-footer {
    text-align: center;
}
.main-footer small {
    display: block;
    margin-bottom: 1em;
}
.logo {
    width: 2em;
}
#log {
    display: none;
}
/* ===========
   Ingredients
   =========== */
.ingredients {
    width: 100%;
}
.ingredients th {
    text-align: left;
}
.ingredients td {
    text-align: right;
}
.ingredients td[data-unit="gram"]::after {
    content: " g";
}
/* ====
   Info
   ==== */
.info dl {
    margin: 0;
}
.info dt {
    font-size: 1.5em;
    font-weight: bold;
}
.info dd {
    margin-left: 0;
    margin-bottom: 0.5em;
}
kbd {
    font-size: 1.5em;
}
/* ====
   Menu
   ==== */
#menu {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 0.5em;
}
#menu input {
    width: 100%;
}
#menu input,
#menu button {
    background-color: gray;
    color: white;
    font-size: 2em;
    padding: 0.25em;
    text-align: center;
    border: 0;
}
#menu button {
    flex: 1 0 auto;
    outline: transparent;
    cursor: pointer;
}
#menu button:hover {
    background-color: #666;
}
#menu button:active {
    background-color: #444;
}

/* =========
   2 columns
   ========= */
@media screen and (min-width: 680px) {
    main {
        grid-template-rows: auto;
        grid-template-columns: 1fr 3fr;
    }
    h1 {
        font-size: 5em;
        text-align: left;
    }
}

/* =========
   Dark mode
   ========= */
@media screen and (prefers-color-scheme: dark) {
    body {
        background-color: #222;
        color: #ddd;
    }
    a:active {
        color: #7bb6ff;
    }
    #gh-logo {
        filter: invert(100%);
    }
}
