* {
    background: #E6D8C1
}

.navigation {
    display: flex;
    margin-bottom: 20px;
}

.page {
    display: none;
    padding: 20px;
}

.page.active {
    display: block;
}

.thought-item {
    border: 1px solid #b8a688;
    border-radius: 6px;
    padding: 10px;
    margin-top: 15px;
}

.meta {
    font-size: 0.85em;
    color: #6b5a40;
}

.comments {
    margin-left: 20px;
    padding-left: 10px;
    border-left: 2px solid #b8a688;
}

.comment-item {
    margin-bottom: 8px;
}

.comment-item p,
.thought-item p {
    margin: 4px 0;
}

/* Pop-up that covers the page until you enter your name */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay * {
    background: transparent;
}

.overlay-box {
    background: #E6D8C1;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.overlay-box input,
.overlay-box button {
    background: white;
}

/* Drafts get a dashed border so they look different from shared posts */
.draft-item {
    border: 1px dashed #b8a688;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
}

.draft-item p {
    margin: 4px 0;
}

.hint {
    font-size: 0.85em;
    color: #6b5a40;
}

/* The title + text box for writing a post or draft */
.composer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 600px;
}

/* display: flex above would otherwise override the hidden attribute
   on the edit box inside a post */
.composer[hidden] {
    display: none;
}

.composer textarea {
    font: inherit;
    resize: vertical;
}

.editing-note {
    font-size: 0.85em;
    color: #6b5a40;
    margin: 0;
}

.thought-item h3,
.draft-item h4 {
    margin: 4px 0;
}

.post-image,
.draft-image {
    display: block;
    max-width: 100%;
    max-height: 320px;
    margin: 8px 0;
    border-radius: 6px;
    object-fit: cover;
}

/* The draft that's currently open in the writing box */
.draft-item.editing {
    border-style: solid;
    border-width: 2px;
}

.overlay-box input {
    display: block;
    margin: 8px auto;
}

.password-panel {
    max-width: 360px;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #b8a688;
    border-radius: 8px;
}

.password-panel input {
    display: block;
    width: 100%;
    margin: 6px 0;
    box-sizing: border-box;
}

.password-panel h3 {
    margin: 4px 0 8px;
}

/* ---------- Books ---------- */

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

/* Each book in the list is a button that opens its page */
.book-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 1px solid #b8a688;
    border-radius: 6px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.book-card:hover,
.book-card:focus-visible {
    border-color: #6b5a40;
}

.book-card-title {
    font-weight: bold;
}

.book-cover {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
}

/* Shown instead of a cover when there isn't one */
.book-cover.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
    text-align: center;
    font-weight: bold;
    background: #d4c3a5;
    color: #4a3d2a;
    overflow: hidden;
}

/* The cover found while typing a book's name */
.cover-preview {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.cover-preview[hidden] {
    display: none;
}

#book-cover-preview-image {
    width: 100px;
    flex-shrink: 0;
}

.cover-preview p {
    margin: 0 0 6px;
}

.book-header {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 12px 0;
}

#book-page-cover {
    width: 180px;
}

.book-header h2 {
    margin-top: 0;
}

.notes {
    max-width: 600px;
}

.notes .comment-item {
    border: 1px solid #b8a688;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

/* Keep the line breaks people type in their notes */
.notes .comment-item p {
    white-space: pre-wrap;
}
