/* =========================================
   BOOKS & PUBLICATIONS - High Performance UI
   Theme: Solid Colors, Asymmetry, Depth
   Status: Fixed Button Alignment & Card Height
   ========================================= */

:root {
    --bp-primary: #1a237e;   /* Deep Sapphire */
    --bp-accent: #ff8a65;    /* Vibrant Orange */
    --bp-text: #212121;
    --bp-bg: #f4f6f9;
    --bp-white: #ffffff;
}

/* Global Box Sizing Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bp-bg);
    overflow-x: hidden;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

.bp-main {
    width: 100%;
    position: relative;
}

/* =========================================
   1. HERO SECTION
   ========================================= */
.bp-hero {
    position: relative;
    padding: 120px 24px 80px;
    background-color: var(--bp-white);
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.bp-subtitle {
    display: block;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bp-accent);
    margin-bottom: 15px;
    animation: fadeInDown 0.8s ease;
}

.bp-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--bp-primary);
    margin-bottom: 20px;
    letter-spacing: -1px;
    animation: fadeInUp 0.8s ease;
}

.bp-title .highlight {
    color: var(--bp-text);
    position: relative;
    display: inline-block;
}

.bp-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 15px;
    background-color: rgba(255, 138, 101, 0.3);
    z-index: -1;
}

.bp-desc {
    font-size: 1.2rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.6;
    animation: fadeInUp 1s ease;
}

.bp-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 40px;
    animation: fadeInUp 1.2s ease;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--bp-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
}

/* =========================================
   2. GALLERY GRID
   ========================================= */
.bp-gallery {
    display: grid;
    grid-template-columns: repeat(12, 1fr); /* 12 column layout */
    gap: 30px;
    padding-top: 80px;
    padding-bottom: 100px;
    align-items: start;
}

/* --- Base Card Styling --- */
.bp-card {
    background: var(--bp-white);
    position: relative;
    overflow: hidden;
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    border-radius: 8px;
    opacity: 0; 
    transform: translateY(50px);
}

.bp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    z-index: 2;
}

/* --- Layout Fix for Anchor Wrappers around Images --- */
.bp-card > a {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    margin: 0;
    padding: 0;
}

.bp-img-holder {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.bp-img-holder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bp-card:hover .bp-img-holder img {
    transform: scale(1.08);
}

/* --- Card Type 1: STANDARD (Vertical) --- */
.bp-card.standard {
    grid-column: span 4;
    flex-direction: column;
    height: 550px; /* Increased height to fit content + button */
}

.bp-card.standard > a {
    width: 100%;
    height: 260px; /* Fixed image height */
    flex-shrink: 0;
}

.bp-card.standard .bp-info {
    flex: 1;
    padding: 30px;
    border-top: 1px solid #f5f5f5;
}

/* --- Card Type 2: LARGE (Horizontal) --- */
.bp-card.large {
    grid-column: span 8;
    flex-direction: row;
    height: 550px; /* Match standard height */
}

.bp-card.large > a {
    width: 55%;
    height: 100%;
    flex-shrink: 0;
}

.bp-card.large .bp-info {
    width: 45%;
    flex: 1;
    padding: 40px;
    border-left: 1px solid #eee;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Card Type 3: WIDE (Full Width Banner) --- */
.bp-card.wide {
    grid-column: span 12;
    flex-direction: row;
    height: 450px;
    background-color: var(--bp-primary);
    color: white;
}

.bp-card.wide > a {
    width: 50%;
    height: 100%;
    flex-shrink: 0;
    order: 2; 
}

.bp-card.wide .bp-info {
    width: 50%;
    flex: 1;
    padding: 50px;
 
    color: white;
    order: 1;
    border: none;
}



/* --- Info & Typography --- */
.bp-info {
    background: var(--bp-white);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* This pushes button to bottom */
    height: 100%;
}

.bp-card h3, .bp-card h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    font-weight: 700;
    color: var(--bp-primary);
    line-height: 1.3;
    margin-top: 0;
}

.bp-card p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    /* Ensure text doesn't push button out */
    display: -webkit-box;
    -webkit-line-clamp: 4; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Badges & Buttons --- */
.bp-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--bp-accent);
    color: white;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 5;
    box-shadow: 4px 4px 0px rgba(26, 35, 126, 0.2);
    pointer-events: none;
}

/* Corrected Button Alignment */
.bp-btn {
    background: var(--bp-primary);
    color: white;
    border: none;
    padding: 14px 28px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    width: fit-content;
    transition: all 0.3s;
    
    /* Flex properties for icon alignment */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    
    /* Placement logic */
    margin-top: auto; /* Anchors to bottom */
    text-decoration: none; /* Removes underline from <a> tag */
    border-radius: 4px;
}

.bp-btn:hover {
    background: var(--bp-accent);
    transform: translateX(5px);
    color: white;
}

/* =========================================
   3. CTA SECTION
   ========================================= */
.bp-cta {
    background-color: var(--bp-primary);
    color: white;
    padding: 100px 24px;
    text-align: center;
}

.bp-cta h2 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.bp-cta p {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 40px;
}

/* =========================================
   4. ANIMATIONS
   ========================================= */
.scroll-in {
    animation: fadeInUp 0.8s forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(60px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   5. RESPONSIVE DESIGN
   ========================================= */

/* Tablet Landscape */
@media (max-width: 1100px) {
    .bp-card.standard { grid-column: span 6; } /* 2 per row */
    .bp-card.large { grid-column: span 12; }   /* Full width */
}

/* Tablet Portrait & Mobile */
@media (max-width: 900px) {
    .bp-title { font-size: 3rem; }
    
    .bp-gallery {
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    .bp-card, .bp-card.large, .bp-card.wide, .bp-card.standard {
        grid-column: auto;
        width: 100%;
        height: auto;
        flex-direction: column;
    }

    /* Reset Anchor Images for Mobile */
    .bp-card > a, 
    .bp-card.large > a, 
    .bp-card.standard > a, 
    .bp-card.wide > a {
        width: 100%;
        height: 280px;
        order: -1;
    }

    /* Reset Info Areas */
    .bp-card .bp-info, 
    .bp-card.large .bp-info, 
    .bp-card.wide .bp-info {
        width: 100%;
        border: none;
        padding: 30px 24px;
        order: 1;
    }
    
    .bp-card p {
        -webkit-line-clamp: unset; 
    }
}

/* Small Mobile */
@media (max-width: 600px) {
    .bp-hero { padding: 80px 20px 40px; }
    .bp-title { font-size: 2.2rem; }
    .bp-stats { gap: 30px; }
    .stat-num { font-size: 1.8rem; }
    
    .bp-card h3 { font-size: 1.5rem; }
    
    .bp-card > a, 
    .bp-card.large > a, 
    .bp-card.standard > a, 
    .bp-card.wide > a {
        height: 220px;
    }
}