/* Book grid layout */
.book-flex-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: flex-start;
}

.book-card {
    flex: 1 1 22%;
    min-width: 280px;
    max-width: 350px;
    box-sizing: border-box;
    margin-bottom: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Responsive columns */
@media (max-width: 1200px) {
    .book-card { flex-basis: 30%; }
}
@media (max-width: 900px) {
    .book-card { flex-basis: 45%; }
}
@media (max-width: 600px) {
    .book-card { flex-basis: 100%; }
}

/* Book card image */
.book-card img {
    max-height: 120px;
    width: auto;
    border-radius: 6px 6px 0 0;
    align-self: center;
    margin-top: 1rem;
}

/* Card body and text */
.card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    white-space: pre-line;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-author {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
}

/* Example wrapper */
.example-wrapper {
    margin: 1em auto;
    max-width: 800px;
    width: 95%;
    font: 18px/1.5 sans-serif;
}
.example-wrapper code {
    background: #F5F5F5;
    padding: 2px 6px;
}

/* Main header */
.main-header {
    background: #0056b3;
    color: #fff;
    padding: 1rem 0;
    margin-bottom: 2rem;
}
.main-header .container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* Scanner link */
.scanner-link {
    background: #fff;
    color: #0056b3 !important;
    border-radius: 20px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    border: 2px solid #fff;
}
.scanner-link:hover {
    background: #e3f0ff;
    color: #003366 !important;
    border-color: #003366;
    text-decoration: none;
}
