/* ============================================
   FEATURED DOCUMENTS — Shared Styles
   Used across library, home pages, landing pages, and reader
   ============================================ */

/* ---- Featured Badge (library cards) ---- */
.featured-badge-library {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    white-space: nowrap;
}

.featured-badge-library::before {
    content: '\2605'; /* star */
    font-size: 0.6rem;
}

/* Accent border on featured library cards */
.document-card[data-featured="true"] {
    border-left: 3px solid #667eea;
}

/* ---- Library Featured Banner ---- */
.library-featured-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    padding: 2.5rem 2rem;
}

.library-featured-banner:empty {
    display: none;
}

.featured-banner-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.featured-banner-header h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.featured-banner-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0;
}

.featured-banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.featured-banner-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-banner-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.4);
}

.banner-card-image {
    height: 150px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.banner-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-card-placeholder .placeholder-icon {
    font-size: 2.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.15);
}

.banner-card-content {
    padding: 1.25rem;
}

.banner-card-content .featured-label {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(102, 126, 234, 0.25);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a5b4fc;
    margin-bottom: 0.5rem;
}

.banner-card-content h3 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.banner-card-content p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    margin: 0 0 0.75rem;
}

.banner-card-content .banner-cta {
    color: #a5b4fc;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---- Home Page Featured Showcase ---- */
.featured-showcase {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    padding: 4rem 2rem;
}

.featured-showcase .section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.featured-showcase .section-header h2 {
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.featured-showcase .section-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    margin: 0;
}

.featured-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto 2rem;
}

.featured-showcase-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.featured-showcase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    border-color: rgba(102, 126, 234, 0.4);
}

.featured-showcase-image {
    height: 180px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.featured-showcase-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-showcase-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.featured-showcase-body .featured-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 0.2rem 0.6rem;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a5b4fc;
    margin-bottom: 0.75rem;
}

.featured-showcase-body h3 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.featured-showcase-body .featured-org {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin: 0 0 0.5rem;
}

.featured-showcase-body .featured-excerpt {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    line-height: 1.6;
    flex-grow: 1;
    margin: 0;
}

.featured-showcase .browse-all {
    text-align: center;
}

.featured-showcase .browse-all a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #a5b4fc;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.featured-showcase .browse-all a:hover {
    color: #fff;
}

/* ---- Cross-Promotion Section (landing pages) ---- */
.cross-promo-section {
    background: #f7f8fa;
    padding: 3.5rem 2rem;
}

.cross-promo-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.cross-promo-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.25rem;
}

.cross-promo-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
    margin: 0 0 2rem;
}

.cross-promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cross-promo-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cross-promo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #667eea;
}

.cross-promo-image {
    height: 140px;
    overflow: hidden;
    background: #f1f5f9;
}

.cross-promo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cross-promo-body {
    padding: 1.25rem;
}

.cross-promo-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.cross-promo-body .cross-promo-org {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.75rem;
}

.cross-promo-body .cross-promo-cta {
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---- Reader Exit Recommendations ---- */
.exit-recommendations {
    margin: 2rem 0;
    padding: 2rem;
    background: #f7f8fa;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.exit-rec-header {
    margin-bottom: 1rem;
}

.exit-rec-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.15rem;
}

.exit-rec-header p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

.exit-rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.exit-rec-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.exit-rec-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.exit-rec-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.exit-rec-body {
    padding: 0.75rem;
}

.exit-rec-body h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.2rem;
    line-height: 1.3;
}

.exit-rec-body p {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .featured-banner-grid,
    .featured-showcase-grid,
    .cross-promo-grid {
        grid-template-columns: 1fr;
    }

    .library-featured-banner {
        padding: 1.5rem 1rem;
    }

    .featured-showcase {
        padding: 2.5rem 1rem;
    }

    .cross-promo-section {
        padding: 2rem 1rem;
    }

    .exit-rec-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 400px) {
    .exit-rec-grid {
        grid-template-columns: 1fr;
    }
}
