/* Zavier theme-owned stylesheet; visual tokens are finalized by css/theme.css. */
/* Source: app/Modules/Home/Views/index.php */

.home-page {
    min-height: 100vh;
    padding: 32px 20px 76px;
    color: var(--home-text);
    background: transparent;
}

.home-shell {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
}

.home-hero {
    position: relative;
    grid-column: 5 / 13;
    grid-row: 1;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.home-banner-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.home-banner-track::-webkit-scrollbar,
.home-shortcut-list::-webkit-scrollbar,
.home-stat-list::-webkit-scrollbar,
.home-book-list::-webkit-scrollbar,
.home-news-list::-webkit-scrollbar {
    display: none;
}

.home-banner-slide {
    position: relative;
    flex: 0 0 100%;
    height: 310px;
    overflow: hidden;
    background: #dce7f2;
    border: 1px solid var(--home-border);
    border-radius: 10px;
    scroll-snap-align: center;
}

.home-banner-slide > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-banner-copy {
    position: absolute;
    inset: auto auto 24px 24px;
    width: min(520px, calc(100% - 48px));
    padding: 16px 18px;
    color: #fff;
    background: rgba(17, 43, 70, .84);
    border-radius: 10px;
}

.home-banner-copy > span {
    display: inline-block;
    margin-bottom: 5px;
    color: #cfe2f6;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.home-banner-copy h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.2rem, 2.2vw, 1.65rem);
    font-weight: 700;
    line-height: 1.3;
}

.home-banner-copy p {
    display: -webkit-box;
    margin: 5px 0 0;
    overflow: hidden;
    color: #e2ebf4;
    font-size: .8rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.home-banner-dots {
    display: flex;
    min-height: 25px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 8px;
}

.home-banner-dots button {
    width: 7px;
    height: 7px;
    padding: 0;
    background: #aab9c8;
    border: 0;
    border-radius: 999px;
    transition: width .2s ease, background-color .2s ease;
}

.home-banner-dots button.is-active {
    width: 22px;
    background: var(--home-blue);
}

.home-welcome-banner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-height: 380px;
    padding: 48px;
    color: var(--home-text);
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.home-welcome-banner::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 50%;
    background-image: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%),
                      radial-gradient(circle at center, rgba(91, 117, 98, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.home-welcome-banner > span,
.home-welcome-banner > div {
    position: relative;
    z-index: 1;
}

.home-welcome-banner > span {
    display: inline-flex;
    margin-bottom: 16px;
    color: var(--home-blue);
    background: var(--home-blue-soft);
    padding: 12px;
    border-radius: 10px;
    width: 48px;
    height: 48px;
}

.home-welcome-banner svg { width: 24px; height: 24px; }
.home-welcome-banner small { color: var(--home-muted); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.home-welcome-banner h1 { margin: 8px 0 16px; color: #ffffff; font-size: clamp(2rem, 3.5vw, 3.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.home-welcome-banner p { margin: 0; color: var(--home-muted); font-size: 1rem; max-width: 500px; line-height: 1.6; }

.home-search-panel {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    grid-column: 1 / 5;
    grid-row: 1;
    margin-bottom: 0;
    padding: 24px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.home-search-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.home-search-heading > span {
    display: inline-flex;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    color: var(--home-blue);
    background: var(--home-blue-soft);
    border-radius: 10px;
}

.home-search-heading svg { width: 22px; height: 22px; }
.home-search-heading h2 { margin: 0; color: var(--home-text); font-size: 1.1rem; font-weight: 800; }
.home-search-heading p { margin: 4px 0 0; color: var(--home-muted); font-size: .8rem; }

.home-search-panel form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-search-field {
    position: relative;
    margin: 0;
}

.home-search-field > svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #74899e;
    transform: translateY(-50%);
}

.home-search-field input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px 10px 43px;
    color: var(--home-text);
    background: #fff;
    border: 1px solid #b9cadb;
    border-radius: 10px;
    outline: 0;
    font-size: .84rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.home-search-field input:focus {
    border-color: var(--home-blue);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02), 0 0 0 4px rgba(31, 95, 174, .15);
}

.home-search-panel form > button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    color: #fff;
    background: var(--home-blue);
    border: 1px solid var(--home-blue);
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.home-search-panel form > button svg { width: 16px; height: 16px; }
.home-search-panel form > button:hover { background: var(--home-blue-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22, 71, 127, 0.2); }

.home-popular-books {
    margin-top: 24px;
    border-top: 1px solid #e6edf5;
    padding-top: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.home-popular-books h3 {
    font-size: .85rem;
    font-weight: 700;
    color: var(--home-text);
    margin: 0 0 16px;
}

.home-popular-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 8px;
}

.home-popular-slider::-webkit-scrollbar { display: none; }

.home-popular-card {
    flex: 0 0 94px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    scroll-snap-align: start;
}

.home-popular-cover {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 8px;
    background: #edf2f7;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s;
}

.home-popular-card:hover .home-popular-cover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0,0,0,0.08); }

.home-popular-cover img { width: 100%; height: 100%; object-fit: cover; }

.home-popular-cover .home-cover-fallback {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #8c9eae;
}

.home-popular-cover .home-cover-fallback svg { width: 20px; height: 20px; }

.home-popular-info strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: .72rem;
    color: #294158;
    line-height: 1.35;
    transition: color 0.2s;
}

.home-popular-card:hover .home-popular-info strong { color: var(--home-blue); }

.home-search-suggestions {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(23, 43, 67, .16);
}

.home-search-suggestions[hidden] { display: none; }
.home-search-suggestions button { display: flex; width: 100%; padding: 10px 13px; flex-direction: column; align-items: flex-start; color: inherit; background: #fff; border: 0; border-bottom: 1px solid #e8eef4; text-align: left; }
.home-search-suggestions button:last-child { border-bottom: 0; }
.home-search-suggestions button:hover, .home-search-suggestions button:focus { background: #f2f7fb; }
.home-search-suggestions strong { max-width: 100%; overflow: hidden; color: #294158; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.home-search-suggestions small { max-width: 100%; overflow: hidden; color: var(--home-muted); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }

.home-section {
    margin-bottom: 0;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.home-section[aria-labelledby="services-title"] { grid-column: 5 / 13; grid-row: 2; display: flex; flex-direction: column; }
.home-section[aria-labelledby="statistics-title"] { grid-column: span 12; }
.home-section[aria-labelledby="latest-catalog-title"] { grid-column: span 12; }
.home-section.home-news-section { grid-column: 1 / 5; grid-row: 2; display: flex; flex-direction: column; }

.home-section-header {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--home-border);
}

.home-section-header h2 { margin: 0; color: var(--home-text); font-size: 1.1rem; font-weight: 800; }
.home-section-header p { margin: 4px 0 0; color: var(--home-muted); font-size: .8rem; }

.home-section-header > a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: var(--home-blue);
    font-size: .72rem;
    font-weight: 700;
    text-decoration: none;
}

.home-section-header > a svg { width: 15px; height: 15px; }

.home-shortcut-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
    flex: 1;
}

.home-shortcut-list > a {
    display: flex;
    min-width: 0;
    min-height: 130px;
    padding: 20px 12px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: inherit;
    background: var(--home-blue-soft);
    border: none;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
}

.home-shortcut-list > a > span {
    display: inline-flex;
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    align-items: center;
    justify-content: center;
    color: var(--home-blue);
    background: var(--home-blue-soft);
    border-radius: 10px;
}

.home-shortcut-list svg { width: 23px; height: 23px; }
.home-shortcut-list strong { color: #294158; font-size: .72rem; line-height: 1.3; }
.home-shortcut-list small { margin-top: 3px; color: var(--home-muted); font-size: .62rem; }
.home-shortcut-list > a:hover, .home-shortcut-list > a:focus { background: #f1f6fb; border-color: #a7c3df; transform: translateY(-4px); box-shadow: 0 8px 24px rgba(31, 95, 174, 0.12); }

.home-stat-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
}

.home-stat-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--home-border);
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.home-stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05); }

.home-stat-card > span {
    display: inline-flex;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--home-blue);
    background: var(--home-blue-soft);
    border-radius: 10px;
}

.home-stat-card svg { width: 20px; height: 20px; }
.home-stat-card > div { display: flex; min-width: 0; flex-direction: column; }
.home-stat-card small { color: var(--home-muted); font-size: .68rem; font-weight: 650; }
.home-stat-card strong { color: var(--home-text); font-size: 1.35rem; line-height: 1.2; }
.home-stat-card em { margin-top: 3px; color: #8191a2; font-size: .62rem; font-style: normal; }

.home-book-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
}

.home-book-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    transition: transform 0.2s, background-color 0.2s;
}

.home-book-card:hover { transform: translateY(-2px); background: var(--home-blue-soft); }

.home-book-cover {
    display: block;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background: #edf2f7;
    border-radius: 9px;
}

.home-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.home-cover-fallback { display: flex; width: 100%; height: 100%; padding: 7px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #75899e; text-align: center; }
.home-cover-fallback[hidden] { display: none; }
.home-cover-fallback svg { width: 24px; height: 24px; }
.home-cover-fallback small { font-size: .55rem; font-weight: 650; }
.home-book-card > div { min-width: 0; padding-top: 3px; }
.home-book-card h3 { display: -webkit-box; margin: 0 0 7px; overflow: hidden; color: #263e56; font-size: .76rem; font-weight: 700; line-height: 1.38; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.home-book-card h3 a { color: inherit; text-decoration: none; }
.home-book-card p, .home-book-card > div > small { display: block; margin: 0; overflow: hidden; color: var(--home-muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.home-book-card > div > small { margin-top: 4px; color: #8797a8; }

.home-news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    flex: 1;
}

.home-news-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    transition: transform 0.2s;
}

.home-news-card:hover { transform: translateX(4px); }

.home-news-thumb { display: block; overflow: hidden; border-radius: 10px; flex: 0 0 90px; width: 90px; height: 90px; background: #eaf0f5; }
.home-news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.home-news-card:hover .home-news-thumb img { transform: scale(1.05); }
.home-news-card > div { flex: 1; min-width: 0; }
.home-news-card > div > span { display: none; }
.home-news-card h3 { display: -webkit-box; margin: 0 0 6px; overflow: hidden; color: var(--home-text); font-size: .85rem; font-weight: 700; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.home-news-card h3 a { color: inherit; text-decoration: none; }
.home-news-card p { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--home-muted); font-size: .75rem; font-weight: 500; }
.home-news-card p svg { width: 14px; height: 14px; color: var(--home-blue); }

.home-empty {
    display: flex;
    min-height: 230px;
    padding: 28px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.home-empty > span { display: inline-flex; width: 56px; height: 56px; margin-bottom: 12px; align-items: center; justify-content: center; color: var(--home-blue); background: var(--home-blue-soft); border-radius: 10px; }
.home-empty svg { width: 27px; height: 27px; }
.home-empty h3 { margin: 0; color: var(--home-text); font-size: .9rem; }
.home-empty p { margin: 5px 0 0; color: var(--home-muted); font-size: .72rem; }

@media (max-width: 1024px) {
    .home-shell {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    .home-hero, .home-search-panel, .home-section {
        grid-column: auto !important;
        grid-row: auto !important;
        width: auto;
        margin: 0 16px 16px;
    }
    .home-hero { margin-top: 16px; }
    .home-shortcut-list { grid-template-columns: repeat(4, 1fr); }
    .home-book-list, .home-news-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .home-page { padding: 72px 0 calc(92px + env(safe-area-inset-bottom)); }
    .home-hero { margin: 0 0 12px; }
    .home-banner-track { gap: 0; padding: 0; scroll-padding-inline: 0; }
    .home-banner-slide { flex-basis: 100%; height: 190px; border-radius: 0; border: 0; }
    .home-banner-slide > img { border-radius: 0; }
    .home-banner-copy { inset: auto 10px 10px; width: auto; padding: 10px 11px; border-radius: 10px; }
    .home-banner-copy > span { margin-bottom: 2px; font-size: .57rem; }
    .home-banner-copy h1 { font-size: .96rem; }
    .home-banner-copy p { margin-top: 3px; font-size: .64rem; }
    .home-banner-dots { min-height: 28px; padding-top: 9px; }
    .home-welcome-banner { min-height: 178px; margin: 0; padding: 20px 16px; border-radius: 0; border-left: 0; border-right: 0; }
    .home-welcome-banner > span { flex-basis: 50px; width: 50px; height: 50px; border-radius: 10px; }
    .home-welcome-banner h1 { font-size: 1.15rem; }
    .home-welcome-banner p { font-size: .7rem; }
    .home-search-panel, .home-section { margin: 0 0 12px; border-radius: 0; border: 0; border-top: 1px solid #e8eef4; border-bottom: 1px solid #e8eef4; box-shadow: none; }
    .home-search-panel { display: block; padding: 20px 16px; }
    .home-search-heading { margin-bottom: 11px; }
    .home-search-panel form > button { width: 100%; }
    .home-section-header { min-height: 64px; padding: 12px 14px; }
    .home-section-header p { font-size: .67rem; }
    .home-shortcut-list, .home-stat-list { display: flex; gap: 9px; padding: 12px 12px 14px; overflow-x: auto; scroll-padding-inline: 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .home-book-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 14px 16px; }
    .home-shortcut-list > a { flex: 0 0 112px; min-height: 116px; scroll-snap-align: start; }
    .home-stat-card { flex: 0 0 174px; min-height: 104px; scroll-snap-align: start; }
    .home-book-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; flex: none; scroll-snap-align: none; }
    .home-book-cover { width: 100%; aspect-ratio: 2 / 3; }
    .home-news-list { display: flex; flex-direction: column; gap: 12px; padding: 0 12px 16px; }
    .home-news-card { padding: 8px; background: var(--home-blue-soft); }
    .home-news-card h3 { min-height: auto; font-size: .85rem; }
}

@media (max-width: 390px) {
    .home-search-heading > span { display: none; }
    .home-search-heading { gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .home-banner-track { scroll-behavior: auto; }
    .home-news-thumb img { transition: none; }
}
