/* Rain public theme home page styles. */

.home-page {
    --rain-primary: #647D68;
    --rain-primary-dark: #435947;
    --rain-primary-soft: #edf2ed;
    --home-border: #d8e2d9;
    --home-text: #27342a;
    --home-muted: #647166;
    min-height: auto;
    padding: 92px 20px 8px;
    color: var(--home-text);
    background: #f4f7fa;
}

.home-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.home-hero {
    position: relative;
    margin-bottom: 16px;
}

.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: #e6ece6;
    border: 1px solid var(--home-border);
    border-radius: 20px;
    scroll-snap-align: center;
}

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

.home-banner-slide.has-link {
    cursor: pointer;
}

.home-banner-slide.has-link > img {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.home-banner-slide.has-link:hover > img {
    transform: scale(1.02);
}

.home-banner-overlay-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    outline: none;
    text-decoration: none;
}

.home-banner-slide.has-link:focus-within {
    box-shadow: 0 0 0 3px rgba(100, 125, 104, 0.35);
}

.home-banner-slide.has-link:not(.has-cta-btn) .home-banner-copy {
    pointer-events: none;
}

.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);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 14px;
    z-index: 2;
}

.home-banner-cta-wrap {
    margin-top: 12px;
    display: flex;
    align-items: center;
}

.home-banner-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--rain-primary), var(--rain-primary-dark));
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 3;
    pointer-events: auto;
}

.home-banner-cta-btn:hover {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--rain-primary-dark), #34483a);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(67, 89, 71, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.home-banner-cta-btn:active {
    transform: translateY(0);
}

.home-banner-cta-btn i,
.home-banner-cta-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.2px;
    transition: transform 0.25s ease;
}

.home-banner-cta-btn:hover i,
.home-banner-cta-btn:hover svg {
    transform: translateX(3px);
}

.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: #ffffff !important;
    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(--rain-primary);
}

.home-welcome-banner {
    display: flex;
    min-height: 230px;
    align-items: center;
    gap: 20px;
    padding: 32px;
    color: #fff;
    background: var(--rain-primary-dark);
    border-radius: 20px;
}

.home-welcome-banner>span {
    display: inline-flex;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    color: var(--rain-primary-dark);
    background: #fff;
    border-radius: 18px;
}

.home-welcome-banner svg {
    width: 31px;
    height: 31px;
}

.home-welcome-banner small {
    color: #c9dbed;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.home-welcome-banner h1 {
    margin: 3px 0 0;
    color: #fff;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 700;
}

.home-welcome-banner p {
    margin: 5px 0 0;
    color: #dbe7f2;
    font-size: .84rem;
}

.home-search-panel {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 16px;
    padding: 17px 18px;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 18px;
    box-shadow: 0 3px 12px rgba(67, 89, 71, .06);
}

.home-search-heading {
    display: flex;
    align-items: center;
    gap: 11px;
}

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

.home-search-heading svg {
    width: 19px;
    height: 19px;
}

.home-search-heading h2,
.home-section-header h2 {
    margin: 0;
    color: var(--home-text);
    font-size: .98rem;
    font-weight: 700;
}

.home-search-heading p,
.home-section-header p {
    margin: 2px 0 0;
    color: var(--home-muted);
    font-size: .72rem;
}

.home-search-panel form {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
}

.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: 11px;
    outline: 0;
    font-size: .84rem;
}

.home-search-field input:focus {
    border-color: var(--rain-primary);
    box-shadow: 0 0 0 3px rgba(100, 125, 104, .16);
}

.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(--rain-primary);
    border: 1px solid var(--rain-primary);
    border-radius: 11px;
    font-size: .78rem;
    font-weight: 700;
}

.home-search-panel form>button svg {
    width: 16px;
    height: 16px;
}

.home-search-panel form>button:hover {
    background: var(--rain-primary-dark);
}

.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: 12px;
    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;
}

/* Bagian koleksi populer memakai layout daftar horizontal. */
.home-search-popular {
    display: none !important;
}

.home-section {
    margin-bottom: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 18px;
    box-shadow: 0 3px 12px rgba(67, 89, 71, .06);
}

.home-library-summary-section {
    overflow: hidden;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--home-border);
    border-radius: 18px;
    box-shadow: 0 3px 12px rgba(67, 89, 71, .06);
}

.home-section-header {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid #e6edf5;
}

.home-section-header>a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: var(--rain-primary);
    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(8, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
}

.home-shortcut-list>a,
.home-shortcut-list>button,
.home-shortcut-list .shortcut-more-btn {
    display: flex;
    min-width: 0;
    min-height: 126px;
    padding: 13px 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: inherit;
    background: #f8fafc;
    border: 1px solid #dce6ef;
    border-radius: 14px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s ease;
}

.home-shortcut-list>a>span,
.home-shortcut-list>button>span,
.home-shortcut-list .shortcut-more-btn>span {
    display: inline-flex;
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    align-items: center;
    justify-content: center;
    color: var(--icon-color, var(--rain-primary));
    background: var(--icon-bg, var(--rain-primary-soft));
    border-radius: 13px;
}

.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,
.home-shortcut-list>button:hover,
.home-shortcut-list>button:focus,
.home-shortcut-list .shortcut-more-btn:hover,
.home-shortcut-list .shortcut-more-btn:focus {
    background: #f1f6fb;
    border-color: #a7c3df;
}

.home-shortcut-list > a.shortcut-item-mobile-only {
    display: none !important;
}

.home-shortcut-list > a.shortcut-item-modal-only {
    display: none !important;
}

.home-shortcut-list .shortcut-btn-desktop {
    display: flex !important;
}

.home-shortcut-list .shortcut-btn-mobile {
    display: none !important;
}

.home-stat-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
    padding: 0;
}

.home-library-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(440px, 1fr);
    align-items: stretch;
    gap: 30px;
}

.home-library-statistics {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 16px;
}

.home-library-statistics-heading {
    padding: 1px 1px 3px;
}

.home-library-statistics-heading h2 {
    margin: 0;
    color: var(--home-text);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.3;
}

.home-library-statistics-heading p {
    margin: 3px 0 0;
    color: var(--home-muted);
    font-size: .76rem;
    line-height: 1.4;
}

.home-statistics-link {
    display: flex;
    width: 100%;
    min-height: 36px;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 11px;
    color: var(--rain-primary-dark);
    background: #fff;
    border: 1px solid #d8e2d9;
    border-radius: 9px;
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.home-statistics-link:hover,
.home-statistics-link:focus-visible {
    color: #fff;
    background: var(--rain-primary-dark);
}

body[data-theme="rain"] .home-statistics-link:hover,
body[data-theme="rain"] .home-statistics-link:focus-visible {
    color: #fff !important;
}

.home-statistics-link svg {
    width: 16px;
    height: 16px;
}

.home-library-profile {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 8px 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.home-library-npp {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    background: #fff;
    border: 1px solid #e2eae2;
    border-radius: 12px;
}

.home-library-npp > span {
    display: inline-flex;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--rain-primary-dark);
    background: var(--rain-primary-soft);
    border-radius: 11px;
}

.home-library-npp svg {
    width: 20px;
    height: 20px;
}

.home-library-npp > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.home-library-npp small {
    color: var(--home-muted);
    font-size: .72rem;
    font-weight: 600;
}

.home-library-npp strong {
    overflow-wrap: anywhere;
    color: var(--home-text);
    font-size: .94rem;
}

.home-library-about h2 {
    margin: 0 0 6px;
    color: var(--home-text);
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.3;
}

.home-library-about p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--home-muted);
    max-width: 76ch;
    font-size: .84rem;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
}

@media (min-width: 1200px) {
    .home-library-profile {
        min-height: 100%;
    }

    .home-library-statistics {
        justify-content: center;
    }

    .home-stat-list {
        gap: 12px;
    }

    .home-stat-card {
        min-height: 96px;
        gap: 12px;
        padding: 13px;
    }

    .home-statistics-link {
        align-self: stretch;
        margin-top: 1px;
    }
}

.home-stat-card {
    display: flex;
    min-width: 0;
    min-height: 88px;
    align-items: center;
    gap: 10px;
    padding: 11px;
    background: #fff;
    border: 1px solid #dce6ef;
    border-radius: 12px;
}

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

.home-stat-card svg {
    width: 18px;
    height: 18px;
}

.home-stat-card>div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.home-stat-card small {
    color: var(--home-muted);
    font-size: .66rem;
    font-weight: 650;
    line-height: 1.25;
}

.home-stat-card strong {
    color: var(--home-text);
    font-size: 1.18rem;
    line-height: 1.2;
}

.home-stat-card em {
    margin-top: 2px;
    color: #8191a2;
    font-size: .58rem;
    font-style: normal;
    line-height: 1.25;
}

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

.home-book-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 11px;
    min-width: 0;
    padding: 10px;
    background: #f9fbfd;
    border: 1px solid #dce6ef;
    border-radius: 13px;
}

.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-book-availability {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 8px;
    font-size: .65rem;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 4px;
    width: fit-content;
    border: 1px solid transparent;
}

.home-book-avail-yes {
    color: #10b981;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.home-book-avail-no {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fecaca;
}

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

.home-news-card {
    min-width: 0;
    overflow: hidden;
    background: #f9fbfd;
    border: 1px solid #dce6ef;
    border-radius: 13px;
}

.home-news-thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    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.02);
}

.home-news-card>div {
    padding: 11px 12px 12px;
}

.home-news-card>div>span {
    color: var(--rain-primary);
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.home-news-card h3 {
    display: -webkit-box;
    min-height: 2.7em;
    margin: 4px 0 8px;
    overflow: hidden;
    color: #263e56;
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.35;
    -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: 5px;
    margin: 0;
    color: var(--home-muted);
    font-size: .64rem;
}

.home-news-card p svg {
    width: 13px;
    height: 13px;
}

.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(--rain-primary);
    background: var(--rain-primary-soft);
    border-radius: 16px;
}

.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;
}

/* Modal Semua Layanan Mandiri */
.home-modal-content {
    border-radius: 16px;
    border: none;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.home-modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.home-modal-body {
    padding: 24px;
    background: #ffffff;
}

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

.home-shortcut-list-modal>a {
    display: flex;
    min-width: 0;
    min-height: 126px;
    padding: 13px 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: inherit;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.home-shortcut-list-modal>a:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.home-shortcut-list-modal>a>span {
    display: inline-flex;
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    align-items: center;
    justify-content: center;
    color: var(--icon-color, var(--rain-primary, #647D68));
    background: var(--icon-bg, #edf2ed);
    border-radius: 13px;
}

.home-shortcut-list-modal>a svg {
    width: 23px;
    height: 23px;
}

.home-shortcut-list-modal>a strong {
    margin-bottom: 3px;
    color: #294158;
    font-size: 0.72rem;
    line-height: 1.3;
}

.home-shortcut-list-modal>a small {
    color: #64748b;
    font-size: 0.62rem;
}

@media (max-width: 991.98px) {
    .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: 68px 5px calc(80px + env(safe-area-inset-bottom));
    }

    .home-hero {
        margin-bottom: 14px;
    }

    .home-banner-track {
        padding: 0 4px;
        scroll-padding-inline: 4px;
        gap: 10px;
    }

    .home-banner-slide {
        flex: 0 0 calc(100% - 20px);
        height: clamp(170px, 46vw, 210px);
        border-radius: 16px;
        scroll-snap-align: center;
    }

    .home-banner-copy {
        inset: auto 10px 10px;
        width: auto;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .home-banner-copy>span {
        margin-bottom: 2px;
        font-size: .57rem;
    }

    .home-banner-copy h1 {
        font-size: .96rem;
        color: #ffffff !important;
    }

    .home-banner-copy p {
        margin-top: 3px;
        font-size: .64rem;
    }

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

    .home-banner-dots button {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #b0c4de;
        border: none;
        padding: 0;
        transition: all 0.2s ease;
    }

    .home-banner-dots button.is-active {
        width: 22px;
        border-radius: 999px;
        background: #647D68;
    }

    .home-welcome-banner {
        min-height: 178px;
        margin: 0 4px;
        padding: 20px;
        border-radius: 16px;
    }

    .home-welcome-banner>span {
        flex-basis: 50px;
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }

    .home-welcome-banner h1 {
        font-size: 1.15rem;
    }

    .home-welcome-banner p {
        font-size: .7rem;
    }

    /* Search Panel */
    .home-search-panel {
        display: block;
        margin: 0 0 16px;
        padding: 16px;
        background: #ffffff;
        border-radius: 16px;
        border: 1px solid #eef2f6;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    }

    .home-search-heading {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
    }

    .home-search-heading>span {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background: #edf2ed;
        color: #647D68;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .home-search-heading>span svg {
        width: 20px;
        height: 20px;
    }

    .home-search-heading h2 {
        font-size: 1.05rem;
        font-weight: 700;
        color: #14213d;
        margin: 0;
    }

    .home-search-heading p {
        font-size: 0.74rem;
        color: #64758a;
        margin: 2px 0 0;
    }

    .home-search-panel form {
        display: flex;
        gap: 8px;
        align-items: center;
    }

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

    .home-search-field input {
        width: 100%;
        height: 46px;
        padding: 0 12px 0 40px;
        border-radius: 12px;
        border: 1px solid #d7e3e6;
        background: #ffffff;
        font-size: 0.85rem;
        color: #14213d;
        box-sizing: border-box;
    }

    .home-search-field>svg,
    .home-search-field>i {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        width: 18px;
        height: 18px;
        color: #64758a;
        pointer-events: none;
    }

    .home-search-panel form>button {
        width: 46px;
        height: 46px;
        border-radius: 12px;
        background: #647D68;
        border: none;
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .home-search-panel form>button span {
        display: none;
    }

    .home-search-panel form>button svg {
        width: 20px;
        height: 20px;
    }

    /* Sections */
    .home-section {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 0 20px !important;
    }

    .home-library-summary-section {
        padding: 14px !important;
        background: #fff !important;
        border: 1px solid var(--home-border) !important;
        border-radius: 18px !important;
        box-shadow: 0 3px 12px rgba(67, 89, 71, .06) !important;
    }

    .home-section-header {
        min-height: auto;
        padding: 0 2px 10px;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        background: transparent;
        border: none;
    }

    .home-section-header h2 {
        font-size: 1.08rem;
        font-weight: 700;
        color: #14213d;
        margin: 0;
    }

    .home-section-header p {
        font-size: 0.74rem;
        color: #64758a;
        margin: 2px 0 0;
    }

    .home-section-header a {
        font-size: 0.78rem;
        font-weight: 600;
        color: #647D68;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 4px;
        white-space: nowrap;
        margin-top: 2px;
    }

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

    .home-shortcut-list {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 16px 4px !important;
        padding: 4px 0 14px !important;
        overflow: visible !important;
    }

    .home-shortcut-list>a,
    .home-shortcut-list>button,
    .home-shortcut-list .shortcut-more-btn {
        flex: none !important;
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
        cursor: pointer !important;
    }

    .home-shortcut-list > a.shortcut-item-mobile-only {
        display: flex !important;
    }

    .home-shortcut-list > a.shortcut-item-modal-only {
        display: none !important;
    }

    .home-shortcut-list .shortcut-btn-desktop {
        display: none !important;
    }

    .home-shortcut-list .shortcut-btn-mobile {
        display: flex !important;
    }

    .home-shortcut-list>a:active,
    .home-shortcut-list>button:active {
        transform: scale(0.95) !important;
    }

    .home-shortcut-list>a>span,
    .home-shortcut-list>button>span,
    .home-shortcut-list .shortcut-more-btn>span {
        width: 52px !important;
        height: 52px !important;
        border-radius: 18px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto 8px auto !important;
        background: #ffffff !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03) !important;
        border: 1px solid rgba(226, 232, 240, 0.6) !important;
        flex-shrink: 0 !important;
        transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    }

    .home-shortcut-list>a svg,
    .home-shortcut-list>button svg,
    .home-shortcut-list .shortcut-more-btn svg {
        width: 24px !important;
        height: 24px !important;
        stroke-width: 2 !important;
        color: var(--icon-color, #647D68) !important;
    }

    .home-shortcut-list strong {
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        color: #172b43 !important;
        text-align: center !important;
        line-height: 1.25 !important;
        margin: 0 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        word-break: break-word !important;
    }

    .home-shortcut-list small {
        display: none !important;
    }

    /* Modal Mobile Styles - 4 columns squircle cards matching screenshot */
    #allServicesModal .modal-dialog {
        margin: 16px auto !important;
        max-width: calc(100% - 32px) !important;
    }

    #allServicesModal .home-modal-content {
        border-radius: 20px !important;
        border: none !important;
        overflow: hidden !important;
        background: #ffffff !important;
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15) !important;
    }

    #allServicesModal .home-modal-header {
        background: #ffffff !important;
        border-bottom: none !important;
        padding: 22px 20px 10px 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    #allServicesModal .home-modal-title {
        font-size: 1.2rem !important;
        font-weight: 700 !important;
        color: #172b43 !important;
        margin: 0 !important;
    }

    #allServicesModal .home-modal-header .btn-close {
        padding: 8px !important;
        margin: -8px -4px -8px auto !important;
        opacity: 0.6 !important;
        transition: opacity 0.2s ease !important;
    }

    #allServicesModal .home-modal-header .btn-close:hover {
        opacity: 1 !important;
    }

    #allServicesModal .home-modal-body {
        padding: 8px 14px 24px 14px !important;
        background: #ffffff !important;
    }

    .home-shortcut-list-modal {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 18px 6px !important;
        padding: 0 !important;
    }

    .home-shortcut-list-modal > a {
        flex: none !important;
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
        cursor: pointer !important;
    }

    .home-shortcut-list-modal > a:active {
        transform: scale(0.95) !important;
    }

    .home-shortcut-list-modal > a > span {
        width: 52px !important;
        height: 52px !important;
        border-radius: 18px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto 8px auto !important;
        background: #ffffff !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03) !important;
        border: 1px solid rgba(226, 232, 240, 0.6) !important;
        flex-shrink: 0 !important;
        transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    }

    .home-shortcut-list-modal > a svg {
        width: 24px !important;
        height: 24px !important;
        stroke-width: 2 !important;
        color: var(--icon-color, #647D68) !important;
    }

    .home-shortcut-list-modal > a strong {
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        color: #172b43 !important;
        text-align: center !important;
        line-height: 1.25 !important;
        margin: 0 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        word-break: break-word !important;
    }

    .home-shortcut-list-modal > a small {
        display: none !important;
    }

    /* Library identity and two-by-two statistics on mobile. */
    .home-library-summary {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .home-library-profile {
        gap: 11px;
        padding: 13px;
        background: #f0f5f0;
        border: 1px solid #e1eae1;
        border-radius: 14px;
    }

    .home-library-npp {
        gap: 9px;
        padding: 10px;
    }

    .home-library-npp > span {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }

    .home-library-npp small {
        font-size: .66rem;
    }

    .home-library-npp strong {
        font-size: .82rem;
    }

    .home-library-about p {
        font-size: .74rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .home-library-about h2 {
        font-size: .92rem;
    }

    .home-stat-list {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        padding: 0 !important;
        overflow: visible !important;
        background: transparent !important;
        border: none !important;
    }

    .home-statistics-link {
        width: 100%;
        min-height: 38px;
    }

    .home-library-statistics-heading {
        padding: 0 2px 2px;
    }

    .home-library-statistics-heading h2 {
        font-size: .94rem;
    }

    .home-library-statistics-heading p {
        font-size: .72rem;
    }

    .home-stat-card {
        min-height: 82px !important;
        border-radius: 13px !important;
        background: #ffffff !important;
        border: 1px solid #eef2f6 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
        padding: 10px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 9px !important;
        box-sizing: border-box !important;
    }

    .home-stat-card>span {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        background: #edf2ed !important;
        color: #647D68 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    .home-stat-card>span svg {
        width: 18px !important;
        height: 18px !important;
    }

    .home-stat-card>div {
        display: flex !important;
        flex-direction: column !important;
        min-width: 0 !important;
    }

    .home-stat-card small {
        font-size: 0.62rem !important;
        font-weight: 500 !important;
        color: #64758a !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .home-stat-card strong {
        font-size: 1.12rem !important;
        font-weight: 800 !important;
        color: #14213d !important;
        line-height: 1.15 !important;
        margin: 2px 0 1px !important;
    }

    .home-stat-card em {
        font-size: 0.62rem !important;
        color: #94a3b8 !important;
        font-style: normal !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Books & News Lists */
    .home-book-list,
    .home-news-list {
        display: flex !important;
        gap: 10px !important;
        padding: 2px 0 10px !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .home-book-list::-webkit-scrollbar,
    .home-news-list::-webkit-scrollbar {
        display: none !important;
    }

    .home-book-card {
        flex: 0 0 240px !important;
        border-radius: 16px !important;
        background: #ffffff !important;
        border: 1px solid #eef2f6 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
        padding: 12px !important;
        display: grid !important;
        grid-template-columns: 78px minmax(0, 1fr) !important;
        gap: 12px !important;
        scroll-snap-align: start !important;
        box-sizing: border-box !important;
    }

    .home-book-cover {
        width: 78px !important;
        height: 108px !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        background: #f1f5f9 !important;
    }

    .home-book-card h3 a {
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        color: #14213d !important;
    }

    .home-book-card p {
        font-size: 0.72rem !important;
        color: #64758a !important;
        margin: 3px 0 0 !important;
    }

    .home-book-availability {
        font-size: 0.65rem !important;
        border-radius: 6px !important;
        padding: 2px 6px !important;
        margin-top: 6px !important;
        display: inline-block !important;
    }

    .home-book-avail-yes {
        background: rgba(19, 138, 103, 0.1) !important;
        color: #138a67 !important;
        border: 1px solid rgba(19, 138, 103, 0.25) !important;
    }

    .home-book-avail-no {
        background: rgba(220, 38, 38, 0.1) !important;
        color: #dc2626 !important;
        border: 1px solid rgba(220, 38, 38, 0.25) !important;
    }

    .home-news-card {
        flex: 0 0 250px !important;
        border-radius: 16px !important;
        background: #ffffff !important;
        border: 1px solid #eef2f6 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
        scroll-snap-align: start !important;
        box-sizing: border-box !important;
    }

    .home-news-card h3 {
        min-height: auto;
    }
}

@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;
    }
}

.home-news-section {
    margin-bottom: 2rem !important;
    padding-bottom: 0 !important;
}

.home-contact-cta {
    display: grid;
    grid-template-columns: minmax(220px, .85fr) minmax(0, 1.6fr);
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 22px;
    color: #fff;
    background: linear-gradient(130deg, #435947, #647d68 62%, #78927b);
    border: 1px solid rgba(67, 89, 71, .18);
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(39, 52, 42, .14);
}

body[data-theme="rain"]:has(.home-contact-cta) .main-footer {
    margin-top: 20px !important;
}

@media (max-width: 768px) {
    body[data-theme="rain"]:has(.home-contact-cta) .main-footer {
        margin-top: 4px !important;
        padding-top: 0 !important;
        padding-bottom: calc(12px + max(68px, env(safe-area-inset-bottom, 24px))) !important;
    }

    body[data-theme="rain"]:has(.home-contact-cta) .main-footer > .container > .row {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body[data-theme="rain"]:has(.home-contact-cta) .main-footer > .container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}

.home-contact-intro {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

.home-contact-mark {
    display: inline-flex;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    color: #435947;
    background: #edf5ed;
    border-radius: 15px;
}

.home-contact-mark svg {
    width: 23px;
    height: 23px;
}

.home-contact-eyebrow {
    color: #dce9dc;
    font-size: .66rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.home-contact-intro h2 {
    margin: 3px 0 4px;
    color: #fff;
    font-size: clamp(1rem, 1.5vw, 1.28rem);
    font-weight: 750;
    line-height: 1.25;
}

.home-contact-intro p {
    margin: 0;
    color: #e5eee5;
    font-size: .74rem;
}

.home-contact-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.home-contact-action {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 88px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 11px 28px 11px 12px;
    color: #27342a;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 14px;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.home-contact-action:hover,
.home-contact-action:focus-visible {
    color: #27342a;
    transform: translateY(-2px);
    box-shadow: 0 7px 16px rgba(23, 43, 27, .18);
}

.home-contact-action > span {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
    color: #435947;
    background: #edf3ed;
    border-radius: 9px;
}

.home-contact-action > span svg {
    width: 16px;
    height: 16px;
}

.home-contact-action small {
    color: #718174;
    font-size: .62rem;
    font-weight: 650;
}

.home-contact-action strong {
    display: block;
    overflow: hidden;
    color: #27342a;
    font-size: .72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-contact-action--whatsapp > span {
    color: #177245;
    background: #e6f6ec;
}

.home-contact-action--instagram > span {
    color: #a13d71;
    background: #faedf4;
}

.home-contact-action--email > span {
    color: #486c9e;
    background: #edf3fb;
}

.home-contact-arrow {
    position: absolute;
    top: 12px;
    right: 10px;
    width: 14px;
    height: 14px;
    color: #8a998d;
}

.home-contact-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 14px;
    color: #e5eee5;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 13px;
    font-size: .8rem;
}

@media (max-width: 768px) {
    .home-contact-cta {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        margin: 0;
        padding: 16px;
        border-radius: 18px;
    }

    .home-contact-mark {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .home-contact-actions {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .home-contact-action {
        min-height: 62px;
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) 18px;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 9px;
        padding: 9px 12px;
    }

    .home-contact-action > span {
        grid-row: 1 / 3;
        width: 36px;
        height: 36px;
        margin: 0;
        border-radius: 11px;
    }

    .home-contact-action small,
    .home-contact-action strong {
        grid-column: 2;
    }

    .home-contact-action small {
        align-self: end;
    }

    .home-contact-action strong {
        align-self: start;
    }

    .home-contact-arrow {
        position: static;
        grid-column: 3;
        grid-row: 1 / 3;
        justify-self: end;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-contact-action {
        transition: none;
    }
}

/* Lead story with a compact list of the next articles. */
.home-news-feature-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    padding: 16px;
}

.home-news-feature-card,
.home-news-next-card {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dce6dd;
    border-radius: 16px;
    box-shadow: 0 5px 16px rgba(39, 52, 42, .06);
}

.home-news-feature-card {
    min-height: 390px;
}

.home-news-feature-image {
    position: relative;
    display: block;
    min-height: 390px;
    height: 100%;
    overflow: hidden;
    color: #fff;
    background: #35483a;
    text-decoration: none;
}

.home-news-feature-image > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.home-news-feature-card:hover .home-news-feature-image > img {
    transform: scale(1.025);
}

.home-news-feature-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 30, 19, .08) 15%, rgba(15, 30, 19, .88) 100%);
}

.home-news-feature-date {
    position: absolute;
    top: 18px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    color: #fff;
    background: var(--rain-primary-dark);
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
}

.home-news-feature-date svg,
.home-news-next-date svg {
    width: 15px;
    height: 15px;
}

.home-news-feature-copy {
    position: absolute;
    right: 22px;
    bottom: 22px;
    left: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

.home-news-category {
    color: #d5e8d8;
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.home-news-feature-copy strong {
    display: -webkit-box;
    overflow: hidden;
    color: #fff;
    font-size: clamp(1.15rem, 2vw, 1.8rem);
    font-weight: 750;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.home-news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e0f0e2;
    font-size: .82rem;
    font-weight: 650;
}

.home-news-read-more svg,
.home-news-next-link svg {
    width: 15px;
    height: 15px;
}

.home-news-next-list {
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home-news-next-card {
    display: grid;
    grid-template-columns: minmax(100px, 27%) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 12px;
}

.home-news-next-thumb {
    display: block;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #edf2ed;
    border-radius: 11px;
}

.home-news-next-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-news-next-card > div {
    min-width: 0;
}

.home-news-next-date {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    color: #758276;
    font-size: .72rem;
}

.home-news-next-card h3 {
    display: -webkit-box;
    margin: 0 0 8px;
    overflow: hidden;
    color: var(--home-text);
    font-size: .93rem;
    font-weight: 700;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.home-news-next-card h3 a {
    color: inherit;
    text-decoration: none;
}

.home-news-next-card h3 a:hover {
    color: var(--rain-primary-dark);
}

.home-news-next-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--rain-primary-dark);
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 768px) {
    .home-news-feature-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 4px 2px 12px;
    }

    .home-news-feature-card,
    .home-news-feature-image {
        min-height: 300px;
    }

    .home-news-next-list {
        grid-template-rows: none;
        grid-auto-rows: minmax(112px, auto);
    }

    .home-news-next-card {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 11px;
        padding: 10px;
    }

    .home-news-next-card h3 {
        font-size: .82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-news-feature-image > img {
        transition: none;
    }
}

/* Latest and popular catalog cards use a consistent portrait layout. */
.home-book-list--portrait {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch !important;
}

.home-book-list--portrait .home-book-card {
    display: flex !important;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    gap: 11px !important;
    padding: 12px !important;
    background: #fff !important;
    border: 1px solid #dce6dd !important;
    border-radius: 14px !important;
    box-shadow: 0 5px 16px rgba(39, 52, 42, .06) !important;
    box-sizing: border-box;
}

.home-book-list--portrait .home-book-cover {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 10px !important;
    background: #edf2ed !important;
}

.home-book-list--portrait .home-book-cover img {
    object-fit: cover !important;
}

.home-book-list--portrait .home-book-card > div {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 !important;
}

.home-book-list--portrait .home-book-card h3 {
    min-height: 2.7em;
    margin: 0 0 5px;
    font-size: .82rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.home-book-list--portrait .home-book-card h3 a {
    color: #27342a !important;
}

.home-book-list--portrait .home-book-card p {
    display: block !important;
    width: 100%;
    margin: 0 0 5px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    min-height: 1.35em !important;
}

.home-book-list--portrait .home-book-card .home-book-publish-year,
.home-book-list--portrait .home-book-card .home-book-loan-count {
    margin-top: 2px !important;
    color: #718174 !important;
    font-size: .68rem !important;
}

.home-book-list--portrait .home-book-card .home-book-publish-year {
    min-height: 1.1em;
}

.home-most-borrowed-section .home-book-list--portrait .home-book-cover {
    position: relative;
}

.home-most-borrowed-section .home-book-list--portrait .home-book-loan-count {
    position: absolute !important;
    z-index: 3;
    top: 16px;
    right: 7px;
    display: inline-flex !important;
    width: auto !important;
    max-width: calc(100% - 14px);
    min-height: 0 !important;
    align-items: center;
    gap: 3px;
    margin: 0 !important;
    padding: 4px 6px !important;
    overflow: hidden;
    color: #fff !important;
    background: rgba(39, 52, 42, .9) !important;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    font-size: .57rem !important;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(17, 24, 39, .2);
}

.home-most-borrowed-section .home-book-list--portrait .home-book-loan-count svg {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    color: #fb923c;
    fill: #fb923c;
}

.home-most-borrowed-section .home-book-list--portrait .home-book-availability {
    right: auto;
    left: 7px;
    max-width: calc(100% - 82px);
}

.home-book-list--portrait .home-book-availability {
    position: absolute !important;
    z-index: 2;
    top: 16px;
    right: 7px;
    display: inline-flex !important;
    max-width: calc(100% - 14px);
    margin: 0 !important;
    padding: 4px 6px;
    overflow: hidden;
    font-size: .59rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1 !important;
    box-shadow: 0 2px 8px rgba(17, 24, 39, .18);
}

.home-book-list--portrait .home-book-avail-yes {
    color: #166534 !important;
    background-color: #dcfce7 !important;
    border-color: #86efac !important;
}

.home-book-list--portrait .home-book-avail-no {
    color: #991b1b !important;
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
}

@media (max-width: 768px) {
    .home-book-list--portrait {
        display: grid !important;
        grid-template-columns: none !important;
        grid-auto-rows: auto;
        grid-auto-columns: min(44vw, 180px);
        grid-auto-flow: column;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 4px 0 12px !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
    }

    .home-book-list--portrait .home-book-card {
        width: 100% !important;
        align-self: stretch !important;
        scroll-snap-align: start !important;
    }

    .home-book-list--portrait .home-book-cover {
        aspect-ratio: 2 / 3;
    }

    .home-book-list--portrait .home-book-card h3 {
        min-height: 2.7em !important;
    }

    .home-book-list--portrait .home-book-card p {
        min-height: 1.35em !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .home-book-list--portrait .home-book-card .home-book-publish-year,
    .home-book-list--portrait .home-book-card .home-book-loan-count {
        min-height: 1.1em !important;
    }

}

@media (min-width: 769px) and (max-width: 991.98px) {
    .home-book-list--portrait {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 390px) {
    .home-book-list--portrait .home-book-card {
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    body[data-theme="rain"]:has(.home-contact-cta) .home-page {
        padding-bottom: 0 !important;
    }

    body[data-theme="rain"]:has(.home-contact-cta) .main-footer {
        margin-top: 0 !important;
    }

    body[data-theme="rain"] .home-most-borrowed-section .home-book-list--portrait .home-book-loan-count {
        top: 43px;
        right: auto;
        left: 7px;
    }

    body[data-theme="rain"] .home-book-list--portrait .home-book-availability {
        max-width: calc(100% - 14px) !important;
        overflow: visible !important;
        white-space: normal !important;
        text-overflow: clip !important;
    }
}

/* Rain-specific skeleton layout. */
/* Rain home skeleton follows the portrait catalog, profile summary and feature news layout. */
body[data-theme="rain"] .home-page-skeleton {
    position: relative;
}

body[data-theme="rain"] .home-sk-shell {
    max-width: 1180px;
}

body[data-theme="rain"] .home-sk-section {
    margin-bottom: 16px;
}

body[data-theme="rain"] .home-sk-section-heading {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
}

body[data-theme="rain"] .home-sk-section-heading > div {
    display: grid;
    gap: 8px;
}

body[data-theme="rain"] .home-sk-section-heading .home-sk-section-sub {
    display: block;
}

body[data-theme="rain"] .home-sk-section-link {
    width: 74px;
    height: 13px;
    border-radius: 4px;
}

body[data-theme="rain"] .home-sk-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 30px;
    padding: 20px;
}

body[data-theme="rain"] .home-sk-profile {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    background: #f8faf8;
    border: 1px solid #e0e9e1;
    border-radius: 16px;
}

body[data-theme="rain"] .home-sk-npp {
    display: flex;
    min-height: 76px;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e0e9e1;
    border-radius: 14px;
}

body[data-theme="rain"] .home-sk-npp-icon,
body[data-theme="rain"] .home-sk-contact-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

body[data-theme="rain"] .home-sk-npp > div,
body[data-theme="rain"] .home-sk-summary-heading,
body[data-theme="rain"] .home-sk-contact-intro > div {
    display: grid;
    gap: 8px;
}

body[data-theme="rain"] .home-sk-npp-label { width: 210px; height: 12px; border-radius: 4px; }
body[data-theme="rain"] .home-sk-npp-value { width: 160px; height: 18px; border-radius: 4px; }
body[data-theme="rain"] .home-sk-about-title { width: 230px; height: 24px; margin-top: 4px; border-radius: 5px; }
body[data-theme="rain"] .home-sk-about-line { width: 100%; height: 13px; border-radius: 4px; }
body[data-theme="rain"] .home-sk-about-line--short { width: 72%; }

body[data-theme="rain"] .home-sk-stat-area {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 14px;
}

body[data-theme="rain"] .home-sk-summary-title { width: 210px; height: 19px; border-radius: 5px; }
body[data-theme="rain"] .home-sk-summary-desc { width: 245px; height: 13px; border-radius: 4px; }
body[data-theme="rain"] .home-sk-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
}

body[data-theme="rain"] .home-sk-stat-card {
    min-height: 88px;
    gap: 10px;
    padding: 11px;
    background: #fff;
    border-radius: 12px;
}

body[data-theme="rain"] .home-sk-stats-link { width: 100%; height: 40px; border-radius: 10px; }

body[data-theme="rain"] .home-sk-books {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

body[data-theme="rain"] .home-sk-book-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border-color: #d8e2d9;
    border-radius: 16px;
}

body[data-theme="rain"] .home-sk-book-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
}

body[data-theme="rain"] .home-sk-book-availability,
body[data-theme="rain"] .home-sk-book-loans {
    position: absolute;
    z-index: 1;
    top: 18px;
    left: 16px;
    width: 86px;
    height: 20px;
    border: 1px solid #fff;
    border-radius: 999px;
}

body[data-theme="rain"] .home-sk-book-loans {
    top: 44px;
    left: 16px;
    width: 70px;
    background: linear-gradient(90deg, #35483a 25%, #516854 37%, #35483a 63%);
    background-size: 400% 100%;
}

body[data-theme="rain"] .home-sk-book-body { gap: 7px; }
body[data-theme="rain"] .home-sk-book-year { width: 38px; height: 10px; border-radius: 3px; }
body[data-theme="rain"] .home-sk-book-title--short { width: 64%; }

body[data-theme="rain"] .home-sk-news-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    padding: 16px;
}

body[data-theme="rain"] .home-sk-news-feature {
    display: flex;
    min-height: 390px;
    padding: 18px;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 16px;
}

body[data-theme="rain"] .home-sk-news-feature-date { width: 96px; height: 26px; border-radius: 999px; }
body[data-theme="rain"] .home-sk-news-feature > div { display: grid; gap: 9px; }
body[data-theme="rain"] .home-sk-news-feature-title { width: 94%; height: 22px; border-radius: 5px; }
body[data-theme="rain"] .home-sk-news-feature-title--short { width: 72%; }
body[data-theme="rain"] .home-sk-news-next { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 12px; }
body[data-theme="rain"] .home-sk-news-card { align-items: center; background: #fff; border-color: #d8e2d9; border-radius: 16px; }
body[data-theme="rain"] .home-sk-news-thumb { flex-basis: 88px; width: 88px; height: 76px; }
body[data-theme="rain"] .home-sk-news-title--short { width: 65%; }

body[data-theme="rain"] .home-sk-contact {
    display: grid;
    grid-template-columns: minmax(220px, .85fr) minmax(0, 1.6fr);
    align-items: center;
    gap: 20px;
    padding: 22px;
    background: linear-gradient(130deg, #435947, #647d68 62%, #78927b);
    border-radius: 20px;
}

body[data-theme="rain"] .home-sk-contact-intro { display: flex; align-items: center; gap: 13px; }
body[data-theme="rain"] .home-sk-contact-eyebrow { width: 110px; height: 10px; border-radius: 3px; }
body[data-theme="rain"] .home-sk-contact-title { width: 250px; height: 20px; border-radius: 4px; }
body[data-theme="rain"] .home-sk-contact-sub { width: 210px; height: 12px; border-radius: 3px; }
body[data-theme="rain"] .home-sk-contact-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
body[data-theme="rain"] .home-sk-contact-action { height: 82px; border-radius: 14px; }

@media (max-width: 768px) {
    body[data-theme="rain"] .home-page-skeleton { top: 0; }
    /* Match the real banner slide: page inset + track padding + slide inset. */
    body[data-theme="rain"] .home-sk-hero { width: calc(100% - 28px); margin: 0 auto 14px; height: 178px; }
    body[data-theme="rain"] .home-sk-search,
    body[data-theme="rain"] .home-sk-section { margin: 0 0 20px; }
    body[data-theme="rain"] .home-sk-search { padding: 13px; }
    body[data-theme="rain"] .home-sk-section { overflow: visible; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
    body[data-theme="rain"] .home-sk-section-heading { min-height: 0; padding: 0 2px 10px; }
    body[data-theme="rain"] .home-sk-shortcuts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 4px; padding: 4px 0 14px; overflow: visible; }
    body[data-theme="rain"] .home-sk-shortcut-card { min-height: 0; padding: 0; gap: 8px; background: transparent; border: 0; }
    body[data-theme="rain"] .home-sk-shortcut-icon { width: 52px; height: 52px; border-radius: 18px; }
    body[data-theme="rain"] .home-sk-shortcut-text { width: 86%; height: 12px; }
    body[data-theme="rain"] .home-sk-shortcut-desc { display: none; }
    body[data-theme="rain"] .home-sk-summary { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; background: #fff; border: 1px solid #d8e2d9; border-radius: 18px; box-shadow: 0 3px 12px rgba(67, 89, 71, .06); }
    body[data-theme="rain"] .home-sk-profile { padding: 14px; }
    body[data-theme="rain"] .home-sk-books { display: flex; gap: 12px; padding: 4px 0 12px; overflow: hidden; }
    body[data-theme="rain"] .home-sk-book-card { flex: 0 0 min(44vw, 180px); padding: 10px; }
    body[data-theme="rain"] .home-sk-book-availability,
    body[data-theme="rain"] .home-sk-book-loans { top: 16px; left: 16px; }
    body[data-theme="rain"] .home-sk-book-loans { top: 42px; }
    body[data-theme="rain"] .home-sk-news-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 4px 2px 12px; }
    body[data-theme="rain"] .home-sk-news-feature { min-height: 300px; }
    body[data-theme="rain"] .home-sk-news-next { grid-template-rows: none; grid-auto-rows: minmax(112px, auto); }
    body[data-theme="rain"] .home-sk-contact { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px; }
    body[data-theme="rain"] .home-sk-contact-actions { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    body[data-theme="rain"] .home-sk-contact-action { height: 62px; }
}

body[data-theme="rain"] .home-page-skeleton,
body[data-theme="rain"] .home-sk-shell,
body[data-theme="rain"] .home-sk-shell > * { box-sizing: border-box; }


/* Keep Instagram and WhatsApp contact card content aligned to the left on desktop. */
@media (min-width: 769px) {
    body[data-theme="rain"] .home-contact-action--instagram,
    body[data-theme="rain"] .home-contact-action--whatsapp {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: start !important;
        justify-items: start !important;
        text-align: left !important;
    }

    body[data-theme="rain"] .home-contact-action--instagram > *,
    body[data-theme="rain"] .home-contact-action--whatsapp > * {
        justify-self: start !important;
        text-align: left !important;
        margin-left: 0 !important;
    }
}
