/* Site-wide responsive layout. Loaded after the main stylesheet. */

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

.footer-section {
    overflow-x: clip;
    padding: 72px 0 28px;
}

.footer-section .container {
    width: min(1140px, calc(100% - 32px));
}

.footer-columns {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px 28px;
    margin: 0 !important;
}

.footer-columns > [class*="col-"] {
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 0;
}

.footer-brand,
.footer-links,
.footer-list,
.footer-list li,
.footer-list li a {
    min-width: 0;
    max-width: 100%;
}

.footer-list li a {
    align-items: flex-start;
    overflow-wrap: anywhere;
}

.footer-list li a:hover {
    transform: none;
}

.footer-account-identity {
    width: 100%;
    min-width: 0;
}

.footer-account-identity > span:last-child {
    min-width: 0;
}

.footer-account-identity strong {
    max-width: 100%;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    overflow-wrap: anywhere;
}

.footer-bottom {
    padding-right: 72px;
}

.footer-bottom-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 24px 40px;
    align-items: center;
    justify-content: space-between;
    margin: 0 !important;
}

.footer-bottom-row > [class*="col-"] {
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 0;
    flex: 0 1 auto;
}

.footer-meta-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-legal-col {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
}

.footer-bottom-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    max-width: 100%;
}

.footer-legal-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 8px;
}

.footer-legal-line .footer-dot {
    display: inline;
    color: rgba(255, 255, 255, 0.25);
    margin: 0 4px;
}

.footer-legal-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

.footer-bottom-links a {
    white-space: nowrap;
}

.footer-location {
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.library-search-row,
.library-books-grid,
.books-grid,
.blogs-grid {
    min-width: 0;
}

.library-book-body,
.library-book-body h2,
.book-card h3,
.book-card p {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 1199px) {
    .footer-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .library-search-row {
        grid-template-columns: 1fr 1fr;
    }

    .library-search-input,
    .btn-library-search {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 991px) {
    .footer-section {
        padding: 56px 0 24px;
    }

    .library-hero-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .library-books-grid,
    .personal-library-page[data-card-size="small"] .library-books-grid,
    .personal-library-page[data-card-size="large"] .library-books-grid,
    .books-grid,
    .blogs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .footer-section {
        padding: 48px 0 96px;
    }

    .footer-bottom {
        padding-right: 0;
    }

    .footer-bottom-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .footer-legal-col,
    .footer-bottom-links,
    .footer-legal-line {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .footer-legal-line {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px 12px;
        white-space: normal;
        align-items: center;
        justify-content: flex-start;
    }

    .footer-legal-line .footer-dot {
        display: inline;
        color: rgba(255, 255, 255, 0.25);
    }

    .footer-section .container {
        width: min(1140px, calc(100% - 24px));
    }

    .footer-columns,
    .library-search-row,
    .library-stats-grid,
    .library-books-grid,
    .personal-library-page[data-card-size="small"] .library-books-grid,
    .personal-library-page[data-card-size="large"] .library-books-grid,
    .personal-library-page[data-view-mode="shelf"] .library-books-grid,
    .books-grid,
    .blogs-grid,
    .blog-detail-layout,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .footer-social {
        flex-wrap: wrap;
    }

    .footer-dot {
        display: none;
    }

    .footer-bottom-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .library-hero-card,
    .library-book-card,
    .personal-library-page[data-view-mode="list"] .library-book-card,
    .personal-library-page[data-card-size="small"] .library-book-card,
    .personal-library-page[data-card-size="large"] .library-book-card {
        grid-template-columns: 1fr;
    }

    .library-book-cover {
        min-height: 220px;
        max-height: 280px;
    }

    .library-view-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .back-to-top {
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 420px) {
    .footer-logo {
        font-size: 1.3rem;
    }

    .footer-heading {
        font-size: 1rem;
    }

    .hero-buttons,
    .cta-buttons,
    .cta-trust-badges {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-hero-primary,
    .btn-hero-secondary,
    .btn-cta-secondary,
    .btn-nav-cta,
    .btn-library-customize,
    .btn-library-search {
        width: 100%;
        justify-content: center;
    }
}
