/* Quick actions stay outside the book link, with room for touch and keyboard use. */
#grid > .card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#grid > .card > a { flex: 1; }

/* Keep complete covers visible without stretching their surrounding artwork. */
#grid .cover {
    height: clamp(260px, 22vw, 300px);
    aspect-ratio: auto;
    padding: 34px 18px 20px;
}

#grid .cover > img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
}

#grid .cover > .catalogue-cover-card {
    width: auto;
    height: 100%;
    max-width: 100%;
}

#grid .meta { padding-top: 12px; }
#grid .title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.35;
}
#grid .card-author { margin-top: 4px; font-size: 11px; line-height: 1.35; }
#grid .card-price { margin: 7px 0; font-size: 15px; line-height: 1.4; }
#grid .availability { margin-top: 5px; font-size: 10px; line-height: 1.35; }

.card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.card-actions .card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #c8d5e9;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: 600 14px/1.3 var(--sans);
    text-align: center;
    cursor: pointer;
}

.card-actions .card-action-primary {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.card-actions .card-action-primary:hover { background: #21416f; border-color: #21416f; }
.card-actions .card-action-enquiry:hover { background: #edf3fc; border-color: #2059b1; }
.card-actions .card-action:focus-visible { outline: 3px solid #2059b1; outline-offset: 3px; }

.guide-order-note .guide-enquiry-link {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

@media (max-width: 600px) {
    #grid .cover { height: 230px; padding: 32px 13px 18px; }
    .card-actions { grid-template-columns: 1fr; gap: 7px; margin-top: 12px; }
    .card-actions .card-action { padding-inline: 10px; }
}

@media (max-width: 400px) {
    #grid .cover { height: 205px; padding-inline: 10px; }
    #grid .title { font-size: 17px; }
}
