/* Browse Refinements - Subtle Enhancements
 * Hudson Street Library
 * Improves list view cards + visual grid without changing functionality
 */

/* ============================================
   List View Cards - Refined
   ============================================ */

/* Better card structure and spacing */
.book-card {
    background: white;
    border: 1px solid rgba(10, 10, 10, 0.08);
    padding: 2rem;
    margin-bottom: 1.75rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-card:hover {
    box-shadow:
        0 1px 3px rgba(10, 10, 10, 0.08),
        0 4px 12px rgba(10, 10, 10, 0.08),
        0 8px 24px rgba(10, 10, 10, 0.06);
    transform: translateY(-2px);
    border-color: rgba(10, 10, 10, 0.12);
}

/* Improved title typography */
.book-title {
    font-family: 'Crimson Pro', serif;
    font-size: 1.625rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.625rem;
    letter-spacing: -0.01em;
}

.book-title a {
    color: #0A0A0A;
    text-decoration: none;
    transition: color 0.25s ease;
}

.book-title a:hover {
    color: #8B7355;
}

/* Cleaner author presentation */
.book-author {
    font-size: 1.0625rem;
    font-weight: 400;
    color: #8B7355;
    margin-bottom: 1rem;
    letter-spacing: 0.005em;
}

/* Refined metadata layout */
.book-meta {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(10, 10, 10, 0.65);
    margin-bottom: 1.125rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1rem;
}

.book-meta strong {
    color: rgba(10, 10, 10, 0.85);
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

/* Better description readability */
.book-description {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: rgba(10, 10, 10, 0.75);
    margin-bottom: 1.125rem;
    max-width: 75ch;
}

/* Improved tag presentation */
.book-tags {
    font-size: 0.8125rem;
    color: #8B7355;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Responsive card adjustments */
@media (max-width: 768px) {
    .book-card {
        padding: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .book-title {
        font-size: 1.375rem;
    }

    .book-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ============================================
   Visual Grid - Enhanced
   ============================================ */

/* Larger, more impactful covers */
.visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2rem 1.75rem;
}

@media (min-width: 768px) {
    .visual-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        gap: 2.25rem 2rem;
    }
}

@media (min-width: 1024px) {
    .visual-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 2.5rem 2.25rem;
    }
}

/* Refined cover frame */
.visual-cover {
    aspect-ratio: 3/4;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(10, 10, 10, 0.1);
    margin-bottom: 0.875rem;
    background: #ffffff;
    box-shadow:
        0 1px 3px rgba(10, 10, 10, 0.06),
        0 2px 6px rgba(10, 10, 10, 0.04);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.visual-card:hover .visual-cover {
    box-shadow:
        0 2px 6px rgba(10, 10, 10, 0.08),
        0 4px 12px rgba(10, 10, 10, 0.06),
        0 8px 20px rgba(10, 10, 10, 0.04);
    transform: translateY(-3px);
    border-color: rgba(10, 10, 10, 0.14);
}

.visual-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.visual-card:hover .visual-cover img {
    transform: scale(1.03);
}

/* Better title presentation */
.visual-title {
    font-family: 'Crimson Pro', serif;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.375rem;
    text-align: center;
    color: #0A0A0A;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.visual-author {
    font-size: 0.8125rem;
    color: #8B7355;
    text-align: center;
    font-weight: 400;
    letter-spacing: 0.005em;
}

/* Mobile responsive for visual grid */
@media (max-width: 768px) {
    .visual-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1.5rem 1.25rem;
    }
}

/* ============================================
   Search Controls - Minor Refinements
   ============================================ */

/* Slightly better contrast and spacing */
.search-input {
    border-bottom: 1.5px solid #0A0A0A;
}

.search-input:focus {
    border-bottom-color: #8B7355;
}

.search-select {
    border: 1px solid rgba(10, 10, 10, 0.14);
}

.search-select:hover {
    border-color: rgba(10, 10, 10, 0.22);
}

.search-select:focus {
    border-color: #8B7355;
}

/* ============================================
   Results Count - Better Visibility
   ============================================ */

.results-count {
    font-family: 'Archivo Narrow', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(10, 10, 10, 0.65);
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Pagination - Refined Buttons
   ============================================ */

.pagination-btn {
    font-family: 'Archivo Narrow', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.875rem 1.75rem;
    border: 1px solid rgba(10, 10, 10, 0.12);
    background: white;
    color: #0A0A0A;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pagination-btn:hover:not(:disabled) {
    background: #0A0A0A;
    color: #F8F7F4;
    border-color: #0A0A0A;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #8B7355;
    color: white;
    border-color: #8B7355;
}

/* ============================================
   Toggle Switch - Subtle Enhancement
   ============================================ */

.toggle-switch {
    cursor: pointer;
    user-select: none;
}

.toggle-track {
    border: 1.5px solid #0A0A0A;
    transition: background-color 0.22s ease;
}

.toggle-switch:hover .toggle-track {
    border-color: #8B7355;
}

.toggle-switch input:checked ~ .toggle-track {
    background: #0A0A0A;
}

.toggle-label {
    font-family: 'Archivo Narrow', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #0A0A0A;
}

/* ============================================
   Loading & Empty States - Polish
   ============================================ */

.loading-state,
.empty-state,
.error-state {
    text-align: center;
    padding: 5rem 2rem;
}

.state-title {
    font-family: 'Crimson Pro', serif;
    font-size: 1.625rem;
    font-weight: 600;
    margin-bottom: 0.625rem;
    color: #0A0A0A;
}

.state-text {
    color: rgba(10, 10, 10, 0.6);
    font-size: 1rem;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .book-card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }

    .visual-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1rem !important;
    }

    .visual-cover {
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
}

/* ============================================
   Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .book-card,
    .visual-cover,
    .visual-cover img,
    .pagination-btn,
    .book-title a {
        transition-duration: 0.01ms !important;
    }

    .book-card:hover,
    .visual-card:hover .visual-cover {
        transform: none !important;
    }
}

/* Focus states for keyboard navigation */
.book-card:focus-within {
    outline: 2px solid #8B7355;
    outline-offset: 2px;
}

.visual-card:focus-within .visual-cover {
    outline: 2px solid #8B7355;
    outline-offset: 2px;
}

/* ============================================
   Performance Optimizations
   ============================================ */

/* Use will-change for smoother animations on hover-capable devices */
@media (hover: hover) {
    .book-card,
    .visual-cover {
        will-change: transform, box-shadow;
    }

    .book-card:not(:hover),
    .visual-cover:not(:hover) {
        will-change: auto;
    }
}
