/* Public explore pages (library directory, library, book catalog, book, event).
   Palette and type follow nearby-libraries.css / landing.css. */
:root {
    --explore-ink: #0f172a;
    --explore-muted: #64748b;
    --explore-accent: #4f46e5;
    --explore-tint: #eef2ff;
    --explore-line: #e2e8f0;
    --explore-bg: #f8fafc;
    --explore-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.explore-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--explore-bg);
    color: var(--explore-ink);
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-wrap: anywhere;
}

.explore-page { flex: 1 0 auto; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 48px; }
.explore-page a { color: var(--explore-accent); }
.explore-page a:hover { color: #3730a3; }
.explore-page h1 { margin: 0 0 12px; font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.explore-page h2 { margin: 0 0 16px; font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; }
.explore-page h2 a { color: inherit; }
.explore-page h3 { margin: 0 0 6px; font-size: 1.02rem; font-weight: 700; line-height: 1.35; }
.explore-page h3 a { color: var(--explore-ink); text-decoration: none; }
.explore-page h3 a:hover { color: var(--explore-accent); }

.explore-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; color: var(--explore-muted); font-size: .86rem; }
.explore-breadcrumbs li + li::before { content: '/'; margin-right: 6px; color: #cbd5e1; }
.explore-breadcrumbs a { text-decoration: none; }

.explore-hero { margin-bottom: 28px; padding: 28px; border: 1px solid var(--explore-line); border-radius: 22px; background: #fff; box-shadow: 0 18px 45px rgba(15, 23, 42, .06); }
.explore-hero p { max-width: 720px; margin: 0; color: var(--explore-muted); line-height: 1.65; }
.explore-hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 28px; align-items: center; }
.explore-hero-image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 18px; background: var(--explore-tint); }
.explore-kicker { display: inline-block; margin-bottom: 10px; color: var(--explore-accent); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.explore-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.explore-facts li { padding: 10px 14px; border: 1px solid var(--explore-line); border-radius: 14px; color: var(--explore-muted); font-size: .88rem; }
.explore-facts strong { color: var(--explore-accent); font-size: 1.1rem; }

.explore-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.explore-button { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--explore-gradient); color: #fff !important; font-weight: 650; font-size: .92rem; text-decoration: none; }
.explore-button:hover { filter: brightness(1.06); }
.explore-button-light { border: 1px solid var(--explore-line); background: #fff; color: var(--explore-ink) !important; }

.explore-search { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.explore-search input { flex: 1 1 240px; min-width: 0; min-height: 46px; padding: 0 14px; border: 1px solid var(--explore-line); border-radius: 12px; font-size: 1rem; }
.explore-search input:focus { outline: 3px solid #c7d2fe; border-color: #818cf8; }
.explore-filters { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.explore-filters label { display: flex; flex-direction: column; gap: 4px; color: var(--explore-muted); font-size: .8rem; font-weight: 600; }
.explore-filters select { min-width: 170px; min-height: 42px; padding: 0 10px; border: 1px solid var(--explore-line); border-radius: 10px; background: #fff; color: var(--explore-ink); font-size: .9rem; }
.explore-filters .explore-check { flex-direction: row; align-items: center; gap: 8px; min-height: 42px; color: var(--explore-ink); font-size: .9rem; }
.explore-search .explore-check input { flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--explore-accent); }
.explore-check span { white-space: nowrap; }
.explore-clear { display: inline-flex; min-height: 42px; align-items: center; font-size: .88rem; }
.explore-badge { display: inline-block; margin-top: 4px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650; }
.explore-badge.is-available { background: #dcfce7; color: #166534; }
.explore-badge.is-on-loan { background: #fef3c7; color: #92400e; }
@media (max-width: 560px) { .explore-filters label:not(.explore-check) { flex: 1 1 100%; } .explore-filters select { width: 100%; } }

.explore-section { margin-bottom: 30px; }
.explore-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.explore-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 28px; }
.explore-columns .explore-section { padding: 22px; border: 1px solid var(--explore-line); border-radius: 18px; background: #fff; }

.explore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.explore-card { overflow: hidden; border: 1px solid var(--explore-line); border-radius: 18px; background: #fff; }
.explore-card-media { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--explore-tint); }
.explore-card-body { padding: 16px 18px 18px; }
.explore-card-body p { margin: 0 0 8px; color: #475569; font-size: .9rem; line-height: 1.55; }

.explore-book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: clamp(14px, 2vw, 22px); }
.explore-book-cover { display: block; margin-bottom: 12px; transition: transform .2s ease; }
.explore-book-cover:hover, .explore-book-cover:focus-visible { transform: translateY(-4px); }
.explore-book-cover:hover .book-cover { box-shadow: 0 2px 4px rgba(15, 23, 42, .16), 0 18px 32px -10px rgba(15, 23, 42, .45); }
.explore-book h3 { margin: 0 0 4px; font-size: .95rem; font-weight: 700; line-height: 1.3; }
.explore-book h3 a { color: #0f172a; text-decoration: none; }
.explore-book h3 a:hover { color: var(--explore-accent); }

.explore-meta { margin: 0 0 4px; color: var(--explore-muted); font-size: .85rem; }
.explore-meta i { color: var(--explore-accent); }
.explore-empty, .explore-note { color: var(--explore-muted); }

.explore-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--explore-line); border-radius: 16px; background: #fff; }
.explore-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 14px 18px; }
.explore-list li + li { border-top: 1px solid var(--explore-line); }
.explore-list a { font-weight: 650; }
.explore-list time, .explore-list .explore-meta { margin: 0; color: var(--explore-muted); font-size: .86rem; }

.explore-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 18px 0; }
.explore-details dt { color: var(--explore-muted); font-weight: 500; }
.explore-details dd { margin: 0; }

.explore-title { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; margin-bottom: 30px; padding: 28px; border: 1px solid var(--explore-line); border-radius: 22px; background: #fff; }
.explore-title-cover { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; background: var(--explore-tint); box-shadow: 0 14px 30px rgba(15, 23, 42, .14); }
.explore-byline { margin: 0 0 10px; color: #475569; font-size: 1.08rem; }
.explore-availability { margin: 0; color: var(--explore-muted); }
.explore-availability strong { color: #047857; }
.explore-prose { max-width: 820px; line-height: 1.75; white-space: pre-line; }

/* Book detail page */
.explore-book-hero { position: relative; grid-template-columns: 280px minmax(0, 1fr); gap: 42px; align-items: center; overflow: hidden; padding: 38px; border-color: #e0e7ff; background: radial-gradient(ellipse at 18% 20%, rgba(199, 210, 254, .42), transparent 36%), linear-gradient(125deg, #fff 35%, #f7f8ff 100%); box-shadow: 0 22px 55px rgba(49, 46, 129, .09); }
.explore-book-cover-stage { display: grid; min-height: 380px; place-items: center; border-radius: 20px; background: linear-gradient(145deg, #e0e7ff, #f5f3ff 58%, #ede9fe); }
.explore-book-cover-stage .explore-title-cover { width: min(220px, 82%); box-shadow: 0 2px 4px rgba(15, 23, 42, .18), 0 26px 44px -12px rgba(15, 23, 42, .5); }
.explore-book-summary { min-width: 0; }
.explore-book-summary .explore-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.explore-book-summary h1 { max-width: 760px; margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.35rem); }
.explore-book-summary .explore-byline { margin-bottom: 20px; }
.explore-book-summary .explore-availability { display: inline-flex; align-items: center; gap: 11px; margin: 0; padding: 12px 16px; border: 1px solid #bbf7d0; border-radius: 14px; background: #f0fdf4; color: #166534; }
.explore-book-summary .explore-availability.is-unavailable { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.explore-availability > i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: #dcfce7; font-size: 1rem; }
.explore-availability.is-unavailable > i { background: #fef3c7; }
.explore-availability strong { display: block; color: inherit; font-size: .88rem; }
.explore-availability small { display: block; margin-top: 2px; color: #64748b; font-size: .75rem; }
.explore-book-quick-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.explore-book-quick-facts span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--explore-line); border-radius: 999px; background: rgba(255,255,255,.8); color: #475569; font-size: .78rem; }
.explore-book-quick-facts i { color: var(--explore-accent); }
.explore-book-actions { margin-top: 18px; }
.explore-book-actions .explore-button-light { border-color: #dbe2f0; }
.explore-book-summary .explore-details { grid-template-columns: repeat(2, max-content minmax(0, 1fr)); gap: 10px 12px; max-width: 760px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #e5e7eb; font-size: .82rem; }
.explore-book-summary .explore-details dt { color: #64748b; }
.explore-book-summary .explore-details dd { font-weight: 600; }
.explore-book-holdings { padding: 26px; border: 1px solid var(--explore-line); border-radius: 20px; background: #fff; box-shadow: 0 12px 34px rgba(15, 23, 42, .04); }
.explore-book-holdings h2 { margin-bottom: 18px; }
.explore-book-holding-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.explore-book-holding-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 15px; border: 1px solid var(--explore-line); border-radius: 15px; background: linear-gradient(140deg, #fff, #fafaff); }
.explore-book-holding-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 13px; background: var(--explore-tint); color: var(--explore-accent); font-size: 1.1rem; }
.explore-book-holding-copy { display: grid; min-width: 0; flex: 1; gap: 4px; }
.explore-book-holding-copy > a { overflow: hidden; color: var(--explore-ink); font-weight: 750; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.explore-book-holding-copy > a:hover { color: var(--explore-accent); }
.explore-book-holding-copy .explore-meta { font-size: .76rem; }
.explore-book-copy-count { display: grid; min-width: 58px; justify-items: center; padding: 7px 9px; border-radius: 12px; background: #fff7ed; color: #b45309; }
.explore-book-copy-count.is-available { background: #ecfdf5; color: #047857; }
.explore-book-copy-count strong { font-size: 1.1rem; line-height: 1; }
.explore-book-copy-count small { margin-top: 3px; font-size: .64rem; }
.explore-book-holdings .explore-note { margin: 18px 0 0; padding: 13px 15px; border-radius: 12px; background: #f8fafc; font-size: .88rem; }
.explore-book-holdings > .explore-empty { margin: 0; padding: 24px; border: 1px dashed #cbd5e1; border-radius: 14px; text-align: center; }

.explore-event { padding: 28px; border: 1px solid var(--explore-line); border-radius: 22px; background: #fff; }
.explore-event .explore-hero-image { aspect-ratio: 16 / 9; margin-bottom: 24px; }

.explore-pagination { margin-top: 26px; }

.explore-footer { padding: 26px 16px 34px; border-top: 1px solid var(--explore-line); background: #fff; color: var(--explore-muted); font-size: .88rem; text-align: center; }
.explore-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-bottom: 10px; }
.explore-footer a { display: inline-block; padding: 6px 0; color: #334155; text-decoration: none; }
.explore-footer a:hover { color: var(--explore-accent); }
.explore-footer p { margin: 0; }

@media (max-width: 768px) {
    .explore-hero, .explore-title, .explore-event { padding: 20px; }
    .explore-hero-split { grid-template-columns: 1fr; }
    .explore-title { grid-template-columns: 1fr; gap: 20px; }
    .explore-title-cover { width: 160px; }
    .explore-book-hero { gap: 24px; padding: 22px; }
    .explore-book-cover-stage { min-height: 250px; }
    .explore-book-cover-stage .explore-title-cover { width: 150px; max-height: 225px; }
    .explore-book-summary .explore-details { grid-template-columns: max-content minmax(0, 1fr); }
    .explore-book-holdings { padding: 18px; }
    .explore-book-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 155px), 1fr)); }
}

@media (max-width: 480px) {
    .explore-book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
}

@media (max-width: 350px) {
    .explore-book-grid { grid-template-columns: 1fr; }
}

.explore-plans { display: grid; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.explore-plans li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--explore-line); border-radius: 12px; background: var(--explore-bg); }
.explore-plan-price { color: var(--explore-accent); font-weight: 700; }
