:root {
    --green: #23C55E;
    --green-dark: #1ca34d;
    --green-darker: #15803c;
    --green-light: rgba(35, 197, 94, 0.08);
    --text-primary: #1a1a2e;
    --bg-page: #f5f3f0;
    --bg-card: #ffffff;
    --border-subtle: rgba(0, 0, 0, 0.06);
    --shadow-card: 0 4px 8px rgba(0, 0, 0, 0.08),
        0 8px 20px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 8px 16px rgba(0, 0, 0, 0.12),
        0 16px 36px rgba(0, 0, 0, 0.10),
        0 0 0 1px rgba(35, 197, 94, 0.15);
    --shadow-image: 0 4px 12px rgba(0, 0, 0, 0.12);
    --radius-card: 20px;
    --radius-tag: 100px;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hind Siliguri', 'Noto Sans Bengali', sans-serif;
    background-color: var(--bg-page);
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(35, 197, 94, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 90%, rgba(35, 197, 94, 0.02) 0%, transparent 60%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px 5px;
    -webkit-font-smoothing: antialiased;
}

.cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 100%;
    padding: 4px;
}

.book-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 240px;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
    opacity: 0;
    animation: cardFadeIn 0.6s ease-out forwards;
}

.book-card:nth-child(1) { animation-delay: 0.05s; }
.book-card:nth-child(2) { animation-delay: 0.15s; }
.book-card:nth-child(3) { animation-delay: 0.25s; }
.book-card:nth-child(n+4) { animation-delay: calc(0.1s * var(--i, 1)); }

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

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(35, 197, 94, 0.15);
}

.card-body {
    display: flex;
    flex: 1;
    align-items: stretch;
    position: relative;
}

.card-image-wrap {
    flex: 0 0 48%;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-card) 0 0 var(--radius-card);
    box-shadow: var(--shadow-image);
    transition: box-shadow var(--transition-smooth);
    background: #e9e9e9;
}

.book-card:hover .card-image-wrap {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-smooth);
}

.book-card:hover .card-image-wrap img {
    transform: scale(1.04);
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
    padding: 24px 20px 20px 18px;
    min-width: 0;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-title .highlight-year {
    color: var(--green-dark);
    font-weight: 600;
}

.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-tag);
    white-space: nowrap;
    transition: all var(--transition-smooth);
    line-height: 1;
}

.tag-filled {
    background-color: var(--green);
    color: #fff;
    box-shadow: 0 1px 3px rgba(35, 197, 94, 0.25);
}

.tag-outlined {
    background-color: var(--green-light);
    color: var(--green-dark);
    border: 1.5px solid rgba(35, 197, 94, 0.3);
}

.tag-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 5px;
    flex-shrink: 0;
}

.tag-filled .tag-dot { background: #fff; opacity: 0.8; }
.tag-outlined .tag-dot { background: var(--green); }

/* ── Raised 3D Link (previously button) ── */
.btn-read {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 20px);
    margin: 0 10px 12px 10px;
    padding: 14px 20px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    text-decoration: none;   /* ← added for anchor tag */
    background: linear-gradient(180deg, #26d865 0%, var(--green) 40%, var(--green-dark) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    box-shadow:
        0 5px 0 0 var(--green-darker),
        0 8px 18px rgba(35, 197, 94, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.btn-read::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 100%);
    transition: left 0.7s ease;
}

.btn-read:hover::before {
    left: 100%;
}

.btn-read:hover {
    transform: translateY(-4px);
    box-shadow:
        0 7px 0 0 var(--green-darker),
        0 12px 24px rgba(35, 197, 94, 0.45),
        0 3px 6px rgba(0, 0, 0, 0.10);
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, #30e070 0%, #23C55E 40%, var(--green-dark) 100%);
}

.btn-read:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 0 var(--green-darker),
        0 3px 8px rgba(35, 197, 94, 0.25);
    transition: all 0.1s ease;
    background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 60%, var(--green-darker) 100%);
}

.btn-arrow {
    display: inline-flex;
    transition: transform var(--transition-bounce);
    font-size: 0.95rem;
}

.btn-read:hover .btn-arrow {
    transform: translateX(5px);
}

@media (max-width: 374px) {
    .card-image-wrap { flex: 0 0 45%; }
    .card-content { padding: 14px 14px 14px 12px; gap: 10px; }
    .book-title { font-size: 0.85rem; }
    .tag { font-size: 0.65rem; padding: 3px 9px; }
    .btn-read {
        padding: 12px 16px;
        font-size: 0.85rem;
        width: calc(100% - 14px);
        margin: 0 7px 10px 7px;
        box-shadow: 0 4px 0 0 var(--green-darker), 0 6px 14px rgba(35, 197, 94, 0.3), 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    .btn-read:hover {
        box-shadow: 0 5px 0 0 var(--green-darker), 0 9px 18px rgba(35, 197, 94, 0.38);
        transform: translateY(-3px);
    }
    .btn-read:active { transform: translateY(1px); box-shadow: 0 2px 0 0 var(--green-darker), 0 2px 6px rgba(35, 197, 94, 0.2); }
    .book-card { min-height: 200px; }
}

@media (min-width: 375px) and (max-width: 480px) {
    .book-title { font-size: 0.95rem; }
    .btn-read { padding: 13px 18px; font-size: 0.9rem; width: calc(100% - 16px); margin: 0 8px 11px 8px; }
    .book-card { min-height: 220px; }
}

@media (min-width: 481px) {
    .book-card { min-height: 250px; }
}

.btn-read:focus-visible {
    outline: 3px solid rgba(35, 197, 94, 0.6);
    outline-offset: 4px;
    border-radius: 14px;
}
.book-card:focus-within {
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(35, 197, 94, 0.2);
}
