/* Book Catalog Pro – Public Styles */

/* ---------------------------------------------------------------
   Wrapper
--------------------------------------------------------------- */
.bcp-archive-wrap,
.bcp-single-wrap {
        max-width: 1200px;
        margin: 0 auto;
        padding: 24px 16px 48px;
}

/* ---------------------------------------------------------------
   Archive header
--------------------------------------------------------------- */
.bcp-archive-title {
        margin-bottom: 24px;
}

/* ---------------------------------------------------------------
   Filter bar
--------------------------------------------------------------- */
.bcp-filter-form {
        margin-bottom: 24px;
}
.bcp-filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
}
.bcp-search-wrap {
        display: flex;
        flex: 1 1 220px;
        min-width: 200px;
}
.bcp-search-input {
        flex: 1;
        padding: 8px 12px;
        border: 1px solid #ccc;
        border-right: none;
        border-radius: 4px 0 0 4px;
        font-size: 14px;
}
.bcp-search-btn {
        padding: 8px 12px;
        background: #0073aa;
        color: #fff;
        border: 1px solid #0073aa;
        border-radius: 0 4px 4px 0;
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
}
.bcp-search-btn:hover { background: #005f8d; }

.bcp-filter-select {
        padding: 8px 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 14px;
        background: #fff;
}

.bcp-display-toggle {
        display: flex;
        gap: 4px;
        margin-left: auto;
}
.bcp-display-btn {
        display: inline-block;
        padding: 7px 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
        color: #555;
        text-decoration: none;
        font-size: 13px;
        line-height: 1;
}
.bcp-display-btn.active,
.bcp-display-btn:hover {
        background: #0073aa;
        color: #fff;
        border-color: #0073aa;
}

.bcp-active-filter { margin: 8px 0 0; }
.bcp-clear-filter {
        color: #a00;
        text-decoration: none;
        font-size: 13px;
}
.bcp-clear-filter:hover { text-decoration: underline; }

.bcp-result-count {
        color: #666;
        font-size: 13px;
        margin-bottom: 16px;
}

/* ---------------------------------------------------------------
   Book grid
--------------------------------------------------------------- */
.bcp-book-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 24px;
        margin-bottom: 32px;
}

.bcp-book-card--grid {
        background: transparent;
        border: none;
        border-radius: 6px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        transition: box-shadow .2s, transform .2s;
}
.bcp-book-card--grid:hover {
        box-shadow: 0 4px 16px rgba(0,0,0,.12);
        transform: translateY(-2px);
}

.bcp-card-cover-link {
        display: block;
        background: transparent;
}
.bcp-card-cover {
        position: relative;
        padding-top: 150%;
        overflow: hidden;
}
.bcp-card-cover img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
}

.bcp-card-body {
        padding: 10px 12px 6px;
        flex: 1;
}
.bcp-card-title {
        font-size: 14px;
        margin: 0 0 4px;
        line-height: 1.3;
}
.bcp-card-title a {
        color: inherit;
        text-decoration: none;
}
.bcp-card-title a:hover { color: #0073aa; }
.bcp-card-authors {
        font-size: 12px;
        color: #666;
        margin: 0 0 2px;
}
.bcp-card-series {
        font-size: 11px;
        color: #888;
        margin: 0;
}

.bcp-card-footer {
        padding: 8px 12px;
        border-top: none;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
}
.bcp-card-detail-link,
.bcp-card-buy-link {
        font-size: 12px;
        padding: 4px 10px;
        border-radius: 3px;
        text-decoration: none;
        display: inline-block;
}
.bcp-card-detail-link {
        background: #ff9900;
        color: #fff !important;
        font-weight: 600;
}
.bcp-card-detail-link:hover { background: #e68900; color: #fff; }
.bcp-card-buy-link {
        background: #ff9900;
        color: #fff;
}
.bcp-card-buy-link:hover { background: #e68900; }

/* ---------------------------------------------------------------
   Mosaic display (shortcode display="mosaic")
   - True masonry via CSS multi-column: cards stagger vertically
     down each column like bricks (no row alignment).
   - Generous vertical "mortar" between cards in the same column.
   - Cover fills column width at natural aspect ratio.
--------------------------------------------------------------- */
.bcp-book-grid--mosaic {
        column-width: 130px;
        column-gap: 24px;
        margin-bottom: 32px;
        display: block;          /* override flex/grid from generic .bcp-book-grid */
}
@media (min-width: 600px)  { .bcp-book-grid--mosaic { column-width: 140px; } }
@media (min-width: 900px)  { .bcp-book-grid--mosaic { column-width: 150px; } }
@media (min-width: 1200px) { .bcp-book-grid--mosaic { column-width: 160px; } }

.bcp-book-card--mosaic {
        background: transparent;
        border: none;
        border-radius: 0;
        display: inline-block;   /* required so column-break rules work */
        width: 100%;
        margin: 0 0 36px;        /* the "cement" between bricks */
        break-inside: avoid;
        page-break-inside: avoid;
        -webkit-column-break-inside: avoid;
        transition: transform .2s;
}
.bcp-book-card--mosaic:hover { transform: translateY(-2px); }
.bcp-mosaic-cover-link {
        display: block;
        line-height: 0;
        background: transparent;
}
.bcp-mosaic-cover-img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 4px 4px 0 0;
        box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.bcp-mosaic-body {
        padding: 8px 2px 0;
}
.bcp-mosaic-body .bcp-card-title {
        font-size: 14px;
        margin: 0 0 4px;
        line-height: 1.3;
}
.bcp-mosaic-body .bcp-card-title a { color: inherit; text-decoration: none; }
.bcp-mosaic-body .bcp-card-title a:hover { color: #0073aa; }
.bcp-mosaic-body .bcp-card-authors {
        font-size: 12px;
        color: #666;
        margin: 0 0 4px;
}
.bcp-mosaic-body .bcp-card-series {
        font-size: 11px;
        color: #888;
        margin: 0 0 6px;
}
.bcp-mosaic-actions { margin: 6px 0 0; }

/* ---------------------------------------------------------------
   Book list
--------------------------------------------------------------- */
.bcp-book-list {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-bottom: 32px;
}
.bcp-book-card--list {
        display: flex;
        gap: 20px;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        padding: 16px;
        align-items: stretch;
        min-height: 200px;
}
.bcp-list-cover {
        flex: 0 0 140px;
        display: flex;
        align-items: stretch;
}
.bcp-list-cover img {
        width: 140px;
        height: 100%;
        max-height: 220px;
        object-fit: cover;
        border-radius: 4px;
        box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.bcp-list-info {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 640px;
        display: flex;
        flex-direction: column;
        justify-content: center;
}
.bcp-list-info .bcp-card-title {
        font-size: 17px;
}
.bcp-list-info .bcp-card-authors { font-size: 14px; }
.bcp-card-cats, .bcp-card-tags {
        font-size: 13px;
        color: #555;
        margin: 3px 0;
}
.bcp-card-excerpt {
        font-size: 13px;
        color: #666;
        margin-top: 6px;
}
.bcp-list-actions {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        gap: 8px;
        padding: 0 8px;
        margin-left: auto;
}
.bcp-list-actions .bcp-card-detail-link {
        font-size: 14px;
        padding: 10px 22px;
        text-align: center;
        min-width: 110px;
}

/* ---------------------------------------------------------------
   Single book
--------------------------------------------------------------- */
.bcp-breadcrumb {
        font-size: 13px;
        color: #888;
        margin-bottom: 24px;
}
.bcp-breadcrumb a { color: #0073aa; text-decoration: none; }
.bcp-breadcrumb a:hover { text-decoration: underline; }

.bcp-book-single {
        display: flex;
        gap: 40px;
        align-items: flex-start;
        flex-wrap: wrap;
}
.bcp-book-single-cover {
        flex: 0 0 220px;
        text-align: center;
}
.bcp-cover-img {
        max-width: 100%;
        border-radius: 4px;
        box-shadow: 0 4px 16px rgba(0,0,0,.18);
        margin-bottom: 16px;
}
.bcp-buy-btn {
        display: block;
        background: #ff9900;
        color: #fff !important;
        text-decoration: none;
        padding: 12px 16px;
        border-radius: 4px;
        font-weight: bold;
        font-size: 15px;
        text-align: center;
        transition: background .2s;
}
.bcp-buy-btn:hover { background: #e68900; }
.bcp-buy-btn--bottom { margin-top: 20px; display: inline-block; }

.bcp-book-single-info { flex: 1; min-width: 260px; }
.bcp-book-title { font-size: 28px; margin: 0 0 12px; }
.bcp-book-authors { font-size: 16px; margin: 0 0 8px; }
.bcp-book-series  { font-size: 14px; color: #555; margin: 0 0 8px; }
.bcp-book-series a { color: #0073aa; text-decoration: none; }
.bcp-book-publisher { font-size: 13px; color: #666; margin: 0 0 8px; }
.bcp-book-isbn { font-size: 13px; color: #666; margin: 0 0 8px; }
.bcp-book-categories,
.bcp-book-tags { font-size: 14px; margin: 0 0 8px; }
.bcp-book-categories a,
.bcp-book-tags a { color: #0073aa; text-decoration: none; }
.bcp-book-categories a:hover,
.bcp-book-tags a:hover { text-decoration: underline; }
.bcp-tag-link {
        background: #f0f0f0;
        border-radius: 3px;
        padding: 1px 6px;
        font-size: 12px;
}
.bcp-book-description { margin-top: 20px; line-height: 1.7; }
.bcp-book-description h2 { font-size: 18px; margin-bottom: 10px; }
.bcp-book-description p { margin: 0 0 1em; }
.bcp-book-description p:last-child { margin-bottom: 0; }

.bcp-filter-heading { margin: 0 0 6px; font-size: 22px; }
.bcp-filter-back { margin: 0 0 16px; font-size: 13px; }
.bcp-filter-back a { color: #0073aa; text-decoration: none; }
.bcp-filter-back a:hover { text-decoration: underline; }

.bcp-single-footer { margin-top: 40px; }
.bcp-back-link { color: #0073aa; text-decoration: none; }
.bcp-back-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------
   Pagination
--------------------------------------------------------------- */
.bcp-pagination {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        margin: 32px 0;
}
.bcp-page-link {
        padding: 7px 12px;
        border: 1px solid #ccc;
        border-radius: 4px;
        text-decoration: none;
        color: #333;
        font-size: 14px;
        background: #fff;
        transition: background .15s;
}
.bcp-page-link:hover { background: #f0f0f0; }
.bcp-page-link.current {
        background: #0073aa;
        color: #fff;
        border-color: #0073aa;
}
.bcp-page-ellipsis { padding: 7px 4px; color: #888; }

/* ---------------------------------------------------------------
   No results
--------------------------------------------------------------- */
.bcp-no-results {
        text-align: center;
        padding: 48px 16px;
        color: #666;
}

/* ---------------------------------------------------------------
   Widget
--------------------------------------------------------------- */
.bcp-widget-list {
        list-style: none;
        margin: 0;
        padding: 0;
}
.bcp-widget-list li {
        border-bottom: 1px solid rgba(0,0,0,.07);
}
.bcp-widget-list li:last-child { border-bottom: none; }
.bcp-widget-list a {
        display: block;
        padding: 6px 0;
        text-decoration: none;
        color: inherit;
}
.bcp-widget-list a:hover { color: #0073aa; }
.bcp-count { color: #888; font-size: 12px; }

/* ---------------------------------------------------------------
   Inline single book shortcode
--------------------------------------------------------------- */
.bcp-single-book-inline {
        display: inline-block;
        max-width: 180px;
        vertical-align: top;
        margin: 0 12px 12px 0;
}

/* ---------------------------------------------------------------
   Responsive
--------------------------------------------------------------- */
@media (max-width: 600px) {
        .bcp-book-grid {
                grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
                gap: 14px;
        }
        .bcp-book-single { flex-direction: column; }
        .bcp-book-single-cover { flex: none; width: 100%; max-width: 220px; }
        .bcp-filter-row { flex-direction: column; align-items: stretch; }
        .bcp-display-toggle { margin-left: 0; justify-content: flex-end; }
        .bcp-book-card--list { flex-wrap: wrap; }
        .bcp-list-actions { flex-direction: row; width: 100%; }
}
