/* Variables */ :root { --color-focus: #888833; --width-close-button: 4rem; --font-size-dog: 1.5rem; --spacing-beetle: 0.25rem; --spacing-mouse: 0.5rem; --spacing-cat: 1rem; } /* Top level */ html { height: 100%; } body { margin: 0; display: flex; height: 100%; font-family: sans-serif; } /* Modal */ .g-Modal { width: 100vw; height: 100vh; position: fixed; top: 0; left: 0; display: flex; justify-content: center; align-items: center; background-color: rgba(0, 0, 0, 0.4); z-index: 1; } .g-Modal__Close { position: absolute; top: 2rem; right: 2rem; cursor: pointer; font-weight: bold; border-radius: 50%; border: 1px solid #EEE; background-color: transparent; width: var(--width-close-button); height: var(--width-close-button); font-size: 2rem; font-family: monospace; } .g-Modal__Close:hover, .g-Modal__Close:focus { background-color: #EEE; } .g-Modal__Content { position: relative; background-color: white; width: 50%; height: 50%; border-radius: 0.2rem; border: 1px solid #EEE; padding: 2rem; padding-right: calc(2rem + var(--width-close-button) + 2rem); } /* Filters */ aside { background-color: #333; color: white; width: 200px; overflow-y: auto; } ul { margin: 0; padding: 0; list-style-type: none; } .g-FilterTitle { padding: 0.5rem 1rem; background-color: #555; border-left: 8px solid transparent; font-weight: bold; } .g-Filter--Unselected { border-left: 8px solid #555; } .g-Filter--Selected { border-left: 8px solid #883333; } .g-Filter button { border: none; background-color: transparent; color: inherit; cursor: pointer; padding: 0.5rem 1rem; width: 100%; text-align: left; } .g-Filter button:hover { background-color: var(--color-focus); } /* Books */ main { width: 100%; padding: 1rem; overflow-y: auto; } header { display: flex; font-size: 120%; margin-bottom: 1rem; } .g-Search { margin-right: 1rem; } .g-Books { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-gap: 1rem; } .g-Book { align-self: center; border: 1px solid #DDDDDD; padding: 0; width: fit-content; } .g-Book:hover, .g-Book:focus { cursor: pointer; outline: none; } .g-Book:hover .g-Book__Image, .g-Book:focus .g-Book__Image { transform: scale(105%); opacity: 0.9; } .g-Book__Image { display: flex; width: 13rem; transition: all 0.2s ease-in-out; } /* Book detail */ .g-BookDetail { display: flex; justify-content: space-between; } .g-BookDetail img { width: 10rem; } .g-BookDetail__Title { font-size: var(--font-size-dog); margin-bottom: var(--spacing-beetle); } .g-BookDetail__Subtitle { font-style: italic; margin-bottom: var(--spacing-beetle); } .g-BookDetail__Genres { margin-top: var(--spacing-cat); }