body {
    max-width: 600px;
    margin: auto;
    padding: 0 0.5rem;
    font: 14px/1.5 "Libre Baskerville", serif;
}

input, button {
    font-family: inherit;
    font-size: 12px;
}

a, input, button, #terms-field, #country-field {
    transition:
	color 0.2s,
	background-color 0.2s,
	outline-color 0.2s,
	outline-width 0.2s;
}

header {
    padding: 0.5rem 0;
    text-align: center;
    border-bottom: 1px solid black;
}

footer {
    padding: 0.5rem 0;
    margin: 3rem 0 0 0;
    border-top: 1px solid black;
    text-align: end;
}

a {
    font-weight: bold;
    &:not(:active, :hover) {
	color: black;
    }
    &:hover {
	color: dimgray;
    }
}

#logo {
    display: block;
    height: 5rem;
    margin: 3rem auto 0;
}

h1 {
    margin: 1rem 0;
    font-size: 3rem;
}

h2 {
    margin: 3rem 0 1rem;
    font-size: 2rem;
}

.title {
    font-size: 1.5rem;
}

.subtitle {
    font-size: 1.25rem;
}

#books {
    width: 100%;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.cover {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: black;
    border-radius: 5px;
    overflow: hidden;

    img {
	width: 100%;
	object-fit: cover;
    }
}

.info, .upcoming-event {
    > :not(:last-child) {
	margin: 0 0 1rem 0;
    }
}

.info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    p {
	margin: 0;
    }

    .title {
	font-style: italic;
    }
}

.order-inner {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.5rem 1rem;
    padding: 0.5rem;
    outline: 1px solid black;
    width: fit-content;
    border-radius: 5px;
}

.order-inner input {
    border: none;
    border-radius: 5px;
    text-align: center;
    padding: 0.125rem 0;
    background: whitesmoke;

    &:not(:focus-visible) {
	outline: 1px solid black;
    }
    
    &:invalid {
	background: mistyrose;
	color: darkred;

	&:not(:focus-visible) {
	    outline: 2px solid darkred;
	}
    }
    
    &:focus, &:hover {
	background: #eeeeee;

	&:invalid {
	    background: mistyrose;
	}
    }

    &:disabled {
	background: gainsboro;
	outline-color: dimgray;
	color: dimgray;
    }
}

#terms-field {
    max-width: 100%;
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 5px;
    outline: 1px solid black;
    cursor: pointer;

    label {
	flex-grow: 1;
    }

    input, label {
	cursor: pointer;
    }

    &:has(input:disabled) {
	background: gainsboro;
	outline-color: dimgray;
	color: dimgray;
	cursor: default;

	label input {
	    cursor: default;
	}

	a {
	    color: dimgray;
	}
    }

    &:hover, &:has(*:focus-visible) {
	background: #eeeeee;
    }

    &:has(input:user-invalid) {
	outline: 2px solid darkred;
    }
}

#country-field {
    margin: 1rem 0;
}

select {
    font: 14px "Libre Baskerville", serif;
    border: none;
    border-radius: 5px;
    padding: 0.5rem;
    color: black;
}

input[type="submit"] {
    flex-grow: 0;
    font: 14px "Libre Baskerville", serif;
    background-color: white;
    color: black;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 0.5rem;
}

input[type="submit"], select{
    &:not(:focus-visible) {
	outline: 1px solid black;
	background-color: white;
    }
    
    &:hover, &:focus-visible {
	background: #eeeeee;
    }

    &:disabled, &:active {
	background: gainsboro;
	outline-color: dimgray;
    }

    &:disabled {
	color: dimgray;
	cursor: default;
    }
}

.form-errors {
    color: darkred;
}

.description {
    font-style: italic;
}

.upcoming-event {
    max-width: 100%;
    margin: 0 0 1rem 0;
    padding: 1rem;
    background-color: white;
    outline: 1px solid black;
    border-radius: 5px;

    p {
	margin: 0;
    }
}

.past-event {
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
}

.splitter {
    color: gainsboro;
    font-weight: bold;
}

li:not(:last-child) {
    padding-bottom: 1rem;
}

li > ol, li > ul {
    padding-top: 1rem;
}
