/* Avoid filtering every layer of nested cards while the homepage scrolls. */
.home-page main *,
.home-page #glass-inner {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Search and discovery lead; the department directory has its own full-width row. */
.home-page .hero-layout1 {
    min-height: 0 !important;
    padding: 0;
}
.home-page .hero-layout1 > .container {
    padding-block: clamp(28px, 4vw, 64px) !important;
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: stretch;
    gap: clamp(24px, 4vw, 56px);
}
.hero-grid > * { min-width: 0; }
.home-page .hero-content { padding: 0; }
.home-page .hero-title {
    font-size: clamp(30px, 3.4vw, 48px) !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
}
.home-page .hero-subtitle {
    max-width: 560px !important;
    color: #d2e2e6 !important;
    font-size: 16px !important;
}
.hero-cta-group a { justify-content: center; }
.home-page .hero-search-wrapper {
    width: 100%;
    max-width: none !important;
    background: rgba(0, 26, 36, .65) !important;
}
.home-page .hero-search-input { min-width: 0; width: 100%; font-size: 16px !important; }
.hero-search-input::placeholder { color: #d2e2e6; opacity: 1; }
.hero-search-wrapper button { flex-shrink: 0; }
.hero-stats-wrap-v6 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 28px;
    padding-block: 20px 0;
    border-top: 1px solid rgba(255,255,255,.2);
}
.hero-stats-wrap-v6 > div > div:last-child {
    color: #d2e2e6 !important;
    font-size: 12px !important;
    line-height: 1.5;
}
.home-page .hero-featured-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: rgba(0, 30, 41, .72) !important;
    border-radius: 20px !important;
    min-height: 0 !important;
    padding: clamp(24px, 3vw, 36px);
}
.home-page .hero-featured-copy {
    padding: 0 !important;
    height: auto !important;
    flex: 1;
    gap: 24px;
}
.hero-featured-copy h2 { font-size: clamp(24px, 2.4vw, 32px) !important; }
.home-page .hero-crest-art {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    height: 160px !important;
    flex-shrink: 0;
    order: 1;
    margin-top: 24px;
}
.home-page .hero-crest-art .glass-rings { width: 155px !important; height: 155px !important; }
.home-page .premium-crest { width: 112px !important; height: 112px !important; }
.home-page .premium-crest > i { font-size: 42px !important; }
.hero-departments { grid-column: 1 / -1; }
.home-page .hero-departments-panel {
    padding: 28px 0 0 !important;
    border: 0 !important;
    border-top: 1px solid rgba(255,255,255,.2) !important;
    border-radius: 0 !important;
    background: none !important;
}
.home-page .hero-departments-panel > h2 {
    padding: 0 !important;
    font-size: 20px !important;
}
.hero-departments-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.home-page .hero-department-link {
    min-width: 0;
    margin: 0 !important;
    border-radius: 12px !important;
    background: rgba(0, 30, 41, .65) !important;
    box-shadow: none !important;
    transform: none !important;
    overflow-wrap: anywhere;
}
.hero-department-link > div:first-child > div:last-child { min-width: 0; }
.hero-department-link > div:first-child > div:last-child > div:last-child {
    color: #f2c361 !important;
    font-size: 12px !important;
    flex-wrap: wrap;
}
.home-page .hero-layout1 a:focus-visible,
.home-page .hero-layout1 button:focus-visible,
.home-page .hero-search-wrapper:focus-within {
    outline: 3px solid #f5cc6b;
    outline-offset: 4px;
}
.hero-department-link:hover { border-color: #e6a530 !important; }
@media (max-width: 991.98px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .home-page .hero-featured-card { flex-direction: row; align-items: center; gap: 24px; }
    .home-page .hero-crest-art { width: 160px !important; margin: 0; }
    .hero-departments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .home-page .hero-layout1 > .container { padding-inline: 20px; }
    .home-page .hero-cta-group { display: grid !important; grid-template-columns: 1fr; gap: 10px !important; }
    .home-page .hero-cta-group a { min-height: 48px; padding: 12px 16px !important; }
    .home-page .hero-search-wrapper { flex-wrap: wrap; }
    .home-page .hero-search-input { flex-basis: calc(100% - 50px) !important; }
    .home-page .hero-search-wrapper button { width: 100%; min-height: 44px; }
    .hero-stats-wrap-v6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    .home-page .hero-featured-card { flex-direction: column; align-items: stretch; }
    .home-page .hero-crest-art { align-self: center; }
    .hero-departments-grid { grid-template-columns: minmax(0, 1fr); }
}
.home-page .glass-rings { top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Keep the hero's decorative motion alongside its responsive layout. */
@keyframes orbit {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes pulseGlow {
    0%, 100% { opacity: .5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}
@keyframes floatParticle {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, -20px); }
}
@keyframes crestFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.home-page .premium-crest { animation: crestFloat 4s ease-in-out infinite; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .home-page .hero-department-link:hover { transform: translateY(-3px) !important; }
}

/* Interaction-only motion: no permanent layers or new looping animations. */
@media (prefers-reduced-motion: no-preference) {
    .home-page :is(.hero-cta-group a, .hero-search-wrapper button, .hero-department-link) {
        transition: transform 180ms ease-out !important;
    }
    .home-page :is(.hero-cta-group a, .hero-search-wrapper button):active {
        transform: scale(.98) !important;
    }
    .home-page :is(.hero-department-link, .cat-visual-card, .cta-gold-btn) i {
        transition: transform 180ms ease-out;
    }
    .home-page :is(.hero-department-link, .cat-visual-card, .cta-gold-btn):focus-visible i {
        transform: translateY(-3px);
    }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .home-page .hero-search-wrapper button:hover { transform: translateY(-2px); }
    .home-page :is(.hero-department-link, .cat-visual-card, .cta-gold-btn):hover i {
        transform: translateY(-3px);
    }
}

/* Four illustrated covers, with a curved paper edge matching the library shelf. */
.home-page .trending-hybrid-section > [data-site-background] > .container { max-width: 1200px; width: 88%; }
.home-page #books-ajax-container > .row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0; }
.home-page .home-book-column { width: auto; min-width: 0; padding: 0; margin: 0; --cover-accent: #348766; }
.home-page .home-book-column:nth-child(4n + 2) { --cover-accent: #4887b4; }
.home-page .home-book-column:nth-child(4n + 3) { --cover-accent: #b59151; }
.home-page .home-book-column:nth-child(4n) { --cover-accent: #b78b37; }
@media (max-width: 1199.98px) { .home-page #books-ajax-container > .row { gap: 18px; } }
@media (max-width: 991.98px) {
    .home-page #books-ajax-container > .row { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 580px; margin-inline: auto; }
}
@media (max-width: 575.98px) {
    .home-page .trending-hybrid-section > [data-site-background] > .container { width: calc(100% - 32px); padding-inline: 0; }
    .home-page #books-ajax-container > .row { grid-template-columns: minmax(0, 1fr); max-width: 320px; gap: 12px; }
}
@media (max-width: 359.98px) {
    .home-page #books-ajax-container > .row { grid-template-columns: minmax(0, 1fr); max-width: 240px; }
}
