body {
    margin: 20px;
    font-size: large;
    font-family: serif;
}

#jumbo {
    text-align: center;
}
#jumbo h1 a {
    color: black;
    text-decoration: none;
}
#jumbo p a {
    border: 1px solid grey;
    line-height: 40px;
    padding: 5px;
    text-decoration: none;
    color: grey;
}
#jumbo p a:hover {
    color: black;
}
#jumbo p a.selected {
    color: black;
}


#form {
    display: flex;
    border: 1px solid black;
    border-bottom: none;
    margin-bottom: 0;
}
#form input[type="text"] {
    width: 100%;
    height: 70px;
    padding: 20px;
    border: none;
    font-size: 1em;
}
#form input[type="text"]:focus{
    outline: none;
}
#form input[type="submit"] {
    font-size: .8em;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 2px 20px;
    outline: none;
    cursor: pointer;
}

#answer {
    border: 1px solid black;
    border-top: none;
    padding: 2vw;
    font-family: monospace;
    font-size: 1em;
}
#answer table.props {
    font-size: 1em;
    width: 100%;
    border-spacing: 10px;
}
#answer table.props tr {
}
#answer table.props tr td {
    padding: 5px;
}
#answer table.props tr td.key  {
    width: 20%;
}
#answer table.props tr td.val  {
    background-color: #f4f4f4;
}
#answer table.atomic_props {
    font-size: 1em;
    width: 100%;
    border-spacing: 10px;
}
#answer table.atomic_props tr {
}
#answer table.atomic_props tr td {
    padding: 5px;
    word-break: break-word;
}
#answer table.atomic_props tr td.key  {
    width: 20%;
}
#answer table.atomic_props tr td.val  {
    background-color: #f4f4f4;
}

#answer tr td a {
    text-decoration: none;
    color: grey;
}
#answer tr td a.selected {
    color: black;
}
#answer tr td a.formula:hover {
    color: black;
}
#answer .blue {
    color: blue;
}
#answer .green {
    color: green;
}
#answer .red {
    color: red;
}

#answer .coefficient {
    background-color: yellow;
}







/* table.html */


table#periodic-table {
    margin: calc(-1 * min(120px, 11vw)) auto 0 auto;
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    max-width: 1100px;          /* the original size; it shrinks with the window instead of scrolling */
    height: min(550px, 48vw);
}

table#periodic-table td {
    overflow: hidden;
    text-align: center;
}

table#periodic-table td.element {
    font-size: 1.2em;
    border: 1px solid grey;
}
table#periodic-table td span {
    font-size: .7em;
    display: block;
}
table#periodic-table td span.trend {
    background-color: yellow;
}

table#periodic-table td a {
    text-decoration: none;
    color: black;
}

#trend-selector {
    margin-bottom: 10px;
    text-align: center;
}

.alkali_metal {
    background-color: red;
}
.alkaline_earth_metal {
    background-color: orange;
}
.transition_metal {
    background-color: yellow;
}
.post-transition_metal {
    background-color: lightgreen;
}
.metalloid {
    background-color: darkcyan;
}
.polyatomic_nonmetal {
    background-color: lightblue;
}
.diatomic_nonmetal {
    background-color: lightcyan;
}
.noble_gas {
    background-color: dodgerblue;
}
.actinide {
    background-color: mediumorchid;
}
.lanthanide {
    background-color: mediumvioletred;
}
.unknown {
    background-color: white;
}

#legend {
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;
    max-width: 1100px;          /* same width as the table, so the legend can sit in its empty gap */
    margin: 30px auto 0 auto;
    padding-left: 13%;          /* the gap above the transition metals spans columns 3-12 of 18 */
    padding-right: 35%;
    font-size: min(.8em, 1.25vw);
}
#legend div {
    padding: 2px;
    border: 1px solid black;
    margin: 2px;
}
@media(max-width: 800px) {
    /* too narrow for the legend to fit in the gap: put it above the table instead */
    #legend {
        padding: 0;
        font-size: .8em;
        margin: 10px auto 10px auto;
        justify-content: center;
    }
    table#periodic-table {
        margin-top: 0;
    }
}


/* jsanker.com port: the original pages had no doctype (quirks mode); the port is standards mode.
   These two rules reproduce the quirks-mode behaviour the original look depended on. */
#form input[type="text"] {
    box-sizing: border-box;
}
table#periodic-table {
    font-size: min(16px, 1.45vw);   /* 16px on wide screens, smaller as the window narrows */
}

/* touch screens: panel for the tapped element (table.js) */
#picked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 500px;
    margin: 10px auto;
    padding: 10px;
    border: 1px solid grey;
    background-color: #f6f6f6;
    text-align: center;
}
#picked[hidden] {
    display: none;
}
#picked span {
    font-size: .8em;
}
#picked a.open {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 20px;
    margin-top: 4px;
    border: 1px solid black;
    background-color: white;
    color: black;
    text-decoration: none;
}
table#periodic-table td.picked {
    outline: 3px solid black;
    outline-offset: -3px;
}
