/* Prevent images from overflowing on small screens */
img {
    max-width: 100%;
    height: auto;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    border: 10px solid #223030;
    background-color: #E8D9CD;
    color: #523D35;
    min-height: 100vh;
    margin: 0;
}

header {
    text-align: center;
    padding: 20px;
}

h1 {
    font-weight: normal;
    color: #523D35;
}

/* Navigation directly following the header */
header + nav {
    background-color: #959D90;
    color: #523D35;
    padding: 20px;
    margin: 16px 0 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

nav a,
nav a:visited {
    display: inline-block;
    color: #EFEFE9;
    background-color: #523D35;
    padding: 12px 20px;
    border: 2px solid #BBA58F;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    min-width: 110px;
    box-sizing: border-box;
}

nav a:hover,
nav a:focus {
    background-color: #BBA58F;
    color: #223030;
    text-decoration: none;
}

section.books {
    background-color: #BBA58F;
    min-height: 200px;
    background-image: url("../images/books.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

p {
    margin: 8px;
    line-height: 1.6;
    font-size: 90%;
}

main {
    outline: 4px solid #223030;
    display: flex;
    flex-flow: row wrap;
}

main > section {
    border: 2px solid #223030;
    flex: 1 0 40%;
    margin: 16px;
    padding: 8px;
    border-radius: 4px;
}

main > section.special {
    color: #523D35;
    border: 2px solid #223030;
    flex: 1 0 40%;
    margin: 16px;
    padding: 8px;
    border-radius: 4px;
}

/* Aside section with reversed colors */
aside {
    background-color: #523D35;
    color: #EFEFE9;
    border: 2px solid #223030;
    margin: 16px;
    padding: 16px;
    border-radius: 40px;
    box-sizing: border-box;
}

footer > section.special {
    background-color: #523D35;
    color: #BBA58F;
}

footer {
    color: #523D35;
    text-align: center;
}