@font-face {
    font-family: 'JetBrains Mono';
    src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: normal;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url(/fonts/JetBrainsMono-Bold.woff2) format('woff2');
    font-weight: bold;
}

* {
    font-family: "JetBrains Mono", "Roboto Mono", "Noto Sans Mono", monospace;
}

body {
    background-image: url('/img/background.png');
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 900px;
    margin: auto;
    gap: 1rem;
}

#header-logo {
    width: clamp(10rem, 100%, 20rem);
}

nav a {
    white-space: nowrap;
    text-decoration: unset;
    color: unset;
}

.box {
    background-color: white;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
    padding: 1rem;
}

*:focus {
    outline: 2px solid pink;
}

.bordered {
    border: 0.2rem solid #ccc;
    padding: 0.2rem;
}

header a {
    display: inline-block;
}

header.box {
    text-align: center;
}

nav.box {
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

nav.box ul {
    align-items: flex-start;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

nav.box ul.right {
    align-content: flex-start;
}

nav.box li:hover {
    background-color: #444444;
}

nav.box li:hover a {
    color: white;
}

main {
    overflow: scroll;
}

#fullscreen-btn {
    all: unset;
    cursor: pointer;
    display: block;
    text-align: right;
}

#fullscreen-btn::before {
    content: "⛶";
    font-size: 2rem;
}

#fullscreen-btn:checked::before {
    content: "-";
}

#fullscreen-btn:checked~table {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

table {
    --horizontal-line-color: rgba(0, 0, 0, 0.5);
    --vertical-line-color: rgba(0, 0, 0, 0.05);
    border-collapse: collapse;
    background-color: white;
    min-width: 80%;
    margin: 0 auto;
}

table thead th {
    text-align: left;
    padding: 0.2rem;
    padding-left: 0.6rem;
}

table a {
    padding: 0 0.5rem;
    height: 100%;
    text-decoration: unset;
    color: unset;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

table tbody tr:focus-within {
    outline: 2px solid black;
}

table td {
    padding: 0;
    height: 3rem;
    border: 1px solid;
    border-color: var(--horizontal-line-color) var(--vertical-line-color);
}

table tbody td {
    font-size: 80%;
}

table tbody tr:nth-child(odd) {
    background-color: #dcdcdc;
}

table *:focus {
    outline: unset;
    transform: unset;
}

.medlemslista tbody tr:hover {
    background-color: #444444;
    color: white;
    text-decoration: underline;
}

table tbody tr.error-row {
    background-color: #ff8484;
}

.medlemslista tbody tr.error-row:hover {
    background-color: firebrick;
}

form.login {
    padding: 1rem 0;
    max-width: 30rem;
    margin: auto;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr 2fr;

    label {
        text-align: right;
    }

    button,
    p {
        grid-column: 1 / -1;
    }

    input[type="password"]{
        letter-spacing: 0.08em;
    }
}

button {
    border: 1px solid #cccccc;
    background-color: #eee;
    font-family: inherit;
    cursor: pointer;
    padding: 0.5rem;
}

/* click effect */
button:active {
    transform: scale(0.95);
}

button:hover,
button:focus {
    background-color: #333;
    color: white;
}

footer {
    margin-top: auto;
    text-align: center;
}


/* full logout button on desktop */
@media (min-width: 600px) {
    #logout-btn::after {
        content: "Logga ut";
    }
}

#logout-btn::before {
    content: "🔌 ";
}

.member {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 2fr 3fr;
    /* grid-auto-rows: 1fr; */
    gap: 0.5rem;
    padding: 0.5rem;
    align-items: end;
}

.member input {
    padding: 0.2rem;
    height: 1.5rem;
    margin: 0;
}

.member input[type="checkbox"] {
    justify-self: left;
    width: 1.5rem;
}

.member input:not([type="checkbox"]) {
    border: 1px solid #777;
}

.member label {
    margin-top: 1rem;
    margin-right: 0.5rem;
    border-bottom: 1px solid #ccc;
}

.member .errors,
.member button {
    grid-column: 1 / -1;
    /* span all colunmns of grid */
}

.member .errors {
    margin: 0;
    list-style: none;
    padding: 0;
}

/* create arrow pointing up */
.member .errors li::before {
    display: inline-block;
    transform: rotate(90deg);
    content: "⤶";
    font-size: 1.5rem;
}

.errors {
    color: red;
}

.success {
    color: green;
}