/* Shared content edges for the homepage hero, shortcuts, boards and article feeds. */
.portal-scope.ut-home {
    --home-content-width: min(1472px, calc(100% - 64px));
}
.portal-scope.ut-home :is(.eu-home-intro__inner, #academic, #featured-promo-section, .eh-wrap) {
    box-sizing: border-box;
    width: var(--home-content-width);
    max-width: none;
    margin-inline: auto;
    padding-inline: 0;
}
@media (max-width: 1024px) {
    .portal-scope.ut-home { --home-content-width: calc(100% - 48px); }
}
@media (max-width: 767px) {
    .portal-scope.ut-home { --home-content-width: calc(100% - 32px); }
}
@media (max-width: 359px) {
    .portal-scope.ut-home { --home-content-width: calc(100% - 24px); }
}

/* ==========================================================================
   Book Store — A4 3D Book Showcase & Purchase Cards
   ========================================================================== */
.eh-books-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
@media (max-width: 640px) {
    .eh-books-shelf {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
@media (max-width: 360px) {
    .eh-books-shelf {
        grid-template-columns: 1fr;
    }
}

.eh-book-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    position: relative;
}
.eh-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.12);
    border-color: #93c5fd;
}

.eh-book-mockup-link {
    display: block;
    text-decoration: none;
    perspective: 1000px;
}
.eh-book-3d {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.414; /* Standard A4 book aspect ratio */
    max-width: 210px;
    margin: 0 auto 14px auto;
    border-radius: 3px 10px 10px 3px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 
        -2px 0 4px rgba(0, 0, 0, 0.12),
        2px 2px 0 #e2e8f0,
        3px 3px 0 #cbd5e1,
        6px 12px 22px rgba(15, 23, 42, 0.22);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.eh-book-card:hover .eh-book-3d {
    transform: rotate(-1deg) scale(1.02);
    box-shadow: 
        -3px 0 6px rgba(0, 0, 0, 0.16),
        3px 3px 0 #cbd5e1,
        5px 5px 0 #94a3b8,
        8px 18px 30px rgba(15, 23, 42, 0.3);
}

.eh-book-3d__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.eh-book-3d__spine {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 12px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.15) 60%, rgba(255, 255, 255, 0.15) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 3;
    pointer-events: none;
}
.eh-book-3d__crease {
    position: absolute;
    top: 0;
    left: 16px;
    bottom: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.1);
    z-index: 3;
    pointer-events: none;
}
.eh-book-3d__sheen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.05) 30%, transparent 65%);
    pointer-events: none;
    z-index: 4;
}

.eh-book-3d__format-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(245, 158, 11, 0.6);
    color: #fde68a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 999px;
    z-index: 5;
}
.eh-book-3d__format-badge--free {
    border-color: rgba(16, 185, 129, 0.6);
    color: #a7f3d0;
}

.eh-book-3d__fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #09122a 0%, #172554 45%, #1e3a8a 75%, #09122a 100%);
    color: #ffffff;
    padding: 18px 14px 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-sizing: border-box;
}
.eh-book-3d__fallback-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.eh-book-3d__fallback-badge {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fde68a;
    text-transform: uppercase;
}
.eh-book-3d__fallback-pill {
    background: #f59e0b;
    color: #0f172a;
    font-size: 8.5px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.eh-book-3d__fallback-title {
    font-family: 'Hind Siliguri', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff;
    margin: auto 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.eh-book-3d__fallback-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 8px;
    font-size: 10px;
    color: #94a3b8;
}

.eh-book-card__body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.eh-book-card__category {
    font-size: 11.5px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.eh-book-card__title {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}
.eh-book-card__title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.15s ease;
}
.eh-book-card__title a:hover {
    color: #2563eb;
}

.eh-book-card__pricing {
    margin-bottom: 12px;
}
.eh-book-card__price-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.eh-book-card__price {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}
.eh-book-card__mrp {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
}
.eh-book-card__discount {
    font-size: 11px;
    font-weight: 800;
    color: #dc2626;
    background: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
}
.eh-book-card__badge-free {
    font-size: 11px;
    font-weight: 700;
    color: #059669;
    background: #d1fae5;
    padding: 2px 6px;
    border-radius: 4px;
}

.eh-book-card__action {
    margin-top: auto;
}
.eh-book-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff !important;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.18s ease;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}
.eh-book-card__btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}
.eh-book-card__btn--free {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.25);
}
.eh-book-card__btn--free:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

/* Dark Mode Overrides */
html[data-site-theme="dark"] .eh-book-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
html[data-site-theme="dark"] .eh-book-card__title a,
html[data-site-theme="dark"] .eh-book-card__price {
    color: #f1f5f9;
}
html[data-site-theme="dark"] .eh-book-card__category {
    color: #60a5fa;
}
html[data-site-theme="dark"] .eh-book-3d {
    box-shadow: 
        -2px 0 4px rgba(0, 0, 0, 0.3),
        2px 2px 0 #334155,
        3px 3px 0 #475569,
        6px 12px 22px rgba(0, 0, 0, 0.4);
}
